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