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