001package org.hl7.fhir.dstu3.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu3
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057
058import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus;
059import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory;
060import org.hl7.fhir.dstu3.model.Enumerations.SearchParamType;
061import org.hl7.fhir.dstu3.model.Enumerations.SearchParamTypeEnumFactory;
062import org.hl7.fhir.exceptions.FHIRException;
063import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
064import org.hl7.fhir.instance.model.api.IBaseConformance;
065import org.hl7.fhir.utilities.Utilities;
066
067import ca.uhn.fhir.model.api.annotation.Block;
068import ca.uhn.fhir.model.api.annotation.Child;
069import ca.uhn.fhir.model.api.annotation.ChildOrder;
070import ca.uhn.fhir.model.api.annotation.Description;
071import ca.uhn.fhir.model.api.annotation.ResourceDef;
072import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
073/**
074 * A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
075 */
076@ResourceDef(name="CapabilityStatement", profile="http://hl7.org/fhir/Profile/CapabilityStatement")
077@ChildOrder(names={"url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "kind", "instantiates", "software", "implementation", "fhirVersion", "acceptUnknown", "format", "patchFormat", "implementationGuide", "profile", "rest", "messaging", "document"})
078public class CapabilityStatement extends MetadataResource implements IBaseConformance {
079
080    public enum CapabilityStatementKind {
081        /**
082         * The CapabilityStatement instance represents the present capabilities of a specific system instance.  This is the kind returned by OPTIONS for a FHIR server end-point.
083         */
084        INSTANCE, 
085        /**
086         * The CapabilityStatement instance represents the capabilities of a system or piece of software, independent of a particular installation.
087         */
088        CAPABILITY, 
089        /**
090         * 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'.
091         */
092        REQUIREMENTS, 
093        /**
094         * added to help the parsers with the generic types
095         */
096        NULL;
097        public static CapabilityStatementKind fromCode(String codeString) throws FHIRException {
098            if (codeString == null || "".equals(codeString))
099                return null;
100        if ("instance".equals(codeString))
101          return INSTANCE;
102        if ("capability".equals(codeString))
103          return CAPABILITY;
104        if ("requirements".equals(codeString))
105          return REQUIREMENTS;
106        if (Configuration.isAcceptInvalidEnums())
107          return null;
108        else
109          throw new FHIRException("Unknown CapabilityStatementKind code '"+codeString+"'");
110        }
111        public String toCode() {
112          switch (this) {
113            case INSTANCE: return "instance";
114            case CAPABILITY: return "capability";
115            case REQUIREMENTS: return "requirements";
116            default: return "?";
117          }
118        }
119        public String getSystem() {
120          switch (this) {
121            case INSTANCE: return "http://hl7.org/fhir/capability-statement-kind";
122            case CAPABILITY: return "http://hl7.org/fhir/capability-statement-kind";
123            case REQUIREMENTS: return "http://hl7.org/fhir/capability-statement-kind";
124            default: return "?";
125          }
126        }
127        public String getDefinition() {
128          switch (this) {
129            case INSTANCE: return "The CapabilityStatement instance represents the present capabilities of a specific system instance.  This is the kind returned by OPTIONS for a FHIR server end-point.";
130            case CAPABILITY: return "The CapabilityStatement instance represents the capabilities of a system or piece of software, independent of a particular installation.";
131            case REQUIREMENTS: return "The CapabilityStatement instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'.";
132            default: return "?";
133          }
134        }
135        public String getDisplay() {
136          switch (this) {
137            case INSTANCE: return "Instance";
138            case CAPABILITY: return "Capability";
139            case REQUIREMENTS: return "Requirements";
140            default: return "?";
141          }
142        }
143    }
144
145  public static class CapabilityStatementKindEnumFactory implements EnumFactory<CapabilityStatementKind> {
146    public CapabilityStatementKind fromCode(String codeString) throws IllegalArgumentException {
147      if (codeString == null || "".equals(codeString))
148            if (codeString == null || "".equals(codeString))
149                return null;
150        if ("instance".equals(codeString))
151          return CapabilityStatementKind.INSTANCE;
152        if ("capability".equals(codeString))
153          return CapabilityStatementKind.CAPABILITY;
154        if ("requirements".equals(codeString))
155          return CapabilityStatementKind.REQUIREMENTS;
156        throw new IllegalArgumentException("Unknown CapabilityStatementKind code '"+codeString+"'");
157        }
158        public Enumeration<CapabilityStatementKind> fromType(Base code) throws FHIRException {
159          if (code == null)
160            return null;
161          if (code.isEmpty())
162            return new Enumeration<CapabilityStatementKind>(this);
163          String codeString = ((PrimitiveType) code).asStringValue();
164          if (codeString == null || "".equals(codeString))
165            return null;
166        if ("instance".equals(codeString))
167          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.INSTANCE);
168        if ("capability".equals(codeString))
169          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.CAPABILITY);
170        if ("requirements".equals(codeString))
171          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.REQUIREMENTS);
172        throw new FHIRException("Unknown CapabilityStatementKind code '"+codeString+"'");
173        }
174    public String toCode(CapabilityStatementKind code) {
175      if (code == CapabilityStatementKind.INSTANCE)
176        return "instance";
177      if (code == CapabilityStatementKind.CAPABILITY)
178        return "capability";
179      if (code == CapabilityStatementKind.REQUIREMENTS)
180        return "requirements";
181      return "?";
182      }
183    public String toSystem(CapabilityStatementKind code) {
184      return code.getSystem();
185      }
186    }
187
188    public enum UnknownContentCode {
189        /**
190         * The application does not accept either unknown elements or extensions.
191         */
192        NO, 
193        /**
194         * The application accepts unknown extensions, but not unknown elements.
195         */
196        EXTENSIONS, 
197        /**
198         * The application accepts unknown elements, but not unknown extensions.
199         */
200        ELEMENTS, 
201        /**
202         * The application accepts unknown elements and extensions.
203         */
204        BOTH, 
205        /**
206         * added to help the parsers with the generic types
207         */
208        NULL;
209        public static UnknownContentCode fromCode(String codeString) throws FHIRException {
210            if (codeString == null || "".equals(codeString))
211                return null;
212        if ("no".equals(codeString))
213          return NO;
214        if ("extensions".equals(codeString))
215          return EXTENSIONS;
216        if ("elements".equals(codeString))
217          return ELEMENTS;
218        if ("both".equals(codeString))
219          return BOTH;
220        if (Configuration.isAcceptInvalidEnums())
221          return null;
222        else
223          throw new FHIRException("Unknown UnknownContentCode code '"+codeString+"'");
224        }
225        public String toCode() {
226          switch (this) {
227            case NO: return "no";
228            case EXTENSIONS: return "extensions";
229            case ELEMENTS: return "elements";
230            case BOTH: return "both";
231            default: return "?";
232          }
233        }
234        public String getSystem() {
235          switch (this) {
236            case NO: return "http://hl7.org/fhir/unknown-content-code";
237            case EXTENSIONS: return "http://hl7.org/fhir/unknown-content-code";
238            case ELEMENTS: return "http://hl7.org/fhir/unknown-content-code";
239            case BOTH: return "http://hl7.org/fhir/unknown-content-code";
240            default: return "?";
241          }
242        }
243        public String getDefinition() {
244          switch (this) {
245            case NO: return "The application does not accept either unknown elements or extensions.";
246            case EXTENSIONS: return "The application accepts unknown extensions, but not unknown elements.";
247            case ELEMENTS: return "The application accepts unknown elements, but not unknown extensions.";
248            case BOTH: return "The application accepts unknown elements and extensions.";
249            default: return "?";
250          }
251        }
252        public String getDisplay() {
253          switch (this) {
254            case NO: return "Neither Elements or Extensions";
255            case EXTENSIONS: return "Unknown Extensions";
256            case ELEMENTS: return "Unknown Elements";
257            case BOTH: return "Unknown Elements and Extensions";
258            default: return "?";
259          }
260        }
261    }
262
263  public static class UnknownContentCodeEnumFactory implements EnumFactory<UnknownContentCode> {
264    public UnknownContentCode fromCode(String codeString) throws IllegalArgumentException {
265      if (codeString == null || "".equals(codeString))
266            if (codeString == null || "".equals(codeString))
267                return null;
268        if ("no".equals(codeString))
269          return UnknownContentCode.NO;
270        if ("extensions".equals(codeString))
271          return UnknownContentCode.EXTENSIONS;
272        if ("elements".equals(codeString))
273          return UnknownContentCode.ELEMENTS;
274        if ("both".equals(codeString))
275          return UnknownContentCode.BOTH;
276        throw new IllegalArgumentException("Unknown UnknownContentCode code '"+codeString+"'");
277        }
278        public Enumeration<UnknownContentCode> fromType(Base code) throws FHIRException {
279          if (code == null)
280            return null;
281          if (code.isEmpty())
282            return new Enumeration<UnknownContentCode>(this);
283          String codeString = ((PrimitiveType) code).asStringValue();
284          if (codeString == null || "".equals(codeString))
285            return null;
286        if ("no".equals(codeString))
287          return new Enumeration<UnknownContentCode>(this, UnknownContentCode.NO);
288        if ("extensions".equals(codeString))
289          return new Enumeration<UnknownContentCode>(this, UnknownContentCode.EXTENSIONS);
290        if ("elements".equals(codeString))
291          return new Enumeration<UnknownContentCode>(this, UnknownContentCode.ELEMENTS);
292        if ("both".equals(codeString))
293          return new Enumeration<UnknownContentCode>(this, UnknownContentCode.BOTH);
294        throw new FHIRException("Unknown UnknownContentCode code '"+codeString+"'");
295        }
296    public String toCode(UnknownContentCode code) {
297      if (code == UnknownContentCode.NO)
298        return "no";
299      if (code == UnknownContentCode.EXTENSIONS)
300        return "extensions";
301      if (code == UnknownContentCode.ELEMENTS)
302        return "elements";
303      if (code == UnknownContentCode.BOTH)
304        return "both";
305      return "?";
306      }
307    public String toSystem(UnknownContentCode code) {
308      return code.getSystem();
309      }
310    }
311
312    public enum RestfulCapabilityMode {
313        /**
314         * The application acts as a client for this resource.
315         */
316        CLIENT, 
317        /**
318         * The application acts as a server for this resource.
319         */
320        SERVER, 
321        /**
322         * added to help the parsers with the generic types
323         */
324        NULL;
325        public static RestfulCapabilityMode fromCode(String codeString) throws FHIRException {
326            if (codeString == null || "".equals(codeString))
327                return null;
328        if ("client".equals(codeString))
329          return CLIENT;
330        if ("server".equals(codeString))
331          return SERVER;
332        if (Configuration.isAcceptInvalidEnums())
333          return null;
334        else
335          throw new FHIRException("Unknown RestfulCapabilityMode code '"+codeString+"'");
336        }
337        public String toCode() {
338          switch (this) {
339            case CLIENT: return "client";
340            case SERVER: return "server";
341            default: return "?";
342          }
343        }
344        public String getSystem() {
345          switch (this) {
346            case CLIENT: return "http://hl7.org/fhir/restful-capability-mode";
347            case SERVER: return "http://hl7.org/fhir/restful-capability-mode";
348            default: return "?";
349          }
350        }
351        public String getDefinition() {
352          switch (this) {
353            case CLIENT: return "The application acts as a client for this resource.";
354            case SERVER: return "The application acts as a server for this resource.";
355            default: return "?";
356          }
357        }
358        public String getDisplay() {
359          switch (this) {
360            case CLIENT: return "Client";
361            case SERVER: return "Server";
362            default: return "?";
363          }
364        }
365    }
366
367  public static class RestfulCapabilityModeEnumFactory implements EnumFactory<RestfulCapabilityMode> {
368    public RestfulCapabilityMode fromCode(String codeString) throws IllegalArgumentException {
369      if (codeString == null || "".equals(codeString))
370            if (codeString == null || "".equals(codeString))
371                return null;
372        if ("client".equals(codeString))
373          return RestfulCapabilityMode.CLIENT;
374        if ("server".equals(codeString))
375          return RestfulCapabilityMode.SERVER;
376        throw new IllegalArgumentException("Unknown RestfulCapabilityMode code '"+codeString+"'");
377        }
378        public Enumeration<RestfulCapabilityMode> fromType(Base code) throws FHIRException {
379          if (code == null)
380            return null;
381          if (code.isEmpty())
382            return new Enumeration<RestfulCapabilityMode>(this);
383          String codeString = ((PrimitiveType) code).asStringValue();
384          if (codeString == null || "".equals(codeString))
385            return null;
386        if ("client".equals(codeString))
387          return new Enumeration<RestfulCapabilityMode>(this, RestfulCapabilityMode.CLIENT);
388        if ("server".equals(codeString))
389          return new Enumeration<RestfulCapabilityMode>(this, RestfulCapabilityMode.SERVER);
390        throw new FHIRException("Unknown RestfulCapabilityMode code '"+codeString+"'");
391        }
392    public String toCode(RestfulCapabilityMode code) {
393      if (code == RestfulCapabilityMode.CLIENT)
394        return "client";
395      if (code == RestfulCapabilityMode.SERVER)
396        return "server";
397      return "?";
398      }
399    public String toSystem(RestfulCapabilityMode code) {
400      return code.getSystem();
401      }
402    }
403
404    public enum TypeRestfulInteraction {
405        /**
406         * null
407         */
408        READ, 
409        /**
410         * null
411         */
412        VREAD, 
413        /**
414         * null
415         */
416        UPDATE, 
417        /**
418         * null
419         */
420        PATCH, 
421        /**
422         * null
423         */
424        DELETE, 
425        /**
426         * null
427         */
428        HISTORYINSTANCE, 
429        /**
430         * null
431         */
432        HISTORYTYPE, 
433        /**
434         * null
435         */
436        CREATE, 
437        /**
438         * null
439         */
440        SEARCHTYPE, 
441        /**
442         * added to help the parsers with the generic types
443         */
444        NULL;
445        public static TypeRestfulInteraction fromCode(String codeString) throws FHIRException {
446            if (codeString == null || "".equals(codeString))
447                return null;
448        if ("read".equals(codeString))
449          return READ;
450        if ("vread".equals(codeString))
451          return VREAD;
452        if ("update".equals(codeString))
453          return UPDATE;
454        if ("patch".equals(codeString))
455          return PATCH;
456        if ("delete".equals(codeString))
457          return DELETE;
458        if ("history-instance".equals(codeString))
459          return HISTORYINSTANCE;
460        if ("history-type".equals(codeString))
461          return HISTORYTYPE;
462        if ("create".equals(codeString))
463          return CREATE;
464        if ("search-type".equals(codeString))
465          return SEARCHTYPE;
466        if (Configuration.isAcceptInvalidEnums())
467          return null;
468        else
469          throw new FHIRException("Unknown TypeRestfulInteraction code '"+codeString+"'");
470        }
471        public String toCode() {
472          switch (this) {
473            case READ: return "read";
474            case VREAD: return "vread";
475            case UPDATE: return "update";
476            case PATCH: return "patch";
477            case DELETE: return "delete";
478            case HISTORYINSTANCE: return "history-instance";
479            case HISTORYTYPE: return "history-type";
480            case CREATE: return "create";
481            case SEARCHTYPE: return "search-type";
482            default: return "?";
483          }
484        }
485        public String getSystem() {
486          switch (this) {
487            case READ: return "http://hl7.org/fhir/restful-interaction";
488            case VREAD: return "http://hl7.org/fhir/restful-interaction";
489            case UPDATE: return "http://hl7.org/fhir/restful-interaction";
490            case PATCH: return "http://hl7.org/fhir/restful-interaction";
491            case DELETE: return "http://hl7.org/fhir/restful-interaction";
492            case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction";
493            case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction";
494            case CREATE: return "http://hl7.org/fhir/restful-interaction";
495            case SEARCHTYPE: return "http://hl7.org/fhir/restful-interaction";
496            default: return "?";
497          }
498        }
499        public String getDefinition() {
500          switch (this) {
501            case READ: return "";
502            case VREAD: return "";
503            case UPDATE: return "";
504            case PATCH: return "";
505            case DELETE: return "";
506            case HISTORYINSTANCE: return "";
507            case HISTORYTYPE: return "";
508            case CREATE: return "";
509            case SEARCHTYPE: return "";
510            default: return "?";
511          }
512        }
513        public String getDisplay() {
514          switch (this) {
515            case READ: return "read";
516            case VREAD: return "vread";
517            case UPDATE: return "update";
518            case PATCH: return "patch";
519            case DELETE: return "delete";
520            case HISTORYINSTANCE: return "history-instance";
521            case HISTORYTYPE: return "history-type";
522            case CREATE: return "create";
523            case SEARCHTYPE: return "search-type";
524            default: return "?";
525          }
526        }
527    }
528
529  public static class TypeRestfulInteractionEnumFactory implements EnumFactory<TypeRestfulInteraction> {
530    public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException {
531      if (codeString == null || "".equals(codeString))
532            if (codeString == null || "".equals(codeString))
533                return null;
534        if ("read".equals(codeString))
535          return TypeRestfulInteraction.READ;
536        if ("vread".equals(codeString))
537          return TypeRestfulInteraction.VREAD;
538        if ("update".equals(codeString))
539          return TypeRestfulInteraction.UPDATE;
540        if ("patch".equals(codeString))
541          return TypeRestfulInteraction.PATCH;
542        if ("delete".equals(codeString))
543          return TypeRestfulInteraction.DELETE;
544        if ("history-instance".equals(codeString))
545          return TypeRestfulInteraction.HISTORYINSTANCE;
546        if ("history-type".equals(codeString))
547          return TypeRestfulInteraction.HISTORYTYPE;
548        if ("create".equals(codeString))
549          return TypeRestfulInteraction.CREATE;
550        if ("search-type".equals(codeString))
551          return TypeRestfulInteraction.SEARCHTYPE;
552        throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'");
553        }
554        public Enumeration<TypeRestfulInteraction> fromType(Base code) throws FHIRException {
555          if (code == null)
556            return null;
557          if (code.isEmpty())
558            return new Enumeration<TypeRestfulInteraction>(this);
559          String codeString = ((PrimitiveType) code).asStringValue();
560          if (codeString == null || "".equals(codeString))
561            return null;
562        if ("read".equals(codeString))
563          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.READ);
564        if ("vread".equals(codeString))
565          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.VREAD);
566        if ("update".equals(codeString))
567          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.UPDATE);
568        if ("patch".equals(codeString))
569          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.PATCH);
570        if ("delete".equals(codeString))
571          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.DELETE);
572        if ("history-instance".equals(codeString))
573          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.HISTORYINSTANCE);
574        if ("history-type".equals(codeString))
575          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.HISTORYTYPE);
576        if ("create".equals(codeString))
577          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.CREATE);
578        if ("search-type".equals(codeString))
579          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.SEARCHTYPE);
580        throw new FHIRException("Unknown TypeRestfulInteraction code '"+codeString+"'");
581        }
582    public String toCode(TypeRestfulInteraction code) {
583      if (code == TypeRestfulInteraction.READ)
584        return "read";
585      if (code == TypeRestfulInteraction.VREAD)
586        return "vread";
587      if (code == TypeRestfulInteraction.UPDATE)
588        return "update";
589      if (code == TypeRestfulInteraction.PATCH)
590        return "patch";
591      if (code == TypeRestfulInteraction.DELETE)
592        return "delete";
593      if (code == TypeRestfulInteraction.HISTORYINSTANCE)
594        return "history-instance";
595      if (code == TypeRestfulInteraction.HISTORYTYPE)
596        return "history-type";
597      if (code == TypeRestfulInteraction.CREATE)
598        return "create";
599      if (code == TypeRestfulInteraction.SEARCHTYPE)
600        return "search-type";
601      return "?";
602      }
603    public String toSystem(TypeRestfulInteraction code) {
604      return code.getSystem();
605      }
606    }
607
608    public enum ResourceVersionPolicy {
609        /**
610         * VersionId meta-property is not supported (server) or used (client).
611         */
612        NOVERSION, 
613        /**
614         * VersionId meta-property is supported (server) or used (client).
615         */
616        VERSIONED, 
617        /**
618         * VersionId must be correct for updates (server) or will be specified (If-match header) for updates (client).
619         */
620        VERSIONEDUPDATE, 
621        /**
622         * added to help the parsers with the generic types
623         */
624        NULL;
625        public static ResourceVersionPolicy fromCode(String codeString) throws FHIRException {
626            if (codeString == null || "".equals(codeString))
627                return null;
628        if ("no-version".equals(codeString))
629          return NOVERSION;
630        if ("versioned".equals(codeString))
631          return VERSIONED;
632        if ("versioned-update".equals(codeString))
633          return VERSIONEDUPDATE;
634        if (Configuration.isAcceptInvalidEnums())
635          return null;
636        else
637          throw new FHIRException("Unknown ResourceVersionPolicy code '"+codeString+"'");
638        }
639        public String toCode() {
640          switch (this) {
641            case NOVERSION: return "no-version";
642            case VERSIONED: return "versioned";
643            case VERSIONEDUPDATE: return "versioned-update";
644            default: return "?";
645          }
646        }
647        public String getSystem() {
648          switch (this) {
649            case NOVERSION: return "http://hl7.org/fhir/versioning-policy";
650            case VERSIONED: return "http://hl7.org/fhir/versioning-policy";
651            case VERSIONEDUPDATE: return "http://hl7.org/fhir/versioning-policy";
652            default: return "?";
653          }
654        }
655        public String getDefinition() {
656          switch (this) {
657            case NOVERSION: return "VersionId meta-property is not supported (server) or used (client).";
658            case VERSIONED: return "VersionId meta-property is supported (server) or used (client).";
659            case VERSIONEDUPDATE: return "VersionId must be correct for updates (server) or will be specified (If-match header) for updates (client).";
660            default: return "?";
661          }
662        }
663        public String getDisplay() {
664          switch (this) {
665            case NOVERSION: return "No VersionId Support";
666            case VERSIONED: return "Versioned";
667            case VERSIONEDUPDATE: return "VersionId tracked fully";
668            default: return "?";
669          }
670        }
671    }
672
673  public static class ResourceVersionPolicyEnumFactory implements EnumFactory<ResourceVersionPolicy> {
674    public ResourceVersionPolicy fromCode(String codeString) throws IllegalArgumentException {
675      if (codeString == null || "".equals(codeString))
676            if (codeString == null || "".equals(codeString))
677                return null;
678        if ("no-version".equals(codeString))
679          return ResourceVersionPolicy.NOVERSION;
680        if ("versioned".equals(codeString))
681          return ResourceVersionPolicy.VERSIONED;
682        if ("versioned-update".equals(codeString))
683          return ResourceVersionPolicy.VERSIONEDUPDATE;
684        throw new IllegalArgumentException("Unknown ResourceVersionPolicy code '"+codeString+"'");
685        }
686        public Enumeration<ResourceVersionPolicy> fromType(Base code) throws FHIRException {
687          if (code == null)
688            return null;
689          if (code.isEmpty())
690            return new Enumeration<ResourceVersionPolicy>(this);
691          String codeString = ((PrimitiveType) code).asStringValue();
692          if (codeString == null || "".equals(codeString))
693            return null;
694        if ("no-version".equals(codeString))
695          return new Enumeration<ResourceVersionPolicy>(this, ResourceVersionPolicy.NOVERSION);
696        if ("versioned".equals(codeString))
697          return new Enumeration<ResourceVersionPolicy>(this, ResourceVersionPolicy.VERSIONED);
698        if ("versioned-update".equals(codeString))
699          return new Enumeration<ResourceVersionPolicy>(this, ResourceVersionPolicy.VERSIONEDUPDATE);
700        throw new FHIRException("Unknown ResourceVersionPolicy code '"+codeString+"'");
701        }
702    public String toCode(ResourceVersionPolicy code) {
703      if (code == ResourceVersionPolicy.NOVERSION)
704        return "no-version";
705      if (code == ResourceVersionPolicy.VERSIONED)
706        return "versioned";
707      if (code == ResourceVersionPolicy.VERSIONEDUPDATE)
708        return "versioned-update";
709      return "?";
710      }
711    public String toSystem(ResourceVersionPolicy code) {
712      return code.getSystem();
713      }
714    }
715
716    public enum ConditionalReadStatus {
717        /**
718         * No support for conditional deletes.
719         */
720        NOTSUPPORTED, 
721        /**
722         * Conditional reads are supported, but only with the If-Modified-Since HTTP Header.
723         */
724        MODIFIEDSINCE, 
725        /**
726         * Conditional reads are supported, but only with the If-None-Match HTTP Header.
727         */
728        NOTMATCH, 
729        /**
730         * Conditional reads are supported, with both If-Modified-Since and If-None-Match HTTP Headers.
731         */
732        FULLSUPPORT, 
733        /**
734         * added to help the parsers with the generic types
735         */
736        NULL;
737        public static ConditionalReadStatus fromCode(String codeString) throws FHIRException {
738            if (codeString == null || "".equals(codeString))
739                return null;
740        if ("not-supported".equals(codeString))
741          return NOTSUPPORTED;
742        if ("modified-since".equals(codeString))
743          return MODIFIEDSINCE;
744        if ("not-match".equals(codeString))
745          return NOTMATCH;
746        if ("full-support".equals(codeString))
747          return FULLSUPPORT;
748        if (Configuration.isAcceptInvalidEnums())
749          return null;
750        else
751          throw new FHIRException("Unknown ConditionalReadStatus code '"+codeString+"'");
752        }
753        public String toCode() {
754          switch (this) {
755            case NOTSUPPORTED: return "not-supported";
756            case MODIFIEDSINCE: return "modified-since";
757            case NOTMATCH: return "not-match";
758            case FULLSUPPORT: return "full-support";
759            default: return "?";
760          }
761        }
762        public String getSystem() {
763          switch (this) {
764            case NOTSUPPORTED: return "http://hl7.org/fhir/conditional-read-status";
765            case MODIFIEDSINCE: return "http://hl7.org/fhir/conditional-read-status";
766            case NOTMATCH: return "http://hl7.org/fhir/conditional-read-status";
767            case FULLSUPPORT: return "http://hl7.org/fhir/conditional-read-status";
768            default: return "?";
769          }
770        }
771        public String getDefinition() {
772          switch (this) {
773            case NOTSUPPORTED: return "No support for conditional deletes.";
774            case MODIFIEDSINCE: return "Conditional reads are supported, but only with the If-Modified-Since HTTP Header.";
775            case NOTMATCH: return "Conditional reads are supported, but only with the If-None-Match HTTP Header.";
776            case FULLSUPPORT: return "Conditional reads are supported, with both If-Modified-Since and If-None-Match HTTP Headers.";
777            default: return "?";
778          }
779        }
780        public String getDisplay() {
781          switch (this) {
782            case NOTSUPPORTED: return "Not Supported";
783            case MODIFIEDSINCE: return "If-Modified-Since";
784            case NOTMATCH: return "If-None-Match";
785            case FULLSUPPORT: return "Full Support";
786            default: return "?";
787          }
788        }
789    }
790
791  public static class ConditionalReadStatusEnumFactory implements EnumFactory<ConditionalReadStatus> {
792    public ConditionalReadStatus fromCode(String codeString) throws IllegalArgumentException {
793      if (codeString == null || "".equals(codeString))
794            if (codeString == null || "".equals(codeString))
795                return null;
796        if ("not-supported".equals(codeString))
797          return ConditionalReadStatus.NOTSUPPORTED;
798        if ("modified-since".equals(codeString))
799          return ConditionalReadStatus.MODIFIEDSINCE;
800        if ("not-match".equals(codeString))
801          return ConditionalReadStatus.NOTMATCH;
802        if ("full-support".equals(codeString))
803          return ConditionalReadStatus.FULLSUPPORT;
804        throw new IllegalArgumentException("Unknown ConditionalReadStatus code '"+codeString+"'");
805        }
806        public Enumeration<ConditionalReadStatus> fromType(Base code) throws FHIRException {
807          if (code == null)
808            return null;
809          if (code.isEmpty())
810            return new Enumeration<ConditionalReadStatus>(this);
811          String codeString = ((PrimitiveType) code).asStringValue();
812          if (codeString == null || "".equals(codeString))
813            return null;
814        if ("not-supported".equals(codeString))
815          return new Enumeration<ConditionalReadStatus>(this, ConditionalReadStatus.NOTSUPPORTED);
816        if ("modified-since".equals(codeString))
817          return new Enumeration<ConditionalReadStatus>(this, ConditionalReadStatus.MODIFIEDSINCE);
818        if ("not-match".equals(codeString))
819          return new Enumeration<ConditionalReadStatus>(this, ConditionalReadStatus.NOTMATCH);
820        if ("full-support".equals(codeString))
821          return new Enumeration<ConditionalReadStatus>(this, ConditionalReadStatus.FULLSUPPORT);
822        throw new FHIRException("Unknown ConditionalReadStatus code '"+codeString+"'");
823        }
824    public String toCode(ConditionalReadStatus code) {
825      if (code == ConditionalReadStatus.NOTSUPPORTED)
826        return "not-supported";
827      if (code == ConditionalReadStatus.MODIFIEDSINCE)
828        return "modified-since";
829      if (code == ConditionalReadStatus.NOTMATCH)
830        return "not-match";
831      if (code == ConditionalReadStatus.FULLSUPPORT)
832        return "full-support";
833      return "?";
834      }
835    public String toSystem(ConditionalReadStatus code) {
836      return code.getSystem();
837      }
838    }
839
840    public enum ConditionalDeleteStatus {
841        /**
842         * No support for conditional deletes.
843         */
844        NOTSUPPORTED, 
845        /**
846         * Conditional deletes are supported, but only single resources at a time.
847         */
848        SINGLE, 
849        /**
850         * Conditional deletes are supported, and multiple resources can be deleted in a single interaction.
851         */
852        MULTIPLE, 
853        /**
854         * added to help the parsers with the generic types
855         */
856        NULL;
857        public static ConditionalDeleteStatus fromCode(String codeString) throws FHIRException {
858            if (codeString == null || "".equals(codeString))
859                return null;
860        if ("not-supported".equals(codeString))
861          return NOTSUPPORTED;
862        if ("single".equals(codeString))
863          return SINGLE;
864        if ("multiple".equals(codeString))
865          return MULTIPLE;
866        if (Configuration.isAcceptInvalidEnums())
867          return null;
868        else
869          throw new FHIRException("Unknown ConditionalDeleteStatus code '"+codeString+"'");
870        }
871        public String toCode() {
872          switch (this) {
873            case NOTSUPPORTED: return "not-supported";
874            case SINGLE: return "single";
875            case MULTIPLE: return "multiple";
876            default: return "?";
877          }
878        }
879        public String getSystem() {
880          switch (this) {
881            case NOTSUPPORTED: return "http://hl7.org/fhir/conditional-delete-status";
882            case SINGLE: return "http://hl7.org/fhir/conditional-delete-status";
883            case MULTIPLE: return "http://hl7.org/fhir/conditional-delete-status";
884            default: return "?";
885          }
886        }
887        public String getDefinition() {
888          switch (this) {
889            case NOTSUPPORTED: return "No support for conditional deletes.";
890            case SINGLE: return "Conditional deletes are supported, but only single resources at a time.";
891            case MULTIPLE: return "Conditional deletes are supported, and multiple resources can be deleted in a single interaction.";
892            default: return "?";
893          }
894        }
895        public String getDisplay() {
896          switch (this) {
897            case NOTSUPPORTED: return "Not Supported";
898            case SINGLE: return "Single Deletes Supported";
899            case MULTIPLE: return "Multiple Deletes Supported";
900            default: return "?";
901          }
902        }
903    }
904
905  public static class ConditionalDeleteStatusEnumFactory implements EnumFactory<ConditionalDeleteStatus> {
906    public ConditionalDeleteStatus fromCode(String codeString) throws IllegalArgumentException {
907      if (codeString == null || "".equals(codeString))
908            if (codeString == null || "".equals(codeString))
909                return null;
910        if ("not-supported".equals(codeString))
911          return ConditionalDeleteStatus.NOTSUPPORTED;
912        if ("single".equals(codeString))
913          return ConditionalDeleteStatus.SINGLE;
914        if ("multiple".equals(codeString))
915          return ConditionalDeleteStatus.MULTIPLE;
916        throw new IllegalArgumentException("Unknown ConditionalDeleteStatus code '"+codeString+"'");
917        }
918        public Enumeration<ConditionalDeleteStatus> fromType(Base code) throws FHIRException {
919          if (code == null)
920            return null;
921          if (code.isEmpty())
922            return new Enumeration<ConditionalDeleteStatus>(this);
923          String codeString = ((PrimitiveType) code).asStringValue();
924          if (codeString == null || "".equals(codeString))
925            return null;
926        if ("not-supported".equals(codeString))
927          return new Enumeration<ConditionalDeleteStatus>(this, ConditionalDeleteStatus.NOTSUPPORTED);
928        if ("single".equals(codeString))
929          return new Enumeration<ConditionalDeleteStatus>(this, ConditionalDeleteStatus.SINGLE);
930        if ("multiple".equals(codeString))
931          return new Enumeration<ConditionalDeleteStatus>(this, ConditionalDeleteStatus.MULTIPLE);
932        throw new FHIRException("Unknown ConditionalDeleteStatus code '"+codeString+"'");
933        }
934    public String toCode(ConditionalDeleteStatus code) {
935      if (code == ConditionalDeleteStatus.NOTSUPPORTED)
936        return "not-supported";
937      if (code == ConditionalDeleteStatus.SINGLE)
938        return "single";
939      if (code == ConditionalDeleteStatus.MULTIPLE)
940        return "multiple";
941      return "?";
942      }
943    public String toSystem(ConditionalDeleteStatus code) {
944      return code.getSystem();
945      }
946    }
947
948    public enum ReferenceHandlingPolicy {
949        /**
950         * The server supports and populates Literal references where they are known (this code does not guarantee that all references are literal; see 'enforced')
951         */
952        LITERAL, 
953        /**
954         * The server allows logical references
955         */
956        LOGICAL, 
957        /**
958         * The server will attempt to resolve logical references to literal references (if resolution fails, the server may still accept resources; see logical)
959         */
960        RESOLVES, 
961        /**
962         * 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
963         */
964        ENFORCED, 
965        /**
966         * The server does not support references that point to other servers
967         */
968        LOCAL, 
969        /**
970         * added to help the parsers with the generic types
971         */
972        NULL;
973        public static ReferenceHandlingPolicy fromCode(String codeString) throws FHIRException {
974            if (codeString == null || "".equals(codeString))
975                return null;
976        if ("literal".equals(codeString))
977          return LITERAL;
978        if ("logical".equals(codeString))
979          return LOGICAL;
980        if ("resolves".equals(codeString))
981          return RESOLVES;
982        if ("enforced".equals(codeString))
983          return ENFORCED;
984        if ("local".equals(codeString))
985          return LOCAL;
986        if (Configuration.isAcceptInvalidEnums())
987          return null;
988        else
989          throw new FHIRException("Unknown ReferenceHandlingPolicy code '"+codeString+"'");
990        }
991        public String toCode() {
992          switch (this) {
993            case LITERAL: return "literal";
994            case LOGICAL: return "logical";
995            case RESOLVES: return "resolves";
996            case ENFORCED: return "enforced";
997            case LOCAL: return "local";
998            default: return "?";
999          }
1000        }
1001        public String getSystem() {
1002          switch (this) {
1003            case LITERAL: return "http://hl7.org/fhir/reference-handling-policy";
1004            case LOGICAL: return "http://hl7.org/fhir/reference-handling-policy";
1005            case RESOLVES: return "http://hl7.org/fhir/reference-handling-policy";
1006            case ENFORCED: return "http://hl7.org/fhir/reference-handling-policy";
1007            case LOCAL: return "http://hl7.org/fhir/reference-handling-policy";
1008            default: return "?";
1009          }
1010        }
1011        public String getDefinition() {
1012          switch (this) {
1013            case LITERAL: return "The server supports and populates Literal references where they are known (this code does not guarantee that all references are literal; see 'enforced')";
1014            case LOGICAL: return "The server allows logical references";
1015            case RESOLVES: return "The server will attempt to resolve logical references to literal references (if resolution fails, the server may still accept resources; see logical)";
1016            case ENFORCED: return "The server enforces that references have integrity - e.g. it ensures that references can always be resolved. This is typically the case for clinical record systems, but often not the case for middleware/proxy systems";
1017            case LOCAL: return "The server does not support references that point to other servers";
1018            default: return "?";
1019          }
1020        }
1021        public String getDisplay() {
1022          switch (this) {
1023            case LITERAL: return "Literal References";
1024            case LOGICAL: return "Logical References";
1025            case RESOLVES: return "Resolves References";
1026            case ENFORCED: return "Reference Integrity Enforced";
1027            case LOCAL: return "Local References Only";
1028            default: return "?";
1029          }
1030        }
1031    }
1032
1033  public static class ReferenceHandlingPolicyEnumFactory implements EnumFactory<ReferenceHandlingPolicy> {
1034    public ReferenceHandlingPolicy fromCode(String codeString) throws IllegalArgumentException {
1035      if (codeString == null || "".equals(codeString))
1036            if (codeString == null || "".equals(codeString))
1037                return null;
1038        if ("literal".equals(codeString))
1039          return ReferenceHandlingPolicy.LITERAL;
1040        if ("logical".equals(codeString))
1041          return ReferenceHandlingPolicy.LOGICAL;
1042        if ("resolves".equals(codeString))
1043          return ReferenceHandlingPolicy.RESOLVES;
1044        if ("enforced".equals(codeString))
1045          return ReferenceHandlingPolicy.ENFORCED;
1046        if ("local".equals(codeString))
1047          return ReferenceHandlingPolicy.LOCAL;
1048        throw new IllegalArgumentException("Unknown ReferenceHandlingPolicy code '"+codeString+"'");
1049        }
1050        public Enumeration<ReferenceHandlingPolicy> fromType(Base code) throws FHIRException {
1051          if (code == null)
1052            return null;
1053          if (code.isEmpty())
1054            return new Enumeration<ReferenceHandlingPolicy>(this);
1055          String codeString = ((PrimitiveType) code).asStringValue();
1056          if (codeString == null || "".equals(codeString))
1057            return null;
1058        if ("literal".equals(codeString))
1059          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.LITERAL);
1060        if ("logical".equals(codeString))
1061          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.LOGICAL);
1062        if ("resolves".equals(codeString))
1063          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.RESOLVES);
1064        if ("enforced".equals(codeString))
1065          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.ENFORCED);
1066        if ("local".equals(codeString))
1067          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.LOCAL);
1068        throw new FHIRException("Unknown ReferenceHandlingPolicy code '"+codeString+"'");
1069        }
1070    public String toCode(ReferenceHandlingPolicy code) {
1071      if (code == ReferenceHandlingPolicy.LITERAL)
1072        return "literal";
1073      if (code == ReferenceHandlingPolicy.LOGICAL)
1074        return "logical";
1075      if (code == ReferenceHandlingPolicy.RESOLVES)
1076        return "resolves";
1077      if (code == ReferenceHandlingPolicy.ENFORCED)
1078        return "enforced";
1079      if (code == ReferenceHandlingPolicy.LOCAL)
1080        return "local";
1081      return "?";
1082      }
1083    public String toSystem(ReferenceHandlingPolicy code) {
1084      return code.getSystem();
1085      }
1086    }
1087
1088    public enum SystemRestfulInteraction {
1089        /**
1090         * null
1091         */
1092        TRANSACTION, 
1093        /**
1094         * null
1095         */
1096        BATCH, 
1097        /**
1098         * null
1099         */
1100        SEARCHSYSTEM, 
1101        /**
1102         * null
1103         */
1104        HISTORYSYSTEM, 
1105        /**
1106         * added to help the parsers with the generic types
1107         */
1108        NULL;
1109        public static SystemRestfulInteraction fromCode(String codeString) throws FHIRException {
1110            if (codeString == null || "".equals(codeString))
1111                return null;
1112        if ("transaction".equals(codeString))
1113          return TRANSACTION;
1114        if ("batch".equals(codeString))
1115          return BATCH;
1116        if ("search-system".equals(codeString))
1117          return SEARCHSYSTEM;
1118        if ("history-system".equals(codeString))
1119          return HISTORYSYSTEM;
1120        if (Configuration.isAcceptInvalidEnums())
1121          return null;
1122        else
1123          throw new FHIRException("Unknown SystemRestfulInteraction code '"+codeString+"'");
1124        }
1125        public String toCode() {
1126          switch (this) {
1127            case TRANSACTION: return "transaction";
1128            case BATCH: return "batch";
1129            case SEARCHSYSTEM: return "search-system";
1130            case HISTORYSYSTEM: return "history-system";
1131            default: return "?";
1132          }
1133        }
1134        public String getSystem() {
1135          switch (this) {
1136            case TRANSACTION: return "http://hl7.org/fhir/restful-interaction";
1137            case BATCH: return "http://hl7.org/fhir/restful-interaction";
1138            case SEARCHSYSTEM: return "http://hl7.org/fhir/restful-interaction";
1139            case HISTORYSYSTEM: return "http://hl7.org/fhir/restful-interaction";
1140            default: return "?";
1141          }
1142        }
1143        public String getDefinition() {
1144          switch (this) {
1145            case TRANSACTION: return "";
1146            case BATCH: return "";
1147            case SEARCHSYSTEM: return "";
1148            case HISTORYSYSTEM: return "";
1149            default: return "?";
1150          }
1151        }
1152        public String getDisplay() {
1153          switch (this) {
1154            case TRANSACTION: return "transaction";
1155            case BATCH: return "batch";
1156            case SEARCHSYSTEM: return "search-system";
1157            case HISTORYSYSTEM: return "history-system";
1158            default: return "?";
1159          }
1160        }
1161    }
1162
1163  public static class SystemRestfulInteractionEnumFactory implements EnumFactory<SystemRestfulInteraction> {
1164    public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException {
1165      if (codeString == null || "".equals(codeString))
1166            if (codeString == null || "".equals(codeString))
1167                return null;
1168        if ("transaction".equals(codeString))
1169          return SystemRestfulInteraction.TRANSACTION;
1170        if ("batch".equals(codeString))
1171          return SystemRestfulInteraction.BATCH;
1172        if ("search-system".equals(codeString))
1173          return SystemRestfulInteraction.SEARCHSYSTEM;
1174        if ("history-system".equals(codeString))
1175          return SystemRestfulInteraction.HISTORYSYSTEM;
1176        throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'");
1177        }
1178        public Enumeration<SystemRestfulInteraction> fromType(Base code) throws FHIRException {
1179          if (code == null)
1180            return null;
1181          if (code.isEmpty())
1182            return new Enumeration<SystemRestfulInteraction>(this);
1183          String codeString = ((PrimitiveType) code).asStringValue();
1184          if (codeString == null || "".equals(codeString))
1185            return null;
1186        if ("transaction".equals(codeString))
1187          return new Enumeration<SystemRestfulInteraction>(this, SystemRestfulInteraction.TRANSACTION);
1188        if ("batch".equals(codeString))
1189          return new Enumeration<SystemRestfulInteraction>(this, SystemRestfulInteraction.BATCH);
1190        if ("search-system".equals(codeString))
1191          return new Enumeration<SystemRestfulInteraction>(this, SystemRestfulInteraction.SEARCHSYSTEM);
1192        if ("history-system".equals(codeString))
1193          return new Enumeration<SystemRestfulInteraction>(this, SystemRestfulInteraction.HISTORYSYSTEM);
1194        throw new FHIRException("Unknown SystemRestfulInteraction code '"+codeString+"'");
1195        }
1196    public String toCode(SystemRestfulInteraction code) {
1197      if (code == SystemRestfulInteraction.TRANSACTION)
1198        return "transaction";
1199      if (code == SystemRestfulInteraction.BATCH)
1200        return "batch";
1201      if (code == SystemRestfulInteraction.SEARCHSYSTEM)
1202        return "search-system";
1203      if (code == SystemRestfulInteraction.HISTORYSYSTEM)
1204        return "history-system";
1205      return "?";
1206      }
1207    public String toSystem(SystemRestfulInteraction code) {
1208      return code.getSystem();
1209      }
1210    }
1211
1212    public enum EventCapabilityMode {
1213        /**
1214         * The application sends requests and receives responses.
1215         */
1216        SENDER, 
1217        /**
1218         * The application receives requests and sends responses.
1219         */
1220        RECEIVER, 
1221        /**
1222         * added to help the parsers with the generic types
1223         */
1224        NULL;
1225        public static EventCapabilityMode fromCode(String codeString) throws FHIRException {
1226            if (codeString == null || "".equals(codeString))
1227                return null;
1228        if ("sender".equals(codeString))
1229          return SENDER;
1230        if ("receiver".equals(codeString))
1231          return RECEIVER;
1232        if (Configuration.isAcceptInvalidEnums())
1233          return null;
1234        else
1235          throw new FHIRException("Unknown EventCapabilityMode code '"+codeString+"'");
1236        }
1237        public String toCode() {
1238          switch (this) {
1239            case SENDER: return "sender";
1240            case RECEIVER: return "receiver";
1241            default: return "?";
1242          }
1243        }
1244        public String getSystem() {
1245          switch (this) {
1246            case SENDER: return "http://hl7.org/fhir/event-capability-mode";
1247            case RECEIVER: return "http://hl7.org/fhir/event-capability-mode";
1248            default: return "?";
1249          }
1250        }
1251        public String getDefinition() {
1252          switch (this) {
1253            case SENDER: return "The application sends requests and receives responses.";
1254            case RECEIVER: return "The application receives requests and sends responses.";
1255            default: return "?";
1256          }
1257        }
1258        public String getDisplay() {
1259          switch (this) {
1260            case SENDER: return "Sender";
1261            case RECEIVER: return "Receiver";
1262            default: return "?";
1263          }
1264        }
1265    }
1266
1267  public static class EventCapabilityModeEnumFactory implements EnumFactory<EventCapabilityMode> {
1268    public EventCapabilityMode fromCode(String codeString) throws IllegalArgumentException {
1269      if (codeString == null || "".equals(codeString))
1270            if (codeString == null || "".equals(codeString))
1271                return null;
1272        if ("sender".equals(codeString))
1273          return EventCapabilityMode.SENDER;
1274        if ("receiver".equals(codeString))
1275          return EventCapabilityMode.RECEIVER;
1276        throw new IllegalArgumentException("Unknown EventCapabilityMode code '"+codeString+"'");
1277        }
1278        public Enumeration<EventCapabilityMode> fromType(Base code) throws FHIRException {
1279          if (code == null)
1280            return null;
1281          if (code.isEmpty())
1282            return new Enumeration<EventCapabilityMode>(this);
1283          String codeString = ((PrimitiveType) code).asStringValue();
1284          if (codeString == null || "".equals(codeString))
1285            return null;
1286        if ("sender".equals(codeString))
1287          return new Enumeration<EventCapabilityMode>(this, EventCapabilityMode.SENDER);
1288        if ("receiver".equals(codeString))
1289          return new Enumeration<EventCapabilityMode>(this, EventCapabilityMode.RECEIVER);
1290        throw new FHIRException("Unknown EventCapabilityMode code '"+codeString+"'");
1291        }
1292    public String toCode(EventCapabilityMode code) {
1293      if (code == EventCapabilityMode.SENDER)
1294        return "sender";
1295      if (code == EventCapabilityMode.RECEIVER)
1296        return "receiver";
1297      return "?";
1298      }
1299    public String toSystem(EventCapabilityMode code) {
1300      return code.getSystem();
1301      }
1302    }
1303
1304    public enum MessageSignificanceCategory {
1305        /**
1306         * The message represents/requests a change that should not be processed more than once; e.g., making a booking for an appointment.
1307         */
1308        CONSEQUENCE, 
1309        /**
1310         * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful.
1311         */
1312        CURRENCY, 
1313        /**
1314         * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications.
1315         */
1316        NOTIFICATION, 
1317        /**
1318         * added to help the parsers with the generic types
1319         */
1320        NULL;
1321        public static MessageSignificanceCategory fromCode(String codeString) throws FHIRException {
1322            if (codeString == null || "".equals(codeString))
1323                return null;
1324        if ("Consequence".equals(codeString))
1325          return CONSEQUENCE;
1326        if ("Currency".equals(codeString))
1327          return CURRENCY;
1328        if ("Notification".equals(codeString))
1329          return NOTIFICATION;
1330        if (Configuration.isAcceptInvalidEnums())
1331          return null;
1332        else
1333          throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'");
1334        }
1335        public String toCode() {
1336          switch (this) {
1337            case CONSEQUENCE: return "Consequence";
1338            case CURRENCY: return "Currency";
1339            case NOTIFICATION: return "Notification";
1340            default: return "?";
1341          }
1342        }
1343        public String getSystem() {
1344          switch (this) {
1345            case CONSEQUENCE: return "http://hl7.org/fhir/message-significance-category";
1346            case CURRENCY: return "http://hl7.org/fhir/message-significance-category";
1347            case NOTIFICATION: return "http://hl7.org/fhir/message-significance-category";
1348            default: return "?";
1349          }
1350        }
1351        public String getDefinition() {
1352          switch (this) {
1353            case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once; e.g., making a booking for an appointment.";
1354            case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful.";
1355            case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications.";
1356            default: return "?";
1357          }
1358        }
1359        public String getDisplay() {
1360          switch (this) {
1361            case CONSEQUENCE: return "Consequence";
1362            case CURRENCY: return "Currency";
1363            case NOTIFICATION: return "Notification";
1364            default: return "?";
1365          }
1366        }
1367    }
1368
1369  public static class MessageSignificanceCategoryEnumFactory implements EnumFactory<MessageSignificanceCategory> {
1370    public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException {
1371      if (codeString == null || "".equals(codeString))
1372            if (codeString == null || "".equals(codeString))
1373                return null;
1374        if ("Consequence".equals(codeString))
1375          return MessageSignificanceCategory.CONSEQUENCE;
1376        if ("Currency".equals(codeString))
1377          return MessageSignificanceCategory.CURRENCY;
1378        if ("Notification".equals(codeString))
1379          return MessageSignificanceCategory.NOTIFICATION;
1380        throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'");
1381        }
1382        public Enumeration<MessageSignificanceCategory> fromType(Base code) throws FHIRException {
1383          if (code == null)
1384            return null;
1385          if (code.isEmpty())
1386            return new Enumeration<MessageSignificanceCategory>(this);
1387          String codeString = ((PrimitiveType) code).asStringValue();
1388          if (codeString == null || "".equals(codeString))
1389            return null;
1390        if ("Consequence".equals(codeString))
1391          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.CONSEQUENCE);
1392        if ("Currency".equals(codeString))
1393          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.CURRENCY);
1394        if ("Notification".equals(codeString))
1395          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.NOTIFICATION);
1396        throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'");
1397        }
1398    public String toCode(MessageSignificanceCategory code) {
1399      if (code == MessageSignificanceCategory.CONSEQUENCE)
1400        return "Consequence";
1401      if (code == MessageSignificanceCategory.CURRENCY)
1402        return "Currency";
1403      if (code == MessageSignificanceCategory.NOTIFICATION)
1404        return "Notification";
1405      return "?";
1406      }
1407    public String toSystem(MessageSignificanceCategory code) {
1408      return code.getSystem();
1409      }
1410    }
1411
1412    public enum DocumentMode {
1413        /**
1414         * The application produces documents of the specified type.
1415         */
1416        PRODUCER, 
1417        /**
1418         * The application consumes documents of the specified type.
1419         */
1420        CONSUMER, 
1421        /**
1422         * added to help the parsers with the generic types
1423         */
1424        NULL;
1425        public static DocumentMode fromCode(String codeString) throws FHIRException {
1426            if (codeString == null || "".equals(codeString))
1427                return null;
1428        if ("producer".equals(codeString))
1429          return PRODUCER;
1430        if ("consumer".equals(codeString))
1431          return CONSUMER;
1432        if (Configuration.isAcceptInvalidEnums())
1433          return null;
1434        else
1435          throw new FHIRException("Unknown DocumentMode code '"+codeString+"'");
1436        }
1437        public String toCode() {
1438          switch (this) {
1439            case PRODUCER: return "producer";
1440            case CONSUMER: return "consumer";
1441            default: return "?";
1442          }
1443        }
1444        public String getSystem() {
1445          switch (this) {
1446            case PRODUCER: return "http://hl7.org/fhir/document-mode";
1447            case CONSUMER: return "http://hl7.org/fhir/document-mode";
1448            default: return "?";
1449          }
1450        }
1451        public String getDefinition() {
1452          switch (this) {
1453            case PRODUCER: return "The application produces documents of the specified type.";
1454            case CONSUMER: return "The application consumes documents of the specified type.";
1455            default: return "?";
1456          }
1457        }
1458        public String getDisplay() {
1459          switch (this) {
1460            case PRODUCER: return "Producer";
1461            case CONSUMER: return "Consumer";
1462            default: return "?";
1463          }
1464        }
1465    }
1466
1467  public static class DocumentModeEnumFactory implements EnumFactory<DocumentMode> {
1468    public DocumentMode fromCode(String codeString) throws IllegalArgumentException {
1469      if (codeString == null || "".equals(codeString))
1470            if (codeString == null || "".equals(codeString))
1471                return null;
1472        if ("producer".equals(codeString))
1473          return DocumentMode.PRODUCER;
1474        if ("consumer".equals(codeString))
1475          return DocumentMode.CONSUMER;
1476        throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'");
1477        }
1478        public Enumeration<DocumentMode> fromType(Base code) throws FHIRException {
1479          if (code == null)
1480            return null;
1481          if (code.isEmpty())
1482            return new Enumeration<DocumentMode>(this);
1483          String codeString = ((PrimitiveType) code).asStringValue();
1484          if (codeString == null || "".equals(codeString))
1485            return null;
1486        if ("producer".equals(codeString))
1487          return new Enumeration<DocumentMode>(this, DocumentMode.PRODUCER);
1488        if ("consumer".equals(codeString))
1489          return new Enumeration<DocumentMode>(this, DocumentMode.CONSUMER);
1490        throw new FHIRException("Unknown DocumentMode code '"+codeString+"'");
1491        }
1492    public String toCode(DocumentMode code) {
1493      if (code == DocumentMode.PRODUCER)
1494        return "producer";
1495      if (code == DocumentMode.CONSUMER)
1496        return "consumer";
1497      return "?";
1498      }
1499    public String toSystem(DocumentMode code) {
1500      return code.getSystem();
1501      }
1502    }
1503
1504    @Block()
1505    public static class CapabilityStatementSoftwareComponent extends BackboneElement implements IBaseBackboneElement {
1506        /**
1507         * Name software is known by.
1508         */
1509        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1510        @Description(shortDefinition="A name the software is known by", formalDefinition="Name software is known by." )
1511        protected StringType name;
1512
1513        /**
1514         * The version identifier for the software covered by this statement.
1515         */
1516        @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1517        @Description(shortDefinition="Version covered by this statement", formalDefinition="The version identifier for the software covered by this statement." )
1518        protected StringType version;
1519
1520        /**
1521         * Date this version of the software was released.
1522         */
1523        @Child(name = "releaseDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1524        @Description(shortDefinition="Date this version released", formalDefinition="Date this version of the software was released." )
1525        protected DateTimeType releaseDate;
1526
1527        private static final long serialVersionUID = 1819769027L;
1528
1529    /**
1530     * Constructor
1531     */
1532      public CapabilityStatementSoftwareComponent() {
1533        super();
1534      }
1535
1536    /**
1537     * Constructor
1538     */
1539      public CapabilityStatementSoftwareComponent(StringType name) {
1540        super();
1541        this.name = name;
1542      }
1543
1544        /**
1545         * @return {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1546         */
1547        public StringType getNameElement() { 
1548          if (this.name == null)
1549            if (Configuration.errorOnAutoCreate())
1550              throw new Error("Attempt to auto-create CapabilityStatementSoftwareComponent.name");
1551            else if (Configuration.doAutoCreate())
1552              this.name = new StringType(); // bb
1553          return this.name;
1554        }
1555
1556        public boolean hasNameElement() { 
1557          return this.name != null && !this.name.isEmpty();
1558        }
1559
1560        public boolean hasName() { 
1561          return this.name != null && !this.name.isEmpty();
1562        }
1563
1564        /**
1565         * @param value {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1566         */
1567        public CapabilityStatementSoftwareComponent setNameElement(StringType value) { 
1568          this.name = value;
1569          return this;
1570        }
1571
1572        /**
1573         * @return Name software is known by.
1574         */
1575        public String getName() { 
1576          return this.name == null ? null : this.name.getValue();
1577        }
1578
1579        /**
1580         * @param value Name software is known by.
1581         */
1582        public CapabilityStatementSoftwareComponent setName(String value) { 
1583            if (this.name == null)
1584              this.name = new StringType();
1585            this.name.setValue(value);
1586          return this;
1587        }
1588
1589        /**
1590         * @return {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1591         */
1592        public StringType getVersionElement() { 
1593          if (this.version == null)
1594            if (Configuration.errorOnAutoCreate())
1595              throw new Error("Attempt to auto-create CapabilityStatementSoftwareComponent.version");
1596            else if (Configuration.doAutoCreate())
1597              this.version = new StringType(); // bb
1598          return this.version;
1599        }
1600
1601        public boolean hasVersionElement() { 
1602          return this.version != null && !this.version.isEmpty();
1603        }
1604
1605        public boolean hasVersion() { 
1606          return this.version != null && !this.version.isEmpty();
1607        }
1608
1609        /**
1610         * @param value {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1611         */
1612        public CapabilityStatementSoftwareComponent setVersionElement(StringType value) { 
1613          this.version = value;
1614          return this;
1615        }
1616
1617        /**
1618         * @return The version identifier for the software covered by this statement.
1619         */
1620        public String getVersion() { 
1621          return this.version == null ? null : this.version.getValue();
1622        }
1623
1624        /**
1625         * @param value The version identifier for the software covered by this statement.
1626         */
1627        public CapabilityStatementSoftwareComponent setVersion(String value) { 
1628          if (Utilities.noString(value))
1629            this.version = null;
1630          else {
1631            if (this.version == null)
1632              this.version = new StringType();
1633            this.version.setValue(value);
1634          }
1635          return this;
1636        }
1637
1638        /**
1639         * @return {@link #releaseDate} (Date this version of the software was released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value
1640         */
1641        public DateTimeType getReleaseDateElement() { 
1642          if (this.releaseDate == null)
1643            if (Configuration.errorOnAutoCreate())
1644              throw new Error("Attempt to auto-create CapabilityStatementSoftwareComponent.releaseDate");
1645            else if (Configuration.doAutoCreate())
1646              this.releaseDate = new DateTimeType(); // bb
1647          return this.releaseDate;
1648        }
1649
1650        public boolean hasReleaseDateElement() { 
1651          return this.releaseDate != null && !this.releaseDate.isEmpty();
1652        }
1653
1654        public boolean hasReleaseDate() { 
1655          return this.releaseDate != null && !this.releaseDate.isEmpty();
1656        }
1657
1658        /**
1659         * @param value {@link #releaseDate} (Date this version of the software was released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value
1660         */
1661        public CapabilityStatementSoftwareComponent setReleaseDateElement(DateTimeType value) { 
1662          this.releaseDate = value;
1663          return this;
1664        }
1665
1666        /**
1667         * @return Date this version of the software was released.
1668         */
1669        public Date getReleaseDate() { 
1670          return this.releaseDate == null ? null : this.releaseDate.getValue();
1671        }
1672
1673        /**
1674         * @param value Date this version of the software was released.
1675         */
1676        public CapabilityStatementSoftwareComponent setReleaseDate(Date value) { 
1677          if (value == null)
1678            this.releaseDate = null;
1679          else {
1680            if (this.releaseDate == null)
1681              this.releaseDate = new DateTimeType();
1682            this.releaseDate.setValue(value);
1683          }
1684          return this;
1685        }
1686
1687        protected void listChildren(List<Property> children) {
1688          super.listChildren(children);
1689          children.add(new Property("name", "string", "Name software is known by.", 0, 1, name));
1690          children.add(new Property("version", "string", "The version identifier for the software covered by this statement.", 0, 1, version));
1691          children.add(new Property("releaseDate", "dateTime", "Date this version of the software was released.", 0, 1, releaseDate));
1692        }
1693
1694        @Override
1695        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1696          switch (_hash) {
1697          case 3373707: /*name*/  return new Property("name", "string", "Name software is known by.", 0, 1, name);
1698          case 351608024: /*version*/  return new Property("version", "string", "The version identifier for the software covered by this statement.", 0, 1, version);
1699          case 212873301: /*releaseDate*/  return new Property("releaseDate", "dateTime", "Date this version of the software was released.", 0, 1, releaseDate);
1700          default: return super.getNamedProperty(_hash, _name, _checkValid);
1701          }
1702
1703        }
1704
1705      @Override
1706      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1707        switch (hash) {
1708        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1709        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
1710        case 212873301: /*releaseDate*/ return this.releaseDate == null ? new Base[0] : new Base[] {this.releaseDate}; // DateTimeType
1711        default: return super.getProperty(hash, name, checkValid);
1712        }
1713
1714      }
1715
1716      @Override
1717      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1718        switch (hash) {
1719        case 3373707: // name
1720          this.name = castToString(value); // StringType
1721          return value;
1722        case 351608024: // version
1723          this.version = castToString(value); // StringType
1724          return value;
1725        case 212873301: // releaseDate
1726          this.releaseDate = castToDateTime(value); // DateTimeType
1727          return value;
1728        default: return super.setProperty(hash, name, value);
1729        }
1730
1731      }
1732
1733      @Override
1734      public Base setProperty(String name, Base value) throws FHIRException {
1735        if (name.equals("name")) {
1736          this.name = castToString(value); // StringType
1737        } else if (name.equals("version")) {
1738          this.version = castToString(value); // StringType
1739        } else if (name.equals("releaseDate")) {
1740          this.releaseDate = castToDateTime(value); // DateTimeType
1741        } else
1742          return super.setProperty(name, value);
1743        return value;
1744      }
1745
1746      @Override
1747      public Base makeProperty(int hash, String name) throws FHIRException {
1748        switch (hash) {
1749        case 3373707:  return getNameElement();
1750        case 351608024:  return getVersionElement();
1751        case 212873301:  return getReleaseDateElement();
1752        default: return super.makeProperty(hash, name);
1753        }
1754
1755      }
1756
1757      @Override
1758      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1759        switch (hash) {
1760        case 3373707: /*name*/ return new String[] {"string"};
1761        case 351608024: /*version*/ return new String[] {"string"};
1762        case 212873301: /*releaseDate*/ return new String[] {"dateTime"};
1763        default: return super.getTypesForProperty(hash, name);
1764        }
1765
1766      }
1767
1768      @Override
1769      public Base addChild(String name) throws FHIRException {
1770        if (name.equals("name")) {
1771          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
1772        }
1773        else if (name.equals("version")) {
1774          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.version");
1775        }
1776        else if (name.equals("releaseDate")) {
1777          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.releaseDate");
1778        }
1779        else
1780          return super.addChild(name);
1781      }
1782
1783      public CapabilityStatementSoftwareComponent copy() {
1784        CapabilityStatementSoftwareComponent dst = new CapabilityStatementSoftwareComponent();
1785        copyValues(dst);
1786        dst.name = name == null ? null : name.copy();
1787        dst.version = version == null ? null : version.copy();
1788        dst.releaseDate = releaseDate == null ? null : releaseDate.copy();
1789        return dst;
1790      }
1791
1792      @Override
1793      public boolean equalsDeep(Base other_) {
1794        if (!super.equalsDeep(other_))
1795          return false;
1796        if (!(other_ instanceof CapabilityStatementSoftwareComponent))
1797          return false;
1798        CapabilityStatementSoftwareComponent o = (CapabilityStatementSoftwareComponent) other_;
1799        return compareDeep(name, o.name, true) && compareDeep(version, o.version, true) && compareDeep(releaseDate, o.releaseDate, true)
1800          ;
1801      }
1802
1803      @Override
1804      public boolean equalsShallow(Base other_) {
1805        if (!super.equalsShallow(other_))
1806          return false;
1807        if (!(other_ instanceof CapabilityStatementSoftwareComponent))
1808          return false;
1809        CapabilityStatementSoftwareComponent o = (CapabilityStatementSoftwareComponent) other_;
1810        return compareValues(name, o.name, true) && compareValues(version, o.version, true) && compareValues(releaseDate, o.releaseDate, true)
1811          ;
1812      }
1813
1814      public boolean isEmpty() {
1815        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, version, releaseDate
1816          );
1817      }
1818
1819  public String fhirType() {
1820    return "CapabilityStatement.software";
1821
1822  }
1823
1824  }
1825
1826    @Block()
1827    public static class CapabilityStatementImplementationComponent extends BackboneElement implements IBaseBackboneElement {
1828        /**
1829         * Information about the specific installation that this capability statement relates to.
1830         */
1831        @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1832        @Description(shortDefinition="Describes this specific instance", formalDefinition="Information about the specific installation that this capability statement relates to." )
1833        protected StringType description;
1834
1835        /**
1836         * An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
1837         */
1838        @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1839        @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." )
1840        protected UriType url;
1841
1842        private static final long serialVersionUID = -289238508L;
1843
1844    /**
1845     * Constructor
1846     */
1847      public CapabilityStatementImplementationComponent() {
1848        super();
1849      }
1850
1851    /**
1852     * Constructor
1853     */
1854      public CapabilityStatementImplementationComponent(StringType description) {
1855        super();
1856        this.description = description;
1857      }
1858
1859        /**
1860         * @return {@link #description} (Information about the specific installation that this capability statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1861         */
1862        public StringType getDescriptionElement() { 
1863          if (this.description == null)
1864            if (Configuration.errorOnAutoCreate())
1865              throw new Error("Attempt to auto-create CapabilityStatementImplementationComponent.description");
1866            else if (Configuration.doAutoCreate())
1867              this.description = new StringType(); // bb
1868          return this.description;
1869        }
1870
1871        public boolean hasDescriptionElement() { 
1872          return this.description != null && !this.description.isEmpty();
1873        }
1874
1875        public boolean hasDescription() { 
1876          return this.description != null && !this.description.isEmpty();
1877        }
1878
1879        /**
1880         * @param value {@link #description} (Information about the specific installation that this capability statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1881         */
1882        public CapabilityStatementImplementationComponent setDescriptionElement(StringType value) { 
1883          this.description = value;
1884          return this;
1885        }
1886
1887        /**
1888         * @return Information about the specific installation that this capability statement relates to.
1889         */
1890        public String getDescription() { 
1891          return this.description == null ? null : this.description.getValue();
1892        }
1893
1894        /**
1895         * @param value Information about the specific installation that this capability statement relates to.
1896         */
1897        public CapabilityStatementImplementationComponent setDescription(String value) { 
1898            if (this.description == null)
1899              this.description = new StringType();
1900            this.description.setValue(value);
1901          return this;
1902        }
1903
1904        /**
1905         * @return {@link #url} (An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1906         */
1907        public UriType getUrlElement() { 
1908          if (this.url == null)
1909            if (Configuration.errorOnAutoCreate())
1910              throw new Error("Attempt to auto-create CapabilityStatementImplementationComponent.url");
1911            else if (Configuration.doAutoCreate())
1912              this.url = new UriType(); // bb
1913          return this.url;
1914        }
1915
1916        public boolean hasUrlElement() { 
1917          return this.url != null && !this.url.isEmpty();
1918        }
1919
1920        public boolean hasUrl() { 
1921          return this.url != null && !this.url.isEmpty();
1922        }
1923
1924        /**
1925         * @param value {@link #url} (An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1926         */
1927        public CapabilityStatementImplementationComponent setUrlElement(UriType value) { 
1928          this.url = value;
1929          return this;
1930        }
1931
1932        /**
1933         * @return An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
1934         */
1935        public String getUrl() { 
1936          return this.url == null ? null : this.url.getValue();
1937        }
1938
1939        /**
1940         * @param value An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
1941         */
1942        public CapabilityStatementImplementationComponent setUrl(String value) { 
1943          if (Utilities.noString(value))
1944            this.url = null;
1945          else {
1946            if (this.url == null)
1947              this.url = new UriType();
1948            this.url.setValue(value);
1949          }
1950          return this;
1951        }
1952
1953        protected void listChildren(List<Property> children) {
1954          super.listChildren(children);
1955          children.add(new Property("description", "string", "Information about the specific installation that this capability statement relates to.", 0, 1, description));
1956          children.add(new Property("url", "uri", "An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, 1, url));
1957        }
1958
1959        @Override
1960        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1961          switch (_hash) {
1962          case -1724546052: /*description*/  return new Property("description", "string", "Information about the specific installation that this capability statement relates to.", 0, 1, description);
1963          case 116079: /*url*/  return new Property("url", "uri", "An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, 1, url);
1964          default: return super.getNamedProperty(_hash, _name, _checkValid);
1965          }
1966
1967        }
1968
1969      @Override
1970      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1971        switch (hash) {
1972        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1973        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1974        default: return super.getProperty(hash, name, checkValid);
1975        }
1976
1977      }
1978
1979      @Override
1980      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1981        switch (hash) {
1982        case -1724546052: // description
1983          this.description = castToString(value); // StringType
1984          return value;
1985        case 116079: // url
1986          this.url = castToUri(value); // UriType
1987          return value;
1988        default: return super.setProperty(hash, name, value);
1989        }
1990
1991      }
1992
1993      @Override
1994      public Base setProperty(String name, Base value) throws FHIRException {
1995        if (name.equals("description")) {
1996          this.description = castToString(value); // StringType
1997        } else if (name.equals("url")) {
1998          this.url = castToUri(value); // UriType
1999        } else
2000          return super.setProperty(name, value);
2001        return value;
2002      }
2003
2004      @Override
2005      public Base makeProperty(int hash, String name) throws FHIRException {
2006        switch (hash) {
2007        case -1724546052:  return getDescriptionElement();
2008        case 116079:  return getUrlElement();
2009        default: return super.makeProperty(hash, name);
2010        }
2011
2012      }
2013
2014      @Override
2015      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2016        switch (hash) {
2017        case -1724546052: /*description*/ return new String[] {"string"};
2018        case 116079: /*url*/ return new String[] {"uri"};
2019        default: return super.getTypesForProperty(hash, name);
2020        }
2021
2022      }
2023
2024      @Override
2025      public Base addChild(String name) throws FHIRException {
2026        if (name.equals("description")) {
2027          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
2028        }
2029        else if (name.equals("url")) {
2030          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.url");
2031        }
2032        else
2033          return super.addChild(name);
2034      }
2035
2036      public CapabilityStatementImplementationComponent copy() {
2037        CapabilityStatementImplementationComponent dst = new CapabilityStatementImplementationComponent();
2038        copyValues(dst);
2039        dst.description = description == null ? null : description.copy();
2040        dst.url = url == null ? null : url.copy();
2041        return dst;
2042      }
2043
2044      @Override
2045      public boolean equalsDeep(Base other_) {
2046        if (!super.equalsDeep(other_))
2047          return false;
2048        if (!(other_ instanceof CapabilityStatementImplementationComponent))
2049          return false;
2050        CapabilityStatementImplementationComponent o = (CapabilityStatementImplementationComponent) other_;
2051        return compareDeep(description, o.description, true) && compareDeep(url, o.url, true);
2052      }
2053
2054      @Override
2055      public boolean equalsShallow(Base other_) {
2056        if (!super.equalsShallow(other_))
2057          return false;
2058        if (!(other_ instanceof CapabilityStatementImplementationComponent))
2059          return false;
2060        CapabilityStatementImplementationComponent o = (CapabilityStatementImplementationComponent) other_;
2061        return compareValues(description, o.description, true) && compareValues(url, o.url, true);
2062      }
2063
2064      public boolean isEmpty() {
2065        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, url);
2066      }
2067
2068  public String fhirType() {
2069    return "CapabilityStatement.implementation";
2070
2071  }
2072
2073  }
2074
2075    @Block()
2076    public static class CapabilityStatementRestComponent extends BackboneElement implements IBaseBackboneElement {
2077        /**
2078         * Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
2079         */
2080        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2081        @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations." )
2082        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/restful-capability-mode")
2083        protected Enumeration<RestfulCapabilityMode> mode;
2084
2085        /**
2086         * Information about the system's restful capabilities that apply across all applications, such as security.
2087         */
2088        @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2089        @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." )
2090        protected StringType documentation;
2091
2092        /**
2093         * Information about security implementation from an interface perspective - what a client needs to know.
2094         */
2095        @Child(name = "security", type = {}, order=3, min=0, max=1, modifier=false, summary=true)
2096        @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security implementation from an interface perspective - what a client needs to know." )
2097        protected CapabilityStatementRestSecurityComponent security;
2098
2099        /**
2100         * A specification of the restful capabilities of the solution for a specific resource type.
2101         */
2102        @Child(name = "resource", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2103        @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." )
2104        protected List<CapabilityStatementRestResourceComponent> resource;
2105
2106        /**
2107         * A specification of restful operations supported by the system.
2108         */
2109        @Child(name = "interaction", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2110        @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." )
2111        protected List<SystemInteractionComponent> interaction;
2112
2113        /**
2114         * 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.
2115         */
2116        @Child(name = "searchParam", type = {CapabilityStatementRestResourceSearchParamComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2117        @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." )
2118        protected List<CapabilityStatementRestResourceSearchParamComponent> searchParam;
2119
2120        /**
2121         * Definition of an operation or a named query together with its parameters and their meaning and type.
2122         */
2123        @Child(name = "operation", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2124        @Description(shortDefinition="Definition of an operation or a custom query", formalDefinition="Definition of an operation or a named query together with its parameters and their meaning and type." )
2125        protected List<CapabilityStatementRestOperationComponent> operation;
2126
2127        /**
2128         * 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 .
2129         */
2130        @Child(name = "compartment", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2131        @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 ." )
2132        protected List<UriType> compartment;
2133
2134        private static final long serialVersionUID = 38012979L;
2135
2136    /**
2137     * Constructor
2138     */
2139      public CapabilityStatementRestComponent() {
2140        super();
2141      }
2142
2143    /**
2144     * Constructor
2145     */
2146      public CapabilityStatementRestComponent(Enumeration<RestfulCapabilityMode> mode) {
2147        super();
2148        this.mode = mode;
2149      }
2150
2151        /**
2152         * @return {@link #mode} (Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
2153         */
2154        public Enumeration<RestfulCapabilityMode> getModeElement() { 
2155          if (this.mode == null)
2156            if (Configuration.errorOnAutoCreate())
2157              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.mode");
2158            else if (Configuration.doAutoCreate())
2159              this.mode = new Enumeration<RestfulCapabilityMode>(new RestfulCapabilityModeEnumFactory()); // bb
2160          return this.mode;
2161        }
2162
2163        public boolean hasModeElement() { 
2164          return this.mode != null && !this.mode.isEmpty();
2165        }
2166
2167        public boolean hasMode() { 
2168          return this.mode != null && !this.mode.isEmpty();
2169        }
2170
2171        /**
2172         * @param value {@link #mode} (Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
2173         */
2174        public CapabilityStatementRestComponent setModeElement(Enumeration<RestfulCapabilityMode> value) { 
2175          this.mode = value;
2176          return this;
2177        }
2178
2179        /**
2180         * @return Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
2181         */
2182        public RestfulCapabilityMode getMode() { 
2183          return this.mode == null ? null : this.mode.getValue();
2184        }
2185
2186        /**
2187         * @param value Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
2188         */
2189        public CapabilityStatementRestComponent setMode(RestfulCapabilityMode value) { 
2190            if (this.mode == null)
2191              this.mode = new Enumeration<RestfulCapabilityMode>(new RestfulCapabilityModeEnumFactory());
2192            this.mode.setValue(value);
2193          return this;
2194        }
2195
2196        /**
2197         * @return {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
2198         */
2199        public StringType getDocumentationElement() { 
2200          if (this.documentation == null)
2201            if (Configuration.errorOnAutoCreate())
2202              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.documentation");
2203            else if (Configuration.doAutoCreate())
2204              this.documentation = new StringType(); // bb
2205          return this.documentation;
2206        }
2207
2208        public boolean hasDocumentationElement() { 
2209          return this.documentation != null && !this.documentation.isEmpty();
2210        }
2211
2212        public boolean hasDocumentation() { 
2213          return this.documentation != null && !this.documentation.isEmpty();
2214        }
2215
2216        /**
2217         * @param value {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
2218         */
2219        public CapabilityStatementRestComponent setDocumentationElement(StringType value) { 
2220          this.documentation = value;
2221          return this;
2222        }
2223
2224        /**
2225         * @return Information about the system's restful capabilities that apply across all applications, such as security.
2226         */
2227        public String getDocumentation() { 
2228          return this.documentation == null ? null : this.documentation.getValue();
2229        }
2230
2231        /**
2232         * @param value Information about the system's restful capabilities that apply across all applications, such as security.
2233         */
2234        public CapabilityStatementRestComponent setDocumentation(String value) { 
2235          if (Utilities.noString(value))
2236            this.documentation = null;
2237          else {
2238            if (this.documentation == null)
2239              this.documentation = new StringType();
2240            this.documentation.setValue(value);
2241          }
2242          return this;
2243        }
2244
2245        /**
2246         * @return {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.)
2247         */
2248        public CapabilityStatementRestSecurityComponent getSecurity() { 
2249          if (this.security == null)
2250            if (Configuration.errorOnAutoCreate())
2251              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.security");
2252            else if (Configuration.doAutoCreate())
2253              this.security = new CapabilityStatementRestSecurityComponent(); // cc
2254          return this.security;
2255        }
2256
2257        public boolean hasSecurity() { 
2258          return this.security != null && !this.security.isEmpty();
2259        }
2260
2261        /**
2262         * @param value {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.)
2263         */
2264        public CapabilityStatementRestComponent setSecurity(CapabilityStatementRestSecurityComponent value)  { 
2265          this.security = value;
2266          return this;
2267        }
2268
2269        /**
2270         * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.)
2271         */
2272        public List<CapabilityStatementRestResourceComponent> getResource() { 
2273          if (this.resource == null)
2274            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2275          return this.resource;
2276        }
2277
2278        /**
2279         * @return Returns a reference to <code>this</code> for easy method chaining
2280         */
2281        public CapabilityStatementRestComponent setResource(List<CapabilityStatementRestResourceComponent> theResource) { 
2282          this.resource = theResource;
2283          return this;
2284        }
2285
2286        public boolean hasResource() { 
2287          if (this.resource == null)
2288            return false;
2289          for (CapabilityStatementRestResourceComponent item : this.resource)
2290            if (!item.isEmpty())
2291              return true;
2292          return false;
2293        }
2294
2295        public CapabilityStatementRestResourceComponent addResource() { //3
2296          CapabilityStatementRestResourceComponent t = new CapabilityStatementRestResourceComponent();
2297          if (this.resource == null)
2298            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2299          this.resource.add(t);
2300          return t;
2301        }
2302
2303        public CapabilityStatementRestComponent addResource(CapabilityStatementRestResourceComponent t) { //3
2304          if (t == null)
2305            return this;
2306          if (this.resource == null)
2307            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2308          this.resource.add(t);
2309          return this;
2310        }
2311
2312        /**
2313         * @return The first repetition of repeating field {@link #resource}, creating it if it does not already exist
2314         */
2315        public CapabilityStatementRestResourceComponent getResourceFirstRep() { 
2316          if (getResource().isEmpty()) {
2317            addResource();
2318          }
2319          return getResource().get(0);
2320        }
2321
2322        /**
2323         * @return {@link #interaction} (A specification of restful operations supported by the system.)
2324         */
2325        public List<SystemInteractionComponent> getInteraction() { 
2326          if (this.interaction == null)
2327            this.interaction = new ArrayList<SystemInteractionComponent>();
2328          return this.interaction;
2329        }
2330
2331        /**
2332         * @return Returns a reference to <code>this</code> for easy method chaining
2333         */
2334        public CapabilityStatementRestComponent setInteraction(List<SystemInteractionComponent> theInteraction) { 
2335          this.interaction = theInteraction;
2336          return this;
2337        }
2338
2339        public boolean hasInteraction() { 
2340          if (this.interaction == null)
2341            return false;
2342          for (SystemInteractionComponent item : this.interaction)
2343            if (!item.isEmpty())
2344              return true;
2345          return false;
2346        }
2347
2348        public SystemInteractionComponent addInteraction() { //3
2349          SystemInteractionComponent t = new SystemInteractionComponent();
2350          if (this.interaction == null)
2351            this.interaction = new ArrayList<SystemInteractionComponent>();
2352          this.interaction.add(t);
2353          return t;
2354        }
2355
2356        public CapabilityStatementRestComponent addInteraction(SystemInteractionComponent t) { //3
2357          if (t == null)
2358            return this;
2359          if (this.interaction == null)
2360            this.interaction = new ArrayList<SystemInteractionComponent>();
2361          this.interaction.add(t);
2362          return this;
2363        }
2364
2365        /**
2366         * @return The first repetition of repeating field {@link #interaction}, creating it if it does not already exist
2367         */
2368        public SystemInteractionComponent getInteractionFirstRep() { 
2369          if (getInteraction().isEmpty()) {
2370            addInteraction();
2371          }
2372          return getInteraction().get(0);
2373        }
2374
2375        /**
2376         * @return {@link #searchParam} (Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.)
2377         */
2378        public List<CapabilityStatementRestResourceSearchParamComponent> getSearchParam() { 
2379          if (this.searchParam == null)
2380            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2381          return this.searchParam;
2382        }
2383
2384        /**
2385         * @return Returns a reference to <code>this</code> for easy method chaining
2386         */
2387        public CapabilityStatementRestComponent setSearchParam(List<CapabilityStatementRestResourceSearchParamComponent> theSearchParam) { 
2388          this.searchParam = theSearchParam;
2389          return this;
2390        }
2391
2392        public boolean hasSearchParam() { 
2393          if (this.searchParam == null)
2394            return false;
2395          for (CapabilityStatementRestResourceSearchParamComponent item : this.searchParam)
2396            if (!item.isEmpty())
2397              return true;
2398          return false;
2399        }
2400
2401        public CapabilityStatementRestResourceSearchParamComponent addSearchParam() { //3
2402          CapabilityStatementRestResourceSearchParamComponent t = new CapabilityStatementRestResourceSearchParamComponent();
2403          if (this.searchParam == null)
2404            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2405          this.searchParam.add(t);
2406          return t;
2407        }
2408
2409        public CapabilityStatementRestComponent addSearchParam(CapabilityStatementRestResourceSearchParamComponent t) { //3
2410          if (t == null)
2411            return this;
2412          if (this.searchParam == null)
2413            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2414          this.searchParam.add(t);
2415          return this;
2416        }
2417
2418        /**
2419         * @return The first repetition of repeating field {@link #searchParam}, creating it if it does not already exist
2420         */
2421        public CapabilityStatementRestResourceSearchParamComponent getSearchParamFirstRep() { 
2422          if (getSearchParam().isEmpty()) {
2423            addSearchParam();
2424          }
2425          return getSearchParam().get(0);
2426        }
2427
2428        /**
2429         * @return {@link #operation} (Definition of an operation or a named query together with its parameters and their meaning and type.)
2430         */
2431        public List<CapabilityStatementRestOperationComponent> getOperation() { 
2432          if (this.operation == null)
2433            this.operation = new ArrayList<CapabilityStatementRestOperationComponent>();
2434          return this.operation;
2435        }
2436
2437        /**
2438         * @return Returns a reference to <code>this</code> for easy method chaining
2439         */
2440        public CapabilityStatementRestComponent setOperation(List<CapabilityStatementRestOperationComponent> theOperation) { 
2441          this.operation = theOperation;
2442          return this;
2443        }
2444
2445        public boolean hasOperation() { 
2446          if (this.operation == null)
2447            return false;
2448          for (CapabilityStatementRestOperationComponent item : this.operation)
2449            if (!item.isEmpty())
2450              return true;
2451          return false;
2452        }
2453
2454        public CapabilityStatementRestOperationComponent addOperation() { //3
2455          CapabilityStatementRestOperationComponent t = new CapabilityStatementRestOperationComponent();
2456          if (this.operation == null)
2457            this.operation = new ArrayList<CapabilityStatementRestOperationComponent>();
2458          this.operation.add(t);
2459          return t;
2460        }
2461
2462        public CapabilityStatementRestComponent addOperation(CapabilityStatementRestOperationComponent t) { //3
2463          if (t == null)
2464            return this;
2465          if (this.operation == null)
2466            this.operation = new ArrayList<CapabilityStatementRestOperationComponent>();
2467          this.operation.add(t);
2468          return this;
2469        }
2470
2471        /**
2472         * @return The first repetition of repeating field {@link #operation}, creating it if it does not already exist
2473         */
2474        public CapabilityStatementRestOperationComponent getOperationFirstRep() { 
2475          if (getOperation().isEmpty()) {
2476            addOperation();
2477          }
2478          return getOperation().get(0);
2479        }
2480
2481        /**
2482         * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .)
2483         */
2484        public List<UriType> getCompartment() { 
2485          if (this.compartment == null)
2486            this.compartment = new ArrayList<UriType>();
2487          return this.compartment;
2488        }
2489
2490        /**
2491         * @return Returns a reference to <code>this</code> for easy method chaining
2492         */
2493        public CapabilityStatementRestComponent setCompartment(List<UriType> theCompartment) { 
2494          this.compartment = theCompartment;
2495          return this;
2496        }
2497
2498        public boolean hasCompartment() { 
2499          if (this.compartment == null)
2500            return false;
2501          for (UriType item : this.compartment)
2502            if (!item.isEmpty())
2503              return true;
2504          return false;
2505        }
2506
2507        /**
2508         * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .)
2509         */
2510        public UriType addCompartmentElement() {//2 
2511          UriType t = new UriType();
2512          if (this.compartment == null)
2513            this.compartment = new ArrayList<UriType>();
2514          this.compartment.add(t);
2515          return t;
2516        }
2517
2518        /**
2519         * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .)
2520         */
2521        public CapabilityStatementRestComponent addCompartment(String value) { //1
2522          UriType t = new UriType();
2523          t.setValue(value);
2524          if (this.compartment == null)
2525            this.compartment = new ArrayList<UriType>();
2526          this.compartment.add(t);
2527          return this;
2528        }
2529
2530        /**
2531         * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .)
2532         */
2533        public boolean hasCompartment(String value) { 
2534          if (this.compartment == null)
2535            return false;
2536          for (UriType v : this.compartment)
2537            if (v.getValue().equals(value)) // uri
2538              return true;
2539          return false;
2540        }
2541
2542        protected void listChildren(List<Property> children) {
2543          super.listChildren(children);
2544          children.add(new Property("mode", "code", "Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.", 0, 1, mode));
2545          children.add(new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, 1, documentation));
2546          children.add(new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, 1, security));
2547          children.add(new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource));
2548          children.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction));
2549          children.add(new Property("searchParam", "@CapabilityStatement.rest.resource.searchParam", "Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam));
2550          children.add(new Property("operation", "", "Definition of an operation or a named query together with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation));
2551          children.add(new Property("compartment", "uri", "An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .", 0, java.lang.Integer.MAX_VALUE, compartment));
2552        }
2553
2554        @Override
2555        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2556          switch (_hash) {
2557          case 3357091: /*mode*/  return new Property("mode", "code", "Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.", 0, 1, mode);
2558          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, 1, documentation);
2559          case 949122880: /*security*/  return new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, 1, security);
2560          case -341064690: /*resource*/  return new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource);
2561          case 1844104722: /*interaction*/  return new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction);
2562          case -553645115: /*searchParam*/  return new Property("searchParam", "@CapabilityStatement.rest.resource.searchParam", "Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam);
2563          case 1662702951: /*operation*/  return new Property("operation", "", "Definition of an operation or a named query together with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation);
2564          case -397756334: /*compartment*/  return new Property("compartment", "uri", "An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .", 0, java.lang.Integer.MAX_VALUE, compartment);
2565          default: return super.getNamedProperty(_hash, _name, _checkValid);
2566          }
2567
2568        }
2569
2570      @Override
2571      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2572        switch (hash) {
2573        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<RestfulCapabilityMode>
2574        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
2575        case 949122880: /*security*/ return this.security == null ? new Base[0] : new Base[] {this.security}; // CapabilityStatementRestSecurityComponent
2576        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // CapabilityStatementRestResourceComponent
2577        case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // SystemInteractionComponent
2578        case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // CapabilityStatementRestResourceSearchParamComponent
2579        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : this.operation.toArray(new Base[this.operation.size()]); // CapabilityStatementRestOperationComponent
2580        case -397756334: /*compartment*/ return this.compartment == null ? new Base[0] : this.compartment.toArray(new Base[this.compartment.size()]); // UriType
2581        default: return super.getProperty(hash, name, checkValid);
2582        }
2583
2584      }
2585
2586      @Override
2587      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2588        switch (hash) {
2589        case 3357091: // mode
2590          value = new RestfulCapabilityModeEnumFactory().fromType(castToCode(value));
2591          this.mode = (Enumeration) value; // Enumeration<RestfulCapabilityMode>
2592          return value;
2593        case 1587405498: // documentation
2594          this.documentation = castToString(value); // StringType
2595          return value;
2596        case 949122880: // security
2597          this.security = (CapabilityStatementRestSecurityComponent) value; // CapabilityStatementRestSecurityComponent
2598          return value;
2599        case -341064690: // resource
2600          this.getResource().add((CapabilityStatementRestResourceComponent) value); // CapabilityStatementRestResourceComponent
2601          return value;
2602        case 1844104722: // interaction
2603          this.getInteraction().add((SystemInteractionComponent) value); // SystemInteractionComponent
2604          return value;
2605        case -553645115: // searchParam
2606          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value); // CapabilityStatementRestResourceSearchParamComponent
2607          return value;
2608        case 1662702951: // operation
2609          this.getOperation().add((CapabilityStatementRestOperationComponent) value); // CapabilityStatementRestOperationComponent
2610          return value;
2611        case -397756334: // compartment
2612          this.getCompartment().add(castToUri(value)); // UriType
2613          return value;
2614        default: return super.setProperty(hash, name, value);
2615        }
2616
2617      }
2618
2619      @Override
2620      public Base setProperty(String name, Base value) throws FHIRException {
2621        if (name.equals("mode")) {
2622          value = new RestfulCapabilityModeEnumFactory().fromType(castToCode(value));
2623          this.mode = (Enumeration) value; // Enumeration<RestfulCapabilityMode>
2624        } else if (name.equals("documentation")) {
2625          this.documentation = castToString(value); // StringType
2626        } else if (name.equals("security")) {
2627          this.security = (CapabilityStatementRestSecurityComponent) value; // CapabilityStatementRestSecurityComponent
2628        } else if (name.equals("resource")) {
2629          this.getResource().add((CapabilityStatementRestResourceComponent) value);
2630        } else if (name.equals("interaction")) {
2631          this.getInteraction().add((SystemInteractionComponent) value);
2632        } else if (name.equals("searchParam")) {
2633          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value);
2634        } else if (name.equals("operation")) {
2635          this.getOperation().add((CapabilityStatementRestOperationComponent) value);
2636        } else if (name.equals("compartment")) {
2637          this.getCompartment().add(castToUri(value));
2638        } else
2639          return super.setProperty(name, value);
2640        return value;
2641      }
2642
2643      @Override
2644      public Base makeProperty(int hash, String name) throws FHIRException {
2645        switch (hash) {
2646        case 3357091:  return getModeElement();
2647        case 1587405498:  return getDocumentationElement();
2648        case 949122880:  return getSecurity(); 
2649        case -341064690:  return addResource(); 
2650        case 1844104722:  return addInteraction(); 
2651        case -553645115:  return addSearchParam(); 
2652        case 1662702951:  return addOperation(); 
2653        case -397756334:  return addCompartmentElement();
2654        default: return super.makeProperty(hash, name);
2655        }
2656
2657      }
2658
2659      @Override
2660      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2661        switch (hash) {
2662        case 3357091: /*mode*/ return new String[] {"code"};
2663        case 1587405498: /*documentation*/ return new String[] {"string"};
2664        case 949122880: /*security*/ return new String[] {};
2665        case -341064690: /*resource*/ return new String[] {};
2666        case 1844104722: /*interaction*/ return new String[] {};
2667        case -553645115: /*searchParam*/ return new String[] {"@CapabilityStatement.rest.resource.searchParam"};
2668        case 1662702951: /*operation*/ return new String[] {};
2669        case -397756334: /*compartment*/ return new String[] {"uri"};
2670        default: return super.getTypesForProperty(hash, name);
2671        }
2672
2673      }
2674
2675      @Override
2676      public Base addChild(String name) throws FHIRException {
2677        if (name.equals("mode")) {
2678          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
2679        }
2680        else if (name.equals("documentation")) {
2681          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
2682        }
2683        else if (name.equals("security")) {
2684          this.security = new CapabilityStatementRestSecurityComponent();
2685          return this.security;
2686        }
2687        else if (name.equals("resource")) {
2688          return addResource();
2689        }
2690        else if (name.equals("interaction")) {
2691          return addInteraction();
2692        }
2693        else if (name.equals("searchParam")) {
2694          return addSearchParam();
2695        }
2696        else if (name.equals("operation")) {
2697          return addOperation();
2698        }
2699        else if (name.equals("compartment")) {
2700          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.compartment");
2701        }
2702        else
2703          return super.addChild(name);
2704      }
2705
2706      public CapabilityStatementRestComponent copy() {
2707        CapabilityStatementRestComponent dst = new CapabilityStatementRestComponent();
2708        copyValues(dst);
2709        dst.mode = mode == null ? null : mode.copy();
2710        dst.documentation = documentation == null ? null : documentation.copy();
2711        dst.security = security == null ? null : security.copy();
2712        if (resource != null) {
2713          dst.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2714          for (CapabilityStatementRestResourceComponent i : resource)
2715            dst.resource.add(i.copy());
2716        };
2717        if (interaction != null) {
2718          dst.interaction = new ArrayList<SystemInteractionComponent>();
2719          for (SystemInteractionComponent i : interaction)
2720            dst.interaction.add(i.copy());
2721        };
2722        if (searchParam != null) {
2723          dst.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2724          for (CapabilityStatementRestResourceSearchParamComponent i : searchParam)
2725            dst.searchParam.add(i.copy());
2726        };
2727        if (operation != null) {
2728          dst.operation = new ArrayList<CapabilityStatementRestOperationComponent>();
2729          for (CapabilityStatementRestOperationComponent i : operation)
2730            dst.operation.add(i.copy());
2731        };
2732        if (compartment != null) {
2733          dst.compartment = new ArrayList<UriType>();
2734          for (UriType i : compartment)
2735            dst.compartment.add(i.copy());
2736        };
2737        return dst;
2738      }
2739
2740      @Override
2741      public boolean equalsDeep(Base other_) {
2742        if (!super.equalsDeep(other_))
2743          return false;
2744        if (!(other_ instanceof CapabilityStatementRestComponent))
2745          return false;
2746        CapabilityStatementRestComponent o = (CapabilityStatementRestComponent) other_;
2747        return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(security, o.security, true)
2748           && compareDeep(resource, o.resource, true) && compareDeep(interaction, o.interaction, true) && compareDeep(searchParam, o.searchParam, true)
2749           && compareDeep(operation, o.operation, true) && compareDeep(compartment, o.compartment, true);
2750      }
2751
2752      @Override
2753      public boolean equalsShallow(Base other_) {
2754        if (!super.equalsShallow(other_))
2755          return false;
2756        if (!(other_ instanceof CapabilityStatementRestComponent))
2757          return false;
2758        CapabilityStatementRestComponent o = (CapabilityStatementRestComponent) other_;
2759        return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true) && compareValues(compartment, o.compartment, true)
2760          ;
2761      }
2762
2763      public boolean isEmpty() {
2764        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, documentation, security
2765          , resource, interaction, searchParam, operation, compartment);
2766      }
2767
2768  public String fhirType() {
2769    return "CapabilityStatement.rest";
2770
2771  }
2772
2773  }
2774
2775    @Block()
2776    public static class CapabilityStatementRestSecurityComponent extends BackboneElement implements IBaseBackboneElement {
2777        /**
2778         * Server adds CORS headers when responding to requests - this enables javascript applications to use the server.
2779         */
2780        @Child(name = "cors", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2781        @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." )
2782        protected BooleanType cors;
2783
2784        /**
2785         * Types of security services that are supported/required by the system.
2786         */
2787        @Child(name = "service", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2788        @Description(shortDefinition="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", formalDefinition="Types of security services that are supported/required by the system." )
2789        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/restful-security-service")
2790        protected List<CodeableConcept> service;
2791
2792        /**
2793         * General description of how security works.
2794         */
2795        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2796        @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." )
2797        protected StringType description;
2798
2799        /**
2800         * Certificates associated with security profiles.
2801         */
2802        @Child(name = "certificate", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2803        @Description(shortDefinition="Certificates associated with security profiles", formalDefinition="Certificates associated with security profiles." )
2804        protected List<CapabilityStatementRestSecurityCertificateComponent> certificate;
2805
2806        private static final long serialVersionUID = 1081654002L;
2807
2808    /**
2809     * Constructor
2810     */
2811      public CapabilityStatementRestSecurityComponent() {
2812        super();
2813      }
2814
2815        /**
2816         * @return {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value
2817         */
2818        public BooleanType getCorsElement() { 
2819          if (this.cors == null)
2820            if (Configuration.errorOnAutoCreate())
2821              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityComponent.cors");
2822            else if (Configuration.doAutoCreate())
2823              this.cors = new BooleanType(); // bb
2824          return this.cors;
2825        }
2826
2827        public boolean hasCorsElement() { 
2828          return this.cors != null && !this.cors.isEmpty();
2829        }
2830
2831        public boolean hasCors() { 
2832          return this.cors != null && !this.cors.isEmpty();
2833        }
2834
2835        /**
2836         * @param value {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value
2837         */
2838        public CapabilityStatementRestSecurityComponent setCorsElement(BooleanType value) { 
2839          this.cors = value;
2840          return this;
2841        }
2842
2843        /**
2844         * @return Server adds CORS headers when responding to requests - this enables javascript applications to use the server.
2845         */
2846        public boolean getCors() { 
2847          return this.cors == null || this.cors.isEmpty() ? false : this.cors.getValue();
2848        }
2849
2850        /**
2851         * @param value Server adds CORS headers when responding to requests - this enables javascript applications to use the server.
2852         */
2853        public CapabilityStatementRestSecurityComponent setCors(boolean value) { 
2854            if (this.cors == null)
2855              this.cors = new BooleanType();
2856            this.cors.setValue(value);
2857          return this;
2858        }
2859
2860        /**
2861         * @return {@link #service} (Types of security services that are supported/required by the system.)
2862         */
2863        public List<CodeableConcept> getService() { 
2864          if (this.service == null)
2865            this.service = new ArrayList<CodeableConcept>();
2866          return this.service;
2867        }
2868
2869        /**
2870         * @return Returns a reference to <code>this</code> for easy method chaining
2871         */
2872        public CapabilityStatementRestSecurityComponent setService(List<CodeableConcept> theService) { 
2873          this.service = theService;
2874          return this;
2875        }
2876
2877        public boolean hasService() { 
2878          if (this.service == null)
2879            return false;
2880          for (CodeableConcept item : this.service)
2881            if (!item.isEmpty())
2882              return true;
2883          return false;
2884        }
2885
2886        public CodeableConcept addService() { //3
2887          CodeableConcept t = new CodeableConcept();
2888          if (this.service == null)
2889            this.service = new ArrayList<CodeableConcept>();
2890          this.service.add(t);
2891          return t;
2892        }
2893
2894        public CapabilityStatementRestSecurityComponent addService(CodeableConcept t) { //3
2895          if (t == null)
2896            return this;
2897          if (this.service == null)
2898            this.service = new ArrayList<CodeableConcept>();
2899          this.service.add(t);
2900          return this;
2901        }
2902
2903        /**
2904         * @return The first repetition of repeating field {@link #service}, creating it if it does not already exist
2905         */
2906        public CodeableConcept getServiceFirstRep() { 
2907          if (getService().isEmpty()) {
2908            addService();
2909          }
2910          return getService().get(0);
2911        }
2912
2913        /**
2914         * @return {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2915         */
2916        public StringType getDescriptionElement() { 
2917          if (this.description == null)
2918            if (Configuration.errorOnAutoCreate())
2919              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityComponent.description");
2920            else if (Configuration.doAutoCreate())
2921              this.description = new StringType(); // bb
2922          return this.description;
2923        }
2924
2925        public boolean hasDescriptionElement() { 
2926          return this.description != null && !this.description.isEmpty();
2927        }
2928
2929        public boolean hasDescription() { 
2930          return this.description != null && !this.description.isEmpty();
2931        }
2932
2933        /**
2934         * @param value {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2935         */
2936        public CapabilityStatementRestSecurityComponent setDescriptionElement(StringType value) { 
2937          this.description = value;
2938          return this;
2939        }
2940
2941        /**
2942         * @return General description of how security works.
2943         */
2944        public String getDescription() { 
2945          return this.description == null ? null : this.description.getValue();
2946        }
2947
2948        /**
2949         * @param value General description of how security works.
2950         */
2951        public CapabilityStatementRestSecurityComponent setDescription(String value) { 
2952          if (Utilities.noString(value))
2953            this.description = null;
2954          else {
2955            if (this.description == null)
2956              this.description = new StringType();
2957            this.description.setValue(value);
2958          }
2959          return this;
2960        }
2961
2962        /**
2963         * @return {@link #certificate} (Certificates associated with security profiles.)
2964         */
2965        public List<CapabilityStatementRestSecurityCertificateComponent> getCertificate() { 
2966          if (this.certificate == null)
2967            this.certificate = new ArrayList<CapabilityStatementRestSecurityCertificateComponent>();
2968          return this.certificate;
2969        }
2970
2971        /**
2972         * @return Returns a reference to <code>this</code> for easy method chaining
2973         */
2974        public CapabilityStatementRestSecurityComponent setCertificate(List<CapabilityStatementRestSecurityCertificateComponent> theCertificate) { 
2975          this.certificate = theCertificate;
2976          return this;
2977        }
2978
2979        public boolean hasCertificate() { 
2980          if (this.certificate == null)
2981            return false;
2982          for (CapabilityStatementRestSecurityCertificateComponent item : this.certificate)
2983            if (!item.isEmpty())
2984              return true;
2985          return false;
2986        }
2987
2988        public CapabilityStatementRestSecurityCertificateComponent addCertificate() { //3
2989          CapabilityStatementRestSecurityCertificateComponent t = new CapabilityStatementRestSecurityCertificateComponent();
2990          if (this.certificate == null)
2991            this.certificate = new ArrayList<CapabilityStatementRestSecurityCertificateComponent>();
2992          this.certificate.add(t);
2993          return t;
2994        }
2995
2996        public CapabilityStatementRestSecurityComponent addCertificate(CapabilityStatementRestSecurityCertificateComponent t) { //3
2997          if (t == null)
2998            return this;
2999          if (this.certificate == null)
3000            this.certificate = new ArrayList<CapabilityStatementRestSecurityCertificateComponent>();
3001          this.certificate.add(t);
3002          return this;
3003        }
3004
3005        /**
3006         * @return The first repetition of repeating field {@link #certificate}, creating it if it does not already exist
3007         */
3008        public CapabilityStatementRestSecurityCertificateComponent getCertificateFirstRep() { 
3009          if (getCertificate().isEmpty()) {
3010            addCertificate();
3011          }
3012          return getCertificate().get(0);
3013        }
3014
3015        protected void listChildren(List<Property> children) {
3016          super.listChildren(children);
3017          children.add(new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, 1, cors));
3018          children.add(new Property("service", "CodeableConcept", "Types of security services that are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service));
3019          children.add(new Property("description", "string", "General description of how security works.", 0, 1, description));
3020          children.add(new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate));
3021        }
3022
3023        @Override
3024        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3025          switch (_hash) {
3026          case 3059629: /*cors*/  return new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, 1, cors);
3027          case 1984153269: /*service*/  return new Property("service", "CodeableConcept", "Types of security services that are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service);
3028          case -1724546052: /*description*/  return new Property("description", "string", "General description of how security works.", 0, 1, description);
3029          case 1952399767: /*certificate*/  return new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate);
3030          default: return super.getNamedProperty(_hash, _name, _checkValid);
3031          }
3032
3033        }
3034
3035      @Override
3036      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3037        switch (hash) {
3038        case 3059629: /*cors*/ return this.cors == null ? new Base[0] : new Base[] {this.cors}; // BooleanType
3039        case 1984153269: /*service*/ return this.service == null ? new Base[0] : this.service.toArray(new Base[this.service.size()]); // CodeableConcept
3040        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3041        case 1952399767: /*certificate*/ return this.certificate == null ? new Base[0] : this.certificate.toArray(new Base[this.certificate.size()]); // CapabilityStatementRestSecurityCertificateComponent
3042        default: return super.getProperty(hash, name, checkValid);
3043        }
3044
3045      }
3046
3047      @Override
3048      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3049        switch (hash) {
3050        case 3059629: // cors
3051          this.cors = castToBoolean(value); // BooleanType
3052          return value;
3053        case 1984153269: // service
3054          this.getService().add(castToCodeableConcept(value)); // CodeableConcept
3055          return value;
3056        case -1724546052: // description
3057          this.description = castToString(value); // StringType
3058          return value;
3059        case 1952399767: // certificate
3060          this.getCertificate().add((CapabilityStatementRestSecurityCertificateComponent) value); // CapabilityStatementRestSecurityCertificateComponent
3061          return value;
3062        default: return super.setProperty(hash, name, value);
3063        }
3064
3065      }
3066
3067      @Override
3068      public Base setProperty(String name, Base value) throws FHIRException {
3069        if (name.equals("cors")) {
3070          this.cors = castToBoolean(value); // BooleanType
3071        } else if (name.equals("service")) {
3072          this.getService().add(castToCodeableConcept(value));
3073        } else if (name.equals("description")) {
3074          this.description = castToString(value); // StringType
3075        } else if (name.equals("certificate")) {
3076          this.getCertificate().add((CapabilityStatementRestSecurityCertificateComponent) value);
3077        } else
3078          return super.setProperty(name, value);
3079        return value;
3080      }
3081
3082      @Override
3083      public Base makeProperty(int hash, String name) throws FHIRException {
3084        switch (hash) {
3085        case 3059629:  return getCorsElement();
3086        case 1984153269:  return addService(); 
3087        case -1724546052:  return getDescriptionElement();
3088        case 1952399767:  return addCertificate(); 
3089        default: return super.makeProperty(hash, name);
3090        }
3091
3092      }
3093
3094      @Override
3095      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3096        switch (hash) {
3097        case 3059629: /*cors*/ return new String[] {"boolean"};
3098        case 1984153269: /*service*/ return new String[] {"CodeableConcept"};
3099        case -1724546052: /*description*/ return new String[] {"string"};
3100        case 1952399767: /*certificate*/ return new String[] {};
3101        default: return super.getTypesForProperty(hash, name);
3102        }
3103
3104      }
3105
3106      @Override
3107      public Base addChild(String name) throws FHIRException {
3108        if (name.equals("cors")) {
3109          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.cors");
3110        }
3111        else if (name.equals("service")) {
3112          return addService();
3113        }
3114        else if (name.equals("description")) {
3115          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
3116        }
3117        else if (name.equals("certificate")) {
3118          return addCertificate();
3119        }
3120        else
3121          return super.addChild(name);
3122      }
3123
3124      public CapabilityStatementRestSecurityComponent copy() {
3125        CapabilityStatementRestSecurityComponent dst = new CapabilityStatementRestSecurityComponent();
3126        copyValues(dst);
3127        dst.cors = cors == null ? null : cors.copy();
3128        if (service != null) {
3129          dst.service = new ArrayList<CodeableConcept>();
3130          for (CodeableConcept i : service)
3131            dst.service.add(i.copy());
3132        };
3133        dst.description = description == null ? null : description.copy();
3134        if (certificate != null) {
3135          dst.certificate = new ArrayList<CapabilityStatementRestSecurityCertificateComponent>();
3136          for (CapabilityStatementRestSecurityCertificateComponent i : certificate)
3137            dst.certificate.add(i.copy());
3138        };
3139        return dst;
3140      }
3141
3142      @Override
3143      public boolean equalsDeep(Base other_) {
3144        if (!super.equalsDeep(other_))
3145          return false;
3146        if (!(other_ instanceof CapabilityStatementRestSecurityComponent))
3147          return false;
3148        CapabilityStatementRestSecurityComponent o = (CapabilityStatementRestSecurityComponent) other_;
3149        return compareDeep(cors, o.cors, true) && compareDeep(service, o.service, true) && compareDeep(description, o.description, true)
3150           && compareDeep(certificate, o.certificate, true);
3151      }
3152
3153      @Override
3154      public boolean equalsShallow(Base other_) {
3155        if (!super.equalsShallow(other_))
3156          return false;
3157        if (!(other_ instanceof CapabilityStatementRestSecurityComponent))
3158          return false;
3159        CapabilityStatementRestSecurityComponent o = (CapabilityStatementRestSecurityComponent) other_;
3160        return compareValues(cors, o.cors, true) && compareValues(description, o.description, true);
3161      }
3162
3163      public boolean isEmpty() {
3164        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(cors, service, description
3165          , certificate);
3166      }
3167
3168  public String fhirType() {
3169    return "CapabilityStatement.rest.security";
3170
3171  }
3172
3173  }
3174
3175    @Block()
3176    public static class CapabilityStatementRestSecurityCertificateComponent extends BackboneElement implements IBaseBackboneElement {
3177        /**
3178         * Mime type for a certificate.
3179         */
3180        @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
3181        @Description(shortDefinition="Mime type for certificates", formalDefinition="Mime type for a certificate." )
3182        protected CodeType type;
3183
3184        /**
3185         * Actual certificate.
3186         */
3187        @Child(name = "blob", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3188        @Description(shortDefinition="Actual certificate", formalDefinition="Actual certificate." )
3189        protected Base64BinaryType blob;
3190
3191        private static final long serialVersionUID = 2092655854L;
3192
3193    /**
3194     * Constructor
3195     */
3196      public CapabilityStatementRestSecurityCertificateComponent() {
3197        super();
3198      }
3199
3200        /**
3201         * @return {@link #type} (Mime type for a certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3202         */
3203        public CodeType getTypeElement() { 
3204          if (this.type == null)
3205            if (Configuration.errorOnAutoCreate())
3206              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityCertificateComponent.type");
3207            else if (Configuration.doAutoCreate())
3208              this.type = new CodeType(); // bb
3209          return this.type;
3210        }
3211
3212        public boolean hasTypeElement() { 
3213          return this.type != null && !this.type.isEmpty();
3214        }
3215
3216        public boolean hasType() { 
3217          return this.type != null && !this.type.isEmpty();
3218        }
3219
3220        /**
3221         * @param value {@link #type} (Mime type for a certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3222         */
3223        public CapabilityStatementRestSecurityCertificateComponent setTypeElement(CodeType value) { 
3224          this.type = value;
3225          return this;
3226        }
3227
3228        /**
3229         * @return Mime type for a certificate.
3230         */
3231        public String getType() { 
3232          return this.type == null ? null : this.type.getValue();
3233        }
3234
3235        /**
3236         * @param value Mime type for a certificate.
3237         */
3238        public CapabilityStatementRestSecurityCertificateComponent setType(String value) { 
3239          if (Utilities.noString(value))
3240            this.type = null;
3241          else {
3242            if (this.type == null)
3243              this.type = new CodeType();
3244            this.type.setValue(value);
3245          }
3246          return this;
3247        }
3248
3249        /**
3250         * @return {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value
3251         */
3252        public Base64BinaryType getBlobElement() { 
3253          if (this.blob == null)
3254            if (Configuration.errorOnAutoCreate())
3255              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityCertificateComponent.blob");
3256            else if (Configuration.doAutoCreate())
3257              this.blob = new Base64BinaryType(); // bb
3258          return this.blob;
3259        }
3260
3261        public boolean hasBlobElement() { 
3262          return this.blob != null && !this.blob.isEmpty();
3263        }
3264
3265        public boolean hasBlob() { 
3266          return this.blob != null && !this.blob.isEmpty();
3267        }
3268
3269        /**
3270         * @param value {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value
3271         */
3272        public CapabilityStatementRestSecurityCertificateComponent setBlobElement(Base64BinaryType value) { 
3273          this.blob = value;
3274          return this;
3275        }
3276
3277        /**
3278         * @return Actual certificate.
3279         */
3280        public byte[] getBlob() { 
3281          return this.blob == null ? null : this.blob.getValue();
3282        }
3283
3284        /**
3285         * @param value Actual certificate.
3286         */
3287        public CapabilityStatementRestSecurityCertificateComponent setBlob(byte[] value) { 
3288          if (value == null)
3289            this.blob = null;
3290          else {
3291            if (this.blob == null)
3292              this.blob = new Base64BinaryType();
3293            this.blob.setValue(value);
3294          }
3295          return this;
3296        }
3297
3298        protected void listChildren(List<Property> children) {
3299          super.listChildren(children);
3300          children.add(new Property("type", "code", "Mime type for a certificate.", 0, 1, type));
3301          children.add(new Property("blob", "base64Binary", "Actual certificate.", 0, 1, blob));
3302        }
3303
3304        @Override
3305        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3306          switch (_hash) {
3307          case 3575610: /*type*/  return new Property("type", "code", "Mime type for a certificate.", 0, 1, type);
3308          case 3026845: /*blob*/  return new Property("blob", "base64Binary", "Actual certificate.", 0, 1, blob);
3309          default: return super.getNamedProperty(_hash, _name, _checkValid);
3310          }
3311
3312        }
3313
3314      @Override
3315      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3316        switch (hash) {
3317        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType
3318        case 3026845: /*blob*/ return this.blob == null ? new Base[0] : new Base[] {this.blob}; // Base64BinaryType
3319        default: return super.getProperty(hash, name, checkValid);
3320        }
3321
3322      }
3323
3324      @Override
3325      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3326        switch (hash) {
3327        case 3575610: // type
3328          this.type = castToCode(value); // CodeType
3329          return value;
3330        case 3026845: // blob
3331          this.blob = castToBase64Binary(value); // Base64BinaryType
3332          return value;
3333        default: return super.setProperty(hash, name, value);
3334        }
3335
3336      }
3337
3338      @Override
3339      public Base setProperty(String name, Base value) throws FHIRException {
3340        if (name.equals("type")) {
3341          this.type = castToCode(value); // CodeType
3342        } else if (name.equals("blob")) {
3343          this.blob = castToBase64Binary(value); // Base64BinaryType
3344        } else
3345          return super.setProperty(name, value);
3346        return value;
3347      }
3348
3349      @Override
3350      public Base makeProperty(int hash, String name) throws FHIRException {
3351        switch (hash) {
3352        case 3575610:  return getTypeElement();
3353        case 3026845:  return getBlobElement();
3354        default: return super.makeProperty(hash, name);
3355        }
3356
3357      }
3358
3359      @Override
3360      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3361        switch (hash) {
3362        case 3575610: /*type*/ return new String[] {"code"};
3363        case 3026845: /*blob*/ return new String[] {"base64Binary"};
3364        default: return super.getTypesForProperty(hash, name);
3365        }
3366
3367      }
3368
3369      @Override
3370      public Base addChild(String name) throws FHIRException {
3371        if (name.equals("type")) {
3372          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.type");
3373        }
3374        else if (name.equals("blob")) {
3375          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.blob");
3376        }
3377        else
3378          return super.addChild(name);
3379      }
3380
3381      public CapabilityStatementRestSecurityCertificateComponent copy() {
3382        CapabilityStatementRestSecurityCertificateComponent dst = new CapabilityStatementRestSecurityCertificateComponent();
3383        copyValues(dst);
3384        dst.type = type == null ? null : type.copy();
3385        dst.blob = blob == null ? null : blob.copy();
3386        return dst;
3387      }
3388
3389      @Override
3390      public boolean equalsDeep(Base other_) {
3391        if (!super.equalsDeep(other_))
3392          return false;
3393        if (!(other_ instanceof CapabilityStatementRestSecurityCertificateComponent))
3394          return false;
3395        CapabilityStatementRestSecurityCertificateComponent o = (CapabilityStatementRestSecurityCertificateComponent) other_;
3396        return compareDeep(type, o.type, true) && compareDeep(blob, o.blob, true);
3397      }
3398
3399      @Override
3400      public boolean equalsShallow(Base other_) {
3401        if (!super.equalsShallow(other_))
3402          return false;
3403        if (!(other_ instanceof CapabilityStatementRestSecurityCertificateComponent))
3404          return false;
3405        CapabilityStatementRestSecurityCertificateComponent o = (CapabilityStatementRestSecurityCertificateComponent) other_;
3406        return compareValues(type, o.type, true) && compareValues(blob, o.blob, true);
3407      }
3408
3409      public boolean isEmpty() {
3410        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, blob);
3411      }
3412
3413  public String fhirType() {
3414    return "CapabilityStatement.rest.security.certificate";
3415
3416  }
3417
3418  }
3419
3420    @Block()
3421    public static class CapabilityStatementRestResourceComponent extends BackboneElement implements IBaseBackboneElement {
3422        /**
3423         * A type of resource exposed via the restful interface.
3424         */
3425        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3426        @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." )
3427        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
3428        protected CodeType type;
3429
3430        /**
3431         * 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).
3432         */
3433        @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1, modifier=false, summary=true)
3434        @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)." )
3435        protected Reference profile;
3436
3437        /**
3438         * The actual object that is the target of the reference (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3439         */
3440        protected StructureDefinition profileTarget;
3441
3442        /**
3443         * Additional information about the resource type used by the system.
3444         */
3445        @Child(name = "documentation", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
3446        @Description(shortDefinition="Additional information about the use of the resource type", formalDefinition="Additional information about the resource type used by the system." )
3447        protected MarkdownType documentation;
3448
3449        /**
3450         * Identifies a restful operation supported by the solution.
3451         */
3452        @Child(name = "interaction", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3453        @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." )
3454        protected List<ResourceInteractionComponent> interaction;
3455
3456        /**
3457         * 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.
3458         */
3459        @Child(name = "versioning", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
3460        @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." )
3461        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/versioning-policy")
3462        protected Enumeration<ResourceVersionPolicy> versioning;
3463
3464        /**
3465         * A flag for whether the server is able to return past versions as part of the vRead operation.
3466         */
3467        @Child(name = "readHistory", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=false)
3468        @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." )
3469        protected BooleanType readHistory;
3470
3471        /**
3472         * A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.
3473         */
3474        @Child(name = "updateCreate", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false)
3475        @Description(shortDefinition="If update can commit to a new identity", formalDefinition="A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server." )
3476        protected BooleanType updateCreate;
3477
3478        /**
3479         * A flag that indicates that the server supports conditional create.
3480         */
3481        @Child(name = "conditionalCreate", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false)
3482        @Description(shortDefinition="If allows/uses conditional create", formalDefinition="A flag that indicates that the server supports conditional create." )
3483        protected BooleanType conditionalCreate;
3484
3485        /**
3486         * A code that indicates how the server supports conditional read.
3487         */
3488        @Child(name = "conditionalRead", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false)
3489        @Description(shortDefinition="not-supported | modified-since | not-match | full-support", formalDefinition="A code that indicates how the server supports conditional read." )
3490        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/conditional-read-status")
3491        protected Enumeration<ConditionalReadStatus> conditionalRead;
3492
3493        /**
3494         * A flag that indicates that the server supports conditional update.
3495         */
3496        @Child(name = "conditionalUpdate", type = {BooleanType.class}, order=10, min=0, max=1, modifier=false, summary=false)
3497        @Description(shortDefinition="If allows/uses conditional update", formalDefinition="A flag that indicates that the server supports conditional update." )
3498        protected BooleanType conditionalUpdate;
3499
3500        /**
3501         * A code that indicates how the server supports conditional delete.
3502         */
3503        @Child(name = "conditionalDelete", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=false)
3504        @Description(shortDefinition="not-supported | single | multiple - how conditional delete is supported", formalDefinition="A code that indicates how the server supports conditional delete." )
3505        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/conditional-delete-status")
3506        protected Enumeration<ConditionalDeleteStatus> conditionalDelete;
3507
3508        /**
3509         * A set of flags that defines how references are supported.
3510         */
3511        @Child(name = "referencePolicy", type = {CodeType.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3512        @Description(shortDefinition="literal | logical | resolves | enforced | local", formalDefinition="A set of flags that defines how references are supported." )
3513        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reference-handling-policy")
3514        protected List<Enumeration<ReferenceHandlingPolicy>> referencePolicy;
3515
3516        /**
3517         * A list of _include values supported by the server.
3518         */
3519        @Child(name = "searchInclude", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3520        @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." )
3521        protected List<StringType> searchInclude;
3522
3523        /**
3524         * A list of _revinclude (reverse include) values supported by the server.
3525         */
3526        @Child(name = "searchRevInclude", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3527        @Description(shortDefinition="_revinclude values supported by the server", formalDefinition="A list of _revinclude (reverse include) values supported by the server." )
3528        protected List<StringType> searchRevInclude;
3529
3530        /**
3531         * 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.
3532         */
3533        @Child(name = "searchParam", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3534        @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." )
3535        protected List<CapabilityStatementRestResourceSearchParamComponent> searchParam;
3536
3537        private static final long serialVersionUID = 1271233297L;
3538
3539    /**
3540     * Constructor
3541     */
3542      public CapabilityStatementRestResourceComponent() {
3543        super();
3544      }
3545
3546    /**
3547     * Constructor
3548     */
3549      public CapabilityStatementRestResourceComponent(CodeType type) {
3550        super();
3551        this.type = type;
3552      }
3553
3554        /**
3555         * @return {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3556         */
3557        public CodeType getTypeElement() { 
3558          if (this.type == null)
3559            if (Configuration.errorOnAutoCreate())
3560              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.type");
3561            else if (Configuration.doAutoCreate())
3562              this.type = new CodeType(); // bb
3563          return this.type;
3564        }
3565
3566        public boolean hasTypeElement() { 
3567          return this.type != null && !this.type.isEmpty();
3568        }
3569
3570        public boolean hasType() { 
3571          return this.type != null && !this.type.isEmpty();
3572        }
3573
3574        /**
3575         * @param value {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3576         */
3577        public CapabilityStatementRestResourceComponent setTypeElement(CodeType value) { 
3578          this.type = value;
3579          return this;
3580        }
3581
3582        /**
3583         * @return A type of resource exposed via the restful interface.
3584         */
3585        public String getType() { 
3586          return this.type == null ? null : this.type.getValue();
3587        }
3588
3589        /**
3590         * @param value A type of resource exposed via the restful interface.
3591         */
3592        public CapabilityStatementRestResourceComponent setType(String value) { 
3593            if (this.type == null)
3594              this.type = new CodeType();
3595            this.type.setValue(value);
3596          return this;
3597        }
3598
3599        /**
3600         * @return {@link #profile} (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3601         */
3602        public Reference getProfile() { 
3603          if (this.profile == null)
3604            if (Configuration.errorOnAutoCreate())
3605              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.profile");
3606            else if (Configuration.doAutoCreate())
3607              this.profile = new Reference(); // cc
3608          return this.profile;
3609        }
3610
3611        public boolean hasProfile() { 
3612          return this.profile != null && !this.profile.isEmpty();
3613        }
3614
3615        /**
3616         * @param value {@link #profile} (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3617         */
3618        public CapabilityStatementRestResourceComponent setProfile(Reference value)  { 
3619          this.profile = value;
3620          return this;
3621        }
3622
3623        /**
3624         * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3625         */
3626        public StructureDefinition getProfileTarget() { 
3627          if (this.profileTarget == null)
3628            if (Configuration.errorOnAutoCreate())
3629              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.profile");
3630            else if (Configuration.doAutoCreate())
3631              this.profileTarget = new StructureDefinition(); // aa
3632          return this.profileTarget;
3633        }
3634
3635        /**
3636         * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3637         */
3638        public CapabilityStatementRestResourceComponent setProfileTarget(StructureDefinition value) { 
3639          this.profileTarget = value;
3640          return this;
3641        }
3642
3643        /**
3644         * @return {@link #documentation} (Additional information about the resource type used by the system.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
3645         */
3646        public MarkdownType getDocumentationElement() { 
3647          if (this.documentation == null)
3648            if (Configuration.errorOnAutoCreate())
3649              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.documentation");
3650            else if (Configuration.doAutoCreate())
3651              this.documentation = new MarkdownType(); // bb
3652          return this.documentation;
3653        }
3654
3655        public boolean hasDocumentationElement() { 
3656          return this.documentation != null && !this.documentation.isEmpty();
3657        }
3658
3659        public boolean hasDocumentation() { 
3660          return this.documentation != null && !this.documentation.isEmpty();
3661        }
3662
3663        /**
3664         * @param value {@link #documentation} (Additional information about the resource type used by the system.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
3665         */
3666        public CapabilityStatementRestResourceComponent setDocumentationElement(MarkdownType value) { 
3667          this.documentation = value;
3668          return this;
3669        }
3670
3671        /**
3672         * @return Additional information about the resource type used by the system.
3673         */
3674        public String getDocumentation() { 
3675          return this.documentation == null ? null : this.documentation.getValue();
3676        }
3677
3678        /**
3679         * @param value Additional information about the resource type used by the system.
3680         */
3681        public CapabilityStatementRestResourceComponent setDocumentation(String value) { 
3682          if (value == null)
3683            this.documentation = null;
3684          else {
3685            if (this.documentation == null)
3686              this.documentation = new MarkdownType();
3687            this.documentation.setValue(value);
3688          }
3689          return this;
3690        }
3691
3692        /**
3693         * @return {@link #interaction} (Identifies a restful operation supported by the solution.)
3694         */
3695        public List<ResourceInteractionComponent> getInteraction() { 
3696          if (this.interaction == null)
3697            this.interaction = new ArrayList<ResourceInteractionComponent>();
3698          return this.interaction;
3699        }
3700
3701        /**
3702         * @return Returns a reference to <code>this</code> for easy method chaining
3703         */
3704        public CapabilityStatementRestResourceComponent setInteraction(List<ResourceInteractionComponent> theInteraction) { 
3705          this.interaction = theInteraction;
3706          return this;
3707        }
3708
3709        public boolean hasInteraction() { 
3710          if (this.interaction == null)
3711            return false;
3712          for (ResourceInteractionComponent item : this.interaction)
3713            if (!item.isEmpty())
3714              return true;
3715          return false;
3716        }
3717
3718        public ResourceInteractionComponent addInteraction() { //3
3719          ResourceInteractionComponent t = new ResourceInteractionComponent();
3720          if (this.interaction == null)
3721            this.interaction = new ArrayList<ResourceInteractionComponent>();
3722          this.interaction.add(t);
3723          return t;
3724        }
3725
3726        public CapabilityStatementRestResourceComponent addInteraction(ResourceInteractionComponent t) { //3
3727          if (t == null)
3728            return this;
3729          if (this.interaction == null)
3730            this.interaction = new ArrayList<ResourceInteractionComponent>();
3731          this.interaction.add(t);
3732          return this;
3733        }
3734
3735        /**
3736         * @return The first repetition of repeating field {@link #interaction}, creating it if it does not already exist
3737         */
3738        public ResourceInteractionComponent getInteractionFirstRep() { 
3739          if (getInteraction().isEmpty()) {
3740            addInteraction();
3741          }
3742          return getInteraction().get(0);
3743        }
3744
3745        /**
3746         * @return {@link #versioning} (This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value
3747         */
3748        public Enumeration<ResourceVersionPolicy> getVersioningElement() { 
3749          if (this.versioning == null)
3750            if (Configuration.errorOnAutoCreate())
3751              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.versioning");
3752            else if (Configuration.doAutoCreate())
3753              this.versioning = new Enumeration<ResourceVersionPolicy>(new ResourceVersionPolicyEnumFactory()); // bb
3754          return this.versioning;
3755        }
3756
3757        public boolean hasVersioningElement() { 
3758          return this.versioning != null && !this.versioning.isEmpty();
3759        }
3760
3761        public boolean hasVersioning() { 
3762          return this.versioning != null && !this.versioning.isEmpty();
3763        }
3764
3765        /**
3766         * @param value {@link #versioning} (This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value
3767         */
3768        public CapabilityStatementRestResourceComponent setVersioningElement(Enumeration<ResourceVersionPolicy> value) { 
3769          this.versioning = value;
3770          return this;
3771        }
3772
3773        /**
3774         * @return This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.
3775         */
3776        public ResourceVersionPolicy getVersioning() { 
3777          return this.versioning == null ? null : this.versioning.getValue();
3778        }
3779
3780        /**
3781         * @param value This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.
3782         */
3783        public CapabilityStatementRestResourceComponent setVersioning(ResourceVersionPolicy value) { 
3784          if (value == null)
3785            this.versioning = null;
3786          else {
3787            if (this.versioning == null)
3788              this.versioning = new Enumeration<ResourceVersionPolicy>(new ResourceVersionPolicyEnumFactory());
3789            this.versioning.setValue(value);
3790          }
3791          return this;
3792        }
3793
3794        /**
3795         * @return {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value
3796         */
3797        public BooleanType getReadHistoryElement() { 
3798          if (this.readHistory == null)
3799            if (Configuration.errorOnAutoCreate())
3800              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.readHistory");
3801            else if (Configuration.doAutoCreate())
3802              this.readHistory = new BooleanType(); // bb
3803          return this.readHistory;
3804        }
3805
3806        public boolean hasReadHistoryElement() { 
3807          return this.readHistory != null && !this.readHistory.isEmpty();
3808        }
3809
3810        public boolean hasReadHistory() { 
3811          return this.readHistory != null && !this.readHistory.isEmpty();
3812        }
3813
3814        /**
3815         * @param value {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value
3816         */
3817        public CapabilityStatementRestResourceComponent setReadHistoryElement(BooleanType value) { 
3818          this.readHistory = value;
3819          return this;
3820        }
3821
3822        /**
3823         * @return A flag for whether the server is able to return past versions as part of the vRead operation.
3824         */
3825        public boolean getReadHistory() { 
3826          return this.readHistory == null || this.readHistory.isEmpty() ? false : this.readHistory.getValue();
3827        }
3828
3829        /**
3830         * @param value A flag for whether the server is able to return past versions as part of the vRead operation.
3831         */
3832        public CapabilityStatementRestResourceComponent setReadHistory(boolean value) { 
3833            if (this.readHistory == null)
3834              this.readHistory = new BooleanType();
3835            this.readHistory.setValue(value);
3836          return this;
3837        }
3838
3839        /**
3840         * @return {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value
3841         */
3842        public BooleanType getUpdateCreateElement() { 
3843          if (this.updateCreate == null)
3844            if (Configuration.errorOnAutoCreate())
3845              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.updateCreate");
3846            else if (Configuration.doAutoCreate())
3847              this.updateCreate = new BooleanType(); // bb
3848          return this.updateCreate;
3849        }
3850
3851        public boolean hasUpdateCreateElement() { 
3852          return this.updateCreate != null && !this.updateCreate.isEmpty();
3853        }
3854
3855        public boolean hasUpdateCreate() { 
3856          return this.updateCreate != null && !this.updateCreate.isEmpty();
3857        }
3858
3859        /**
3860         * @param value {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value
3861         */
3862        public CapabilityStatementRestResourceComponent setUpdateCreateElement(BooleanType value) { 
3863          this.updateCreate = value;
3864          return this;
3865        }
3866
3867        /**
3868         * @return A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.
3869         */
3870        public boolean getUpdateCreate() { 
3871          return this.updateCreate == null || this.updateCreate.isEmpty() ? false : this.updateCreate.getValue();
3872        }
3873
3874        /**
3875         * @param value A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.
3876         */
3877        public CapabilityStatementRestResourceComponent setUpdateCreate(boolean value) { 
3878            if (this.updateCreate == null)
3879              this.updateCreate = new BooleanType();
3880            this.updateCreate.setValue(value);
3881          return this;
3882        }
3883
3884        /**
3885         * @return {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value
3886         */
3887        public BooleanType getConditionalCreateElement() { 
3888          if (this.conditionalCreate == null)
3889            if (Configuration.errorOnAutoCreate())
3890              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalCreate");
3891            else if (Configuration.doAutoCreate())
3892              this.conditionalCreate = new BooleanType(); // bb
3893          return this.conditionalCreate;
3894        }
3895
3896        public boolean hasConditionalCreateElement() { 
3897          return this.conditionalCreate != null && !this.conditionalCreate.isEmpty();
3898        }
3899
3900        public boolean hasConditionalCreate() { 
3901          return this.conditionalCreate != null && !this.conditionalCreate.isEmpty();
3902        }
3903
3904        /**
3905         * @param value {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value
3906         */
3907        public CapabilityStatementRestResourceComponent setConditionalCreateElement(BooleanType value) { 
3908          this.conditionalCreate = value;
3909          return this;
3910        }
3911
3912        /**
3913         * @return A flag that indicates that the server supports conditional create.
3914         */
3915        public boolean getConditionalCreate() { 
3916          return this.conditionalCreate == null || this.conditionalCreate.isEmpty() ? false : this.conditionalCreate.getValue();
3917        }
3918
3919        /**
3920         * @param value A flag that indicates that the server supports conditional create.
3921         */
3922        public CapabilityStatementRestResourceComponent setConditionalCreate(boolean value) { 
3923            if (this.conditionalCreate == null)
3924              this.conditionalCreate = new BooleanType();
3925            this.conditionalCreate.setValue(value);
3926          return this;
3927        }
3928
3929        /**
3930         * @return {@link #conditionalRead} (A code that indicates how the server supports conditional read.). This is the underlying object with id, value and extensions. The accessor "getConditionalRead" gives direct access to the value
3931         */
3932        public Enumeration<ConditionalReadStatus> getConditionalReadElement() { 
3933          if (this.conditionalRead == null)
3934            if (Configuration.errorOnAutoCreate())
3935              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalRead");
3936            else if (Configuration.doAutoCreate())
3937              this.conditionalRead = new Enumeration<ConditionalReadStatus>(new ConditionalReadStatusEnumFactory()); // bb
3938          return this.conditionalRead;
3939        }
3940
3941        public boolean hasConditionalReadElement() { 
3942          return this.conditionalRead != null && !this.conditionalRead.isEmpty();
3943        }
3944
3945        public boolean hasConditionalRead() { 
3946          return this.conditionalRead != null && !this.conditionalRead.isEmpty();
3947        }
3948
3949        /**
3950         * @param value {@link #conditionalRead} (A code that indicates how the server supports conditional read.). This is the underlying object with id, value and extensions. The accessor "getConditionalRead" gives direct access to the value
3951         */
3952        public CapabilityStatementRestResourceComponent setConditionalReadElement(Enumeration<ConditionalReadStatus> value) { 
3953          this.conditionalRead = value;
3954          return this;
3955        }
3956
3957        /**
3958         * @return A code that indicates how the server supports conditional read.
3959         */
3960        public ConditionalReadStatus getConditionalRead() { 
3961          return this.conditionalRead == null ? null : this.conditionalRead.getValue();
3962        }
3963
3964        /**
3965         * @param value A code that indicates how the server supports conditional read.
3966         */
3967        public CapabilityStatementRestResourceComponent setConditionalRead(ConditionalReadStatus value) { 
3968          if (value == null)
3969            this.conditionalRead = null;
3970          else {
3971            if (this.conditionalRead == null)
3972              this.conditionalRead = new Enumeration<ConditionalReadStatus>(new ConditionalReadStatusEnumFactory());
3973            this.conditionalRead.setValue(value);
3974          }
3975          return this;
3976        }
3977
3978        /**
3979         * @return {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value
3980         */
3981        public BooleanType getConditionalUpdateElement() { 
3982          if (this.conditionalUpdate == null)
3983            if (Configuration.errorOnAutoCreate())
3984              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalUpdate");
3985            else if (Configuration.doAutoCreate())
3986              this.conditionalUpdate = new BooleanType(); // bb
3987          return this.conditionalUpdate;
3988        }
3989
3990        public boolean hasConditionalUpdateElement() { 
3991          return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty();
3992        }
3993
3994        public boolean hasConditionalUpdate() { 
3995          return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty();
3996        }
3997
3998        /**
3999         * @param value {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value
4000         */
4001        public CapabilityStatementRestResourceComponent setConditionalUpdateElement(BooleanType value) { 
4002          this.conditionalUpdate = value;
4003          return this;
4004        }
4005
4006        /**
4007         * @return A flag that indicates that the server supports conditional update.
4008         */
4009        public boolean getConditionalUpdate() { 
4010          return this.conditionalUpdate == null || this.conditionalUpdate.isEmpty() ? false : this.conditionalUpdate.getValue();
4011        }
4012
4013        /**
4014         * @param value A flag that indicates that the server supports conditional update.
4015         */
4016        public CapabilityStatementRestResourceComponent setConditionalUpdate(boolean value) { 
4017            if (this.conditionalUpdate == null)
4018              this.conditionalUpdate = new BooleanType();
4019            this.conditionalUpdate.setValue(value);
4020          return this;
4021        }
4022
4023        /**
4024         * @return {@link #conditionalDelete} (A code that indicates how the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value
4025         */
4026        public Enumeration<ConditionalDeleteStatus> getConditionalDeleteElement() { 
4027          if (this.conditionalDelete == null)
4028            if (Configuration.errorOnAutoCreate())
4029              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalDelete");
4030            else if (Configuration.doAutoCreate())
4031              this.conditionalDelete = new Enumeration<ConditionalDeleteStatus>(new ConditionalDeleteStatusEnumFactory()); // bb
4032          return this.conditionalDelete;
4033        }
4034
4035        public boolean hasConditionalDeleteElement() { 
4036          return this.conditionalDelete != null && !this.conditionalDelete.isEmpty();
4037        }
4038
4039        public boolean hasConditionalDelete() { 
4040          return this.conditionalDelete != null && !this.conditionalDelete.isEmpty();
4041        }
4042
4043        /**
4044         * @param value {@link #conditionalDelete} (A code that indicates how the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value
4045         */
4046        public CapabilityStatementRestResourceComponent setConditionalDeleteElement(Enumeration<ConditionalDeleteStatus> value) { 
4047          this.conditionalDelete = value;
4048          return this;
4049        }
4050
4051        /**
4052         * @return A code that indicates how the server supports conditional delete.
4053         */
4054        public ConditionalDeleteStatus getConditionalDelete() { 
4055          return this.conditionalDelete == null ? null : this.conditionalDelete.getValue();
4056        }
4057
4058        /**
4059         * @param value A code that indicates how the server supports conditional delete.
4060         */
4061        public CapabilityStatementRestResourceComponent setConditionalDelete(ConditionalDeleteStatus value) { 
4062          if (value == null)
4063            this.conditionalDelete = null;
4064          else {
4065            if (this.conditionalDelete == null)
4066              this.conditionalDelete = new Enumeration<ConditionalDeleteStatus>(new ConditionalDeleteStatusEnumFactory());
4067            this.conditionalDelete.setValue(value);
4068          }
4069          return this;
4070        }
4071
4072        /**
4073         * @return {@link #referencePolicy} (A set of flags that defines how references are supported.)
4074         */
4075        public List<Enumeration<ReferenceHandlingPolicy>> getReferencePolicy() { 
4076          if (this.referencePolicy == null)
4077            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4078          return this.referencePolicy;
4079        }
4080
4081        /**
4082         * @return Returns a reference to <code>this</code> for easy method chaining
4083         */
4084        public CapabilityStatementRestResourceComponent setReferencePolicy(List<Enumeration<ReferenceHandlingPolicy>> theReferencePolicy) { 
4085          this.referencePolicy = theReferencePolicy;
4086          return this;
4087        }
4088
4089        public boolean hasReferencePolicy() { 
4090          if (this.referencePolicy == null)
4091            return false;
4092          for (Enumeration<ReferenceHandlingPolicy> item : this.referencePolicy)
4093            if (!item.isEmpty())
4094              return true;
4095          return false;
4096        }
4097
4098        /**
4099         * @return {@link #referencePolicy} (A set of flags that defines how references are supported.)
4100         */
4101        public Enumeration<ReferenceHandlingPolicy> addReferencePolicyElement() {//2 
4102          Enumeration<ReferenceHandlingPolicy> t = new Enumeration<ReferenceHandlingPolicy>(new ReferenceHandlingPolicyEnumFactory());
4103          if (this.referencePolicy == null)
4104            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4105          this.referencePolicy.add(t);
4106          return t;
4107        }
4108
4109        /**
4110         * @param value {@link #referencePolicy} (A set of flags that defines how references are supported.)
4111         */
4112        public CapabilityStatementRestResourceComponent addReferencePolicy(ReferenceHandlingPolicy value) { //1
4113          Enumeration<ReferenceHandlingPolicy> t = new Enumeration<ReferenceHandlingPolicy>(new ReferenceHandlingPolicyEnumFactory());
4114          t.setValue(value);
4115          if (this.referencePolicy == null)
4116            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4117          this.referencePolicy.add(t);
4118          return this;
4119        }
4120
4121        /**
4122         * @param value {@link #referencePolicy} (A set of flags that defines how references are supported.)
4123         */
4124        public boolean hasReferencePolicy(ReferenceHandlingPolicy value) { 
4125          if (this.referencePolicy == null)
4126            return false;
4127          for (Enumeration<ReferenceHandlingPolicy> v : this.referencePolicy)
4128            if (v.getValue().equals(value)) // code
4129              return true;
4130          return false;
4131        }
4132
4133        /**
4134         * @return {@link #searchInclude} (A list of _include values supported by the server.)
4135         */
4136        public List<StringType> getSearchInclude() { 
4137          if (this.searchInclude == null)
4138            this.searchInclude = new ArrayList<StringType>();
4139          return this.searchInclude;
4140        }
4141
4142        /**
4143         * @return Returns a reference to <code>this</code> for easy method chaining
4144         */
4145        public CapabilityStatementRestResourceComponent setSearchInclude(List<StringType> theSearchInclude) { 
4146          this.searchInclude = theSearchInclude;
4147          return this;
4148        }
4149
4150        public boolean hasSearchInclude() { 
4151          if (this.searchInclude == null)
4152            return false;
4153          for (StringType item : this.searchInclude)
4154            if (!item.isEmpty())
4155              return true;
4156          return false;
4157        }
4158
4159        /**
4160         * @return {@link #searchInclude} (A list of _include values supported by the server.)
4161         */
4162        public StringType addSearchIncludeElement() {//2 
4163          StringType t = new StringType();
4164          if (this.searchInclude == null)
4165            this.searchInclude = new ArrayList<StringType>();
4166          this.searchInclude.add(t);
4167          return t;
4168        }
4169
4170        /**
4171         * @param value {@link #searchInclude} (A list of _include values supported by the server.)
4172         */
4173        public CapabilityStatementRestResourceComponent addSearchInclude(String value) { //1
4174          StringType t = new StringType();
4175          t.setValue(value);
4176          if (this.searchInclude == null)
4177            this.searchInclude = new ArrayList<StringType>();
4178          this.searchInclude.add(t);
4179          return this;
4180        }
4181
4182        /**
4183         * @param value {@link #searchInclude} (A list of _include values supported by the server.)
4184         */
4185        public boolean hasSearchInclude(String value) { 
4186          if (this.searchInclude == null)
4187            return false;
4188          for (StringType v : this.searchInclude)
4189            if (v.getValue().equals(value)) // string
4190              return true;
4191          return false;
4192        }
4193
4194        /**
4195         * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
4196         */
4197        public List<StringType> getSearchRevInclude() { 
4198          if (this.searchRevInclude == null)
4199            this.searchRevInclude = new ArrayList<StringType>();
4200          return this.searchRevInclude;
4201        }
4202
4203        /**
4204         * @return Returns a reference to <code>this</code> for easy method chaining
4205         */
4206        public CapabilityStatementRestResourceComponent setSearchRevInclude(List<StringType> theSearchRevInclude) { 
4207          this.searchRevInclude = theSearchRevInclude;
4208          return this;
4209        }
4210
4211        public boolean hasSearchRevInclude() { 
4212          if (this.searchRevInclude == null)
4213            return false;
4214          for (StringType item : this.searchRevInclude)
4215            if (!item.isEmpty())
4216              return true;
4217          return false;
4218        }
4219
4220        /**
4221         * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
4222         */
4223        public StringType addSearchRevIncludeElement() {//2 
4224          StringType t = new StringType();
4225          if (this.searchRevInclude == null)
4226            this.searchRevInclude = new ArrayList<StringType>();
4227          this.searchRevInclude.add(t);
4228          return t;
4229        }
4230
4231        /**
4232         * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
4233         */
4234        public CapabilityStatementRestResourceComponent addSearchRevInclude(String value) { //1
4235          StringType t = new StringType();
4236          t.setValue(value);
4237          if (this.searchRevInclude == null)
4238            this.searchRevInclude = new ArrayList<StringType>();
4239          this.searchRevInclude.add(t);
4240          return this;
4241        }
4242
4243        /**
4244         * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
4245         */
4246        public boolean hasSearchRevInclude(String value) { 
4247          if (this.searchRevInclude == null)
4248            return false;
4249          for (StringType v : this.searchRevInclude)
4250            if (v.getValue().equals(value)) // string
4251              return true;
4252          return false;
4253        }
4254
4255        /**
4256         * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.)
4257         */
4258        public List<CapabilityStatementRestResourceSearchParamComponent> getSearchParam() { 
4259          if (this.searchParam == null)
4260            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4261          return this.searchParam;
4262        }
4263
4264        /**
4265         * @return Returns a reference to <code>this</code> for easy method chaining
4266         */
4267        public CapabilityStatementRestResourceComponent setSearchParam(List<CapabilityStatementRestResourceSearchParamComponent> theSearchParam) { 
4268          this.searchParam = theSearchParam;
4269          return this;
4270        }
4271
4272        public boolean hasSearchParam() { 
4273          if (this.searchParam == null)
4274            return false;
4275          for (CapabilityStatementRestResourceSearchParamComponent item : this.searchParam)
4276            if (!item.isEmpty())
4277              return true;
4278          return false;
4279        }
4280
4281        public CapabilityStatementRestResourceSearchParamComponent addSearchParam() { //3
4282          CapabilityStatementRestResourceSearchParamComponent t = new CapabilityStatementRestResourceSearchParamComponent();
4283          if (this.searchParam == null)
4284            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4285          this.searchParam.add(t);
4286          return t;
4287        }
4288
4289        public CapabilityStatementRestResourceComponent addSearchParam(CapabilityStatementRestResourceSearchParamComponent t) { //3
4290          if (t == null)
4291            return this;
4292          if (this.searchParam == null)
4293            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4294          this.searchParam.add(t);
4295          return this;
4296        }
4297
4298        /**
4299         * @return The first repetition of repeating field {@link #searchParam}, creating it if it does not already exist
4300         */
4301        public CapabilityStatementRestResourceSearchParamComponent getSearchParamFirstRep() { 
4302          if (getSearchParam().isEmpty()) {
4303            addSearchParam();
4304          }
4305          return getSearchParam().get(0);
4306        }
4307
4308        protected void listChildren(List<Property> children) {
4309          super.listChildren(children);
4310          children.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, 1, type));
4311          children.add(new Property("profile", "Reference(StructureDefinition)", "A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, 1, profile));
4312          children.add(new Property("documentation", "markdown", "Additional information about the resource type used by the system.", 0, 1, documentation));
4313          children.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction));
4314          children.add(new Property("versioning", "code", "This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.", 0, 1, versioning));
4315          children.add(new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, 1, readHistory));
4316          children.add(new Property("updateCreate", "boolean", "A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.", 0, 1, updateCreate));
4317          children.add(new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, 1, conditionalCreate));
4318          children.add(new Property("conditionalRead", "code", "A code that indicates how the server supports conditional read.", 0, 1, conditionalRead));
4319          children.add(new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, 1, conditionalUpdate));
4320          children.add(new Property("conditionalDelete", "code", "A code that indicates how the server supports conditional delete.", 0, 1, conditionalDelete));
4321          children.add(new Property("referencePolicy", "code", "A set of flags that defines how references are supported.", 0, java.lang.Integer.MAX_VALUE, referencePolicy));
4322          children.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude));
4323          children.add(new Property("searchRevInclude", "string", "A list of _revinclude (reverse include) values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchRevInclude));
4324          children.add(new Property("searchParam", "", "Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam));
4325        }
4326
4327        @Override
4328        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4329          switch (_hash) {
4330          case 3575610: /*type*/  return new Property("type", "code", "A type of resource exposed via the restful interface.", 0, 1, type);
4331          case -309425751: /*profile*/  return new Property("profile", "Reference(StructureDefinition)", "A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, 1, profile);
4332          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "Additional information about the resource type used by the system.", 0, 1, documentation);
4333          case 1844104722: /*interaction*/  return new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction);
4334          case -670487542: /*versioning*/  return new Property("versioning", "code", "This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.", 0, 1, versioning);
4335          case 187518494: /*readHistory*/  return new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, 1, readHistory);
4336          case -1400550619: /*updateCreate*/  return new Property("updateCreate", "boolean", "A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.", 0, 1, updateCreate);
4337          case 6401826: /*conditionalCreate*/  return new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, 1, conditionalCreate);
4338          case 822786364: /*conditionalRead*/  return new Property("conditionalRead", "code", "A code that indicates how the server supports conditional read.", 0, 1, conditionalRead);
4339          case 519849711: /*conditionalUpdate*/  return new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, 1, conditionalUpdate);
4340          case 23237585: /*conditionalDelete*/  return new Property("conditionalDelete", "code", "A code that indicates how the server supports conditional delete.", 0, 1, conditionalDelete);
4341          case 796257373: /*referencePolicy*/  return new Property("referencePolicy", "code", "A set of flags that defines how references are supported.", 0, java.lang.Integer.MAX_VALUE, referencePolicy);
4342          case -1035904544: /*searchInclude*/  return new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude);
4343          case -2123884979: /*searchRevInclude*/  return new Property("searchRevInclude", "string", "A list of _revinclude (reverse include) values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchRevInclude);
4344          case -553645115: /*searchParam*/  return new Property("searchParam", "", "Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam);
4345          default: return super.getNamedProperty(_hash, _name, _checkValid);
4346          }
4347
4348        }
4349
4350      @Override
4351      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4352        switch (hash) {
4353        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType
4354        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference
4355        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
4356        case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // ResourceInteractionComponent
4357        case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration<ResourceVersionPolicy>
4358        case 187518494: /*readHistory*/ return this.readHistory == null ? new Base[0] : new Base[] {this.readHistory}; // BooleanType
4359        case -1400550619: /*updateCreate*/ return this.updateCreate == null ? new Base[0] : new Base[] {this.updateCreate}; // BooleanType
4360        case 6401826: /*conditionalCreate*/ return this.conditionalCreate == null ? new Base[0] : new Base[] {this.conditionalCreate}; // BooleanType
4361        case 822786364: /*conditionalRead*/ return this.conditionalRead == null ? new Base[0] : new Base[] {this.conditionalRead}; // Enumeration<ConditionalReadStatus>
4362        case 519849711: /*conditionalUpdate*/ return this.conditionalUpdate == null ? new Base[0] : new Base[] {this.conditionalUpdate}; // BooleanType
4363        case 23237585: /*conditionalDelete*/ return this.conditionalDelete == null ? new Base[0] : new Base[] {this.conditionalDelete}; // Enumeration<ConditionalDeleteStatus>
4364        case 796257373: /*referencePolicy*/ return this.referencePolicy == null ? new Base[0] : this.referencePolicy.toArray(new Base[this.referencePolicy.size()]); // Enumeration<ReferenceHandlingPolicy>
4365        case -1035904544: /*searchInclude*/ return this.searchInclude == null ? new Base[0] : this.searchInclude.toArray(new Base[this.searchInclude.size()]); // StringType
4366        case -2123884979: /*searchRevInclude*/ return this.searchRevInclude == null ? new Base[0] : this.searchRevInclude.toArray(new Base[this.searchRevInclude.size()]); // StringType
4367        case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // CapabilityStatementRestResourceSearchParamComponent
4368        default: return super.getProperty(hash, name, checkValid);
4369        }
4370
4371      }
4372
4373      @Override
4374      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4375        switch (hash) {
4376        case 3575610: // type
4377          this.type = castToCode(value); // CodeType
4378          return value;
4379        case -309425751: // profile
4380          this.profile = castToReference(value); // Reference
4381          return value;
4382        case 1587405498: // documentation
4383          this.documentation = castToMarkdown(value); // MarkdownType
4384          return value;
4385        case 1844104722: // interaction
4386          this.getInteraction().add((ResourceInteractionComponent) value); // ResourceInteractionComponent
4387          return value;
4388        case -670487542: // versioning
4389          value = new ResourceVersionPolicyEnumFactory().fromType(castToCode(value));
4390          this.versioning = (Enumeration) value; // Enumeration<ResourceVersionPolicy>
4391          return value;
4392        case 187518494: // readHistory
4393          this.readHistory = castToBoolean(value); // BooleanType
4394          return value;
4395        case -1400550619: // updateCreate
4396          this.updateCreate = castToBoolean(value); // BooleanType
4397          return value;
4398        case 6401826: // conditionalCreate
4399          this.conditionalCreate = castToBoolean(value); // BooleanType
4400          return value;
4401        case 822786364: // conditionalRead
4402          value = new ConditionalReadStatusEnumFactory().fromType(castToCode(value));
4403          this.conditionalRead = (Enumeration) value; // Enumeration<ConditionalReadStatus>
4404          return value;
4405        case 519849711: // conditionalUpdate
4406          this.conditionalUpdate = castToBoolean(value); // BooleanType
4407          return value;
4408        case 23237585: // conditionalDelete
4409          value = new ConditionalDeleteStatusEnumFactory().fromType(castToCode(value));
4410          this.conditionalDelete = (Enumeration) value; // Enumeration<ConditionalDeleteStatus>
4411          return value;
4412        case 796257373: // referencePolicy
4413          value = new ReferenceHandlingPolicyEnumFactory().fromType(castToCode(value));
4414          this.getReferencePolicy().add((Enumeration) value); // Enumeration<ReferenceHandlingPolicy>
4415          return value;
4416        case -1035904544: // searchInclude
4417          this.getSearchInclude().add(castToString(value)); // StringType
4418          return value;
4419        case -2123884979: // searchRevInclude
4420          this.getSearchRevInclude().add(castToString(value)); // StringType
4421          return value;
4422        case -553645115: // searchParam
4423          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value); // CapabilityStatementRestResourceSearchParamComponent
4424          return value;
4425        default: return super.setProperty(hash, name, value);
4426        }
4427
4428      }
4429
4430      @Override
4431      public Base setProperty(String name, Base value) throws FHIRException {
4432        if (name.equals("type")) {
4433          this.type = castToCode(value); // CodeType
4434        } else if (name.equals("profile")) {
4435          this.profile = castToReference(value); // Reference
4436        } else if (name.equals("documentation")) {
4437          this.documentation = castToMarkdown(value); // MarkdownType
4438        } else if (name.equals("interaction")) {
4439          this.getInteraction().add((ResourceInteractionComponent) value);
4440        } else if (name.equals("versioning")) {
4441          value = new ResourceVersionPolicyEnumFactory().fromType(castToCode(value));
4442          this.versioning = (Enumeration) value; // Enumeration<ResourceVersionPolicy>
4443        } else if (name.equals("readHistory")) {
4444          this.readHistory = castToBoolean(value); // BooleanType
4445        } else if (name.equals("updateCreate")) {
4446          this.updateCreate = castToBoolean(value); // BooleanType
4447        } else if (name.equals("conditionalCreate")) {
4448          this.conditionalCreate = castToBoolean(value); // BooleanType
4449        } else if (name.equals("conditionalRead")) {
4450          value = new ConditionalReadStatusEnumFactory().fromType(castToCode(value));
4451          this.conditionalRead = (Enumeration) value; // Enumeration<ConditionalReadStatus>
4452        } else if (name.equals("conditionalUpdate")) {
4453          this.conditionalUpdate = castToBoolean(value); // BooleanType
4454        } else if (name.equals("conditionalDelete")) {
4455          value = new ConditionalDeleteStatusEnumFactory().fromType(castToCode(value));
4456          this.conditionalDelete = (Enumeration) value; // Enumeration<ConditionalDeleteStatus>
4457        } else if (name.equals("referencePolicy")) {
4458          value = new ReferenceHandlingPolicyEnumFactory().fromType(castToCode(value));
4459          this.getReferencePolicy().add((Enumeration) value);
4460        } else if (name.equals("searchInclude")) {
4461          this.getSearchInclude().add(castToString(value));
4462        } else if (name.equals("searchRevInclude")) {
4463          this.getSearchRevInclude().add(castToString(value));
4464        } else if (name.equals("searchParam")) {
4465          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value);
4466        } else
4467          return super.setProperty(name, value);
4468        return value;
4469      }
4470
4471      @Override
4472      public Base makeProperty(int hash, String name) throws FHIRException {
4473        switch (hash) {
4474        case 3575610:  return getTypeElement();
4475        case -309425751:  return getProfile(); 
4476        case 1587405498:  return getDocumentationElement();
4477        case 1844104722:  return addInteraction(); 
4478        case -670487542:  return getVersioningElement();
4479        case 187518494:  return getReadHistoryElement();
4480        case -1400550619:  return getUpdateCreateElement();
4481        case 6401826:  return getConditionalCreateElement();
4482        case 822786364:  return getConditionalReadElement();
4483        case 519849711:  return getConditionalUpdateElement();
4484        case 23237585:  return getConditionalDeleteElement();
4485        case 796257373:  return addReferencePolicyElement();
4486        case -1035904544:  return addSearchIncludeElement();
4487        case -2123884979:  return addSearchRevIncludeElement();
4488        case -553645115:  return addSearchParam(); 
4489        default: return super.makeProperty(hash, name);
4490        }
4491
4492      }
4493
4494      @Override
4495      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4496        switch (hash) {
4497        case 3575610: /*type*/ return new String[] {"code"};
4498        case -309425751: /*profile*/ return new String[] {"Reference"};
4499        case 1587405498: /*documentation*/ return new String[] {"markdown"};
4500        case 1844104722: /*interaction*/ return new String[] {};
4501        case -670487542: /*versioning*/ return new String[] {"code"};
4502        case 187518494: /*readHistory*/ return new String[] {"boolean"};
4503        case -1400550619: /*updateCreate*/ return new String[] {"boolean"};
4504        case 6401826: /*conditionalCreate*/ return new String[] {"boolean"};
4505        case 822786364: /*conditionalRead*/ return new String[] {"code"};
4506        case 519849711: /*conditionalUpdate*/ return new String[] {"boolean"};
4507        case 23237585: /*conditionalDelete*/ return new String[] {"code"};
4508        case 796257373: /*referencePolicy*/ return new String[] {"code"};
4509        case -1035904544: /*searchInclude*/ return new String[] {"string"};
4510        case -2123884979: /*searchRevInclude*/ return new String[] {"string"};
4511        case -553645115: /*searchParam*/ return new String[] {};
4512        default: return super.getTypesForProperty(hash, name);
4513        }
4514
4515      }
4516
4517      @Override
4518      public Base addChild(String name) throws FHIRException {
4519        if (name.equals("type")) {
4520          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.type");
4521        }
4522        else if (name.equals("profile")) {
4523          this.profile = new Reference();
4524          return this.profile;
4525        }
4526        else if (name.equals("documentation")) {
4527          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
4528        }
4529        else if (name.equals("interaction")) {
4530          return addInteraction();
4531        }
4532        else if (name.equals("versioning")) {
4533          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.versioning");
4534        }
4535        else if (name.equals("readHistory")) {
4536          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.readHistory");
4537        }
4538        else if (name.equals("updateCreate")) {
4539          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.updateCreate");
4540        }
4541        else if (name.equals("conditionalCreate")) {
4542          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalCreate");
4543        }
4544        else if (name.equals("conditionalRead")) {
4545          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalRead");
4546        }
4547        else if (name.equals("conditionalUpdate")) {
4548          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalUpdate");
4549        }
4550        else if (name.equals("conditionalDelete")) {
4551          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalDelete");
4552        }
4553        else if (name.equals("referencePolicy")) {
4554          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.referencePolicy");
4555        }
4556        else if (name.equals("searchInclude")) {
4557          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.searchInclude");
4558        }
4559        else if (name.equals("searchRevInclude")) {
4560          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.searchRevInclude");
4561        }
4562        else if (name.equals("searchParam")) {
4563          return addSearchParam();
4564        }
4565        else
4566          return super.addChild(name);
4567      }
4568
4569      public CapabilityStatementRestResourceComponent copy() {
4570        CapabilityStatementRestResourceComponent dst = new CapabilityStatementRestResourceComponent();
4571        copyValues(dst);
4572        dst.type = type == null ? null : type.copy();
4573        dst.profile = profile == null ? null : profile.copy();
4574        dst.documentation = documentation == null ? null : documentation.copy();
4575        if (interaction != null) {
4576          dst.interaction = new ArrayList<ResourceInteractionComponent>();
4577          for (ResourceInteractionComponent i : interaction)
4578            dst.interaction.add(i.copy());
4579        };
4580        dst.versioning = versioning == null ? null : versioning.copy();
4581        dst.readHistory = readHistory == null ? null : readHistory.copy();
4582        dst.updateCreate = updateCreate == null ? null : updateCreate.copy();
4583        dst.conditionalCreate = conditionalCreate == null ? null : conditionalCreate.copy();
4584        dst.conditionalRead = conditionalRead == null ? null : conditionalRead.copy();
4585        dst.conditionalUpdate = conditionalUpdate == null ? null : conditionalUpdate.copy();
4586        dst.conditionalDelete = conditionalDelete == null ? null : conditionalDelete.copy();
4587        if (referencePolicy != null) {
4588          dst.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4589          for (Enumeration<ReferenceHandlingPolicy> i : referencePolicy)
4590            dst.referencePolicy.add(i.copy());
4591        };
4592        if (searchInclude != null) {
4593          dst.searchInclude = new ArrayList<StringType>();
4594          for (StringType i : searchInclude)
4595            dst.searchInclude.add(i.copy());
4596        };
4597        if (searchRevInclude != null) {
4598          dst.searchRevInclude = new ArrayList<StringType>();
4599          for (StringType i : searchRevInclude)
4600            dst.searchRevInclude.add(i.copy());
4601        };
4602        if (searchParam != null) {
4603          dst.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4604          for (CapabilityStatementRestResourceSearchParamComponent i : searchParam)
4605            dst.searchParam.add(i.copy());
4606        };
4607        return dst;
4608      }
4609
4610      @Override
4611      public boolean equalsDeep(Base other_) {
4612        if (!super.equalsDeep(other_))
4613          return false;
4614        if (!(other_ instanceof CapabilityStatementRestResourceComponent))
4615          return false;
4616        CapabilityStatementRestResourceComponent o = (CapabilityStatementRestResourceComponent) other_;
4617        return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(documentation, o.documentation, true)
4618           && compareDeep(interaction, o.interaction, true) && compareDeep(versioning, o.versioning, true)
4619           && compareDeep(readHistory, o.readHistory, true) && compareDeep(updateCreate, o.updateCreate, true)
4620           && compareDeep(conditionalCreate, o.conditionalCreate, true) && compareDeep(conditionalRead, o.conditionalRead, true)
4621           && compareDeep(conditionalUpdate, o.conditionalUpdate, true) && compareDeep(conditionalDelete, o.conditionalDelete, true)
4622           && compareDeep(referencePolicy, o.referencePolicy, true) && compareDeep(searchInclude, o.searchInclude, true)
4623           && compareDeep(searchRevInclude, o.searchRevInclude, true) && compareDeep(searchParam, o.searchParam, true)
4624          ;
4625      }
4626
4627      @Override
4628      public boolean equalsShallow(Base other_) {
4629        if (!super.equalsShallow(other_))
4630          return false;
4631        if (!(other_ instanceof CapabilityStatementRestResourceComponent))
4632          return false;
4633        CapabilityStatementRestResourceComponent o = (CapabilityStatementRestResourceComponent) other_;
4634        return compareValues(type, o.type, true) && compareValues(documentation, o.documentation, true) && compareValues(versioning, o.versioning, true)
4635           && compareValues(readHistory, o.readHistory, true) && compareValues(updateCreate, o.updateCreate, true)
4636           && compareValues(conditionalCreate, o.conditionalCreate, true) && compareValues(conditionalRead, o.conditionalRead, true)
4637           && compareValues(conditionalUpdate, o.conditionalUpdate, true) && compareValues(conditionalDelete, o.conditionalDelete, true)
4638           && compareValues(referencePolicy, o.referencePolicy, true) && compareValues(searchInclude, o.searchInclude, true)
4639           && compareValues(searchRevInclude, o.searchRevInclude, true);
4640      }
4641
4642      public boolean isEmpty() {
4643        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, profile, documentation
4644          , interaction, versioning, readHistory, updateCreate, conditionalCreate, conditionalRead
4645          , conditionalUpdate, conditionalDelete, referencePolicy, searchInclude, searchRevInclude
4646          , searchParam);
4647      }
4648
4649  public String fhirType() {
4650    return "CapabilityStatement.rest.resource";
4651
4652  }
4653
4654  }
4655
4656    @Block()
4657    public static class ResourceInteractionComponent extends BackboneElement implements IBaseBackboneElement {
4658        /**
4659         * Coded identifier of the operation, supported by the system resource.
4660         */
4661        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4662        @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." )
4663        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/type-restful-interaction")
4664        protected Enumeration<TypeRestfulInteraction> code;
4665
4666        /**
4667         * 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'.
4668         */
4669        @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4670        @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'." )
4671        protected StringType documentation;
4672
4673        private static final long serialVersionUID = -437507806L;
4674
4675    /**
4676     * Constructor
4677     */
4678      public ResourceInteractionComponent() {
4679        super();
4680      }
4681
4682    /**
4683     * Constructor
4684     */
4685      public ResourceInteractionComponent(Enumeration<TypeRestfulInteraction> code) {
4686        super();
4687        this.code = code;
4688      }
4689
4690        /**
4691         * @return {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
4692         */
4693        public Enumeration<TypeRestfulInteraction> getCodeElement() { 
4694          if (this.code == null)
4695            if (Configuration.errorOnAutoCreate())
4696              throw new Error("Attempt to auto-create ResourceInteractionComponent.code");
4697            else if (Configuration.doAutoCreate())
4698              this.code = new Enumeration<TypeRestfulInteraction>(new TypeRestfulInteractionEnumFactory()); // bb
4699          return this.code;
4700        }
4701
4702        public boolean hasCodeElement() { 
4703          return this.code != null && !this.code.isEmpty();
4704        }
4705
4706        public boolean hasCode() { 
4707          return this.code != null && !this.code.isEmpty();
4708        }
4709
4710        /**
4711         * @param value {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
4712         */
4713        public ResourceInteractionComponent setCodeElement(Enumeration<TypeRestfulInteraction> value) { 
4714          this.code = value;
4715          return this;
4716        }
4717
4718        /**
4719         * @return Coded identifier of the operation, supported by the system resource.
4720         */
4721        public TypeRestfulInteraction getCode() { 
4722          return this.code == null ? null : this.code.getValue();
4723        }
4724
4725        /**
4726         * @param value Coded identifier of the operation, supported by the system resource.
4727         */
4728        public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { 
4729            if (this.code == null)
4730              this.code = new Enumeration<TypeRestfulInteraction>(new TypeRestfulInteractionEnumFactory());
4731            this.code.setValue(value);
4732          return this;
4733        }
4734
4735        /**
4736         * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
4737         */
4738        public StringType getDocumentationElement() { 
4739          if (this.documentation == null)
4740            if (Configuration.errorOnAutoCreate())
4741              throw new Error("Attempt to auto-create ResourceInteractionComponent.documentation");
4742            else if (Configuration.doAutoCreate())
4743              this.documentation = new StringType(); // bb
4744          return this.documentation;
4745        }
4746
4747        public boolean hasDocumentationElement() { 
4748          return this.documentation != null && !this.documentation.isEmpty();
4749        }
4750
4751        public boolean hasDocumentation() { 
4752          return this.documentation != null && !this.documentation.isEmpty();
4753        }
4754
4755        /**
4756         * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
4757         */
4758        public ResourceInteractionComponent setDocumentationElement(StringType value) { 
4759          this.documentation = value;
4760          return this;
4761        }
4762
4763        /**
4764         * @return Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.
4765         */
4766        public String getDocumentation() { 
4767          return this.documentation == null ? null : this.documentation.getValue();
4768        }
4769
4770        /**
4771         * @param value Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.
4772         */
4773        public ResourceInteractionComponent setDocumentation(String value) { 
4774          if (Utilities.noString(value))
4775            this.documentation = null;
4776          else {
4777            if (this.documentation == null)
4778              this.documentation = new StringType();
4779            this.documentation.setValue(value);
4780          }
4781          return this;
4782        }
4783
4784        protected void listChildren(List<Property> children) {
4785          super.listChildren(children);
4786          children.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, 1, code));
4787          children.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, 1, documentation));
4788        }
4789
4790        @Override
4791        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4792          switch (_hash) {
4793          case 3059181: /*code*/  return new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, 1, code);
4794          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, 1, documentation);
4795          default: return super.getNamedProperty(_hash, _name, _checkValid);
4796          }
4797
4798        }
4799
4800      @Override
4801      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4802        switch (hash) {
4803        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<TypeRestfulInteraction>
4804        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
4805        default: return super.getProperty(hash, name, checkValid);
4806        }
4807
4808      }
4809
4810      @Override
4811      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4812        switch (hash) {
4813        case 3059181: // code
4814          value = new TypeRestfulInteractionEnumFactory().fromType(castToCode(value));
4815          this.code = (Enumeration) value; // Enumeration<TypeRestfulInteraction>
4816          return value;
4817        case 1587405498: // documentation
4818          this.documentation = castToString(value); // StringType
4819          return value;
4820        default: return super.setProperty(hash, name, value);
4821        }
4822
4823      }
4824
4825      @Override
4826      public Base setProperty(String name, Base value) throws FHIRException {
4827        if (name.equals("code")) {
4828          value = new TypeRestfulInteractionEnumFactory().fromType(castToCode(value));
4829          this.code = (Enumeration) value; // Enumeration<TypeRestfulInteraction>
4830        } else if (name.equals("documentation")) {
4831          this.documentation = castToString(value); // StringType
4832        } else
4833          return super.setProperty(name, value);
4834        return value;
4835      }
4836
4837      @Override
4838      public Base makeProperty(int hash, String name) throws FHIRException {
4839        switch (hash) {
4840        case 3059181:  return getCodeElement();
4841        case 1587405498:  return getDocumentationElement();
4842        default: return super.makeProperty(hash, name);
4843        }
4844
4845      }
4846
4847      @Override
4848      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4849        switch (hash) {
4850        case 3059181: /*code*/ return new String[] {"code"};
4851        case 1587405498: /*documentation*/ return new String[] {"string"};
4852        default: return super.getTypesForProperty(hash, name);
4853        }
4854
4855      }
4856
4857      @Override
4858      public Base addChild(String name) throws FHIRException {
4859        if (name.equals("code")) {
4860          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.code");
4861        }
4862        else if (name.equals("documentation")) {
4863          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
4864        }
4865        else
4866          return super.addChild(name);
4867      }
4868
4869      public ResourceInteractionComponent copy() {
4870        ResourceInteractionComponent dst = new ResourceInteractionComponent();
4871        copyValues(dst);
4872        dst.code = code == null ? null : code.copy();
4873        dst.documentation = documentation == null ? null : documentation.copy();
4874        return dst;
4875      }
4876
4877      @Override
4878      public boolean equalsDeep(Base other_) {
4879        if (!super.equalsDeep(other_))
4880          return false;
4881        if (!(other_ instanceof ResourceInteractionComponent))
4882          return false;
4883        ResourceInteractionComponent o = (ResourceInteractionComponent) other_;
4884        return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true);
4885      }
4886
4887      @Override
4888      public boolean equalsShallow(Base other_) {
4889        if (!super.equalsShallow(other_))
4890          return false;
4891        if (!(other_ instanceof ResourceInteractionComponent))
4892          return false;
4893        ResourceInteractionComponent o = (ResourceInteractionComponent) other_;
4894        return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true);
4895      }
4896
4897      public boolean isEmpty() {
4898        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, documentation);
4899      }
4900
4901  public String fhirType() {
4902    return "CapabilityStatement.rest.resource.interaction";
4903
4904  }
4905
4906  }
4907
4908    @Block()
4909    public static class CapabilityStatementRestResourceSearchParamComponent extends BackboneElement implements IBaseBackboneElement {
4910        /**
4911         * The name of the search parameter used in the interface.
4912         */
4913        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4914        @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." )
4915        protected StringType name;
4916
4917        /**
4918         * 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]]]).
4919         */
4920        @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4921        @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]]])." )
4922        protected UriType definition;
4923
4924        /**
4925         * The type of value a search parameter refers to, and how the content is interpreted.
4926         */
4927        @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false)
4928        @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." )
4929        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-param-type")
4930        protected Enumeration<SearchParamType> type;
4931
4932        /**
4933         * This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
4934         */
4935        @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
4936        @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." )
4937        protected StringType documentation;
4938
4939        private static final long serialVersionUID = 72133006L;
4940
4941    /**
4942     * Constructor
4943     */
4944      public CapabilityStatementRestResourceSearchParamComponent() {
4945        super();
4946      }
4947
4948    /**
4949     * Constructor
4950     */
4951      public CapabilityStatementRestResourceSearchParamComponent(StringType name, Enumeration<SearchParamType> type) {
4952        super();
4953        this.name = name;
4954        this.type = type;
4955      }
4956
4957        /**
4958         * @return {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4959         */
4960        public StringType getNameElement() { 
4961          if (this.name == null)
4962            if (Configuration.errorOnAutoCreate())
4963              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.name");
4964            else if (Configuration.doAutoCreate())
4965              this.name = new StringType(); // bb
4966          return this.name;
4967        }
4968
4969        public boolean hasNameElement() { 
4970          return this.name != null && !this.name.isEmpty();
4971        }
4972
4973        public boolean hasName() { 
4974          return this.name != null && !this.name.isEmpty();
4975        }
4976
4977        /**
4978         * @param value {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4979         */
4980        public CapabilityStatementRestResourceSearchParamComponent setNameElement(StringType value) { 
4981          this.name = value;
4982          return this;
4983        }
4984
4985        /**
4986         * @return The name of the search parameter used in the interface.
4987         */
4988        public String getName() { 
4989          return this.name == null ? null : this.name.getValue();
4990        }
4991
4992        /**
4993         * @param value The name of the search parameter used in the interface.
4994         */
4995        public CapabilityStatementRestResourceSearchParamComponent setName(String value) { 
4996            if (this.name == null)
4997              this.name = new StringType();
4998            this.name.setValue(value);
4999          return this;
5000        }
5001
5002        /**
5003         * @return {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
5004         */
5005        public UriType getDefinitionElement() { 
5006          if (this.definition == null)
5007            if (Configuration.errorOnAutoCreate())
5008              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.definition");
5009            else if (Configuration.doAutoCreate())
5010              this.definition = new UriType(); // bb
5011          return this.definition;
5012        }
5013
5014        public boolean hasDefinitionElement() { 
5015          return this.definition != null && !this.definition.isEmpty();
5016        }
5017
5018        public boolean hasDefinition() { 
5019          return this.definition != null && !this.definition.isEmpty();
5020        }
5021
5022        /**
5023         * @param value {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
5024         */
5025        public CapabilityStatementRestResourceSearchParamComponent setDefinitionElement(UriType value) { 
5026          this.definition = value;
5027          return this;
5028        }
5029
5030        /**
5031         * @return An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).
5032         */
5033        public String getDefinition() { 
5034          return this.definition == null ? null : this.definition.getValue();
5035        }
5036
5037        /**
5038         * @param value An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).
5039         */
5040        public CapabilityStatementRestResourceSearchParamComponent setDefinition(String value) { 
5041          if (Utilities.noString(value))
5042            this.definition = null;
5043          else {
5044            if (this.definition == null)
5045              this.definition = new UriType();
5046            this.definition.setValue(value);
5047          }
5048          return this;
5049        }
5050
5051        /**
5052         * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
5053         */
5054        public Enumeration<SearchParamType> getTypeElement() { 
5055          if (this.type == null)
5056            if (Configuration.errorOnAutoCreate())
5057              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.type");
5058            else if (Configuration.doAutoCreate())
5059              this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory()); // bb
5060          return this.type;
5061        }
5062
5063        public boolean hasTypeElement() { 
5064          return this.type != null && !this.type.isEmpty();
5065        }
5066
5067        public boolean hasType() { 
5068          return this.type != null && !this.type.isEmpty();
5069        }
5070
5071        /**
5072         * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
5073         */
5074        public CapabilityStatementRestResourceSearchParamComponent setTypeElement(Enumeration<SearchParamType> value) { 
5075          this.type = value;
5076          return this;
5077        }
5078
5079        /**
5080         * @return The type of value a search parameter refers to, and how the content is interpreted.
5081         */
5082        public SearchParamType getType() { 
5083          return this.type == null ? null : this.type.getValue();
5084        }
5085
5086        /**
5087         * @param value The type of value a search parameter refers to, and how the content is interpreted.
5088         */
5089        public CapabilityStatementRestResourceSearchParamComponent setType(SearchParamType value) { 
5090            if (this.type == null)
5091              this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory());
5092            this.type.setValue(value);
5093          return this;
5094        }
5095
5096        /**
5097         * @return {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5098         */
5099        public StringType getDocumentationElement() { 
5100          if (this.documentation == null)
5101            if (Configuration.errorOnAutoCreate())
5102              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.documentation");
5103            else if (Configuration.doAutoCreate())
5104              this.documentation = new StringType(); // bb
5105          return this.documentation;
5106        }
5107
5108        public boolean hasDocumentationElement() { 
5109          return this.documentation != null && !this.documentation.isEmpty();
5110        }
5111
5112        public boolean hasDocumentation() { 
5113          return this.documentation != null && !this.documentation.isEmpty();
5114        }
5115
5116        /**
5117         * @param value {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5118         */
5119        public CapabilityStatementRestResourceSearchParamComponent setDocumentationElement(StringType value) { 
5120          this.documentation = value;
5121          return this;
5122        }
5123
5124        /**
5125         * @return This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
5126         */
5127        public String getDocumentation() { 
5128          return this.documentation == null ? null : this.documentation.getValue();
5129        }
5130
5131        /**
5132         * @param value This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
5133         */
5134        public CapabilityStatementRestResourceSearchParamComponent setDocumentation(String value) { 
5135          if (Utilities.noString(value))
5136            this.documentation = null;
5137          else {
5138            if (this.documentation == null)
5139              this.documentation = new StringType();
5140            this.documentation.setValue(value);
5141          }
5142          return this;
5143        }
5144
5145        protected void listChildren(List<Property> children) {
5146          super.listChildren(children);
5147          children.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, 1, name));
5148          children.add(new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, 1, definition));
5149          children.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, 1, type));
5150          children.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.", 0, 1, documentation));
5151        }
5152
5153        @Override
5154        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5155          switch (_hash) {
5156          case 3373707: /*name*/  return new Property("name", "string", "The name of the search parameter used in the interface.", 0, 1, name);
5157          case -1014418093: /*definition*/  return new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, 1, definition);
5158          case 3575610: /*type*/  return new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, 1, type);
5159          case 1587405498: /*documentation*/  return new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.", 0, 1, documentation);
5160          default: return super.getNamedProperty(_hash, _name, _checkValid);
5161          }
5162
5163        }
5164
5165      @Override
5166      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5167        switch (hash) {
5168        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
5169        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType
5170        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<SearchParamType>
5171        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
5172        default: return super.getProperty(hash, name, checkValid);
5173        }
5174
5175      }
5176
5177      @Override
5178      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5179        switch (hash) {
5180        case 3373707: // name
5181          this.name = castToString(value); // StringType
5182          return value;
5183        case -1014418093: // definition
5184          this.definition = castToUri(value); // UriType
5185          return value;
5186        case 3575610: // type
5187          value = new SearchParamTypeEnumFactory().fromType(castToCode(value));
5188          this.type = (Enumeration) value; // Enumeration<SearchParamType>
5189          return value;
5190        case 1587405498: // documentation
5191          this.documentation = castToString(value); // StringType
5192          return value;
5193        default: return super.setProperty(hash, name, value);
5194        }
5195
5196      }
5197
5198      @Override
5199      public Base setProperty(String name, Base value) throws FHIRException {
5200        if (name.equals("name")) {
5201          this.name = castToString(value); // StringType
5202        } else if (name.equals("definition")) {
5203          this.definition = castToUri(value); // UriType
5204        } else if (name.equals("type")) {
5205          value = new SearchParamTypeEnumFactory().fromType(castToCode(value));
5206          this.type = (Enumeration) value; // Enumeration<SearchParamType>
5207        } else if (name.equals("documentation")) {
5208          this.documentation = castToString(value); // StringType
5209        } else
5210          return super.setProperty(name, value);
5211        return value;
5212      }
5213
5214      @Override
5215      public Base makeProperty(int hash, String name) throws FHIRException {
5216        switch (hash) {
5217        case 3373707:  return getNameElement();
5218        case -1014418093:  return getDefinitionElement();
5219        case 3575610:  return getTypeElement();
5220        case 1587405498:  return getDocumentationElement();
5221        default: return super.makeProperty(hash, name);
5222        }
5223
5224      }
5225
5226      @Override
5227      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5228        switch (hash) {
5229        case 3373707: /*name*/ return new String[] {"string"};
5230        case -1014418093: /*definition*/ return new String[] {"uri"};
5231        case 3575610: /*type*/ return new String[] {"code"};
5232        case 1587405498: /*documentation*/ return new String[] {"string"};
5233        default: return super.getTypesForProperty(hash, name);
5234        }
5235
5236      }
5237
5238      @Override
5239      public Base addChild(String name) throws FHIRException {
5240        if (name.equals("name")) {
5241          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
5242        }
5243        else if (name.equals("definition")) {
5244          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.definition");
5245        }
5246        else if (name.equals("type")) {
5247          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.type");
5248        }
5249        else if (name.equals("documentation")) {
5250          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
5251        }
5252        else
5253          return super.addChild(name);
5254      }
5255
5256      public CapabilityStatementRestResourceSearchParamComponent copy() {
5257        CapabilityStatementRestResourceSearchParamComponent dst = new CapabilityStatementRestResourceSearchParamComponent();
5258        copyValues(dst);
5259        dst.name = name == null ? null : name.copy();
5260        dst.definition = definition == null ? null : definition.copy();
5261        dst.type = type == null ? null : type.copy();
5262        dst.documentation = documentation == null ? null : documentation.copy();
5263        return dst;
5264      }
5265
5266      @Override
5267      public boolean equalsDeep(Base other_) {
5268        if (!super.equalsDeep(other_))
5269          return false;
5270        if (!(other_ instanceof CapabilityStatementRestResourceSearchParamComponent))
5271          return false;
5272        CapabilityStatementRestResourceSearchParamComponent o = (CapabilityStatementRestResourceSearchParamComponent) other_;
5273        return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(type, o.type, true)
5274           && compareDeep(documentation, o.documentation, true);
5275      }
5276
5277      @Override
5278      public boolean equalsShallow(Base other_) {
5279        if (!super.equalsShallow(other_))
5280          return false;
5281        if (!(other_ instanceof CapabilityStatementRestResourceSearchParamComponent))
5282          return false;
5283        CapabilityStatementRestResourceSearchParamComponent o = (CapabilityStatementRestResourceSearchParamComponent) other_;
5284        return compareValues(name, o.name, true) && compareValues(definition, o.definition, true) && compareValues(type, o.type, true)
5285           && compareValues(documentation, o.documentation, true);
5286      }
5287
5288      public boolean isEmpty() {
5289        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, definition, type, documentation
5290          );
5291      }
5292
5293  public String fhirType() {
5294    return "CapabilityStatement.rest.resource.searchParam";
5295
5296  }
5297
5298  }
5299
5300    @Block()
5301    public static class SystemInteractionComponent extends BackboneElement implements IBaseBackboneElement {
5302        /**
5303         * A coded identifier of the operation, supported by the system.
5304         */
5305        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
5306        @Description(shortDefinition="transaction | batch | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." )
5307        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/system-restful-interaction")
5308        protected Enumeration<SystemRestfulInteraction> code;
5309
5310        /**
5311         * 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.
5312         */
5313        @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5314        @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." )
5315        protected StringType documentation;
5316
5317        private static final long serialVersionUID = 510675287L;
5318
5319    /**
5320     * Constructor
5321     */
5322      public SystemInteractionComponent() {
5323        super();
5324      }
5325
5326    /**
5327     * Constructor
5328     */
5329      public SystemInteractionComponent(Enumeration<SystemRestfulInteraction> code) {
5330        super();
5331        this.code = code;
5332      }
5333
5334        /**
5335         * @return {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
5336         */
5337        public Enumeration<SystemRestfulInteraction> getCodeElement() { 
5338          if (this.code == null)
5339            if (Configuration.errorOnAutoCreate())
5340              throw new Error("Attempt to auto-create SystemInteractionComponent.code");
5341            else if (Configuration.doAutoCreate())
5342              this.code = new Enumeration<SystemRestfulInteraction>(new SystemRestfulInteractionEnumFactory()); // bb
5343          return this.code;
5344        }
5345
5346        public boolean hasCodeElement() { 
5347          return this.code != null && !this.code.isEmpty();
5348        }
5349
5350        public boolean hasCode() { 
5351          return this.code != null && !this.code.isEmpty();
5352        }
5353
5354        /**
5355         * @param value {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
5356         */
5357        public SystemInteractionComponent setCodeElement(Enumeration<SystemRestfulInteraction> value) { 
5358          this.code = value;
5359          return this;
5360        }
5361
5362        /**
5363         * @return A coded identifier of the operation, supported by the system.
5364         */
5365        public SystemRestfulInteraction getCode() { 
5366          return this.code == null ? null : this.code.getValue();
5367        }
5368
5369        /**
5370         * @param value A coded identifier of the operation, supported by the system.
5371         */
5372        public SystemInteractionComponent setCode(SystemRestfulInteraction value) { 
5373            if (this.code == null)
5374              this.code = new Enumeration<SystemRestfulInteraction>(new SystemRestfulInteractionEnumFactory());
5375            this.code.setValue(value);
5376          return this;
5377        }
5378
5379        /**
5380         * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5381         */
5382        public StringType getDocumentationElement() { 
5383          if (this.documentation == null)
5384            if (Configuration.errorOnAutoCreate())
5385              throw new Error("Attempt to auto-create SystemInteractionComponent.documentation");
5386            else if (Configuration.doAutoCreate())
5387              this.documentation = new StringType(); // bb
5388          return this.documentation;
5389        }
5390
5391        public boolean hasDocumentationElement() { 
5392          return this.documentation != null && !this.documentation.isEmpty();
5393        }
5394
5395        public boolean hasDocumentation() { 
5396          return this.documentation != null && !this.documentation.isEmpty();
5397        }
5398
5399        /**
5400         * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5401         */
5402        public SystemInteractionComponent setDocumentationElement(StringType value) { 
5403          this.documentation = value;
5404          return this;
5405        }
5406
5407        /**
5408         * @return Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.
5409         */
5410        public String getDocumentation() { 
5411          return this.documentation == null ? null : this.documentation.getValue();
5412        }
5413
5414        /**
5415         * @param value Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.
5416         */
5417        public SystemInteractionComponent setDocumentation(String value) { 
5418          if (Utilities.noString(value))
5419            this.documentation = null;
5420          else {
5421            if (this.documentation == null)
5422              this.documentation = new StringType();
5423            this.documentation.setValue(value);
5424          }
5425          return this;
5426        }
5427
5428        protected void listChildren(List<Property> children) {
5429          super.listChildren(children);
5430          children.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, 1, code));
5431          children.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, 1, documentation));
5432        }
5433
5434        @Override
5435        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5436          switch (_hash) {
5437          case 3059181: /*code*/  return new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, 1, code);
5438          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, 1, documentation);
5439          default: return super.getNamedProperty(_hash, _name, _checkValid);
5440          }
5441
5442        }
5443
5444      @Override
5445      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5446        switch (hash) {
5447        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<SystemRestfulInteraction>
5448        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
5449        default: return super.getProperty(hash, name, checkValid);
5450        }
5451
5452      }
5453
5454      @Override
5455      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5456        switch (hash) {
5457        case 3059181: // code
5458          value = new SystemRestfulInteractionEnumFactory().fromType(castToCode(value));
5459          this.code = (Enumeration) value; // Enumeration<SystemRestfulInteraction>
5460          return value;
5461        case 1587405498: // documentation
5462          this.documentation = castToString(value); // StringType
5463          return value;
5464        default: return super.setProperty(hash, name, value);
5465        }
5466
5467      }
5468
5469      @Override
5470      public Base setProperty(String name, Base value) throws FHIRException {
5471        if (name.equals("code")) {
5472          value = new SystemRestfulInteractionEnumFactory().fromType(castToCode(value));
5473          this.code = (Enumeration) value; // Enumeration<SystemRestfulInteraction>
5474        } else if (name.equals("documentation")) {
5475          this.documentation = castToString(value); // StringType
5476        } else
5477          return super.setProperty(name, value);
5478        return value;
5479      }
5480
5481      @Override
5482      public Base makeProperty(int hash, String name) throws FHIRException {
5483        switch (hash) {
5484        case 3059181:  return getCodeElement();
5485        case 1587405498:  return getDocumentationElement();
5486        default: return super.makeProperty(hash, name);
5487        }
5488
5489      }
5490
5491      @Override
5492      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5493        switch (hash) {
5494        case 3059181: /*code*/ return new String[] {"code"};
5495        case 1587405498: /*documentation*/ return new String[] {"string"};
5496        default: return super.getTypesForProperty(hash, name);
5497        }
5498
5499      }
5500
5501      @Override
5502      public Base addChild(String name) throws FHIRException {
5503        if (name.equals("code")) {
5504          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.code");
5505        }
5506        else if (name.equals("documentation")) {
5507          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
5508        }
5509        else
5510          return super.addChild(name);
5511      }
5512
5513      public SystemInteractionComponent copy() {
5514        SystemInteractionComponent dst = new SystemInteractionComponent();
5515        copyValues(dst);
5516        dst.code = code == null ? null : code.copy();
5517        dst.documentation = documentation == null ? null : documentation.copy();
5518        return dst;
5519      }
5520
5521      @Override
5522      public boolean equalsDeep(Base other_) {
5523        if (!super.equalsDeep(other_))
5524          return false;
5525        if (!(other_ instanceof SystemInteractionComponent))
5526          return false;
5527        SystemInteractionComponent o = (SystemInteractionComponent) other_;
5528        return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true);
5529      }
5530
5531      @Override
5532      public boolean equalsShallow(Base other_) {
5533        if (!super.equalsShallow(other_))
5534          return false;
5535        if (!(other_ instanceof SystemInteractionComponent))
5536          return false;
5537        SystemInteractionComponent o = (SystemInteractionComponent) other_;
5538        return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true);
5539      }
5540
5541      public boolean isEmpty() {
5542        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, documentation);
5543      }
5544
5545  public String fhirType() {
5546    return "CapabilityStatement.rest.interaction";
5547
5548  }
5549
5550  }
5551
5552    @Block()
5553    public static class CapabilityStatementRestOperationComponent extends BackboneElement implements IBaseBackboneElement {
5554        /**
5555         * 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.
5556         */
5557        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
5558        @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." )
5559        protected StringType name;
5560
5561        /**
5562         * Where the formal definition can be found.
5563         */
5564        @Child(name = "definition", type = {OperationDefinition.class}, order=2, min=1, max=1, modifier=false, summary=true)
5565        @Description(shortDefinition="The defined operation/query", formalDefinition="Where the formal definition can be found." )
5566        protected Reference definition;
5567
5568        /**
5569         * The actual object that is the target of the reference (Where the formal definition can be found.)
5570         */
5571        protected OperationDefinition definitionTarget;
5572
5573        private static final long serialVersionUID = 122107272L;
5574
5575    /**
5576     * Constructor
5577     */
5578      public CapabilityStatementRestOperationComponent() {
5579        super();
5580      }
5581
5582    /**
5583     * Constructor
5584     */
5585      public CapabilityStatementRestOperationComponent(StringType name, Reference definition) {
5586        super();
5587        this.name = name;
5588        this.definition = definition;
5589      }
5590
5591        /**
5592         * @return {@link #name} (The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5593         */
5594        public StringType getNameElement() { 
5595          if (this.name == null)
5596            if (Configuration.errorOnAutoCreate())
5597              throw new Error("Attempt to auto-create CapabilityStatementRestOperationComponent.name");
5598            else if (Configuration.doAutoCreate())
5599              this.name = new StringType(); // bb
5600          return this.name;
5601        }
5602
5603        public boolean hasNameElement() { 
5604          return this.name != null && !this.name.isEmpty();
5605        }
5606
5607        public boolean hasName() { 
5608          return this.name != null && !this.name.isEmpty();
5609        }
5610
5611        /**
5612         * @param value {@link #name} (The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5613         */
5614        public CapabilityStatementRestOperationComponent setNameElement(StringType value) { 
5615          this.name = value;
5616          return this;
5617        }
5618
5619        /**
5620         * @return The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.
5621         */
5622        public String getName() { 
5623          return this.name == null ? null : this.name.getValue();
5624        }
5625
5626        /**
5627         * @param value The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.
5628         */
5629        public CapabilityStatementRestOperationComponent setName(String value) { 
5630            if (this.name == null)
5631              this.name = new StringType();
5632            this.name.setValue(value);
5633          return this;
5634        }
5635
5636        /**
5637         * @return {@link #definition} (Where the formal definition can be found.)
5638         */
5639        public Reference getDefinition() { 
5640          if (this.definition == null)
5641            if (Configuration.errorOnAutoCreate())
5642              throw new Error("Attempt to auto-create CapabilityStatementRestOperationComponent.definition");
5643            else if (Configuration.doAutoCreate())
5644              this.definition = new Reference(); // cc
5645          return this.definition;
5646        }
5647
5648        public boolean hasDefinition() { 
5649          return this.definition != null && !this.definition.isEmpty();
5650        }
5651
5652        /**
5653         * @param value {@link #definition} (Where the formal definition can be found.)
5654         */
5655        public CapabilityStatementRestOperationComponent setDefinition(Reference value)  { 
5656          this.definition = value;
5657          return this;
5658        }
5659
5660        /**
5661         * @return {@link #definition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the formal definition can be found.)
5662         */
5663        public OperationDefinition getDefinitionTarget() { 
5664          if (this.definitionTarget == null)
5665            if (Configuration.errorOnAutoCreate())
5666              throw new Error("Attempt to auto-create CapabilityStatementRestOperationComponent.definition");
5667            else if (Configuration.doAutoCreate())
5668              this.definitionTarget = new OperationDefinition(); // aa
5669          return this.definitionTarget;
5670        }
5671
5672        /**
5673         * @param value {@link #definition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the formal definition can be found.)
5674         */
5675        public CapabilityStatementRestOperationComponent setDefinitionTarget(OperationDefinition value) { 
5676          this.definitionTarget = value;
5677          return this;
5678        }
5679
5680        protected void listChildren(List<Property> children) {
5681          super.listChildren(children);
5682          children.add(new Property("name", "string", "The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.", 0, 1, name));
5683          children.add(new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, 1, definition));
5684        }
5685
5686        @Override
5687        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5688          switch (_hash) {
5689          case 3373707: /*name*/  return new Property("name", "string", "The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.", 0, 1, name);
5690          case -1014418093: /*definition*/  return new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, 1, definition);
5691          default: return super.getNamedProperty(_hash, _name, _checkValid);
5692          }
5693
5694        }
5695
5696      @Override
5697      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5698        switch (hash) {
5699        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
5700        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference
5701        default: return super.getProperty(hash, name, checkValid);
5702        }
5703
5704      }
5705
5706      @Override
5707      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5708        switch (hash) {
5709        case 3373707: // name
5710          this.name = castToString(value); // StringType
5711          return value;
5712        case -1014418093: // definition
5713          this.definition = castToReference(value); // Reference
5714          return value;
5715        default: return super.setProperty(hash, name, value);
5716        }
5717
5718      }
5719
5720      @Override
5721      public Base setProperty(String name, Base value) throws FHIRException {
5722        if (name.equals("name")) {
5723          this.name = castToString(value); // StringType
5724        } else if (name.equals("definition")) {
5725          this.definition = castToReference(value); // Reference
5726        } else
5727          return super.setProperty(name, value);
5728        return value;
5729      }
5730
5731      @Override
5732      public Base makeProperty(int hash, String name) throws FHIRException {
5733        switch (hash) {
5734        case 3373707:  return getNameElement();
5735        case -1014418093:  return getDefinition(); 
5736        default: return super.makeProperty(hash, name);
5737        }
5738
5739      }
5740
5741      @Override
5742      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5743        switch (hash) {
5744        case 3373707: /*name*/ return new String[] {"string"};
5745        case -1014418093: /*definition*/ return new String[] {"Reference"};
5746        default: return super.getTypesForProperty(hash, name);
5747        }
5748
5749      }
5750
5751      @Override
5752      public Base addChild(String name) throws FHIRException {
5753        if (name.equals("name")) {
5754          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
5755        }
5756        else if (name.equals("definition")) {
5757          this.definition = new Reference();
5758          return this.definition;
5759        }
5760        else
5761          return super.addChild(name);
5762      }
5763
5764      public CapabilityStatementRestOperationComponent copy() {
5765        CapabilityStatementRestOperationComponent dst = new CapabilityStatementRestOperationComponent();
5766        copyValues(dst);
5767        dst.name = name == null ? null : name.copy();
5768        dst.definition = definition == null ? null : definition.copy();
5769        return dst;
5770      }
5771
5772      @Override
5773      public boolean equalsDeep(Base other_) {
5774        if (!super.equalsDeep(other_))
5775          return false;
5776        if (!(other_ instanceof CapabilityStatementRestOperationComponent))
5777          return false;
5778        CapabilityStatementRestOperationComponent o = (CapabilityStatementRestOperationComponent) other_;
5779        return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true);
5780      }
5781
5782      @Override
5783      public boolean equalsShallow(Base other_) {
5784        if (!super.equalsShallow(other_))
5785          return false;
5786        if (!(other_ instanceof CapabilityStatementRestOperationComponent))
5787          return false;
5788        CapabilityStatementRestOperationComponent o = (CapabilityStatementRestOperationComponent) other_;
5789        return compareValues(name, o.name, true);
5790      }
5791
5792      public boolean isEmpty() {
5793        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, definition);
5794      }
5795
5796  public String fhirType() {
5797    return "CapabilityStatement.rest.operation";
5798
5799  }
5800
5801  }
5802
5803    @Block()
5804    public static class CapabilityStatementMessagingComponent extends BackboneElement implements IBaseBackboneElement {
5805        /**
5806         * An endpoint (network accessible address) to which messages and/or replies are to be sent.
5807         */
5808        @Child(name = "endpoint", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5809        @Description(shortDefinition="Where messages should be sent", formalDefinition="An endpoint (network accessible address) to which messages and/or replies are to be sent." )
5810        protected List<CapabilityStatementMessagingEndpointComponent> endpoint;
5811
5812        /**
5813         * 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).
5814         */
5815        @Child(name = "reliableCache", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5816        @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)." )
5817        protected UnsignedIntType reliableCache;
5818
5819        /**
5820         * 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.
5821         */
5822        @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5823        @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." )
5824        protected StringType documentation;
5825
5826        /**
5827         * References to message definitions for messages this system can send or receive.
5828         */
5829        @Child(name = "supportedMessage", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5830        @Description(shortDefinition="Messages supported by this system", formalDefinition="References to message definitions for messages this system can send or receive." )
5831        protected List<CapabilityStatementMessagingSupportedMessageComponent> supportedMessage;
5832
5833        /**
5834         * A description of the solution's support for an event at this end-point.
5835         */
5836        @Child(name = "event", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5837        @Description(shortDefinition="Declare support for this event", formalDefinition="A description of the solution's support for an event at this end-point." )
5838        protected List<CapabilityStatementMessagingEventComponent> event;
5839
5840        private static final long serialVersionUID = 816243355L;
5841
5842    /**
5843     * Constructor
5844     */
5845      public CapabilityStatementMessagingComponent() {
5846        super();
5847      }
5848
5849        /**
5850         * @return {@link #endpoint} (An endpoint (network accessible address) to which messages and/or replies are to be sent.)
5851         */
5852        public List<CapabilityStatementMessagingEndpointComponent> getEndpoint() { 
5853          if (this.endpoint == null)
5854            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5855          return this.endpoint;
5856        }
5857
5858        /**
5859         * @return Returns a reference to <code>this</code> for easy method chaining
5860         */
5861        public CapabilityStatementMessagingComponent setEndpoint(List<CapabilityStatementMessagingEndpointComponent> theEndpoint) { 
5862          this.endpoint = theEndpoint;
5863          return this;
5864        }
5865
5866        public boolean hasEndpoint() { 
5867          if (this.endpoint == null)
5868            return false;
5869          for (CapabilityStatementMessagingEndpointComponent item : this.endpoint)
5870            if (!item.isEmpty())
5871              return true;
5872          return false;
5873        }
5874
5875        public CapabilityStatementMessagingEndpointComponent addEndpoint() { //3
5876          CapabilityStatementMessagingEndpointComponent t = new CapabilityStatementMessagingEndpointComponent();
5877          if (this.endpoint == null)
5878            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5879          this.endpoint.add(t);
5880          return t;
5881        }
5882
5883        public CapabilityStatementMessagingComponent addEndpoint(CapabilityStatementMessagingEndpointComponent t) { //3
5884          if (t == null)
5885            return this;
5886          if (this.endpoint == null)
5887            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5888          this.endpoint.add(t);
5889          return this;
5890        }
5891
5892        /**
5893         * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist
5894         */
5895        public CapabilityStatementMessagingEndpointComponent getEndpointFirstRep() { 
5896          if (getEndpoint().isEmpty()) {
5897            addEndpoint();
5898          }
5899          return getEndpoint().get(0);
5900        }
5901
5902        /**
5903         * @return {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value
5904         */
5905        public UnsignedIntType getReliableCacheElement() { 
5906          if (this.reliableCache == null)
5907            if (Configuration.errorOnAutoCreate())
5908              throw new Error("Attempt to auto-create CapabilityStatementMessagingComponent.reliableCache");
5909            else if (Configuration.doAutoCreate())
5910              this.reliableCache = new UnsignedIntType(); // bb
5911          return this.reliableCache;
5912        }
5913
5914        public boolean hasReliableCacheElement() { 
5915          return this.reliableCache != null && !this.reliableCache.isEmpty();
5916        }
5917
5918        public boolean hasReliableCache() { 
5919          return this.reliableCache != null && !this.reliableCache.isEmpty();
5920        }
5921
5922        /**
5923         * @param value {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value
5924         */
5925        public CapabilityStatementMessagingComponent setReliableCacheElement(UnsignedIntType value) { 
5926          this.reliableCache = value;
5927          return this;
5928        }
5929
5930        /**
5931         * @return Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).
5932         */
5933        public int getReliableCache() { 
5934          return this.reliableCache == null || this.reliableCache.isEmpty() ? 0 : this.reliableCache.getValue();
5935        }
5936
5937        /**
5938         * @param value Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).
5939         */
5940        public CapabilityStatementMessagingComponent setReliableCache(int value) { 
5941            if (this.reliableCache == null)
5942              this.reliableCache = new UnsignedIntType();
5943            this.reliableCache.setValue(value);
5944          return this;
5945        }
5946
5947        /**
5948         * @return {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5949         */
5950        public StringType getDocumentationElement() { 
5951          if (this.documentation == null)
5952            if (Configuration.errorOnAutoCreate())
5953              throw new Error("Attempt to auto-create CapabilityStatementMessagingComponent.documentation");
5954            else if (Configuration.doAutoCreate())
5955              this.documentation = new StringType(); // bb
5956          return this.documentation;
5957        }
5958
5959        public boolean hasDocumentationElement() { 
5960          return this.documentation != null && !this.documentation.isEmpty();
5961        }
5962
5963        public boolean hasDocumentation() { 
5964          return this.documentation != null && !this.documentation.isEmpty();
5965        }
5966
5967        /**
5968         * @param value {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5969         */
5970        public CapabilityStatementMessagingComponent setDocumentationElement(StringType value) { 
5971          this.documentation = value;
5972          return this;
5973        }
5974
5975        /**
5976         * @return Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.
5977         */
5978        public String getDocumentation() { 
5979          return this.documentation == null ? null : this.documentation.getValue();
5980        }
5981
5982        /**
5983         * @param value Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.
5984         */
5985        public CapabilityStatementMessagingComponent setDocumentation(String value) { 
5986          if (Utilities.noString(value))
5987            this.documentation = null;
5988          else {
5989            if (this.documentation == null)
5990              this.documentation = new StringType();
5991            this.documentation.setValue(value);
5992          }
5993          return this;
5994        }
5995
5996        /**
5997         * @return {@link #supportedMessage} (References to message definitions for messages this system can send or receive.)
5998         */
5999        public List<CapabilityStatementMessagingSupportedMessageComponent> getSupportedMessage() { 
6000          if (this.supportedMessage == null)
6001            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
6002          return this.supportedMessage;
6003        }
6004
6005        /**
6006         * @return Returns a reference to <code>this</code> for easy method chaining
6007         */
6008        public CapabilityStatementMessagingComponent setSupportedMessage(List<CapabilityStatementMessagingSupportedMessageComponent> theSupportedMessage) { 
6009          this.supportedMessage = theSupportedMessage;
6010          return this;
6011        }
6012
6013        public boolean hasSupportedMessage() { 
6014          if (this.supportedMessage == null)
6015            return false;
6016          for (CapabilityStatementMessagingSupportedMessageComponent item : this.supportedMessage)
6017            if (!item.isEmpty())
6018              return true;
6019          return false;
6020        }
6021
6022        public CapabilityStatementMessagingSupportedMessageComponent addSupportedMessage() { //3
6023          CapabilityStatementMessagingSupportedMessageComponent t = new CapabilityStatementMessagingSupportedMessageComponent();
6024          if (this.supportedMessage == null)
6025            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
6026          this.supportedMessage.add(t);
6027          return t;
6028        }
6029
6030        public CapabilityStatementMessagingComponent addSupportedMessage(CapabilityStatementMessagingSupportedMessageComponent t) { //3
6031          if (t == null)
6032            return this;
6033          if (this.supportedMessage == null)
6034            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
6035          this.supportedMessage.add(t);
6036          return this;
6037        }
6038
6039        /**
6040         * @return The first repetition of repeating field {@link #supportedMessage}, creating it if it does not already exist
6041         */
6042        public CapabilityStatementMessagingSupportedMessageComponent getSupportedMessageFirstRep() { 
6043          if (getSupportedMessage().isEmpty()) {
6044            addSupportedMessage();
6045          }
6046          return getSupportedMessage().get(0);
6047        }
6048
6049        /**
6050         * @return {@link #event} (A description of the solution's support for an event at this end-point.)
6051         */
6052        public List<CapabilityStatementMessagingEventComponent> getEvent() { 
6053          if (this.event == null)
6054            this.event = new ArrayList<CapabilityStatementMessagingEventComponent>();
6055          return this.event;
6056        }
6057
6058        /**
6059         * @return Returns a reference to <code>this</code> for easy method chaining
6060         */
6061        public CapabilityStatementMessagingComponent setEvent(List<CapabilityStatementMessagingEventComponent> theEvent) { 
6062          this.event = theEvent;
6063          return this;
6064        }
6065
6066        public boolean hasEvent() { 
6067          if (this.event == null)
6068            return false;
6069          for (CapabilityStatementMessagingEventComponent item : this.event)
6070            if (!item.isEmpty())
6071              return true;
6072          return false;
6073        }
6074
6075        public CapabilityStatementMessagingEventComponent addEvent() { //3
6076          CapabilityStatementMessagingEventComponent t = new CapabilityStatementMessagingEventComponent();
6077          if (this.event == null)
6078            this.event = new ArrayList<CapabilityStatementMessagingEventComponent>();
6079          this.event.add(t);
6080          return t;
6081        }
6082
6083        public CapabilityStatementMessagingComponent addEvent(CapabilityStatementMessagingEventComponent t) { //3
6084          if (t == null)
6085            return this;
6086          if (this.event == null)
6087            this.event = new ArrayList<CapabilityStatementMessagingEventComponent>();
6088          this.event.add(t);
6089          return this;
6090        }
6091
6092        /**
6093         * @return The first repetition of repeating field {@link #event}, creating it if it does not already exist
6094         */
6095        public CapabilityStatementMessagingEventComponent getEventFirstRep() { 
6096          if (getEvent().isEmpty()) {
6097            addEvent();
6098          }
6099          return getEvent().get(0);
6100        }
6101
6102        protected void listChildren(List<Property> children) {
6103          super.listChildren(children);
6104          children.add(new Property("endpoint", "", "An endpoint (network accessible address) to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint));
6105          children.add(new Property("reliableCache", "unsignedInt", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, 1, reliableCache));
6106          children.add(new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.", 0, 1, documentation));
6107          children.add(new Property("supportedMessage", "", "References to message definitions for messages this system can send or receive.", 0, java.lang.Integer.MAX_VALUE, supportedMessage));
6108          children.add(new Property("event", "", "A description of the solution's support for an event at this end-point.", 0, java.lang.Integer.MAX_VALUE, event));
6109        }
6110
6111        @Override
6112        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6113          switch (_hash) {
6114          case 1741102485: /*endpoint*/  return new Property("endpoint", "", "An endpoint (network accessible address) to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint);
6115          case 897803608: /*reliableCache*/  return new Property("reliableCache", "unsignedInt", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, 1, reliableCache);
6116          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.", 0, 1, documentation);
6117          case -1805139079: /*supportedMessage*/  return new Property("supportedMessage", "", "References to message definitions for messages this system can send or receive.", 0, java.lang.Integer.MAX_VALUE, supportedMessage);
6118          case 96891546: /*event*/  return new Property("event", "", "A description of the solution's support for an event at this end-point.", 0, java.lang.Integer.MAX_VALUE, event);
6119          default: return super.getNamedProperty(_hash, _name, _checkValid);
6120          }
6121
6122        }
6123
6124      @Override
6125      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6126        switch (hash) {
6127        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // CapabilityStatementMessagingEndpointComponent
6128        case 897803608: /*reliableCache*/ return this.reliableCache == null ? new Base[0] : new Base[] {this.reliableCache}; // UnsignedIntType
6129        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
6130        case -1805139079: /*supportedMessage*/ return this.supportedMessage == null ? new Base[0] : this.supportedMessage.toArray(new Base[this.supportedMessage.size()]); // CapabilityStatementMessagingSupportedMessageComponent
6131        case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // CapabilityStatementMessagingEventComponent
6132        default: return super.getProperty(hash, name, checkValid);
6133        }
6134
6135      }
6136
6137      @Override
6138      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6139        switch (hash) {
6140        case 1741102485: // endpoint
6141          this.getEndpoint().add((CapabilityStatementMessagingEndpointComponent) value); // CapabilityStatementMessagingEndpointComponent
6142          return value;
6143        case 897803608: // reliableCache
6144          this.reliableCache = castToUnsignedInt(value); // UnsignedIntType
6145          return value;
6146        case 1587405498: // documentation
6147          this.documentation = castToString(value); // StringType
6148          return value;
6149        case -1805139079: // supportedMessage
6150          this.getSupportedMessage().add((CapabilityStatementMessagingSupportedMessageComponent) value); // CapabilityStatementMessagingSupportedMessageComponent
6151          return value;
6152        case 96891546: // event
6153          this.getEvent().add((CapabilityStatementMessagingEventComponent) value); // CapabilityStatementMessagingEventComponent
6154          return value;
6155        default: return super.setProperty(hash, name, value);
6156        }
6157
6158      }
6159
6160      @Override
6161      public Base setProperty(String name, Base value) throws FHIRException {
6162        if (name.equals("endpoint")) {
6163          this.getEndpoint().add((CapabilityStatementMessagingEndpointComponent) value);
6164        } else if (name.equals("reliableCache")) {
6165          this.reliableCache = castToUnsignedInt(value); // UnsignedIntType
6166        } else if (name.equals("documentation")) {
6167          this.documentation = castToString(value); // StringType
6168        } else if (name.equals("supportedMessage")) {
6169          this.getSupportedMessage().add((CapabilityStatementMessagingSupportedMessageComponent) value);
6170        } else if (name.equals("event")) {
6171          this.getEvent().add((CapabilityStatementMessagingEventComponent) value);
6172        } else
6173          return super.setProperty(name, value);
6174        return value;
6175      }
6176
6177      @Override
6178      public Base makeProperty(int hash, String name) throws FHIRException {
6179        switch (hash) {
6180        case 1741102485:  return addEndpoint(); 
6181        case 897803608:  return getReliableCacheElement();
6182        case 1587405498:  return getDocumentationElement();
6183        case -1805139079:  return addSupportedMessage(); 
6184        case 96891546:  return addEvent(); 
6185        default: return super.makeProperty(hash, name);
6186        }
6187
6188      }
6189
6190      @Override
6191      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6192        switch (hash) {
6193        case 1741102485: /*endpoint*/ return new String[] {};
6194        case 897803608: /*reliableCache*/ return new String[] {"unsignedInt"};
6195        case 1587405498: /*documentation*/ return new String[] {"string"};
6196        case -1805139079: /*supportedMessage*/ return new String[] {};
6197        case 96891546: /*event*/ return new String[] {};
6198        default: return super.getTypesForProperty(hash, name);
6199        }
6200
6201      }
6202
6203      @Override
6204      public Base addChild(String name) throws FHIRException {
6205        if (name.equals("endpoint")) {
6206          return addEndpoint();
6207        }
6208        else if (name.equals("reliableCache")) {
6209          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.reliableCache");
6210        }
6211        else if (name.equals("documentation")) {
6212          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
6213        }
6214        else if (name.equals("supportedMessage")) {
6215          return addSupportedMessage();
6216        }
6217        else if (name.equals("event")) {
6218          return addEvent();
6219        }
6220        else
6221          return super.addChild(name);
6222      }
6223
6224      public CapabilityStatementMessagingComponent copy() {
6225        CapabilityStatementMessagingComponent dst = new CapabilityStatementMessagingComponent();
6226        copyValues(dst);
6227        if (endpoint != null) {
6228          dst.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
6229          for (CapabilityStatementMessagingEndpointComponent i : endpoint)
6230            dst.endpoint.add(i.copy());
6231        };
6232        dst.reliableCache = reliableCache == null ? null : reliableCache.copy();
6233        dst.documentation = documentation == null ? null : documentation.copy();
6234        if (supportedMessage != null) {
6235          dst.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
6236          for (CapabilityStatementMessagingSupportedMessageComponent i : supportedMessage)
6237            dst.supportedMessage.add(i.copy());
6238        };
6239        if (event != null) {
6240          dst.event = new ArrayList<CapabilityStatementMessagingEventComponent>();
6241          for (CapabilityStatementMessagingEventComponent i : event)
6242            dst.event.add(i.copy());
6243        };
6244        return dst;
6245      }
6246
6247      @Override
6248      public boolean equalsDeep(Base other_) {
6249        if (!super.equalsDeep(other_))
6250          return false;
6251        if (!(other_ instanceof CapabilityStatementMessagingComponent))
6252          return false;
6253        CapabilityStatementMessagingComponent o = (CapabilityStatementMessagingComponent) other_;
6254        return compareDeep(endpoint, o.endpoint, true) && compareDeep(reliableCache, o.reliableCache, true)
6255           && compareDeep(documentation, o.documentation, true) && compareDeep(supportedMessage, o.supportedMessage, true)
6256           && compareDeep(event, o.event, true);
6257      }
6258
6259      @Override
6260      public boolean equalsShallow(Base other_) {
6261        if (!super.equalsShallow(other_))
6262          return false;
6263        if (!(other_ instanceof CapabilityStatementMessagingComponent))
6264          return false;
6265        CapabilityStatementMessagingComponent o = (CapabilityStatementMessagingComponent) other_;
6266        return compareValues(reliableCache, o.reliableCache, true) && compareValues(documentation, o.documentation, true)
6267          ;
6268      }
6269
6270      public boolean isEmpty() {
6271        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(endpoint, reliableCache, documentation
6272          , supportedMessage, event);
6273      }
6274
6275  public String fhirType() {
6276    return "CapabilityStatement.messaging";
6277
6278  }
6279
6280  }
6281
6282    @Block()
6283    public static class CapabilityStatementMessagingEndpointComponent extends BackboneElement implements IBaseBackboneElement {
6284        /**
6285         * A list of the messaging transport protocol(s) identifiers, supported by this endpoint.
6286         */
6287        @Child(name = "protocol", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
6288        @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." )
6289        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-transport")
6290        protected Coding protocol;
6291
6292        /**
6293         * The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.
6294         */
6295        @Child(name = "address", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false)
6296        @Description(shortDefinition="Network address or identifier of the end-point", formalDefinition="The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier." )
6297        protected UriType address;
6298
6299        private static final long serialVersionUID = 1294656428L;
6300
6301    /**
6302     * Constructor
6303     */
6304      public CapabilityStatementMessagingEndpointComponent() {
6305        super();
6306      }
6307
6308    /**
6309     * Constructor
6310     */
6311      public CapabilityStatementMessagingEndpointComponent(Coding protocol, UriType address) {
6312        super();
6313        this.protocol = protocol;
6314        this.address = address;
6315      }
6316
6317        /**
6318         * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.)
6319         */
6320        public Coding getProtocol() { 
6321          if (this.protocol == null)
6322            if (Configuration.errorOnAutoCreate())
6323              throw new Error("Attempt to auto-create CapabilityStatementMessagingEndpointComponent.protocol");
6324            else if (Configuration.doAutoCreate())
6325              this.protocol = new Coding(); // cc
6326          return this.protocol;
6327        }
6328
6329        public boolean hasProtocol() { 
6330          return this.protocol != null && !this.protocol.isEmpty();
6331        }
6332
6333        /**
6334         * @param value {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.)
6335         */
6336        public CapabilityStatementMessagingEndpointComponent setProtocol(Coding value)  { 
6337          this.protocol = value;
6338          return this;
6339        }
6340
6341        /**
6342         * @return {@link #address} (The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value
6343         */
6344        public UriType getAddressElement() { 
6345          if (this.address == null)
6346            if (Configuration.errorOnAutoCreate())
6347              throw new Error("Attempt to auto-create CapabilityStatementMessagingEndpointComponent.address");
6348            else if (Configuration.doAutoCreate())
6349              this.address = new UriType(); // bb
6350          return this.address;
6351        }
6352
6353        public boolean hasAddressElement() { 
6354          return this.address != null && !this.address.isEmpty();
6355        }
6356
6357        public boolean hasAddress() { 
6358          return this.address != null && !this.address.isEmpty();
6359        }
6360
6361        /**
6362         * @param value {@link #address} (The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value
6363         */
6364        public CapabilityStatementMessagingEndpointComponent setAddressElement(UriType value) { 
6365          this.address = value;
6366          return this;
6367        }
6368
6369        /**
6370         * @return The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.
6371         */
6372        public String getAddress() { 
6373          return this.address == null ? null : this.address.getValue();
6374        }
6375
6376        /**
6377         * @param value The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.
6378         */
6379        public CapabilityStatementMessagingEndpointComponent setAddress(String value) { 
6380            if (this.address == null)
6381              this.address = new UriType();
6382            this.address.setValue(value);
6383          return this;
6384        }
6385
6386        protected void listChildren(List<Property> children) {
6387          super.listChildren(children);
6388          children.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, 1, protocol));
6389          children.add(new Property("address", "uri", "The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.", 0, 1, address));
6390        }
6391
6392        @Override
6393        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6394          switch (_hash) {
6395          case -989163880: /*protocol*/  return new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, 1, protocol);
6396          case -1147692044: /*address*/  return new Property("address", "uri", "The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.", 0, 1, address);
6397          default: return super.getNamedProperty(_hash, _name, _checkValid);
6398          }
6399
6400        }
6401
6402      @Override
6403      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6404        switch (hash) {
6405        case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // Coding
6406        case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // UriType
6407        default: return super.getProperty(hash, name, checkValid);
6408        }
6409
6410      }
6411
6412      @Override
6413      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6414        switch (hash) {
6415        case -989163880: // protocol
6416          this.protocol = castToCoding(value); // Coding
6417          return value;
6418        case -1147692044: // address
6419          this.address = castToUri(value); // UriType
6420          return value;
6421        default: return super.setProperty(hash, name, value);
6422        }
6423
6424      }
6425
6426      @Override
6427      public Base setProperty(String name, Base value) throws FHIRException {
6428        if (name.equals("protocol")) {
6429          this.protocol = castToCoding(value); // Coding
6430        } else if (name.equals("address")) {
6431          this.address = castToUri(value); // UriType
6432        } else
6433          return super.setProperty(name, value);
6434        return value;
6435      }
6436
6437      @Override
6438      public Base makeProperty(int hash, String name) throws FHIRException {
6439        switch (hash) {
6440        case -989163880:  return getProtocol(); 
6441        case -1147692044:  return getAddressElement();
6442        default: return super.makeProperty(hash, name);
6443        }
6444
6445      }
6446
6447      @Override
6448      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6449        switch (hash) {
6450        case -989163880: /*protocol*/ return new String[] {"Coding"};
6451        case -1147692044: /*address*/ return new String[] {"uri"};
6452        default: return super.getTypesForProperty(hash, name);
6453        }
6454
6455      }
6456
6457      @Override
6458      public Base addChild(String name) throws FHIRException {
6459        if (name.equals("protocol")) {
6460          this.protocol = new Coding();
6461          return this.protocol;
6462        }
6463        else if (name.equals("address")) {
6464          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.address");
6465        }
6466        else
6467          return super.addChild(name);
6468      }
6469
6470      public CapabilityStatementMessagingEndpointComponent copy() {
6471        CapabilityStatementMessagingEndpointComponent dst = new CapabilityStatementMessagingEndpointComponent();
6472        copyValues(dst);
6473        dst.protocol = protocol == null ? null : protocol.copy();
6474        dst.address = address == null ? null : address.copy();
6475        return dst;
6476      }
6477
6478      @Override
6479      public boolean equalsDeep(Base other_) {
6480        if (!super.equalsDeep(other_))
6481          return false;
6482        if (!(other_ instanceof CapabilityStatementMessagingEndpointComponent))
6483          return false;
6484        CapabilityStatementMessagingEndpointComponent o = (CapabilityStatementMessagingEndpointComponent) other_;
6485        return compareDeep(protocol, o.protocol, true) && compareDeep(address, o.address, true);
6486      }
6487
6488      @Override
6489      public boolean equalsShallow(Base other_) {
6490        if (!super.equalsShallow(other_))
6491          return false;
6492        if (!(other_ instanceof CapabilityStatementMessagingEndpointComponent))
6493          return false;
6494        CapabilityStatementMessagingEndpointComponent o = (CapabilityStatementMessagingEndpointComponent) other_;
6495        return compareValues(address, o.address, true);
6496      }
6497
6498      public boolean isEmpty() {
6499        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(protocol, address);
6500      }
6501
6502  public String fhirType() {
6503    return "CapabilityStatement.messaging.endpoint";
6504
6505  }
6506
6507  }
6508
6509    @Block()
6510    public static class CapabilityStatementMessagingSupportedMessageComponent extends BackboneElement implements IBaseBackboneElement {
6511        /**
6512         * The mode of this event declaration - whether application is sender or receiver.
6513         */
6514        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
6515        @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." )
6516        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-capability-mode")
6517        protected Enumeration<EventCapabilityMode> mode;
6518
6519        /**
6520         * Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.
6521         */
6522        @Child(name = "definition", type = {MessageDefinition.class}, order=2, min=1, max=1, modifier=false, summary=true)
6523        @Description(shortDefinition="Message supported by this system", formalDefinition="Points to a message definition that identifies the messaging event, message structure, allowed responses, etc." )
6524        protected Reference definition;
6525
6526        /**
6527         * The actual object that is the target of the reference (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6528         */
6529        protected MessageDefinition definitionTarget;
6530
6531        private static final long serialVersionUID = -741523869L;
6532
6533    /**
6534     * Constructor
6535     */
6536      public CapabilityStatementMessagingSupportedMessageComponent() {
6537        super();
6538      }
6539
6540    /**
6541     * Constructor
6542     */
6543      public CapabilityStatementMessagingSupportedMessageComponent(Enumeration<EventCapabilityMode> mode, Reference definition) {
6544        super();
6545        this.mode = mode;
6546        this.definition = definition;
6547      }
6548
6549        /**
6550         * @return {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
6551         */
6552        public Enumeration<EventCapabilityMode> getModeElement() { 
6553          if (this.mode == null)
6554            if (Configuration.errorOnAutoCreate())
6555              throw new Error("Attempt to auto-create CapabilityStatementMessagingSupportedMessageComponent.mode");
6556            else if (Configuration.doAutoCreate())
6557              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory()); // bb
6558          return this.mode;
6559        }
6560
6561        public boolean hasModeElement() { 
6562          return this.mode != null && !this.mode.isEmpty();
6563        }
6564
6565        public boolean hasMode() { 
6566          return this.mode != null && !this.mode.isEmpty();
6567        }
6568
6569        /**
6570         * @param value {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
6571         */
6572        public CapabilityStatementMessagingSupportedMessageComponent setModeElement(Enumeration<EventCapabilityMode> value) { 
6573          this.mode = value;
6574          return this;
6575        }
6576
6577        /**
6578         * @return The mode of this event declaration - whether application is sender or receiver.
6579         */
6580        public EventCapabilityMode getMode() { 
6581          return this.mode == null ? null : this.mode.getValue();
6582        }
6583
6584        /**
6585         * @param value The mode of this event declaration - whether application is sender or receiver.
6586         */
6587        public CapabilityStatementMessagingSupportedMessageComponent setMode(EventCapabilityMode value) { 
6588            if (this.mode == null)
6589              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory());
6590            this.mode.setValue(value);
6591          return this;
6592        }
6593
6594        /**
6595         * @return {@link #definition} (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6596         */
6597        public Reference getDefinition() { 
6598          if (this.definition == null)
6599            if (Configuration.errorOnAutoCreate())
6600              throw new Error("Attempt to auto-create CapabilityStatementMessagingSupportedMessageComponent.definition");
6601            else if (Configuration.doAutoCreate())
6602              this.definition = new Reference(); // cc
6603          return this.definition;
6604        }
6605
6606        public boolean hasDefinition() { 
6607          return this.definition != null && !this.definition.isEmpty();
6608        }
6609
6610        /**
6611         * @param value {@link #definition} (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6612         */
6613        public CapabilityStatementMessagingSupportedMessageComponent setDefinition(Reference value)  { 
6614          this.definition = value;
6615          return this;
6616        }
6617
6618        /**
6619         * @return {@link #definition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6620         */
6621        public MessageDefinition getDefinitionTarget() { 
6622          if (this.definitionTarget == null)
6623            if (Configuration.errorOnAutoCreate())
6624              throw new Error("Attempt to auto-create CapabilityStatementMessagingSupportedMessageComponent.definition");
6625            else if (Configuration.doAutoCreate())
6626              this.definitionTarget = new MessageDefinition(); // aa
6627          return this.definitionTarget;
6628        }
6629
6630        /**
6631         * @param value {@link #definition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6632         */
6633        public CapabilityStatementMessagingSupportedMessageComponent setDefinitionTarget(MessageDefinition value) { 
6634          this.definitionTarget = value;
6635          return this;
6636        }
6637
6638        protected void listChildren(List<Property> children) {
6639          super.listChildren(children);
6640          children.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, 1, mode));
6641          children.add(new Property("definition", "Reference(MessageDefinition)", "Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.", 0, 1, definition));
6642        }
6643
6644        @Override
6645        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6646          switch (_hash) {
6647          case 3357091: /*mode*/  return new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, 1, mode);
6648          case -1014418093: /*definition*/  return new Property("definition", "Reference(MessageDefinition)", "Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.", 0, 1, definition);
6649          default: return super.getNamedProperty(_hash, _name, _checkValid);
6650          }
6651
6652        }
6653
6654      @Override
6655      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6656        switch (hash) {
6657        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<EventCapabilityMode>
6658        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference
6659        default: return super.getProperty(hash, name, checkValid);
6660        }
6661
6662      }
6663
6664      @Override
6665      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6666        switch (hash) {
6667        case 3357091: // mode
6668          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
6669          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
6670          return value;
6671        case -1014418093: // definition
6672          this.definition = castToReference(value); // Reference
6673          return value;
6674        default: return super.setProperty(hash, name, value);
6675        }
6676
6677      }
6678
6679      @Override
6680      public Base setProperty(String name, Base value) throws FHIRException {
6681        if (name.equals("mode")) {
6682          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
6683          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
6684        } else if (name.equals("definition")) {
6685          this.definition = castToReference(value); // Reference
6686        } else
6687          return super.setProperty(name, value);
6688        return value;
6689      }
6690
6691      @Override
6692      public Base makeProperty(int hash, String name) throws FHIRException {
6693        switch (hash) {
6694        case 3357091:  return getModeElement();
6695        case -1014418093:  return getDefinition(); 
6696        default: return super.makeProperty(hash, name);
6697        }
6698
6699      }
6700
6701      @Override
6702      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6703        switch (hash) {
6704        case 3357091: /*mode*/ return new String[] {"code"};
6705        case -1014418093: /*definition*/ return new String[] {"Reference"};
6706        default: return super.getTypesForProperty(hash, name);
6707        }
6708
6709      }
6710
6711      @Override
6712      public Base addChild(String name) throws FHIRException {
6713        if (name.equals("mode")) {
6714          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
6715        }
6716        else if (name.equals("definition")) {
6717          this.definition = new Reference();
6718          return this.definition;
6719        }
6720        else
6721          return super.addChild(name);
6722      }
6723
6724      public CapabilityStatementMessagingSupportedMessageComponent copy() {
6725        CapabilityStatementMessagingSupportedMessageComponent dst = new CapabilityStatementMessagingSupportedMessageComponent();
6726        copyValues(dst);
6727        dst.mode = mode == null ? null : mode.copy();
6728        dst.definition = definition == null ? null : definition.copy();
6729        return dst;
6730      }
6731
6732      @Override
6733      public boolean equalsDeep(Base other_) {
6734        if (!super.equalsDeep(other_))
6735          return false;
6736        if (!(other_ instanceof CapabilityStatementMessagingSupportedMessageComponent))
6737          return false;
6738        CapabilityStatementMessagingSupportedMessageComponent o = (CapabilityStatementMessagingSupportedMessageComponent) other_;
6739        return compareDeep(mode, o.mode, true) && compareDeep(definition, o.definition, true);
6740      }
6741
6742      @Override
6743      public boolean equalsShallow(Base other_) {
6744        if (!super.equalsShallow(other_))
6745          return false;
6746        if (!(other_ instanceof CapabilityStatementMessagingSupportedMessageComponent))
6747          return false;
6748        CapabilityStatementMessagingSupportedMessageComponent o = (CapabilityStatementMessagingSupportedMessageComponent) other_;
6749        return compareValues(mode, o.mode, true);
6750      }
6751
6752      public boolean isEmpty() {
6753        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, definition);
6754      }
6755
6756  public String fhirType() {
6757    return "CapabilityStatement.messaging.supportedMessage";
6758
6759  }
6760
6761  }
6762
6763    @Block()
6764    public static class CapabilityStatementMessagingEventComponent extends BackboneElement implements IBaseBackboneElement {
6765        /**
6766         * A coded identifier of a supported messaging event.
6767         */
6768        @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
6769        @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." )
6770        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-events")
6771        protected Coding code;
6772
6773        /**
6774         * The impact of the content of the message.
6775         */
6776        @Child(name = "category", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6777        @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." )
6778        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-significance-category")
6779        protected Enumeration<MessageSignificanceCategory> category;
6780
6781        /**
6782         * The mode of this event declaration - whether an application is a sender or receiver.
6783         */
6784        @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false)
6785        @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether an application is a sender or receiver." )
6786        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-capability-mode")
6787        protected Enumeration<EventCapabilityMode> mode;
6788
6789        /**
6790         * A resource associated with the event.  This is the resource that defines the event.
6791         */
6792        @Child(name = "focus", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false)
6793        @Description(shortDefinition="Resource that's focus of message", formalDefinition="A resource associated with the event.  This is the resource that defines the event." )
6794        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
6795        protected CodeType focus;
6796
6797        /**
6798         * Information about the request for this event.
6799         */
6800        @Child(name = "request", type = {StructureDefinition.class}, order=5, min=1, max=1, modifier=false, summary=true)
6801        @Description(shortDefinition="Profile that describes the request", formalDefinition="Information about the request for this event." )
6802        protected Reference request;
6803
6804        /**
6805         * The actual object that is the target of the reference (Information about the request for this event.)
6806         */
6807        protected StructureDefinition requestTarget;
6808
6809        /**
6810         * Information about the response for this event.
6811         */
6812        @Child(name = "response", type = {StructureDefinition.class}, order=6, min=1, max=1, modifier=false, summary=true)
6813        @Description(shortDefinition="Profile that describes the response", formalDefinition="Information about the response for this event." )
6814        protected Reference response;
6815
6816        /**
6817         * The actual object that is the target of the reference (Information about the response for this event.)
6818         */
6819        protected StructureDefinition responseTarget;
6820
6821        /**
6822         * Guidance on how this event is handled, such as internal system trigger points, business rules, etc.
6823         */
6824        @Child(name = "documentation", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
6825        @Description(shortDefinition="Endpoint-specific event documentation", formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." )
6826        protected StringType documentation;
6827
6828        private static final long serialVersionUID = -491306017L;
6829
6830    /**
6831     * Constructor
6832     */
6833      public CapabilityStatementMessagingEventComponent() {
6834        super();
6835      }
6836
6837    /**
6838     * Constructor
6839     */
6840      public CapabilityStatementMessagingEventComponent(Coding code, Enumeration<EventCapabilityMode> mode, CodeType focus, Reference request, Reference response) {
6841        super();
6842        this.code = code;
6843        this.mode = mode;
6844        this.focus = focus;
6845        this.request = request;
6846        this.response = response;
6847      }
6848
6849        /**
6850         * @return {@link #code} (A coded identifier of a supported messaging event.)
6851         */
6852        public Coding getCode() { 
6853          if (this.code == null)
6854            if (Configuration.errorOnAutoCreate())
6855              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.code");
6856            else if (Configuration.doAutoCreate())
6857              this.code = new Coding(); // cc
6858          return this.code;
6859        }
6860
6861        public boolean hasCode() { 
6862          return this.code != null && !this.code.isEmpty();
6863        }
6864
6865        /**
6866         * @param value {@link #code} (A coded identifier of a supported messaging event.)
6867         */
6868        public CapabilityStatementMessagingEventComponent setCode(Coding value)  { 
6869          this.code = value;
6870          return this;
6871        }
6872
6873        /**
6874         * @return {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value
6875         */
6876        public Enumeration<MessageSignificanceCategory> getCategoryElement() { 
6877          if (this.category == null)
6878            if (Configuration.errorOnAutoCreate())
6879              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.category");
6880            else if (Configuration.doAutoCreate())
6881              this.category = new Enumeration<MessageSignificanceCategory>(new MessageSignificanceCategoryEnumFactory()); // bb
6882          return this.category;
6883        }
6884
6885        public boolean hasCategoryElement() { 
6886          return this.category != null && !this.category.isEmpty();
6887        }
6888
6889        public boolean hasCategory() { 
6890          return this.category != null && !this.category.isEmpty();
6891        }
6892
6893        /**
6894         * @param value {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value
6895         */
6896        public CapabilityStatementMessagingEventComponent setCategoryElement(Enumeration<MessageSignificanceCategory> value) { 
6897          this.category = value;
6898          return this;
6899        }
6900
6901        /**
6902         * @return The impact of the content of the message.
6903         */
6904        public MessageSignificanceCategory getCategory() { 
6905          return this.category == null ? null : this.category.getValue();
6906        }
6907
6908        /**
6909         * @param value The impact of the content of the message.
6910         */
6911        public CapabilityStatementMessagingEventComponent setCategory(MessageSignificanceCategory value) { 
6912          if (value == null)
6913            this.category = null;
6914          else {
6915            if (this.category == null)
6916              this.category = new Enumeration<MessageSignificanceCategory>(new MessageSignificanceCategoryEnumFactory());
6917            this.category.setValue(value);
6918          }
6919          return this;
6920        }
6921
6922        /**
6923         * @return {@link #mode} (The mode of this event declaration - whether an application is a sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
6924         */
6925        public Enumeration<EventCapabilityMode> getModeElement() { 
6926          if (this.mode == null)
6927            if (Configuration.errorOnAutoCreate())
6928              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.mode");
6929            else if (Configuration.doAutoCreate())
6930              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory()); // bb
6931          return this.mode;
6932        }
6933
6934        public boolean hasModeElement() { 
6935          return this.mode != null && !this.mode.isEmpty();
6936        }
6937
6938        public boolean hasMode() { 
6939          return this.mode != null && !this.mode.isEmpty();
6940        }
6941
6942        /**
6943         * @param value {@link #mode} (The mode of this event declaration - whether an application is a sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
6944         */
6945        public CapabilityStatementMessagingEventComponent setModeElement(Enumeration<EventCapabilityMode> value) { 
6946          this.mode = value;
6947          return this;
6948        }
6949
6950        /**
6951         * @return The mode of this event declaration - whether an application is a sender or receiver.
6952         */
6953        public EventCapabilityMode getMode() { 
6954          return this.mode == null ? null : this.mode.getValue();
6955        }
6956
6957        /**
6958         * @param value The mode of this event declaration - whether an application is a sender or receiver.
6959         */
6960        public CapabilityStatementMessagingEventComponent setMode(EventCapabilityMode value) { 
6961            if (this.mode == null)
6962              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory());
6963            this.mode.setValue(value);
6964          return this;
6965        }
6966
6967        /**
6968         * @return {@link #focus} (A resource associated with the event.  This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value
6969         */
6970        public CodeType getFocusElement() { 
6971          if (this.focus == null)
6972            if (Configuration.errorOnAutoCreate())
6973              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.focus");
6974            else if (Configuration.doAutoCreate())
6975              this.focus = new CodeType(); // bb
6976          return this.focus;
6977        }
6978
6979        public boolean hasFocusElement() { 
6980          return this.focus != null && !this.focus.isEmpty();
6981        }
6982
6983        public boolean hasFocus() { 
6984          return this.focus != null && !this.focus.isEmpty();
6985        }
6986
6987        /**
6988         * @param value {@link #focus} (A resource associated with the event.  This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value
6989         */
6990        public CapabilityStatementMessagingEventComponent setFocusElement(CodeType value) { 
6991          this.focus = value;
6992          return this;
6993        }
6994
6995        /**
6996         * @return A resource associated with the event.  This is the resource that defines the event.
6997         */
6998        public String getFocus() { 
6999          return this.focus == null ? null : this.focus.getValue();
7000        }
7001
7002        /**
7003         * @param value A resource associated with the event.  This is the resource that defines the event.
7004         */
7005        public CapabilityStatementMessagingEventComponent setFocus(String value) { 
7006            if (this.focus == null)
7007              this.focus = new CodeType();
7008            this.focus.setValue(value);
7009          return this;
7010        }
7011
7012        /**
7013         * @return {@link #request} (Information about the request for this event.)
7014         */
7015        public Reference getRequest() { 
7016          if (this.request == null)
7017            if (Configuration.errorOnAutoCreate())
7018              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.request");
7019            else if (Configuration.doAutoCreate())
7020              this.request = new Reference(); // cc
7021          return this.request;
7022        }
7023
7024        public boolean hasRequest() { 
7025          return this.request != null && !this.request.isEmpty();
7026        }
7027
7028        /**
7029         * @param value {@link #request} (Information about the request for this event.)
7030         */
7031        public CapabilityStatementMessagingEventComponent setRequest(Reference value)  { 
7032          this.request = value;
7033          return this;
7034        }
7035
7036        /**
7037         * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information about the request for this event.)
7038         */
7039        public StructureDefinition getRequestTarget() { 
7040          if (this.requestTarget == null)
7041            if (Configuration.errorOnAutoCreate())
7042              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.request");
7043            else if (Configuration.doAutoCreate())
7044              this.requestTarget = new StructureDefinition(); // aa
7045          return this.requestTarget;
7046        }
7047
7048        /**
7049         * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information about the request for this event.)
7050         */
7051        public CapabilityStatementMessagingEventComponent setRequestTarget(StructureDefinition value) { 
7052          this.requestTarget = value;
7053          return this;
7054        }
7055
7056        /**
7057         * @return {@link #response} (Information about the response for this event.)
7058         */
7059        public Reference getResponse() { 
7060          if (this.response == null)
7061            if (Configuration.errorOnAutoCreate())
7062              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.response");
7063            else if (Configuration.doAutoCreate())
7064              this.response = new Reference(); // cc
7065          return this.response;
7066        }
7067
7068        public boolean hasResponse() { 
7069          return this.response != null && !this.response.isEmpty();
7070        }
7071
7072        /**
7073         * @param value {@link #response} (Information about the response for this event.)
7074         */
7075        public CapabilityStatementMessagingEventComponent setResponse(Reference value)  { 
7076          this.response = value;
7077          return this;
7078        }
7079
7080        /**
7081         * @return {@link #response} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information about the response for this event.)
7082         */
7083        public StructureDefinition getResponseTarget() { 
7084          if (this.responseTarget == null)
7085            if (Configuration.errorOnAutoCreate())
7086              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.response");
7087            else if (Configuration.doAutoCreate())
7088              this.responseTarget = new StructureDefinition(); // aa
7089          return this.responseTarget;
7090        }
7091
7092        /**
7093         * @param value {@link #response} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information about the response for this event.)
7094         */
7095        public CapabilityStatementMessagingEventComponent setResponseTarget(StructureDefinition value) { 
7096          this.responseTarget = value;
7097          return this;
7098        }
7099
7100        /**
7101         * @return {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
7102         */
7103        public StringType getDocumentationElement() { 
7104          if (this.documentation == null)
7105            if (Configuration.errorOnAutoCreate())
7106              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.documentation");
7107            else if (Configuration.doAutoCreate())
7108              this.documentation = new StringType(); // bb
7109          return this.documentation;
7110        }
7111
7112        public boolean hasDocumentationElement() { 
7113          return this.documentation != null && !this.documentation.isEmpty();
7114        }
7115
7116        public boolean hasDocumentation() { 
7117          return this.documentation != null && !this.documentation.isEmpty();
7118        }
7119
7120        /**
7121         * @param value {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
7122         */
7123        public CapabilityStatementMessagingEventComponent setDocumentationElement(StringType value) { 
7124          this.documentation = value;
7125          return this;
7126        }
7127
7128        /**
7129         * @return Guidance on how this event is handled, such as internal system trigger points, business rules, etc.
7130         */
7131        public String getDocumentation() { 
7132          return this.documentation == null ? null : this.documentation.getValue();
7133        }
7134
7135        /**
7136         * @param value Guidance on how this event is handled, such as internal system trigger points, business rules, etc.
7137         */
7138        public CapabilityStatementMessagingEventComponent setDocumentation(String value) { 
7139          if (Utilities.noString(value))
7140            this.documentation = null;
7141          else {
7142            if (this.documentation == null)
7143              this.documentation = new StringType();
7144            this.documentation.setValue(value);
7145          }
7146          return this;
7147        }
7148
7149        protected void listChildren(List<Property> children) {
7150          super.listChildren(children);
7151          children.add(new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, 1, code));
7152          children.add(new Property("category", "code", "The impact of the content of the message.", 0, 1, category));
7153          children.add(new Property("mode", "code", "The mode of this event declaration - whether an application is a sender or receiver.", 0, 1, mode));
7154          children.add(new Property("focus", "code", "A resource associated with the event.  This is the resource that defines the event.", 0, 1, focus));
7155          children.add(new Property("request", "Reference(StructureDefinition)", "Information about the request for this event.", 0, 1, request));
7156          children.add(new Property("response", "Reference(StructureDefinition)", "Information about the response for this event.", 0, 1, response));
7157          children.add(new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, 1, documentation));
7158        }
7159
7160        @Override
7161        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7162          switch (_hash) {
7163          case 3059181: /*code*/  return new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, 1, code);
7164          case 50511102: /*category*/  return new Property("category", "code", "The impact of the content of the message.", 0, 1, category);
7165          case 3357091: /*mode*/  return new Property("mode", "code", "The mode of this event declaration - whether an application is a sender or receiver.", 0, 1, mode);
7166          case 97604824: /*focus*/  return new Property("focus", "code", "A resource associated with the event.  This is the resource that defines the event.", 0, 1, focus);
7167          case 1095692943: /*request*/  return new Property("request", "Reference(StructureDefinition)", "Information about the request for this event.", 0, 1, request);
7168          case -340323263: /*response*/  return new Property("response", "Reference(StructureDefinition)", "Information about the response for this event.", 0, 1, response);
7169          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, 1, documentation);
7170          default: return super.getNamedProperty(_hash, _name, _checkValid);
7171          }
7172
7173        }
7174
7175      @Override
7176      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7177        switch (hash) {
7178        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding
7179        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration<MessageSignificanceCategory>
7180        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<EventCapabilityMode>
7181        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // CodeType
7182        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
7183        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference
7184        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
7185        default: return super.getProperty(hash, name, checkValid);
7186        }
7187
7188      }
7189
7190      @Override
7191      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7192        switch (hash) {
7193        case 3059181: // code
7194          this.code = castToCoding(value); // Coding
7195          return value;
7196        case 50511102: // category
7197          value = new MessageSignificanceCategoryEnumFactory().fromType(castToCode(value));
7198          this.category = (Enumeration) value; // Enumeration<MessageSignificanceCategory>
7199          return value;
7200        case 3357091: // mode
7201          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
7202          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
7203          return value;
7204        case 97604824: // focus
7205          this.focus = castToCode(value); // CodeType
7206          return value;
7207        case 1095692943: // request
7208          this.request = castToReference(value); // Reference
7209          return value;
7210        case -340323263: // response
7211          this.response = castToReference(value); // Reference
7212          return value;
7213        case 1587405498: // documentation
7214          this.documentation = castToString(value); // StringType
7215          return value;
7216        default: return super.setProperty(hash, name, value);
7217        }
7218
7219      }
7220
7221      @Override
7222      public Base setProperty(String name, Base value) throws FHIRException {
7223        if (name.equals("code")) {
7224          this.code = castToCoding(value); // Coding
7225        } else if (name.equals("category")) {
7226          value = new MessageSignificanceCategoryEnumFactory().fromType(castToCode(value));
7227          this.category = (Enumeration) value; // Enumeration<MessageSignificanceCategory>
7228        } else if (name.equals("mode")) {
7229          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
7230          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
7231        } else if (name.equals("focus")) {
7232          this.focus = castToCode(value); // CodeType
7233        } else if (name.equals("request")) {
7234          this.request = castToReference(value); // Reference
7235        } else if (name.equals("response")) {
7236          this.response = castToReference(value); // Reference
7237        } else if (name.equals("documentation")) {
7238          this.documentation = castToString(value); // StringType
7239        } else
7240          return super.setProperty(name, value);
7241        return value;
7242      }
7243
7244      @Override
7245      public Base makeProperty(int hash, String name) throws FHIRException {
7246        switch (hash) {
7247        case 3059181:  return getCode(); 
7248        case 50511102:  return getCategoryElement();
7249        case 3357091:  return getModeElement();
7250        case 97604824:  return getFocusElement();
7251        case 1095692943:  return getRequest(); 
7252        case -340323263:  return getResponse(); 
7253        case 1587405498:  return getDocumentationElement();
7254        default: return super.makeProperty(hash, name);
7255        }
7256
7257      }
7258
7259      @Override
7260      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7261        switch (hash) {
7262        case 3059181: /*code*/ return new String[] {"Coding"};
7263        case 50511102: /*category*/ return new String[] {"code"};
7264        case 3357091: /*mode*/ return new String[] {"code"};
7265        case 97604824: /*focus*/ return new String[] {"code"};
7266        case 1095692943: /*request*/ return new String[] {"Reference"};
7267        case -340323263: /*response*/ return new String[] {"Reference"};
7268        case 1587405498: /*documentation*/ return new String[] {"string"};
7269        default: return super.getTypesForProperty(hash, name);
7270        }
7271
7272      }
7273
7274      @Override
7275      public Base addChild(String name) throws FHIRException {
7276        if (name.equals("code")) {
7277          this.code = new Coding();
7278          return this.code;
7279        }
7280        else if (name.equals("category")) {
7281          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.category");
7282        }
7283        else if (name.equals("mode")) {
7284          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
7285        }
7286        else if (name.equals("focus")) {
7287          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.focus");
7288        }
7289        else if (name.equals("request")) {
7290          this.request = new Reference();
7291          return this.request;
7292        }
7293        else if (name.equals("response")) {
7294          this.response = new Reference();
7295          return this.response;
7296        }
7297        else if (name.equals("documentation")) {
7298          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
7299        }
7300        else
7301          return super.addChild(name);
7302      }
7303
7304      public CapabilityStatementMessagingEventComponent copy() {
7305        CapabilityStatementMessagingEventComponent dst = new CapabilityStatementMessagingEventComponent();
7306        copyValues(dst);
7307        dst.code = code == null ? null : code.copy();
7308        dst.category = category == null ? null : category.copy();
7309        dst.mode = mode == null ? null : mode.copy();
7310        dst.focus = focus == null ? null : focus.copy();
7311        dst.request = request == null ? null : request.copy();
7312        dst.response = response == null ? null : response.copy();
7313        dst.documentation = documentation == null ? null : documentation.copy();
7314        return dst;
7315      }
7316
7317      @Override
7318      public boolean equalsDeep(Base other_) {
7319        if (!super.equalsDeep(other_))
7320          return false;
7321        if (!(other_ instanceof CapabilityStatementMessagingEventComponent))
7322          return false;
7323        CapabilityStatementMessagingEventComponent o = (CapabilityStatementMessagingEventComponent) other_;
7324        return compareDeep(code, o.code, true) && compareDeep(category, o.category, true) && compareDeep(mode, o.mode, true)
7325           && compareDeep(focus, o.focus, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true)
7326           && compareDeep(documentation, o.documentation, true);
7327      }
7328
7329      @Override
7330      public boolean equalsShallow(Base other_) {
7331        if (!super.equalsShallow(other_))
7332          return false;
7333        if (!(other_ instanceof CapabilityStatementMessagingEventComponent))
7334          return false;
7335        CapabilityStatementMessagingEventComponent o = (CapabilityStatementMessagingEventComponent) other_;
7336        return compareValues(category, o.category, true) && compareValues(mode, o.mode, true) && compareValues(focus, o.focus, true)
7337           && compareValues(documentation, o.documentation, true);
7338      }
7339
7340      public boolean isEmpty() {
7341        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, category, mode, focus
7342          , request, response, documentation);
7343      }
7344
7345  public String fhirType() {
7346    return "CapabilityStatement.messaging.event";
7347
7348  }
7349
7350  }
7351
7352    @Block()
7353    public static class CapabilityStatementDocumentComponent extends BackboneElement implements IBaseBackboneElement {
7354        /**
7355         * Mode of this document declaration - whether an application is a producer or consumer.
7356         */
7357        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
7358        @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether an application is a producer or consumer." )
7359        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/document-mode")
7360        protected Enumeration<DocumentMode> mode;
7361
7362        /**
7363         * 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.
7364         */
7365        @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
7366        @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." )
7367        protected StringType documentation;
7368
7369        /**
7370         * A constraint on a resource used in the document.
7371         */
7372        @Child(name = "profile", type = {StructureDefinition.class}, order=3, min=1, max=1, modifier=false, summary=true)
7373        @Description(shortDefinition="Constraint on a resource used in the document", formalDefinition="A constraint on a resource used in the document." )
7374        protected Reference profile;
7375
7376        /**
7377         * The actual object that is the target of the reference (A constraint on a resource used in the document.)
7378         */
7379        protected StructureDefinition profileTarget;
7380
7381        private static final long serialVersionUID = -1059555053L;
7382
7383    /**
7384     * Constructor
7385     */
7386      public CapabilityStatementDocumentComponent() {
7387        super();
7388      }
7389
7390    /**
7391     * Constructor
7392     */
7393      public CapabilityStatementDocumentComponent(Enumeration<DocumentMode> mode, Reference profile) {
7394        super();
7395        this.mode = mode;
7396        this.profile = profile;
7397      }
7398
7399        /**
7400         * @return {@link #mode} (Mode of this document declaration - whether an application is a producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
7401         */
7402        public Enumeration<DocumentMode> getModeElement() { 
7403          if (this.mode == null)
7404            if (Configuration.errorOnAutoCreate())
7405              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.mode");
7406            else if (Configuration.doAutoCreate())
7407              this.mode = new Enumeration<DocumentMode>(new DocumentModeEnumFactory()); // bb
7408          return this.mode;
7409        }
7410
7411        public boolean hasModeElement() { 
7412          return this.mode != null && !this.mode.isEmpty();
7413        }
7414
7415        public boolean hasMode() { 
7416          return this.mode != null && !this.mode.isEmpty();
7417        }
7418
7419        /**
7420         * @param value {@link #mode} (Mode of this document declaration - whether an application is a producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
7421         */
7422        public CapabilityStatementDocumentComponent setModeElement(Enumeration<DocumentMode> value) { 
7423          this.mode = value;
7424          return this;
7425        }
7426
7427        /**
7428         * @return Mode of this document declaration - whether an application is a producer or consumer.
7429         */
7430        public DocumentMode getMode() { 
7431          return this.mode == null ? null : this.mode.getValue();
7432        }
7433
7434        /**
7435         * @param value Mode of this document declaration - whether an application is a producer or consumer.
7436         */
7437        public CapabilityStatementDocumentComponent setMode(DocumentMode value) { 
7438            if (this.mode == null)
7439              this.mode = new Enumeration<DocumentMode>(new DocumentModeEnumFactory());
7440            this.mode.setValue(value);
7441          return this;
7442        }
7443
7444        /**
7445         * @return {@link #documentation} (A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
7446         */
7447        public StringType getDocumentationElement() { 
7448          if (this.documentation == null)
7449            if (Configuration.errorOnAutoCreate())
7450              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.documentation");
7451            else if (Configuration.doAutoCreate())
7452              this.documentation = new StringType(); // bb
7453          return this.documentation;
7454        }
7455
7456        public boolean hasDocumentationElement() { 
7457          return this.documentation != null && !this.documentation.isEmpty();
7458        }
7459
7460        public boolean hasDocumentation() { 
7461          return this.documentation != null && !this.documentation.isEmpty();
7462        }
7463
7464        /**
7465         * @param value {@link #documentation} (A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
7466         */
7467        public CapabilityStatementDocumentComponent setDocumentationElement(StringType value) { 
7468          this.documentation = value;
7469          return this;
7470        }
7471
7472        /**
7473         * @return A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.
7474         */
7475        public String getDocumentation() { 
7476          return this.documentation == null ? null : this.documentation.getValue();
7477        }
7478
7479        /**
7480         * @param value A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.
7481         */
7482        public CapabilityStatementDocumentComponent setDocumentation(String value) { 
7483          if (Utilities.noString(value))
7484            this.documentation = null;
7485          else {
7486            if (this.documentation == null)
7487              this.documentation = new StringType();
7488            this.documentation.setValue(value);
7489          }
7490          return this;
7491        }
7492
7493        /**
7494         * @return {@link #profile} (A constraint on a resource used in the document.)
7495         */
7496        public Reference getProfile() { 
7497          if (this.profile == null)
7498            if (Configuration.errorOnAutoCreate())
7499              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.profile");
7500            else if (Configuration.doAutoCreate())
7501              this.profile = new Reference(); // cc
7502          return this.profile;
7503        }
7504
7505        public boolean hasProfile() { 
7506          return this.profile != null && !this.profile.isEmpty();
7507        }
7508
7509        /**
7510         * @param value {@link #profile} (A constraint on a resource used in the document.)
7511         */
7512        public CapabilityStatementDocumentComponent setProfile(Reference value)  { 
7513          this.profile = value;
7514          return this;
7515        }
7516
7517        /**
7518         * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A constraint on a resource used in the document.)
7519         */
7520        public StructureDefinition getProfileTarget() { 
7521          if (this.profileTarget == null)
7522            if (Configuration.errorOnAutoCreate())
7523              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.profile");
7524            else if (Configuration.doAutoCreate())
7525              this.profileTarget = new StructureDefinition(); // aa
7526          return this.profileTarget;
7527        }
7528
7529        /**
7530         * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A constraint on a resource used in the document.)
7531         */
7532        public CapabilityStatementDocumentComponent setProfileTarget(StructureDefinition value) { 
7533          this.profileTarget = value;
7534          return this;
7535        }
7536
7537        protected void listChildren(List<Property> children) {
7538          super.listChildren(children);
7539          children.add(new Property("mode", "code", "Mode of this document declaration - whether an application is a producer or consumer.", 0, 1, mode));
7540          children.add(new Property("documentation", "string", "A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.", 0, 1, documentation));
7541          children.add(new Property("profile", "Reference(StructureDefinition)", "A constraint on a resource used in the document.", 0, 1, profile));
7542        }
7543
7544        @Override
7545        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7546          switch (_hash) {
7547          case 3357091: /*mode*/  return new Property("mode", "code", "Mode of this document declaration - whether an application is a producer or consumer.", 0, 1, mode);
7548          case 1587405498: /*documentation*/  return new Property("documentation", "string", "A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.", 0, 1, documentation);
7549          case -309425751: /*profile*/  return new Property("profile", "Reference(StructureDefinition)", "A constraint on a resource used in the document.", 0, 1, profile);
7550          default: return super.getNamedProperty(_hash, _name, _checkValid);
7551          }
7552
7553        }
7554
7555      @Override
7556      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7557        switch (hash) {
7558        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<DocumentMode>
7559        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
7560        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference
7561        default: return super.getProperty(hash, name, checkValid);
7562        }
7563
7564      }
7565
7566      @Override
7567      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7568        switch (hash) {
7569        case 3357091: // mode
7570          value = new DocumentModeEnumFactory().fromType(castToCode(value));
7571          this.mode = (Enumeration) value; // Enumeration<DocumentMode>
7572          return value;
7573        case 1587405498: // documentation
7574          this.documentation = castToString(value); // StringType
7575          return value;
7576        case -309425751: // profile
7577          this.profile = castToReference(value); // Reference
7578          return value;
7579        default: return super.setProperty(hash, name, value);
7580        }
7581
7582      }
7583
7584      @Override
7585      public Base setProperty(String name, Base value) throws FHIRException {
7586        if (name.equals("mode")) {
7587          value = new DocumentModeEnumFactory().fromType(castToCode(value));
7588          this.mode = (Enumeration) value; // Enumeration<DocumentMode>
7589        } else if (name.equals("documentation")) {
7590          this.documentation = castToString(value); // StringType
7591        } else if (name.equals("profile")) {
7592          this.profile = castToReference(value); // Reference
7593        } else
7594          return super.setProperty(name, value);
7595        return value;
7596      }
7597
7598      @Override
7599      public Base makeProperty(int hash, String name) throws FHIRException {
7600        switch (hash) {
7601        case 3357091:  return getModeElement();
7602        case 1587405498:  return getDocumentationElement();
7603        case -309425751:  return getProfile(); 
7604        default: return super.makeProperty(hash, name);
7605        }
7606
7607      }
7608
7609      @Override
7610      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7611        switch (hash) {
7612        case 3357091: /*mode*/ return new String[] {"code"};
7613        case 1587405498: /*documentation*/ return new String[] {"string"};
7614        case -309425751: /*profile*/ return new String[] {"Reference"};
7615        default: return super.getTypesForProperty(hash, name);
7616        }
7617
7618      }
7619
7620      @Override
7621      public Base addChild(String name) throws FHIRException {
7622        if (name.equals("mode")) {
7623          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
7624        }
7625        else if (name.equals("documentation")) {
7626          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
7627        }
7628        else if (name.equals("profile")) {
7629          this.profile = new Reference();
7630          return this.profile;
7631        }
7632        else
7633          return super.addChild(name);
7634      }
7635
7636      public CapabilityStatementDocumentComponent copy() {
7637        CapabilityStatementDocumentComponent dst = new CapabilityStatementDocumentComponent();
7638        copyValues(dst);
7639        dst.mode = mode == null ? null : mode.copy();
7640        dst.documentation = documentation == null ? null : documentation.copy();
7641        dst.profile = profile == null ? null : profile.copy();
7642        return dst;
7643      }
7644
7645      @Override
7646      public boolean equalsDeep(Base other_) {
7647        if (!super.equalsDeep(other_))
7648          return false;
7649        if (!(other_ instanceof CapabilityStatementDocumentComponent))
7650          return false;
7651        CapabilityStatementDocumentComponent o = (CapabilityStatementDocumentComponent) other_;
7652        return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(profile, o.profile, true)
7653          ;
7654      }
7655
7656      @Override
7657      public boolean equalsShallow(Base other_) {
7658        if (!super.equalsShallow(other_))
7659          return false;
7660        if (!(other_ instanceof CapabilityStatementDocumentComponent))
7661          return false;
7662        CapabilityStatementDocumentComponent o = (CapabilityStatementDocumentComponent) other_;
7663        return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true);
7664      }
7665
7666      public boolean isEmpty() {
7667        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, documentation, profile
7668          );
7669      }
7670
7671  public String fhirType() {
7672    return "CapabilityStatement.document";
7673
7674  }
7675
7676  }
7677
7678    /**
7679     * Explaination of why this capability statement is needed and why it has been designed as it has.
7680     */
7681    @Child(name = "purpose", type = {MarkdownType.class}, order=0, min=0, max=1, modifier=false, summary=false)
7682    @Description(shortDefinition="Why this capability statement is defined", formalDefinition="Explaination of why this capability statement is needed and why it has been designed as it has." )
7683    protected MarkdownType purpose;
7684
7685    /**
7686     * 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.
7687     */
7688    @Child(name = "copyright", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
7689    @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." )
7690    protected MarkdownType copyright;
7691
7692    /**
7693     * 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).
7694     */
7695    @Child(name = "kind", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
7696    @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)." )
7697    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/capability-statement-kind")
7698    protected Enumeration<CapabilityStatementKind> kind;
7699
7700    /**
7701     * Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.
7702     */
7703    @Child(name = "instantiates", type = {UriType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7704    @Description(shortDefinition="Canonical URL of another capability statement this implements", formalDefinition="Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so." )
7705    protected List<UriType> instantiates;
7706
7707    /**
7708     * 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.
7709     */
7710    @Child(name = "software", type = {}, order=4, min=0, max=1, modifier=false, summary=true)
7711    @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." )
7712    protected CapabilityStatementSoftwareComponent software;
7713
7714    /**
7715     * 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.
7716     */
7717    @Child(name = "implementation", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
7718    @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." )
7719    protected CapabilityStatementImplementationComponent implementation;
7720
7721    /**
7722     * The version of the FHIR specification on which this capability statement is based.
7723     */
7724    @Child(name = "fhirVersion", type = {IdType.class}, order=6, min=1, max=1, modifier=false, summary=true)
7725    @Description(shortDefinition="FHIR Version the system uses", formalDefinition="The version of the FHIR specification on which this capability statement is based." )
7726    protected IdType fhirVersion;
7727
7728    /**
7729     * A code that indicates whether the application accepts unknown elements or extensions when reading resources.
7730     */
7731    @Child(name = "acceptUnknown", type = {CodeType.class}, order=7, min=1, max=1, modifier=false, summary=true)
7732    @Description(shortDefinition="no | extensions | elements | both", formalDefinition="A code that indicates whether the application accepts unknown elements or extensions when reading resources." )
7733    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/unknown-content-code")
7734    protected Enumeration<UnknownContentCode> acceptUnknown;
7735
7736    /**
7737     * A list of the formats supported by this implementation using their content types.
7738     */
7739    @Child(name = "format", type = {CodeType.class}, order=8, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7740    @Description(shortDefinition="formats supported (xml | json | ttl | mime type)", formalDefinition="A list of the formats supported by this implementation using their content types." )
7741    protected List<CodeType> format;
7742
7743    /**
7744     * A list of the patch formats supported by this implementation using their content types.
7745     */
7746    @Child(name = "patchFormat", type = {CodeType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7747    @Description(shortDefinition="Patch formats supported", formalDefinition="A list of the patch formats supported by this implementation using their content types." )
7748    protected List<CodeType> patchFormat;
7749
7750    /**
7751     * A list of implementation guides that the server does (or should) support in their entirety.
7752     */
7753    @Child(name = "implementationGuide", type = {UriType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7754    @Description(shortDefinition="Implementation guides supported", formalDefinition="A list of implementation guides that the server does (or should) support in their entirety." )
7755    protected List<UriType> implementationGuide;
7756
7757    /**
7758     * 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).
7759     */
7760    @Child(name = "profile", type = {StructureDefinition.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7761    @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)." )
7762    protected List<Reference> profile;
7763    /**
7764     * The actual objects that are the target of the reference (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).)
7765     */
7766    protected List<StructureDefinition> profileTarget;
7767
7768
7769    /**
7770     * A definition of the restful capabilities of the solution, if any.
7771     */
7772    @Child(name = "rest", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7773    @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." )
7774    protected List<CapabilityStatementRestComponent> rest;
7775
7776    /**
7777     * A description of the messaging capabilities of the solution.
7778     */
7779    @Child(name = "messaging", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7780    @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." )
7781    protected List<CapabilityStatementMessagingComponent> messaging;
7782
7783    /**
7784     * A document definition.
7785     */
7786    @Child(name = "document", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7787    @Description(shortDefinition="Document definition", formalDefinition="A document definition." )
7788    protected List<CapabilityStatementDocumentComponent> document;
7789
7790    private static final long serialVersionUID = 227177541L;
7791
7792  /**
7793   * Constructor
7794   */
7795    public CapabilityStatement() {
7796      super();
7797    }
7798
7799  /**
7800   * Constructor
7801   */
7802    public CapabilityStatement(Enumeration<PublicationStatus> status, DateTimeType date, Enumeration<CapabilityStatementKind> kind, IdType fhirVersion, Enumeration<UnknownContentCode> acceptUnknown) {
7803      super();
7804      this.status = status;
7805      this.date = date;
7806      this.kind = kind;
7807      this.fhirVersion = fhirVersion;
7808      this.acceptUnknown = acceptUnknown;
7809    }
7810
7811    /**
7812     * @return {@link #url} (An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
7813     */
7814    public UriType getUrlElement() { 
7815      if (this.url == null)
7816        if (Configuration.errorOnAutoCreate())
7817          throw new Error("Attempt to auto-create CapabilityStatement.url");
7818        else if (Configuration.doAutoCreate())
7819          this.url = new UriType(); // bb
7820      return this.url;
7821    }
7822
7823    public boolean hasUrlElement() { 
7824      return this.url != null && !this.url.isEmpty();
7825    }
7826
7827    public boolean hasUrl() { 
7828      return this.url != null && !this.url.isEmpty();
7829    }
7830
7831    /**
7832     * @param value {@link #url} (An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
7833     */
7834    public CapabilityStatement setUrlElement(UriType value) { 
7835      this.url = value;
7836      return this;
7837    }
7838
7839    /**
7840     * @return An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).
7841     */
7842    public String getUrl() { 
7843      return this.url == null ? null : this.url.getValue();
7844    }
7845
7846    /**
7847     * @param value An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).
7848     */
7849    public CapabilityStatement setUrl(String value) { 
7850      if (Utilities.noString(value))
7851        this.url = null;
7852      else {
7853        if (this.url == null)
7854          this.url = new UriType();
7855        this.url.setValue(value);
7856      }
7857      return this;
7858    }
7859
7860    /**
7861     * @return {@link #version} (The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
7862     */
7863    public StringType getVersionElement() { 
7864      if (this.version == null)
7865        if (Configuration.errorOnAutoCreate())
7866          throw new Error("Attempt to auto-create CapabilityStatement.version");
7867        else if (Configuration.doAutoCreate())
7868          this.version = new StringType(); // bb
7869      return this.version;
7870    }
7871
7872    public boolean hasVersionElement() { 
7873      return this.version != null && !this.version.isEmpty();
7874    }
7875
7876    public boolean hasVersion() { 
7877      return this.version != null && !this.version.isEmpty();
7878    }
7879
7880    /**
7881     * @param value {@link #version} (The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
7882     */
7883    public CapabilityStatement setVersionElement(StringType value) { 
7884      this.version = value;
7885      return this;
7886    }
7887
7888    /**
7889     * @return The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
7890     */
7891    public String getVersion() { 
7892      return this.version == null ? null : this.version.getValue();
7893    }
7894
7895    /**
7896     * @param value The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
7897     */
7898    public CapabilityStatement setVersion(String value) { 
7899      if (Utilities.noString(value))
7900        this.version = null;
7901      else {
7902        if (this.version == null)
7903          this.version = new StringType();
7904        this.version.setValue(value);
7905      }
7906      return this;
7907    }
7908
7909    /**
7910     * @return {@link #name} (A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
7911     */
7912    public StringType getNameElement() { 
7913      if (this.name == null)
7914        if (Configuration.errorOnAutoCreate())
7915          throw new Error("Attempt to auto-create CapabilityStatement.name");
7916        else if (Configuration.doAutoCreate())
7917          this.name = new StringType(); // bb
7918      return this.name;
7919    }
7920
7921    public boolean hasNameElement() { 
7922      return this.name != null && !this.name.isEmpty();
7923    }
7924
7925    public boolean hasName() { 
7926      return this.name != null && !this.name.isEmpty();
7927    }
7928
7929    /**
7930     * @param value {@link #name} (A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
7931     */
7932    public CapabilityStatement setNameElement(StringType value) { 
7933      this.name = value;
7934      return this;
7935    }
7936
7937    /**
7938     * @return A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.
7939     */
7940    public String getName() { 
7941      return this.name == null ? null : this.name.getValue();
7942    }
7943
7944    /**
7945     * @param value A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.
7946     */
7947    public CapabilityStatement setName(String value) { 
7948      if (Utilities.noString(value))
7949        this.name = null;
7950      else {
7951        if (this.name == null)
7952          this.name = new StringType();
7953        this.name.setValue(value);
7954      }
7955      return this;
7956    }
7957
7958    /**
7959     * @return {@link #title} (A short, descriptive, user-friendly title for the capability statement.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
7960     */
7961    public StringType getTitleElement() { 
7962      if (this.title == null)
7963        if (Configuration.errorOnAutoCreate())
7964          throw new Error("Attempt to auto-create CapabilityStatement.title");
7965        else if (Configuration.doAutoCreate())
7966          this.title = new StringType(); // bb
7967      return this.title;
7968    }
7969
7970    public boolean hasTitleElement() { 
7971      return this.title != null && !this.title.isEmpty();
7972    }
7973
7974    public boolean hasTitle() { 
7975      return this.title != null && !this.title.isEmpty();
7976    }
7977
7978    /**
7979     * @param value {@link #title} (A short, descriptive, user-friendly title for the capability statement.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
7980     */
7981    public CapabilityStatement setTitleElement(StringType value) { 
7982      this.title = value;
7983      return this;
7984    }
7985
7986    /**
7987     * @return A short, descriptive, user-friendly title for the capability statement.
7988     */
7989    public String getTitle() { 
7990      return this.title == null ? null : this.title.getValue();
7991    }
7992
7993    /**
7994     * @param value A short, descriptive, user-friendly title for the capability statement.
7995     */
7996    public CapabilityStatement setTitle(String value) { 
7997      if (Utilities.noString(value))
7998        this.title = null;
7999      else {
8000        if (this.title == null)
8001          this.title = new StringType();
8002        this.title.setValue(value);
8003      }
8004      return this;
8005    }
8006
8007    /**
8008     * @return {@link #status} (The status of this capability statement. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
8009     */
8010    public Enumeration<PublicationStatus> getStatusElement() { 
8011      if (this.status == null)
8012        if (Configuration.errorOnAutoCreate())
8013          throw new Error("Attempt to auto-create CapabilityStatement.status");
8014        else if (Configuration.doAutoCreate())
8015          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
8016      return this.status;
8017    }
8018
8019    public boolean hasStatusElement() { 
8020      return this.status != null && !this.status.isEmpty();
8021    }
8022
8023    public boolean hasStatus() { 
8024      return this.status != null && !this.status.isEmpty();
8025    }
8026
8027    /**
8028     * @param value {@link #status} (The status of this capability statement. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
8029     */
8030    public CapabilityStatement setStatusElement(Enumeration<PublicationStatus> value) { 
8031      this.status = value;
8032      return this;
8033    }
8034
8035    /**
8036     * @return The status of this capability statement. Enables tracking the life-cycle of the content.
8037     */
8038    public PublicationStatus getStatus() { 
8039      return this.status == null ? null : this.status.getValue();
8040    }
8041
8042    /**
8043     * @param value The status of this capability statement. Enables tracking the life-cycle of the content.
8044     */
8045    public CapabilityStatement setStatus(PublicationStatus value) { 
8046        if (this.status == null)
8047          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
8048        this.status.setValue(value);
8049      return this;
8050    }
8051
8052    /**
8053     * @return {@link #experimental} (A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
8054     */
8055    public BooleanType getExperimentalElement() { 
8056      if (this.experimental == null)
8057        if (Configuration.errorOnAutoCreate())
8058          throw new Error("Attempt to auto-create CapabilityStatement.experimental");
8059        else if (Configuration.doAutoCreate())
8060          this.experimental = new BooleanType(); // bb
8061      return this.experimental;
8062    }
8063
8064    public boolean hasExperimentalElement() { 
8065      return this.experimental != null && !this.experimental.isEmpty();
8066    }
8067
8068    public boolean hasExperimental() { 
8069      return this.experimental != null && !this.experimental.isEmpty();
8070    }
8071
8072    /**
8073     * @param value {@link #experimental} (A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
8074     */
8075    public CapabilityStatement setExperimentalElement(BooleanType value) { 
8076      this.experimental = value;
8077      return this;
8078    }
8079
8080    /**
8081     * @return A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
8082     */
8083    public boolean getExperimental() { 
8084      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
8085    }
8086
8087    /**
8088     * @param value A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
8089     */
8090    public CapabilityStatement setExperimental(boolean value) { 
8091        if (this.experimental == null)
8092          this.experimental = new BooleanType();
8093        this.experimental.setValue(value);
8094      return this;
8095    }
8096
8097    /**
8098     * @return {@link #date} (The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
8099     */
8100    public DateTimeType getDateElement() { 
8101      if (this.date == null)
8102        if (Configuration.errorOnAutoCreate())
8103          throw new Error("Attempt to auto-create CapabilityStatement.date");
8104        else if (Configuration.doAutoCreate())
8105          this.date = new DateTimeType(); // bb
8106      return this.date;
8107    }
8108
8109    public boolean hasDateElement() { 
8110      return this.date != null && !this.date.isEmpty();
8111    }
8112
8113    public boolean hasDate() { 
8114      return this.date != null && !this.date.isEmpty();
8115    }
8116
8117    /**
8118     * @param value {@link #date} (The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
8119     */
8120    public CapabilityStatement setDateElement(DateTimeType value) { 
8121      this.date = value;
8122      return this;
8123    }
8124
8125    /**
8126     * @return The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.
8127     */
8128    public Date getDate() { 
8129      return this.date == null ? null : this.date.getValue();
8130    }
8131
8132    /**
8133     * @param value The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.
8134     */
8135    public CapabilityStatement setDate(Date value) { 
8136        if (this.date == null)
8137          this.date = new DateTimeType();
8138        this.date.setValue(value);
8139      return this;
8140    }
8141
8142    /**
8143     * @return {@link #publisher} (The name of the individual or organization that published the capability statement.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
8144     */
8145    public StringType getPublisherElement() { 
8146      if (this.publisher == null)
8147        if (Configuration.errorOnAutoCreate())
8148          throw new Error("Attempt to auto-create CapabilityStatement.publisher");
8149        else if (Configuration.doAutoCreate())
8150          this.publisher = new StringType(); // bb
8151      return this.publisher;
8152    }
8153
8154    public boolean hasPublisherElement() { 
8155      return this.publisher != null && !this.publisher.isEmpty();
8156    }
8157
8158    public boolean hasPublisher() { 
8159      return this.publisher != null && !this.publisher.isEmpty();
8160    }
8161
8162    /**
8163     * @param value {@link #publisher} (The name of the individual or organization that published the capability statement.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
8164     */
8165    public CapabilityStatement setPublisherElement(StringType value) { 
8166      this.publisher = value;
8167      return this;
8168    }
8169
8170    /**
8171     * @return The name of the individual or organization that published the capability statement.
8172     */
8173    public String getPublisher() { 
8174      return this.publisher == null ? null : this.publisher.getValue();
8175    }
8176
8177    /**
8178     * @param value The name of the individual or organization that published the capability statement.
8179     */
8180    public CapabilityStatement setPublisher(String value) { 
8181      if (Utilities.noString(value))
8182        this.publisher = null;
8183      else {
8184        if (this.publisher == null)
8185          this.publisher = new StringType();
8186        this.publisher.setValue(value);
8187      }
8188      return this;
8189    }
8190
8191    /**
8192     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
8193     */
8194    public List<ContactDetail> getContact() { 
8195      if (this.contact == null)
8196        this.contact = new ArrayList<ContactDetail>();
8197      return this.contact;
8198    }
8199
8200    /**
8201     * @return Returns a reference to <code>this</code> for easy method chaining
8202     */
8203    public CapabilityStatement setContact(List<ContactDetail> theContact) { 
8204      this.contact = theContact;
8205      return this;
8206    }
8207
8208    public boolean hasContact() { 
8209      if (this.contact == null)
8210        return false;
8211      for (ContactDetail item : this.contact)
8212        if (!item.isEmpty())
8213          return true;
8214      return false;
8215    }
8216
8217    public ContactDetail addContact() { //3
8218      ContactDetail t = new ContactDetail();
8219      if (this.contact == null)
8220        this.contact = new ArrayList<ContactDetail>();
8221      this.contact.add(t);
8222      return t;
8223    }
8224
8225    public CapabilityStatement addContact(ContactDetail t) { //3
8226      if (t == null)
8227        return this;
8228      if (this.contact == null)
8229        this.contact = new ArrayList<ContactDetail>();
8230      this.contact.add(t);
8231      return this;
8232    }
8233
8234    /**
8235     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
8236     */
8237    public ContactDetail getContactFirstRep() { 
8238      if (getContact().isEmpty()) {
8239        addContact();
8240      }
8241      return getContact().get(0);
8242    }
8243
8244    /**
8245     * @return {@link #description} (A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
8246     */
8247    public MarkdownType getDescriptionElement() { 
8248      if (this.description == null)
8249        if (Configuration.errorOnAutoCreate())
8250          throw new Error("Attempt to auto-create CapabilityStatement.description");
8251        else if (Configuration.doAutoCreate())
8252          this.description = new MarkdownType(); // bb
8253      return this.description;
8254    }
8255
8256    public boolean hasDescriptionElement() { 
8257      return this.description != null && !this.description.isEmpty();
8258    }
8259
8260    public boolean hasDescription() { 
8261      return this.description != null && !this.description.isEmpty();
8262    }
8263
8264    /**
8265     * @param value {@link #description} (A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
8266     */
8267    public CapabilityStatement setDescriptionElement(MarkdownType value) { 
8268      this.description = value;
8269      return this;
8270    }
8271
8272    /**
8273     * @return A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.
8274     */
8275    public String getDescription() { 
8276      return this.description == null ? null : this.description.getValue();
8277    }
8278
8279    /**
8280     * @param value A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.
8281     */
8282    public CapabilityStatement setDescription(String value) { 
8283      if (value == null)
8284        this.description = null;
8285      else {
8286        if (this.description == null)
8287          this.description = new MarkdownType();
8288        this.description.setValue(value);
8289      }
8290      return this;
8291    }
8292
8293    /**
8294     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate capability statement instances.)
8295     */
8296    public List<UsageContext> getUseContext() { 
8297      if (this.useContext == null)
8298        this.useContext = new ArrayList<UsageContext>();
8299      return this.useContext;
8300    }
8301
8302    /**
8303     * @return Returns a reference to <code>this</code> for easy method chaining
8304     */
8305    public CapabilityStatement setUseContext(List<UsageContext> theUseContext) { 
8306      this.useContext = theUseContext;
8307      return this;
8308    }
8309
8310    public boolean hasUseContext() { 
8311      if (this.useContext == null)
8312        return false;
8313      for (UsageContext item : this.useContext)
8314        if (!item.isEmpty())
8315          return true;
8316      return false;
8317    }
8318
8319    public UsageContext addUseContext() { //3
8320      UsageContext t = new UsageContext();
8321      if (this.useContext == null)
8322        this.useContext = new ArrayList<UsageContext>();
8323      this.useContext.add(t);
8324      return t;
8325    }
8326
8327    public CapabilityStatement addUseContext(UsageContext t) { //3
8328      if (t == null)
8329        return this;
8330      if (this.useContext == null)
8331        this.useContext = new ArrayList<UsageContext>();
8332      this.useContext.add(t);
8333      return this;
8334    }
8335
8336    /**
8337     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
8338     */
8339    public UsageContext getUseContextFirstRep() { 
8340      if (getUseContext().isEmpty()) {
8341        addUseContext();
8342      }
8343      return getUseContext().get(0);
8344    }
8345
8346    /**
8347     * @return {@link #jurisdiction} (A legal or geographic region in which the capability statement is intended to be used.)
8348     */
8349    public List<CodeableConcept> getJurisdiction() { 
8350      if (this.jurisdiction == null)
8351        this.jurisdiction = new ArrayList<CodeableConcept>();
8352      return this.jurisdiction;
8353    }
8354
8355    /**
8356     * @return Returns a reference to <code>this</code> for easy method chaining
8357     */
8358    public CapabilityStatement setJurisdiction(List<CodeableConcept> theJurisdiction) { 
8359      this.jurisdiction = theJurisdiction;
8360      return this;
8361    }
8362
8363    public boolean hasJurisdiction() { 
8364      if (this.jurisdiction == null)
8365        return false;
8366      for (CodeableConcept item : this.jurisdiction)
8367        if (!item.isEmpty())
8368          return true;
8369      return false;
8370    }
8371
8372    public CodeableConcept addJurisdiction() { //3
8373      CodeableConcept t = new CodeableConcept();
8374      if (this.jurisdiction == null)
8375        this.jurisdiction = new ArrayList<CodeableConcept>();
8376      this.jurisdiction.add(t);
8377      return t;
8378    }
8379
8380    public CapabilityStatement addJurisdiction(CodeableConcept t) { //3
8381      if (t == null)
8382        return this;
8383      if (this.jurisdiction == null)
8384        this.jurisdiction = new ArrayList<CodeableConcept>();
8385      this.jurisdiction.add(t);
8386      return this;
8387    }
8388
8389    /**
8390     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
8391     */
8392    public CodeableConcept getJurisdictionFirstRep() { 
8393      if (getJurisdiction().isEmpty()) {
8394        addJurisdiction();
8395      }
8396      return getJurisdiction().get(0);
8397    }
8398
8399    /**
8400     * @return {@link #purpose} (Explaination of why this capability statement is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
8401     */
8402    public MarkdownType getPurposeElement() { 
8403      if (this.purpose == null)
8404        if (Configuration.errorOnAutoCreate())
8405          throw new Error("Attempt to auto-create CapabilityStatement.purpose");
8406        else if (Configuration.doAutoCreate())
8407          this.purpose = new MarkdownType(); // bb
8408      return this.purpose;
8409    }
8410
8411    public boolean hasPurposeElement() { 
8412      return this.purpose != null && !this.purpose.isEmpty();
8413    }
8414
8415    public boolean hasPurpose() { 
8416      return this.purpose != null && !this.purpose.isEmpty();
8417    }
8418
8419    /**
8420     * @param value {@link #purpose} (Explaination of why this capability statement is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
8421     */
8422    public CapabilityStatement setPurposeElement(MarkdownType value) { 
8423      this.purpose = value;
8424      return this;
8425    }
8426
8427    /**
8428     * @return Explaination of why this capability statement is needed and why it has been designed as it has.
8429     */
8430    public String getPurpose() { 
8431      return this.purpose == null ? null : this.purpose.getValue();
8432    }
8433
8434    /**
8435     * @param value Explaination of why this capability statement is needed and why it has been designed as it has.
8436     */
8437    public CapabilityStatement setPurpose(String value) { 
8438      if (value == null)
8439        this.purpose = null;
8440      else {
8441        if (this.purpose == null)
8442          this.purpose = new MarkdownType();
8443        this.purpose.setValue(value);
8444      }
8445      return this;
8446    }
8447
8448    /**
8449     * @return {@link #copyright} (A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
8450     */
8451    public MarkdownType getCopyrightElement() { 
8452      if (this.copyright == null)
8453        if (Configuration.errorOnAutoCreate())
8454          throw new Error("Attempt to auto-create CapabilityStatement.copyright");
8455        else if (Configuration.doAutoCreate())
8456          this.copyright = new MarkdownType(); // bb
8457      return this.copyright;
8458    }
8459
8460    public boolean hasCopyrightElement() { 
8461      return this.copyright != null && !this.copyright.isEmpty();
8462    }
8463
8464    public boolean hasCopyright() { 
8465      return this.copyright != null && !this.copyright.isEmpty();
8466    }
8467
8468    /**
8469     * @param value {@link #copyright} (A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
8470     */
8471    public CapabilityStatement setCopyrightElement(MarkdownType value) { 
8472      this.copyright = value;
8473      return this;
8474    }
8475
8476    /**
8477     * @return A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.
8478     */
8479    public String getCopyright() { 
8480      return this.copyright == null ? null : this.copyright.getValue();
8481    }
8482
8483    /**
8484     * @param value A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.
8485     */
8486    public CapabilityStatement setCopyright(String value) { 
8487      if (value == null)
8488        this.copyright = null;
8489      else {
8490        if (this.copyright == null)
8491          this.copyright = new MarkdownType();
8492        this.copyright.setValue(value);
8493      }
8494      return this;
8495    }
8496
8497    /**
8498     * @return {@link #kind} (The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
8499     */
8500    public Enumeration<CapabilityStatementKind> getKindElement() { 
8501      if (this.kind == null)
8502        if (Configuration.errorOnAutoCreate())
8503          throw new Error("Attempt to auto-create CapabilityStatement.kind");
8504        else if (Configuration.doAutoCreate())
8505          this.kind = new Enumeration<CapabilityStatementKind>(new CapabilityStatementKindEnumFactory()); // bb
8506      return this.kind;
8507    }
8508
8509    public boolean hasKindElement() { 
8510      return this.kind != null && !this.kind.isEmpty();
8511    }
8512
8513    public boolean hasKind() { 
8514      return this.kind != null && !this.kind.isEmpty();
8515    }
8516
8517    /**
8518     * @param value {@link #kind} (The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
8519     */
8520    public CapabilityStatement setKindElement(Enumeration<CapabilityStatementKind> value) { 
8521      this.kind = value;
8522      return this;
8523    }
8524
8525    /**
8526     * @return The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).
8527     */
8528    public CapabilityStatementKind getKind() { 
8529      return this.kind == null ? null : this.kind.getValue();
8530    }
8531
8532    /**
8533     * @param value The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).
8534     */
8535    public CapabilityStatement setKind(CapabilityStatementKind value) { 
8536        if (this.kind == null)
8537          this.kind = new Enumeration<CapabilityStatementKind>(new CapabilityStatementKindEnumFactory());
8538        this.kind.setValue(value);
8539      return this;
8540    }
8541
8542    /**
8543     * @return {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.)
8544     */
8545    public List<UriType> getInstantiates() { 
8546      if (this.instantiates == null)
8547        this.instantiates = new ArrayList<UriType>();
8548      return this.instantiates;
8549    }
8550
8551    /**
8552     * @return Returns a reference to <code>this</code> for easy method chaining
8553     */
8554    public CapabilityStatement setInstantiates(List<UriType> theInstantiates) { 
8555      this.instantiates = theInstantiates;
8556      return this;
8557    }
8558
8559    public boolean hasInstantiates() { 
8560      if (this.instantiates == null)
8561        return false;
8562      for (UriType item : this.instantiates)
8563        if (!item.isEmpty())
8564          return true;
8565      return false;
8566    }
8567
8568    /**
8569     * @return {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.)
8570     */
8571    public UriType addInstantiatesElement() {//2 
8572      UriType t = new UriType();
8573      if (this.instantiates == null)
8574        this.instantiates = new ArrayList<UriType>();
8575      this.instantiates.add(t);
8576      return t;
8577    }
8578
8579    /**
8580     * @param value {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.)
8581     */
8582    public CapabilityStatement addInstantiates(String value) { //1
8583      UriType t = new UriType();
8584      t.setValue(value);
8585      if (this.instantiates == null)
8586        this.instantiates = new ArrayList<UriType>();
8587      this.instantiates.add(t);
8588      return this;
8589    }
8590
8591    /**
8592     * @param value {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.)
8593     */
8594    public boolean hasInstantiates(String value) { 
8595      if (this.instantiates == null)
8596        return false;
8597      for (UriType v : this.instantiates)
8598        if (v.getValue().equals(value)) // uri
8599          return true;
8600      return false;
8601    }
8602
8603    /**
8604     * @return {@link #software} (Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.)
8605     */
8606    public CapabilityStatementSoftwareComponent getSoftware() { 
8607      if (this.software == null)
8608        if (Configuration.errorOnAutoCreate())
8609          throw new Error("Attempt to auto-create CapabilityStatement.software");
8610        else if (Configuration.doAutoCreate())
8611          this.software = new CapabilityStatementSoftwareComponent(); // cc
8612      return this.software;
8613    }
8614
8615    public boolean hasSoftware() { 
8616      return this.software != null && !this.software.isEmpty();
8617    }
8618
8619    /**
8620     * @param value {@link #software} (Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.)
8621     */
8622    public CapabilityStatement setSoftware(CapabilityStatementSoftwareComponent value)  { 
8623      this.software = value;
8624      return this;
8625    }
8626
8627    /**
8628     * @return {@link #implementation} (Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.)
8629     */
8630    public CapabilityStatementImplementationComponent getImplementation() { 
8631      if (this.implementation == null)
8632        if (Configuration.errorOnAutoCreate())
8633          throw new Error("Attempt to auto-create CapabilityStatement.implementation");
8634        else if (Configuration.doAutoCreate())
8635          this.implementation = new CapabilityStatementImplementationComponent(); // cc
8636      return this.implementation;
8637    }
8638
8639    public boolean hasImplementation() { 
8640      return this.implementation != null && !this.implementation.isEmpty();
8641    }
8642
8643    /**
8644     * @param value {@link #implementation} (Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.)
8645     */
8646    public CapabilityStatement setImplementation(CapabilityStatementImplementationComponent value)  { 
8647      this.implementation = value;
8648      return this;
8649    }
8650
8651    /**
8652     * @return {@link #fhirVersion} (The version of the FHIR specification on which this capability statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value
8653     */
8654    public IdType getFhirVersionElement() { 
8655      if (this.fhirVersion == null)
8656        if (Configuration.errorOnAutoCreate())
8657          throw new Error("Attempt to auto-create CapabilityStatement.fhirVersion");
8658        else if (Configuration.doAutoCreate())
8659          this.fhirVersion = new IdType(); // bb
8660      return this.fhirVersion;
8661    }
8662
8663    public boolean hasFhirVersionElement() { 
8664      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
8665    }
8666
8667    public boolean hasFhirVersion() { 
8668      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
8669    }
8670
8671    /**
8672     * @param value {@link #fhirVersion} (The version of the FHIR specification on which this capability statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value
8673     */
8674    public CapabilityStatement setFhirVersionElement(IdType value) { 
8675      this.fhirVersion = value;
8676      return this;
8677    }
8678
8679    /**
8680     * @return The version of the FHIR specification on which this capability statement is based.
8681     */
8682    public String getFhirVersion() { 
8683      return this.fhirVersion == null ? null : this.fhirVersion.getValue();
8684    }
8685
8686    /**
8687     * @param value The version of the FHIR specification on which this capability statement is based.
8688     */
8689    public CapabilityStatement setFhirVersion(String value) { 
8690        if (this.fhirVersion == null)
8691          this.fhirVersion = new IdType();
8692        this.fhirVersion.setValue(value);
8693      return this;
8694    }
8695
8696    /**
8697     * @return {@link #acceptUnknown} (A code that indicates whether the application accepts unknown elements or extensions when reading resources.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value
8698     */
8699    public Enumeration<UnknownContentCode> getAcceptUnknownElement() { 
8700      if (this.acceptUnknown == null)
8701        if (Configuration.errorOnAutoCreate())
8702          throw new Error("Attempt to auto-create CapabilityStatement.acceptUnknown");
8703        else if (Configuration.doAutoCreate())
8704          this.acceptUnknown = new Enumeration<UnknownContentCode>(new UnknownContentCodeEnumFactory()); // bb
8705      return this.acceptUnknown;
8706    }
8707
8708    public boolean hasAcceptUnknownElement() { 
8709      return this.acceptUnknown != null && !this.acceptUnknown.isEmpty();
8710    }
8711
8712    public boolean hasAcceptUnknown() { 
8713      return this.acceptUnknown != null && !this.acceptUnknown.isEmpty();
8714    }
8715
8716    /**
8717     * @param value {@link #acceptUnknown} (A code that indicates whether the application accepts unknown elements or extensions when reading resources.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value
8718     */
8719    public CapabilityStatement setAcceptUnknownElement(Enumeration<UnknownContentCode> value) { 
8720      this.acceptUnknown = value;
8721      return this;
8722    }
8723
8724    /**
8725     * @return A code that indicates whether the application accepts unknown elements or extensions when reading resources.
8726     */
8727    public UnknownContentCode getAcceptUnknown() { 
8728      return this.acceptUnknown == null ? null : this.acceptUnknown.getValue();
8729    }
8730
8731    /**
8732     * @param value A code that indicates whether the application accepts unknown elements or extensions when reading resources.
8733     */
8734    public CapabilityStatement setAcceptUnknown(UnknownContentCode value) { 
8735        if (this.acceptUnknown == null)
8736          this.acceptUnknown = new Enumeration<UnknownContentCode>(new UnknownContentCodeEnumFactory());
8737        this.acceptUnknown.setValue(value);
8738      return this;
8739    }
8740
8741    /**
8742     * @return {@link #format} (A list of the formats supported by this implementation using their content types.)
8743     */
8744    public List<CodeType> getFormat() { 
8745      if (this.format == null)
8746        this.format = new ArrayList<CodeType>();
8747      return this.format;
8748    }
8749
8750    /**
8751     * @return Returns a reference to <code>this</code> for easy method chaining
8752     */
8753    public CapabilityStatement setFormat(List<CodeType> theFormat) { 
8754      this.format = theFormat;
8755      return this;
8756    }
8757
8758    public boolean hasFormat() { 
8759      if (this.format == null)
8760        return false;
8761      for (CodeType item : this.format)
8762        if (!item.isEmpty())
8763          return true;
8764      return false;
8765    }
8766
8767    /**
8768     * @return {@link #format} (A list of the formats supported by this implementation using their content types.)
8769     */
8770    public CodeType addFormatElement() {//2 
8771      CodeType t = new CodeType();
8772      if (this.format == null)
8773        this.format = new ArrayList<CodeType>();
8774      this.format.add(t);
8775      return t;
8776    }
8777
8778    /**
8779     * @param value {@link #format} (A list of the formats supported by this implementation using their content types.)
8780     */
8781    public CapabilityStatement addFormat(String value) { //1
8782      CodeType t = new CodeType();
8783      t.setValue(value);
8784      if (this.format == null)
8785        this.format = new ArrayList<CodeType>();
8786      this.format.add(t);
8787      return this;
8788    }
8789
8790    /**
8791     * @param value {@link #format} (A list of the formats supported by this implementation using their content types.)
8792     */
8793    public boolean hasFormat(String value) { 
8794      if (this.format == null)
8795        return false;
8796      for (CodeType v : this.format)
8797        if (v.getValue().equals(value)) // code
8798          return true;
8799      return false;
8800    }
8801
8802    /**
8803     * @return {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
8804     */
8805    public List<CodeType> getPatchFormat() { 
8806      if (this.patchFormat == null)
8807        this.patchFormat = new ArrayList<CodeType>();
8808      return this.patchFormat;
8809    }
8810
8811    /**
8812     * @return Returns a reference to <code>this</code> for easy method chaining
8813     */
8814    public CapabilityStatement setPatchFormat(List<CodeType> thePatchFormat) { 
8815      this.patchFormat = thePatchFormat;
8816      return this;
8817    }
8818
8819    public boolean hasPatchFormat() { 
8820      if (this.patchFormat == null)
8821        return false;
8822      for (CodeType item : this.patchFormat)
8823        if (!item.isEmpty())
8824          return true;
8825      return false;
8826    }
8827
8828    /**
8829     * @return {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
8830     */
8831    public CodeType addPatchFormatElement() {//2 
8832      CodeType t = new CodeType();
8833      if (this.patchFormat == null)
8834        this.patchFormat = new ArrayList<CodeType>();
8835      this.patchFormat.add(t);
8836      return t;
8837    }
8838
8839    /**
8840     * @param value {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
8841     */
8842    public CapabilityStatement addPatchFormat(String value) { //1
8843      CodeType t = new CodeType();
8844      t.setValue(value);
8845      if (this.patchFormat == null)
8846        this.patchFormat = new ArrayList<CodeType>();
8847      this.patchFormat.add(t);
8848      return this;
8849    }
8850
8851    /**
8852     * @param value {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
8853     */
8854    public boolean hasPatchFormat(String value) { 
8855      if (this.patchFormat == null)
8856        return false;
8857      for (CodeType v : this.patchFormat)
8858        if (v.getValue().equals(value)) // code
8859          return true;
8860      return false;
8861    }
8862
8863    /**
8864     * @return {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
8865     */
8866    public List<UriType> getImplementationGuide() { 
8867      if (this.implementationGuide == null)
8868        this.implementationGuide = new ArrayList<UriType>();
8869      return this.implementationGuide;
8870    }
8871
8872    /**
8873     * @return Returns a reference to <code>this</code> for easy method chaining
8874     */
8875    public CapabilityStatement setImplementationGuide(List<UriType> theImplementationGuide) { 
8876      this.implementationGuide = theImplementationGuide;
8877      return this;
8878    }
8879
8880    public boolean hasImplementationGuide() { 
8881      if (this.implementationGuide == null)
8882        return false;
8883      for (UriType item : this.implementationGuide)
8884        if (!item.isEmpty())
8885          return true;
8886      return false;
8887    }
8888
8889    /**
8890     * @return {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
8891     */
8892    public UriType addImplementationGuideElement() {//2 
8893      UriType t = new UriType();
8894      if (this.implementationGuide == null)
8895        this.implementationGuide = new ArrayList<UriType>();
8896      this.implementationGuide.add(t);
8897      return t;
8898    }
8899
8900    /**
8901     * @param value {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
8902     */
8903    public CapabilityStatement addImplementationGuide(String value) { //1
8904      UriType t = new UriType();
8905      t.setValue(value);
8906      if (this.implementationGuide == null)
8907        this.implementationGuide = new ArrayList<UriType>();
8908      this.implementationGuide.add(t);
8909      return this;
8910    }
8911
8912    /**
8913     * @param value {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
8914     */
8915    public boolean hasImplementationGuide(String value) { 
8916      if (this.implementationGuide == null)
8917        return false;
8918      for (UriType v : this.implementationGuide)
8919        if (v.getValue().equals(value)) // uri
8920          return true;
8921      return false;
8922    }
8923
8924    /**
8925     * @return {@link #profile} (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).)
8926     */
8927    public List<Reference> getProfile() { 
8928      if (this.profile == null)
8929        this.profile = new ArrayList<Reference>();
8930      return this.profile;
8931    }
8932
8933    /**
8934     * @return Returns a reference to <code>this</code> for easy method chaining
8935     */
8936    public CapabilityStatement setProfile(List<Reference> theProfile) { 
8937      this.profile = theProfile;
8938      return this;
8939    }
8940
8941    public boolean hasProfile() { 
8942      if (this.profile == null)
8943        return false;
8944      for (Reference item : this.profile)
8945        if (!item.isEmpty())
8946          return true;
8947      return false;
8948    }
8949
8950    public Reference addProfile() { //3
8951      Reference t = new Reference();
8952      if (this.profile == null)
8953        this.profile = new ArrayList<Reference>();
8954      this.profile.add(t);
8955      return t;
8956    }
8957
8958    public CapabilityStatement addProfile(Reference t) { //3
8959      if (t == null)
8960        return this;
8961      if (this.profile == null)
8962        this.profile = new ArrayList<Reference>();
8963      this.profile.add(t);
8964      return this;
8965    }
8966
8967    /**
8968     * @return The first repetition of repeating field {@link #profile}, creating it if it does not already exist
8969     */
8970    public Reference getProfileFirstRep() { 
8971      if (getProfile().isEmpty()) {
8972        addProfile();
8973      }
8974      return getProfile().get(0);
8975    }
8976
8977    /**
8978     * @deprecated Use Reference#setResource(IBaseResource) instead
8979     */
8980    @Deprecated
8981    public List<StructureDefinition> getProfileTarget() { 
8982      if (this.profileTarget == null)
8983        this.profileTarget = new ArrayList<StructureDefinition>();
8984      return this.profileTarget;
8985    }
8986
8987    /**
8988     * @deprecated Use Reference#setResource(IBaseResource) instead
8989     */
8990    @Deprecated
8991    public StructureDefinition addProfileTarget() { 
8992      StructureDefinition r = new StructureDefinition();
8993      if (this.profileTarget == null)
8994        this.profileTarget = new ArrayList<StructureDefinition>();
8995      this.profileTarget.add(r);
8996      return r;
8997    }
8998
8999    /**
9000     * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.)
9001     */
9002    public List<CapabilityStatementRestComponent> getRest() { 
9003      if (this.rest == null)
9004        this.rest = new ArrayList<CapabilityStatementRestComponent>();
9005      return this.rest;
9006    }
9007
9008    /**
9009     * @return Returns a reference to <code>this</code> for easy method chaining
9010     */
9011    public CapabilityStatement setRest(List<CapabilityStatementRestComponent> theRest) { 
9012      this.rest = theRest;
9013      return this;
9014    }
9015
9016    public boolean hasRest() { 
9017      if (this.rest == null)
9018        return false;
9019      for (CapabilityStatementRestComponent item : this.rest)
9020        if (!item.isEmpty())
9021          return true;
9022      return false;
9023    }
9024
9025    public CapabilityStatementRestComponent addRest() { //3
9026      CapabilityStatementRestComponent t = new CapabilityStatementRestComponent();
9027      if (this.rest == null)
9028        this.rest = new ArrayList<CapabilityStatementRestComponent>();
9029      this.rest.add(t);
9030      return t;
9031    }
9032
9033    public CapabilityStatement addRest(CapabilityStatementRestComponent t) { //3
9034      if (t == null)
9035        return this;
9036      if (this.rest == null)
9037        this.rest = new ArrayList<CapabilityStatementRestComponent>();
9038      this.rest.add(t);
9039      return this;
9040    }
9041
9042    /**
9043     * @return The first repetition of repeating field {@link #rest}, creating it if it does not already exist
9044     */
9045    public CapabilityStatementRestComponent getRestFirstRep() { 
9046      if (getRest().isEmpty()) {
9047        addRest();
9048      }
9049      return getRest().get(0);
9050    }
9051
9052    /**
9053     * @return {@link #messaging} (A description of the messaging capabilities of the solution.)
9054     */
9055    public List<CapabilityStatementMessagingComponent> getMessaging() { 
9056      if (this.messaging == null)
9057        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
9058      return this.messaging;
9059    }
9060
9061    /**
9062     * @return Returns a reference to <code>this</code> for easy method chaining
9063     */
9064    public CapabilityStatement setMessaging(List<CapabilityStatementMessagingComponent> theMessaging) { 
9065      this.messaging = theMessaging;
9066      return this;
9067    }
9068
9069    public boolean hasMessaging() { 
9070      if (this.messaging == null)
9071        return false;
9072      for (CapabilityStatementMessagingComponent item : this.messaging)
9073        if (!item.isEmpty())
9074          return true;
9075      return false;
9076    }
9077
9078    public CapabilityStatementMessagingComponent addMessaging() { //3
9079      CapabilityStatementMessagingComponent t = new CapabilityStatementMessagingComponent();
9080      if (this.messaging == null)
9081        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
9082      this.messaging.add(t);
9083      return t;
9084    }
9085
9086    public CapabilityStatement addMessaging(CapabilityStatementMessagingComponent t) { //3
9087      if (t == null)
9088        return this;
9089      if (this.messaging == null)
9090        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
9091      this.messaging.add(t);
9092      return this;
9093    }
9094
9095    /**
9096     * @return The first repetition of repeating field {@link #messaging}, creating it if it does not already exist
9097     */
9098    public CapabilityStatementMessagingComponent getMessagingFirstRep() { 
9099      if (getMessaging().isEmpty()) {
9100        addMessaging();
9101      }
9102      return getMessaging().get(0);
9103    }
9104
9105    /**
9106     * @return {@link #document} (A document definition.)
9107     */
9108    public List<CapabilityStatementDocumentComponent> getDocument() { 
9109      if (this.document == null)
9110        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
9111      return this.document;
9112    }
9113
9114    /**
9115     * @return Returns a reference to <code>this</code> for easy method chaining
9116     */
9117    public CapabilityStatement setDocument(List<CapabilityStatementDocumentComponent> theDocument) { 
9118      this.document = theDocument;
9119      return this;
9120    }
9121
9122    public boolean hasDocument() { 
9123      if (this.document == null)
9124        return false;
9125      for (CapabilityStatementDocumentComponent item : this.document)
9126        if (!item.isEmpty())
9127          return true;
9128      return false;
9129    }
9130
9131    public CapabilityStatementDocumentComponent addDocument() { //3
9132      CapabilityStatementDocumentComponent t = new CapabilityStatementDocumentComponent();
9133      if (this.document == null)
9134        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
9135      this.document.add(t);
9136      return t;
9137    }
9138
9139    public CapabilityStatement addDocument(CapabilityStatementDocumentComponent t) { //3
9140      if (t == null)
9141        return this;
9142      if (this.document == null)
9143        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
9144      this.document.add(t);
9145      return this;
9146    }
9147
9148    /**
9149     * @return The first repetition of repeating field {@link #document}, creating it if it does not already exist
9150     */
9151    public CapabilityStatementDocumentComponent getDocumentFirstRep() { 
9152      if (getDocument().isEmpty()) {
9153        addDocument();
9154      }
9155      return getDocument().get(0);
9156    }
9157
9158      protected void listChildren(List<Property> children) {
9159        super.listChildren(children);
9160        children.add(new Property("url", "uri", "An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url));
9161        children.add(new Property("version", "string", "The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
9162        children.add(new Property("name", "string", "A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
9163        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the capability statement.", 0, 1, title));
9164        children.add(new Property("status", "code", "The status of this capability statement. Enables tracking the life-cycle of the content.", 0, 1, status));
9165        children.add(new Property("experimental", "boolean", "A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
9166        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.", 0, 1, date));
9167        children.add(new Property("publisher", "string", "The name of the individual or organization that published the capability statement.", 0, 1, publisher));
9168        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
9169        children.add(new Property("description", "markdown", "A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, 1, description));
9170        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate capability statement instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
9171        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the capability statement is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
9172        children.add(new Property("purpose", "markdown", "Explaination of why this capability statement is needed and why it has been designed as it has.", 0, 1, purpose));
9173        children.add(new Property("copyright", "markdown", "A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.", 0, 1, copyright));
9174        children.add(new Property("kind", "code", "The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).", 0, 1, kind));
9175        children.add(new Property("instantiates", "uri", "Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.", 0, java.lang.Integer.MAX_VALUE, instantiates));
9176        children.add(new Property("software", "", "Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.", 0, 1, software));
9177        children.add(new Property("implementation", "", "Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, 1, implementation));
9178        children.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this capability statement is based.", 0, 1, fhirVersion));
9179        children.add(new Property("acceptUnknown", "code", "A code that indicates whether the application accepts unknown elements or extensions when reading resources.", 0, 1, acceptUnknown));
9180        children.add(new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format));
9181        children.add(new Property("patchFormat", "code", "A list of the patch formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, patchFormat));
9182        children.add(new Property("implementationGuide", "uri", "A list of implementation guides that the server does (or should) support in their entirety.", 0, java.lang.Integer.MAX_VALUE, implementationGuide));
9183        children.add(new Property("profile", "Reference(StructureDefinition)", "A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, java.lang.Integer.MAX_VALUE, profile));
9184        children.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest));
9185        children.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging));
9186        children.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document));
9187      }
9188
9189      @Override
9190      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9191        switch (_hash) {
9192        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url);
9193        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
9194        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
9195        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the capability statement.", 0, 1, title);
9196        case -892481550: /*status*/  return new Property("status", "code", "The status of this capability statement. Enables tracking the life-cycle of the content.", 0, 1, status);
9197        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
9198        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.", 0, 1, date);
9199        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the individual or organization that published the capability statement.", 0, 1, publisher);
9200        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
9201        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, 1, description);
9202        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate capability statement instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
9203        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the capability statement is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
9204        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explaination of why this capability statement is needed and why it has been designed as it has.", 0, 1, purpose);
9205        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.", 0, 1, copyright);
9206        case 3292052: /*kind*/  return new Property("kind", "code", "The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).", 0, 1, kind);
9207        case -246883639: /*instantiates*/  return new Property("instantiates", "uri", "Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.", 0, java.lang.Integer.MAX_VALUE, instantiates);
9208        case 1319330215: /*software*/  return new Property("software", "", "Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.", 0, 1, software);
9209        case 1683336114: /*implementation*/  return new Property("implementation", "", "Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, 1, implementation);
9210        case 461006061: /*fhirVersion*/  return new Property("fhirVersion", "id", "The version of the FHIR specification on which this capability statement is based.", 0, 1, fhirVersion);
9211        case -1862642142: /*acceptUnknown*/  return new Property("acceptUnknown", "code", "A code that indicates whether the application accepts unknown elements or extensions when reading resources.", 0, 1, acceptUnknown);
9212        case -1268779017: /*format*/  return new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format);
9213        case 172338783: /*patchFormat*/  return new Property("patchFormat", "code", "A list of the patch formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, patchFormat);
9214        case 156966506: /*implementationGuide*/  return new Property("implementationGuide", "uri", "A list of implementation guides that the server does (or should) support in their entirety.", 0, java.lang.Integer.MAX_VALUE, implementationGuide);
9215        case -309425751: /*profile*/  return new Property("profile", "Reference(StructureDefinition)", "A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, java.lang.Integer.MAX_VALUE, profile);
9216        case 3496916: /*rest*/  return new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest);
9217        case -1440008444: /*messaging*/  return new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging);
9218        case 861720859: /*document*/  return new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document);
9219        default: return super.getNamedProperty(_hash, _name, _checkValid);
9220        }
9221
9222      }
9223
9224      @Override
9225      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9226        switch (hash) {
9227        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
9228        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
9229        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
9230        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
9231        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
9232        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
9233        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
9234        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
9235        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
9236        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
9237        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
9238        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
9239        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
9240        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
9241        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<CapabilityStatementKind>
9242        case -246883639: /*instantiates*/ return this.instantiates == null ? new Base[0] : this.instantiates.toArray(new Base[this.instantiates.size()]); // UriType
9243        case 1319330215: /*software*/ return this.software == null ? new Base[0] : new Base[] {this.software}; // CapabilityStatementSoftwareComponent
9244        case 1683336114: /*implementation*/ return this.implementation == null ? new Base[0] : new Base[] {this.implementation}; // CapabilityStatementImplementationComponent
9245        case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType
9246        case -1862642142: /*acceptUnknown*/ return this.acceptUnknown == null ? new Base[0] : new Base[] {this.acceptUnknown}; // Enumeration<UnknownContentCode>
9247        case -1268779017: /*format*/ return this.format == null ? new Base[0] : this.format.toArray(new Base[this.format.size()]); // CodeType
9248        case 172338783: /*patchFormat*/ return this.patchFormat == null ? new Base[0] : this.patchFormat.toArray(new Base[this.patchFormat.size()]); // CodeType
9249        case 156966506: /*implementationGuide*/ return this.implementationGuide == null ? new Base[0] : this.implementationGuide.toArray(new Base[this.implementationGuide.size()]); // UriType
9250        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference
9251        case 3496916: /*rest*/ return this.rest == null ? new Base[0] : this.rest.toArray(new Base[this.rest.size()]); // CapabilityStatementRestComponent
9252        case -1440008444: /*messaging*/ return this.messaging == null ? new Base[0] : this.messaging.toArray(new Base[this.messaging.size()]); // CapabilityStatementMessagingComponent
9253        case 861720859: /*document*/ return this.document == null ? new Base[0] : this.document.toArray(new Base[this.document.size()]); // CapabilityStatementDocumentComponent
9254        default: return super.getProperty(hash, name, checkValid);
9255        }
9256
9257      }
9258
9259      @Override
9260      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9261        switch (hash) {
9262        case 116079: // url
9263          this.url = castToUri(value); // UriType
9264          return value;
9265        case 351608024: // version
9266          this.version = castToString(value); // StringType
9267          return value;
9268        case 3373707: // name
9269          this.name = castToString(value); // StringType
9270          return value;
9271        case 110371416: // title
9272          this.title = castToString(value); // StringType
9273          return value;
9274        case -892481550: // status
9275          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
9276          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
9277          return value;
9278        case -404562712: // experimental
9279          this.experimental = castToBoolean(value); // BooleanType
9280          return value;
9281        case 3076014: // date
9282          this.date = castToDateTime(value); // DateTimeType
9283          return value;
9284        case 1447404028: // publisher
9285          this.publisher = castToString(value); // StringType
9286          return value;
9287        case 951526432: // contact
9288          this.getContact().add(castToContactDetail(value)); // ContactDetail
9289          return value;
9290        case -1724546052: // description
9291          this.description = castToMarkdown(value); // MarkdownType
9292          return value;
9293        case -669707736: // useContext
9294          this.getUseContext().add(castToUsageContext(value)); // UsageContext
9295          return value;
9296        case -507075711: // jurisdiction
9297          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
9298          return value;
9299        case -220463842: // purpose
9300          this.purpose = castToMarkdown(value); // MarkdownType
9301          return value;
9302        case 1522889671: // copyright
9303          this.copyright = castToMarkdown(value); // MarkdownType
9304          return value;
9305        case 3292052: // kind
9306          value = new CapabilityStatementKindEnumFactory().fromType(castToCode(value));
9307          this.kind = (Enumeration) value; // Enumeration<CapabilityStatementKind>
9308          return value;
9309        case -246883639: // instantiates
9310          this.getInstantiates().add(castToUri(value)); // UriType
9311          return value;
9312        case 1319330215: // software
9313          this.software = (CapabilityStatementSoftwareComponent) value; // CapabilityStatementSoftwareComponent
9314          return value;
9315        case 1683336114: // implementation
9316          this.implementation = (CapabilityStatementImplementationComponent) value; // CapabilityStatementImplementationComponent
9317          return value;
9318        case 461006061: // fhirVersion
9319          this.fhirVersion = castToId(value); // IdType
9320          return value;
9321        case -1862642142: // acceptUnknown
9322          value = new UnknownContentCodeEnumFactory().fromType(castToCode(value));
9323          this.acceptUnknown = (Enumeration) value; // Enumeration<UnknownContentCode>
9324          return value;
9325        case -1268779017: // format
9326          this.getFormat().add(castToCode(value)); // CodeType
9327          return value;
9328        case 172338783: // patchFormat
9329          this.getPatchFormat().add(castToCode(value)); // CodeType
9330          return value;
9331        case 156966506: // implementationGuide
9332          this.getImplementationGuide().add(castToUri(value)); // UriType
9333          return value;
9334        case -309425751: // profile
9335          this.getProfile().add(castToReference(value)); // Reference
9336          return value;
9337        case 3496916: // rest
9338          this.getRest().add((CapabilityStatementRestComponent) value); // CapabilityStatementRestComponent
9339          return value;
9340        case -1440008444: // messaging
9341          this.getMessaging().add((CapabilityStatementMessagingComponent) value); // CapabilityStatementMessagingComponent
9342          return value;
9343        case 861720859: // document
9344          this.getDocument().add((CapabilityStatementDocumentComponent) value); // CapabilityStatementDocumentComponent
9345          return value;
9346        default: return super.setProperty(hash, name, value);
9347        }
9348
9349      }
9350
9351      @Override
9352      public Base setProperty(String name, Base value) throws FHIRException {
9353        if (name.equals("url")) {
9354          this.url = castToUri(value); // UriType
9355        } else if (name.equals("version")) {
9356          this.version = castToString(value); // StringType
9357        } else if (name.equals("name")) {
9358          this.name = castToString(value); // StringType
9359        } else if (name.equals("title")) {
9360          this.title = castToString(value); // StringType
9361        } else if (name.equals("status")) {
9362          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
9363          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
9364        } else if (name.equals("experimental")) {
9365          this.experimental = castToBoolean(value); // BooleanType
9366        } else if (name.equals("date")) {
9367          this.date = castToDateTime(value); // DateTimeType
9368        } else if (name.equals("publisher")) {
9369          this.publisher = castToString(value); // StringType
9370        } else if (name.equals("contact")) {
9371          this.getContact().add(castToContactDetail(value));
9372        } else if (name.equals("description")) {
9373          this.description = castToMarkdown(value); // MarkdownType
9374        } else if (name.equals("useContext")) {
9375          this.getUseContext().add(castToUsageContext(value));
9376        } else if (name.equals("jurisdiction")) {
9377          this.getJurisdiction().add(castToCodeableConcept(value));
9378        } else if (name.equals("purpose")) {
9379          this.purpose = castToMarkdown(value); // MarkdownType
9380        } else if (name.equals("copyright")) {
9381          this.copyright = castToMarkdown(value); // MarkdownType
9382        } else if (name.equals("kind")) {
9383          value = new CapabilityStatementKindEnumFactory().fromType(castToCode(value));
9384          this.kind = (Enumeration) value; // Enumeration<CapabilityStatementKind>
9385        } else if (name.equals("instantiates")) {
9386          this.getInstantiates().add(castToUri(value));
9387        } else if (name.equals("software")) {
9388          this.software = (CapabilityStatementSoftwareComponent) value; // CapabilityStatementSoftwareComponent
9389        } else if (name.equals("implementation")) {
9390          this.implementation = (CapabilityStatementImplementationComponent) value; // CapabilityStatementImplementationComponent
9391        } else if (name.equals("fhirVersion")) {
9392          this.fhirVersion = castToId(value); // IdType
9393        } else if (name.equals("acceptUnknown")) {
9394          value = new UnknownContentCodeEnumFactory().fromType(castToCode(value));
9395          this.acceptUnknown = (Enumeration) value; // Enumeration<UnknownContentCode>
9396        } else if (name.equals("format")) {
9397          this.getFormat().add(castToCode(value));
9398        } else if (name.equals("patchFormat")) {
9399          this.getPatchFormat().add(castToCode(value));
9400        } else if (name.equals("implementationGuide")) {
9401          this.getImplementationGuide().add(castToUri(value));
9402        } else if (name.equals("profile")) {
9403          this.getProfile().add(castToReference(value));
9404        } else if (name.equals("rest")) {
9405          this.getRest().add((CapabilityStatementRestComponent) value);
9406        } else if (name.equals("messaging")) {
9407          this.getMessaging().add((CapabilityStatementMessagingComponent) value);
9408        } else if (name.equals("document")) {
9409          this.getDocument().add((CapabilityStatementDocumentComponent) value);
9410        } else
9411          return super.setProperty(name, value);
9412        return value;
9413      }
9414
9415      @Override
9416      public Base makeProperty(int hash, String name) throws FHIRException {
9417        switch (hash) {
9418        case 116079:  return getUrlElement();
9419        case 351608024:  return getVersionElement();
9420        case 3373707:  return getNameElement();
9421        case 110371416:  return getTitleElement();
9422        case -892481550:  return getStatusElement();
9423        case -404562712:  return getExperimentalElement();
9424        case 3076014:  return getDateElement();
9425        case 1447404028:  return getPublisherElement();
9426        case 951526432:  return addContact(); 
9427        case -1724546052:  return getDescriptionElement();
9428        case -669707736:  return addUseContext(); 
9429        case -507075711:  return addJurisdiction(); 
9430        case -220463842:  return getPurposeElement();
9431        case 1522889671:  return getCopyrightElement();
9432        case 3292052:  return getKindElement();
9433        case -246883639:  return addInstantiatesElement();
9434        case 1319330215:  return getSoftware(); 
9435        case 1683336114:  return getImplementation(); 
9436        case 461006061:  return getFhirVersionElement();
9437        case -1862642142:  return getAcceptUnknownElement();
9438        case -1268779017:  return addFormatElement();
9439        case 172338783:  return addPatchFormatElement();
9440        case 156966506:  return addImplementationGuideElement();
9441        case -309425751:  return addProfile(); 
9442        case 3496916:  return addRest(); 
9443        case -1440008444:  return addMessaging(); 
9444        case 861720859:  return addDocument(); 
9445        default: return super.makeProperty(hash, name);
9446        }
9447
9448      }
9449
9450      @Override
9451      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9452        switch (hash) {
9453        case 116079: /*url*/ return new String[] {"uri"};
9454        case 351608024: /*version*/ return new String[] {"string"};
9455        case 3373707: /*name*/ return new String[] {"string"};
9456        case 110371416: /*title*/ return new String[] {"string"};
9457        case -892481550: /*status*/ return new String[] {"code"};
9458        case -404562712: /*experimental*/ return new String[] {"boolean"};
9459        case 3076014: /*date*/ return new String[] {"dateTime"};
9460        case 1447404028: /*publisher*/ return new String[] {"string"};
9461        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
9462        case -1724546052: /*description*/ return new String[] {"markdown"};
9463        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
9464        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
9465        case -220463842: /*purpose*/ return new String[] {"markdown"};
9466        case 1522889671: /*copyright*/ return new String[] {"markdown"};
9467        case 3292052: /*kind*/ return new String[] {"code"};
9468        case -246883639: /*instantiates*/ return new String[] {"uri"};
9469        case 1319330215: /*software*/ return new String[] {};
9470        case 1683336114: /*implementation*/ return new String[] {};
9471        case 461006061: /*fhirVersion*/ return new String[] {"id"};
9472        case -1862642142: /*acceptUnknown*/ return new String[] {"code"};
9473        case -1268779017: /*format*/ return new String[] {"code"};
9474        case 172338783: /*patchFormat*/ return new String[] {"code"};
9475        case 156966506: /*implementationGuide*/ return new String[] {"uri"};
9476        case -309425751: /*profile*/ return new String[] {"Reference"};
9477        case 3496916: /*rest*/ return new String[] {};
9478        case -1440008444: /*messaging*/ return new String[] {};
9479        case 861720859: /*document*/ return new String[] {};
9480        default: return super.getTypesForProperty(hash, name);
9481        }
9482
9483      }
9484
9485      @Override
9486      public Base addChild(String name) throws FHIRException {
9487        if (name.equals("url")) {
9488          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.url");
9489        }
9490        else if (name.equals("version")) {
9491          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.version");
9492        }
9493        else if (name.equals("name")) {
9494          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
9495        }
9496        else if (name.equals("title")) {
9497          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.title");
9498        }
9499        else if (name.equals("status")) {
9500          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.status");
9501        }
9502        else if (name.equals("experimental")) {
9503          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.experimental");
9504        }
9505        else if (name.equals("date")) {
9506          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.date");
9507        }
9508        else if (name.equals("publisher")) {
9509          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.publisher");
9510        }
9511        else if (name.equals("contact")) {
9512          return addContact();
9513        }
9514        else if (name.equals("description")) {
9515          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
9516        }
9517        else if (name.equals("useContext")) {
9518          return addUseContext();
9519        }
9520        else if (name.equals("jurisdiction")) {
9521          return addJurisdiction();
9522        }
9523        else if (name.equals("purpose")) {
9524          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.purpose");
9525        }
9526        else if (name.equals("copyright")) {
9527          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.copyright");
9528        }
9529        else if (name.equals("kind")) {
9530          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.kind");
9531        }
9532        else if (name.equals("instantiates")) {
9533          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.instantiates");
9534        }
9535        else if (name.equals("software")) {
9536          this.software = new CapabilityStatementSoftwareComponent();
9537          return this.software;
9538        }
9539        else if (name.equals("implementation")) {
9540          this.implementation = new CapabilityStatementImplementationComponent();
9541          return this.implementation;
9542        }
9543        else if (name.equals("fhirVersion")) {
9544          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.fhirVersion");
9545        }
9546        else if (name.equals("acceptUnknown")) {
9547          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.acceptUnknown");
9548        }
9549        else if (name.equals("format")) {
9550          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.format");
9551        }
9552        else if (name.equals("patchFormat")) {
9553          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.patchFormat");
9554        }
9555        else if (name.equals("implementationGuide")) {
9556          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.implementationGuide");
9557        }
9558        else if (name.equals("profile")) {
9559          return addProfile();
9560        }
9561        else if (name.equals("rest")) {
9562          return addRest();
9563        }
9564        else if (name.equals("messaging")) {
9565          return addMessaging();
9566        }
9567        else if (name.equals("document")) {
9568          return addDocument();
9569        }
9570        else
9571          return super.addChild(name);
9572      }
9573
9574  public String fhirType() {
9575    return "CapabilityStatement";
9576
9577  }
9578
9579      public CapabilityStatement copy() {
9580        CapabilityStatement dst = new CapabilityStatement();
9581        copyValues(dst);
9582        dst.url = url == null ? null : url.copy();
9583        dst.version = version == null ? null : version.copy();
9584        dst.name = name == null ? null : name.copy();
9585        dst.title = title == null ? null : title.copy();
9586        dst.status = status == null ? null : status.copy();
9587        dst.experimental = experimental == null ? null : experimental.copy();
9588        dst.date = date == null ? null : date.copy();
9589        dst.publisher = publisher == null ? null : publisher.copy();
9590        if (contact != null) {
9591          dst.contact = new ArrayList<ContactDetail>();
9592          for (ContactDetail i : contact)
9593            dst.contact.add(i.copy());
9594        };
9595        dst.description = description == null ? null : description.copy();
9596        if (useContext != null) {
9597          dst.useContext = new ArrayList<UsageContext>();
9598          for (UsageContext i : useContext)
9599            dst.useContext.add(i.copy());
9600        };
9601        if (jurisdiction != null) {
9602          dst.jurisdiction = new ArrayList<CodeableConcept>();
9603          for (CodeableConcept i : jurisdiction)
9604            dst.jurisdiction.add(i.copy());
9605        };
9606        dst.purpose = purpose == null ? null : purpose.copy();
9607        dst.copyright = copyright == null ? null : copyright.copy();
9608        dst.kind = kind == null ? null : kind.copy();
9609        if (instantiates != null) {
9610          dst.instantiates = new ArrayList<UriType>();
9611          for (UriType i : instantiates)
9612            dst.instantiates.add(i.copy());
9613        };
9614        dst.software = software == null ? null : software.copy();
9615        dst.implementation = implementation == null ? null : implementation.copy();
9616        dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy();
9617        dst.acceptUnknown = acceptUnknown == null ? null : acceptUnknown.copy();
9618        if (format != null) {
9619          dst.format = new ArrayList<CodeType>();
9620          for (CodeType i : format)
9621            dst.format.add(i.copy());
9622        };
9623        if (patchFormat != null) {
9624          dst.patchFormat = new ArrayList<CodeType>();
9625          for (CodeType i : patchFormat)
9626            dst.patchFormat.add(i.copy());
9627        };
9628        if (implementationGuide != null) {
9629          dst.implementationGuide = new ArrayList<UriType>();
9630          for (UriType i : implementationGuide)
9631            dst.implementationGuide.add(i.copy());
9632        };
9633        if (profile != null) {
9634          dst.profile = new ArrayList<Reference>();
9635          for (Reference i : profile)
9636            dst.profile.add(i.copy());
9637        };
9638        if (rest != null) {
9639          dst.rest = new ArrayList<CapabilityStatementRestComponent>();
9640          for (CapabilityStatementRestComponent i : rest)
9641            dst.rest.add(i.copy());
9642        };
9643        if (messaging != null) {
9644          dst.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
9645          for (CapabilityStatementMessagingComponent i : messaging)
9646            dst.messaging.add(i.copy());
9647        };
9648        if (document != null) {
9649          dst.document = new ArrayList<CapabilityStatementDocumentComponent>();
9650          for (CapabilityStatementDocumentComponent i : document)
9651            dst.document.add(i.copy());
9652        };
9653        return dst;
9654      }
9655
9656      protected CapabilityStatement typedCopy() {
9657        return copy();
9658      }
9659
9660      @Override
9661      public boolean equalsDeep(Base other_) {
9662        if (!super.equalsDeep(other_))
9663          return false;
9664        if (!(other_ instanceof CapabilityStatement))
9665          return false;
9666        CapabilityStatement o = (CapabilityStatement) other_;
9667        return compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true) && compareDeep(kind, o.kind, true)
9668           && compareDeep(instantiates, o.instantiates, true) && compareDeep(software, o.software, true) && compareDeep(implementation, o.implementation, true)
9669           && compareDeep(fhirVersion, o.fhirVersion, true) && compareDeep(acceptUnknown, o.acceptUnknown, true)
9670           && compareDeep(format, o.format, true) && compareDeep(patchFormat, o.patchFormat, true) && compareDeep(implementationGuide, o.implementationGuide, true)
9671           && compareDeep(profile, o.profile, true) && compareDeep(rest, o.rest, true) && compareDeep(messaging, o.messaging, true)
9672           && compareDeep(document, o.document, true);
9673      }
9674
9675      @Override
9676      public boolean equalsShallow(Base other_) {
9677        if (!super.equalsShallow(other_))
9678          return false;
9679        if (!(other_ instanceof CapabilityStatement))
9680          return false;
9681        CapabilityStatement o = (CapabilityStatement) other_;
9682        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(kind, o.kind, true)
9683           && compareValues(instantiates, o.instantiates, true) && compareValues(fhirVersion, o.fhirVersion, true)
9684           && compareValues(acceptUnknown, o.acceptUnknown, true) && compareValues(format, o.format, true) && compareValues(patchFormat, o.patchFormat, true)
9685           && compareValues(implementationGuide, o.implementationGuide, true);
9686      }
9687
9688      public boolean isEmpty() {
9689        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(purpose, copyright, kind
9690          , instantiates, software, implementation, fhirVersion, acceptUnknown, format, patchFormat
9691          , implementationGuide, profile, rest, messaging, document);
9692      }
9693
9694  @Override
9695  public ResourceType getResourceType() {
9696    return ResourceType.CapabilityStatement;
9697   }
9698
9699 /**
9700   * Search parameter: <b>date</b>
9701   * <p>
9702   * Description: <b>The capability statement publication date</b><br>
9703   * Type: <b>date</b><br>
9704   * Path: <b>CapabilityStatement.date</b><br>
9705   * </p>
9706   */
9707  @SearchParamDefinition(name="date", path="CapabilityStatement.date", description="The capability statement publication date", type="date" )
9708  public static final String SP_DATE = "date";
9709 /**
9710   * <b>Fluent Client</b> search parameter constant for <b>date</b>
9711   * <p>
9712   * Description: <b>The capability statement publication date</b><br>
9713   * Type: <b>date</b><br>
9714   * Path: <b>CapabilityStatement.date</b><br>
9715   * </p>
9716   */
9717  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
9718
9719 /**
9720   * Search parameter: <b>resource-profile</b>
9721   * <p>
9722   * Description: <b>A profile id invoked in a capability statement</b><br>
9723   * Type: <b>reference</b><br>
9724   * Path: <b>CapabilityStatement.rest.resource.profile</b><br>
9725   * </p>
9726   */
9727  @SearchParamDefinition(name="resource-profile", path="CapabilityStatement.rest.resource.profile", description="A profile id invoked in a capability statement", type="reference", target={StructureDefinition.class } )
9728  public static final String SP_RESOURCE_PROFILE = "resource-profile";
9729 /**
9730   * <b>Fluent Client</b> search parameter constant for <b>resource-profile</b>
9731   * <p>
9732   * Description: <b>A profile id invoked in a capability statement</b><br>
9733   * Type: <b>reference</b><br>
9734   * Path: <b>CapabilityStatement.rest.resource.profile</b><br>
9735   * </p>
9736   */
9737  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESOURCE_PROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESOURCE_PROFILE);
9738
9739/**
9740   * Constant for fluent queries to be used to add include statements. Specifies
9741   * the path value of "<b>CapabilityStatement:resource-profile</b>".
9742   */
9743  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESOURCE_PROFILE = new ca.uhn.fhir.model.api.Include("CapabilityStatement:resource-profile").toLocked();
9744
9745 /**
9746   * Search parameter: <b>software</b>
9747   * <p>
9748   * Description: <b>Part of a the name of a software application</b><br>
9749   * Type: <b>string</b><br>
9750   * Path: <b>CapabilityStatement.software.name</b><br>
9751   * </p>
9752   */
9753  @SearchParamDefinition(name="software", path="CapabilityStatement.software.name", description="Part of a the name of a software application", type="string" )
9754  public static final String SP_SOFTWARE = "software";
9755 /**
9756   * <b>Fluent Client</b> search parameter constant for <b>software</b>
9757   * <p>
9758   * Description: <b>Part of a the name of a software application</b><br>
9759   * Type: <b>string</b><br>
9760   * Path: <b>CapabilityStatement.software.name</b><br>
9761   * </p>
9762   */
9763  public static final ca.uhn.fhir.rest.gclient.StringClientParam SOFTWARE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SOFTWARE);
9764
9765 /**
9766   * Search parameter: <b>resource</b>
9767   * <p>
9768   * Description: <b>Name of a resource mentioned in a capability statement</b><br>
9769   * Type: <b>token</b><br>
9770   * Path: <b>CapabilityStatement.rest.resource.type</b><br>
9771   * </p>
9772   */
9773  @SearchParamDefinition(name="resource", path="CapabilityStatement.rest.resource.type", description="Name of a resource mentioned in a capability statement", type="token" )
9774  public static final String SP_RESOURCE = "resource";
9775 /**
9776   * <b>Fluent Client</b> search parameter constant for <b>resource</b>
9777   * <p>
9778   * Description: <b>Name of a resource mentioned in a capability statement</b><br>
9779   * Type: <b>token</b><br>
9780   * Path: <b>CapabilityStatement.rest.resource.type</b><br>
9781   * </p>
9782   */
9783  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESOURCE);
9784
9785 /**
9786   * Search parameter: <b>jurisdiction</b>
9787   * <p>
9788   * Description: <b>Intended jurisdiction for the capability statement</b><br>
9789   * Type: <b>token</b><br>
9790   * Path: <b>CapabilityStatement.jurisdiction</b><br>
9791   * </p>
9792   */
9793  @SearchParamDefinition(name="jurisdiction", path="CapabilityStatement.jurisdiction", description="Intended jurisdiction for the capability statement", type="token" )
9794  public static final String SP_JURISDICTION = "jurisdiction";
9795 /**
9796   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
9797   * <p>
9798   * Description: <b>Intended jurisdiction for the capability statement</b><br>
9799   * Type: <b>token</b><br>
9800   * Path: <b>CapabilityStatement.jurisdiction</b><br>
9801   * </p>
9802   */
9803  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
9804
9805 /**
9806   * Search parameter: <b>format</b>
9807   * <p>
9808   * Description: <b>formats supported (xml | json | ttl | mime type)</b><br>
9809   * Type: <b>token</b><br>
9810   * Path: <b>CapabilityStatement.format</b><br>
9811   * </p>
9812   */
9813  @SearchParamDefinition(name="format", path="CapabilityStatement.format", description="formats supported (xml | json | ttl | mime type)", type="token" )
9814  public static final String SP_FORMAT = "format";
9815 /**
9816   * <b>Fluent Client</b> search parameter constant for <b>format</b>
9817   * <p>
9818   * Description: <b>formats supported (xml | json | ttl | mime type)</b><br>
9819   * Type: <b>token</b><br>
9820   * Path: <b>CapabilityStatement.format</b><br>
9821   * </p>
9822   */
9823  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMAT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMAT);
9824
9825 /**
9826   * Search parameter: <b>description</b>
9827   * <p>
9828   * Description: <b>The description of the capability statement</b><br>
9829   * Type: <b>string</b><br>
9830   * Path: <b>CapabilityStatement.description</b><br>
9831   * </p>
9832   */
9833  @SearchParamDefinition(name="description", path="CapabilityStatement.description", description="The description of the capability statement", type="string" )
9834  public static final String SP_DESCRIPTION = "description";
9835 /**
9836   * <b>Fluent Client</b> search parameter constant for <b>description</b>
9837   * <p>
9838   * Description: <b>The description of the capability statement</b><br>
9839   * Type: <b>string</b><br>
9840   * Path: <b>CapabilityStatement.description</b><br>
9841   * </p>
9842   */
9843  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
9844
9845 /**
9846   * Search parameter: <b>title</b>
9847   * <p>
9848   * Description: <b>The human-friendly name of the capability statement</b><br>
9849   * Type: <b>string</b><br>
9850   * Path: <b>CapabilityStatement.title</b><br>
9851   * </p>
9852   */
9853  @SearchParamDefinition(name="title", path="CapabilityStatement.title", description="The human-friendly name of the capability statement", type="string" )
9854  public static final String SP_TITLE = "title";
9855 /**
9856   * <b>Fluent Client</b> search parameter constant for <b>title</b>
9857   * <p>
9858   * Description: <b>The human-friendly name of the capability statement</b><br>
9859   * Type: <b>string</b><br>
9860   * Path: <b>CapabilityStatement.title</b><br>
9861   * </p>
9862   */
9863  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
9864
9865 /**
9866   * Search parameter: <b>fhirversion</b>
9867   * <p>
9868   * Description: <b>The version of FHIR</b><br>
9869   * Type: <b>token</b><br>
9870   * Path: <b>CapabilityStatement.version</b><br>
9871   * </p>
9872   */
9873  @SearchParamDefinition(name="fhirversion", path="CapabilityStatement.version", description="The version of FHIR", type="token" )
9874  public static final String SP_FHIRVERSION = "fhirversion";
9875 /**
9876   * <b>Fluent Client</b> search parameter constant for <b>fhirversion</b>
9877   * <p>
9878   * Description: <b>The version of FHIR</b><br>
9879   * Type: <b>token</b><br>
9880   * Path: <b>CapabilityStatement.version</b><br>
9881   * </p>
9882   */
9883  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FHIRVERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FHIRVERSION);
9884
9885 /**
9886   * Search parameter: <b>version</b>
9887   * <p>
9888   * Description: <b>The business version of the capability statement</b><br>
9889   * Type: <b>token</b><br>
9890   * Path: <b>CapabilityStatement.version</b><br>
9891   * </p>
9892   */
9893  @SearchParamDefinition(name="version", path="CapabilityStatement.version", description="The business version of the capability statement", type="token" )
9894  public static final String SP_VERSION = "version";
9895 /**
9896   * <b>Fluent Client</b> search parameter constant for <b>version</b>
9897   * <p>
9898   * Description: <b>The business version of the capability statement</b><br>
9899   * Type: <b>token</b><br>
9900   * Path: <b>CapabilityStatement.version</b><br>
9901   * </p>
9902   */
9903  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
9904
9905 /**
9906   * Search parameter: <b>url</b>
9907   * <p>
9908   * Description: <b>The uri that identifies the capability statement</b><br>
9909   * Type: <b>uri</b><br>
9910   * Path: <b>CapabilityStatement.url</b><br>
9911   * </p>
9912   */
9913  @SearchParamDefinition(name="url", path="CapabilityStatement.url", description="The uri that identifies the capability statement", type="uri" )
9914  public static final String SP_URL = "url";
9915 /**
9916   * <b>Fluent Client</b> search parameter constant for <b>url</b>
9917   * <p>
9918   * Description: <b>The uri that identifies the capability statement</b><br>
9919   * Type: <b>uri</b><br>
9920   * Path: <b>CapabilityStatement.url</b><br>
9921   * </p>
9922   */
9923  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
9924
9925 /**
9926   * Search parameter: <b>supported-profile</b>
9927   * <p>
9928   * Description: <b>Profiles for use cases supported</b><br>
9929   * Type: <b>reference</b><br>
9930   * Path: <b>CapabilityStatement.profile</b><br>
9931   * </p>
9932   */
9933  @SearchParamDefinition(name="supported-profile", path="CapabilityStatement.profile", description="Profiles for use cases supported", type="reference", target={StructureDefinition.class } )
9934  public static final String SP_SUPPORTED_PROFILE = "supported-profile";
9935 /**
9936   * <b>Fluent Client</b> search parameter constant for <b>supported-profile</b>
9937   * <p>
9938   * Description: <b>Profiles for use cases supported</b><br>
9939   * Type: <b>reference</b><br>
9940   * Path: <b>CapabilityStatement.profile</b><br>
9941   * </p>
9942   */
9943  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPORTED_PROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPORTED_PROFILE);
9944
9945/**
9946   * Constant for fluent queries to be used to add include statements. Specifies
9947   * the path value of "<b>CapabilityStatement:supported-profile</b>".
9948   */
9949  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPORTED_PROFILE = new ca.uhn.fhir.model.api.Include("CapabilityStatement:supported-profile").toLocked();
9950
9951 /**
9952   * Search parameter: <b>mode</b>
9953   * <p>
9954   * Description: <b>Mode - restful (server/client) or messaging (sender/receiver)</b><br>
9955   * Type: <b>token</b><br>
9956   * Path: <b>CapabilityStatement.rest.mode</b><br>
9957   * </p>
9958   */
9959  @SearchParamDefinition(name="mode", path="CapabilityStatement.rest.mode", description="Mode - restful (server/client) or messaging (sender/receiver)", type="token" )
9960  public static final String SP_MODE = "mode";
9961 /**
9962   * <b>Fluent Client</b> search parameter constant for <b>mode</b>
9963   * <p>
9964   * Description: <b>Mode - restful (server/client) or messaging (sender/receiver)</b><br>
9965   * Type: <b>token</b><br>
9966   * Path: <b>CapabilityStatement.rest.mode</b><br>
9967   * </p>
9968   */
9969  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MODE);
9970
9971 /**
9972   * Search parameter: <b>security-service</b>
9973   * <p>
9974   * Description: <b>OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates</b><br>
9975   * Type: <b>token</b><br>
9976   * Path: <b>CapabilityStatement.rest.security.service</b><br>
9977   * </p>
9978   */
9979  @SearchParamDefinition(name="security-service", path="CapabilityStatement.rest.security.service", description="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", type="token" )
9980  public static final String SP_SECURITY_SERVICE = "security-service";
9981 /**
9982   * <b>Fluent Client</b> search parameter constant for <b>security-service</b>
9983   * <p>
9984   * Description: <b>OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates</b><br>
9985   * Type: <b>token</b><br>
9986   * Path: <b>CapabilityStatement.rest.security.service</b><br>
9987   * </p>
9988   */
9989  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITY_SERVICE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITY_SERVICE);
9990
9991 /**
9992   * Search parameter: <b>name</b>
9993   * <p>
9994   * Description: <b>Computationally friendly name of the capability statement</b><br>
9995   * Type: <b>string</b><br>
9996   * Path: <b>CapabilityStatement.name</b><br>
9997   * </p>
9998   */
9999  @SearchParamDefinition(name="name", path="CapabilityStatement.name", description="Computationally friendly name of the capability statement", type="string" )
10000  public static final String SP_NAME = "name";
10001 /**
10002   * <b>Fluent Client</b> search parameter constant for <b>name</b>
10003   * <p>
10004   * Description: <b>Computationally friendly name of the capability statement</b><br>
10005   * Type: <b>string</b><br>
10006   * Path: <b>CapabilityStatement.name</b><br>
10007   * </p>
10008   */
10009  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
10010
10011 /**
10012   * Search parameter: <b>publisher</b>
10013   * <p>
10014   * Description: <b>Name of the publisher of the capability statement</b><br>
10015   * Type: <b>string</b><br>
10016   * Path: <b>CapabilityStatement.publisher</b><br>
10017   * </p>
10018   */
10019  @SearchParamDefinition(name="publisher", path="CapabilityStatement.publisher", description="Name of the publisher of the capability statement", type="string" )
10020  public static final String SP_PUBLISHER = "publisher";
10021 /**
10022   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
10023   * <p>
10024   * Description: <b>Name of the publisher of the capability statement</b><br>
10025   * Type: <b>string</b><br>
10026   * Path: <b>CapabilityStatement.publisher</b><br>
10027   * </p>
10028   */
10029  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
10030
10031 /**
10032   * Search parameter: <b>event</b>
10033   * <p>
10034   * Description: <b>Event code in a capability statement</b><br>
10035   * Type: <b>token</b><br>
10036   * Path: <b>CapabilityStatement.messaging.event.code</b><br>
10037   * </p>
10038   */
10039  @SearchParamDefinition(name="event", path="CapabilityStatement.messaging.event.code", description="Event code in a capability statement", type="token" )
10040  public static final String SP_EVENT = "event";
10041 /**
10042   * <b>Fluent Client</b> search parameter constant for <b>event</b>
10043   * <p>
10044   * Description: <b>Event code in a capability statement</b><br>
10045   * Type: <b>token</b><br>
10046   * Path: <b>CapabilityStatement.messaging.event.code</b><br>
10047   * </p>
10048   */
10049  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT);
10050
10051 /**
10052   * Search parameter: <b>guide</b>
10053   * <p>
10054   * Description: <b>Implementation guides supported</b><br>
10055   * Type: <b>uri</b><br>
10056   * Path: <b>CapabilityStatement.implementationGuide</b><br>
10057   * </p>
10058   */
10059  @SearchParamDefinition(name="guide", path="CapabilityStatement.implementationGuide", description="Implementation guides supported", type="uri" )
10060  public static final String SP_GUIDE = "guide";
10061 /**
10062   * <b>Fluent Client</b> search parameter constant for <b>guide</b>
10063   * <p>
10064   * Description: <b>Implementation guides supported</b><br>
10065   * Type: <b>uri</b><br>
10066   * Path: <b>CapabilityStatement.implementationGuide</b><br>
10067   * </p>
10068   */
10069  public static final ca.uhn.fhir.rest.gclient.UriClientParam GUIDE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_GUIDE);
10070
10071 /**
10072   * Search parameter: <b>status</b>
10073   * <p>
10074   * Description: <b>The current status of the capability statement</b><br>
10075   * Type: <b>token</b><br>
10076   * Path: <b>CapabilityStatement.status</b><br>
10077   * </p>
10078   */
10079  @SearchParamDefinition(name="status", path="CapabilityStatement.status", description="The current status of the capability statement", type="token" )
10080  public static final String SP_STATUS = "status";
10081 /**
10082   * <b>Fluent Client</b> search parameter constant for <b>status</b>
10083   * <p>
10084   * Description: <b>The current status of the capability statement</b><br>
10085   * Type: <b>token</b><br>
10086   * Path: <b>CapabilityStatement.status</b><br>
10087   * </p>
10088   */
10089  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
10090
10091
10092}
10093