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