001package org.hl7.fhir.dstu3.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 Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.dstu3.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * A code system resource specifies a set of codes drawn from one or more code systems.
048 */
049@ResourceDef(name="CodeSystem", profile="http://hl7.org/fhir/Profile/CodeSystem")
050@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "caseSensitive", "valueSet", "hierarchyMeaning", "compositional", "versionNeeded", "content", "count", "filter", "property", "concept"})
051public class CodeSystem extends MetadataResource {
052
053    public enum CodeSystemHierarchyMeaning {
054        /**
055         * No particular relationship between the concepts can be assumed, except what can be determined by inspection of the definitions of the elements (possible reasons to use this: importing from a source where this is not defined, or where various parts of the hierarchy have different meanings)
056         */
057        GROUPEDBY, 
058        /**
059         * A hierarchy where the child concepts have an IS-A relationship with the parents - that is, all the properties of the parent are also true for its child concepts
060         */
061        ISA, 
062        /**
063         * Child elements list the individual parts of a composite whole (e.g. body site)
064         */
065        PARTOF, 
066        /**
067         * Child concepts in the hierarchy may have only one parent, and there is a presumption that the code system is a "closed world" meaning all things must be in the hierarchy. This results in concepts such as "not otherwise classified."
068         */
069        CLASSIFIEDWITH, 
070        /**
071         * added to help the parsers with the generic types
072         */
073        NULL;
074        public static CodeSystemHierarchyMeaning fromCode(String codeString) throws FHIRException {
075            if (codeString == null || "".equals(codeString))
076                return null;
077        if ("grouped-by".equals(codeString))
078          return GROUPEDBY;
079        if ("is-a".equals(codeString))
080          return ISA;
081        if ("part-of".equals(codeString))
082          return PARTOF;
083        if ("classified-with".equals(codeString))
084          return CLASSIFIEDWITH;
085        if (Configuration.isAcceptInvalidEnums())
086          return null;
087        else
088          throw new FHIRException("Unknown CodeSystemHierarchyMeaning code '"+codeString+"'");
089        }
090        public String toCode() {
091          switch (this) {
092            case GROUPEDBY: return "grouped-by";
093            case ISA: return "is-a";
094            case PARTOF: return "part-of";
095            case CLASSIFIEDWITH: return "classified-with";
096            default: return "?";
097          }
098        }
099        public String getSystem() {
100          switch (this) {
101            case GROUPEDBY: return "http://hl7.org/fhir/codesystem-hierarchy-meaning";
102            case ISA: return "http://hl7.org/fhir/codesystem-hierarchy-meaning";
103            case PARTOF: return "http://hl7.org/fhir/codesystem-hierarchy-meaning";
104            case CLASSIFIEDWITH: return "http://hl7.org/fhir/codesystem-hierarchy-meaning";
105            default: return "?";
106          }
107        }
108        public String getDefinition() {
109          switch (this) {
110            case GROUPEDBY: return "No particular relationship between the concepts can be assumed, except what can be determined by inspection of the definitions of the elements (possible reasons to use this: importing from a source where this is not defined, or where various parts of the hierarchy have different meanings)";
111            case ISA: return "A hierarchy where the child concepts have an IS-A relationship with the parents - that is, all the properties of the parent are also true for its child concepts";
112            case PARTOF: return "Child elements list the individual parts of a composite whole (e.g. body site)";
113            case CLASSIFIEDWITH: return "Child concepts in the hierarchy may have only one parent, and there is a presumption that the code system is a \"closed world\" meaning all things must be in the hierarchy. This results in concepts such as \"not otherwise classified.\"";
114            default: return "?";
115          }
116        }
117        public String getDisplay() {
118          switch (this) {
119            case GROUPEDBY: return "Grouped By";
120            case ISA: return "Is-A";
121            case PARTOF: return "Part Of";
122            case CLASSIFIEDWITH: return "Classified With";
123            default: return "?";
124          }
125        }
126    }
127
128  public static class CodeSystemHierarchyMeaningEnumFactory implements EnumFactory<CodeSystemHierarchyMeaning> {
129    public CodeSystemHierarchyMeaning fromCode(String codeString) throws IllegalArgumentException {
130      if (codeString == null || "".equals(codeString))
131            if (codeString == null || "".equals(codeString))
132                return null;
133        if ("grouped-by".equals(codeString))
134          return CodeSystemHierarchyMeaning.GROUPEDBY;
135        if ("is-a".equals(codeString))
136          return CodeSystemHierarchyMeaning.ISA;
137        if ("part-of".equals(codeString))
138          return CodeSystemHierarchyMeaning.PARTOF;
139        if ("classified-with".equals(codeString))
140          return CodeSystemHierarchyMeaning.CLASSIFIEDWITH;
141        throw new IllegalArgumentException("Unknown CodeSystemHierarchyMeaning code '"+codeString+"'");
142        }
143        public Enumeration<CodeSystemHierarchyMeaning> fromType(Base code) throws FHIRException {
144          if (code == null)
145            return null;
146          if (code.isEmpty())
147            return new Enumeration<CodeSystemHierarchyMeaning>(this);
148          String codeString = ((PrimitiveType) code).asStringValue();
149          if (codeString == null || "".equals(codeString))
150            return null;
151        if ("grouped-by".equals(codeString))
152          return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.GROUPEDBY);
153        if ("is-a".equals(codeString))
154          return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.ISA);
155        if ("part-of".equals(codeString))
156          return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.PARTOF);
157        if ("classified-with".equals(codeString))
158          return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.CLASSIFIEDWITH);
159        throw new FHIRException("Unknown CodeSystemHierarchyMeaning code '"+codeString+"'");
160        }
161    public String toCode(CodeSystemHierarchyMeaning code) {
162      if (code == CodeSystemHierarchyMeaning.GROUPEDBY)
163        return "grouped-by";
164      if (code == CodeSystemHierarchyMeaning.ISA)
165        return "is-a";
166      if (code == CodeSystemHierarchyMeaning.PARTOF)
167        return "part-of";
168      if (code == CodeSystemHierarchyMeaning.CLASSIFIEDWITH)
169        return "classified-with";
170      return "?";
171      }
172    public String toSystem(CodeSystemHierarchyMeaning code) {
173      return code.getSystem();
174      }
175    }
176
177    public enum CodeSystemContentMode {
178        /**
179         * None of the concepts defined by the code system are included in the code system resource
180         */
181        NOTPRESENT, 
182        /**
183         * A few representative concepts are included in the code system resource
184         */
185        EXAMPLE, 
186        /**
187         * A subset of the code system concepts are included in the code system resource
188         */
189        FRAGMENT, 
190        /**
191         * All the concepts defined by the code system are included in the code system resource
192         */
193        COMPLETE, 
194        /**
195         * added to help the parsers with the generic types
196         */
197        NULL;
198        public static CodeSystemContentMode fromCode(String codeString) throws FHIRException {
199            if (codeString == null || "".equals(codeString))
200                return null;
201        if ("not-present".equals(codeString))
202          return NOTPRESENT;
203        if ("example".equals(codeString))
204          return EXAMPLE;
205        if ("fragment".equals(codeString))
206          return FRAGMENT;
207        if ("complete".equals(codeString))
208          return COMPLETE;
209        if (Configuration.isAcceptInvalidEnums())
210          return null;
211        else
212          throw new FHIRException("Unknown CodeSystemContentMode code '"+codeString+"'");
213        }
214        public String toCode() {
215          switch (this) {
216            case NOTPRESENT: return "not-present";
217            case EXAMPLE: return "example";
218            case FRAGMENT: return "fragment";
219            case COMPLETE: return "complete";
220            default: return "?";
221          }
222        }
223        public String getSystem() {
224          switch (this) {
225            case NOTPRESENT: return "http://hl7.org/fhir/codesystem-content-mode";
226            case EXAMPLE: return "http://hl7.org/fhir/codesystem-content-mode";
227            case FRAGMENT: return "http://hl7.org/fhir/codesystem-content-mode";
228            case COMPLETE: return "http://hl7.org/fhir/codesystem-content-mode";
229            default: return "?";
230          }
231        }
232        public String getDefinition() {
233          switch (this) {
234            case NOTPRESENT: return "None of the concepts defined by the code system are included in the code system resource";
235            case EXAMPLE: return "A few representative concepts are included in the code system resource";
236            case FRAGMENT: return "A subset of the code system concepts are included in the code system resource";
237            case COMPLETE: return "All the concepts defined by the code system are included in the code system resource";
238            default: return "?";
239          }
240        }
241        public String getDisplay() {
242          switch (this) {
243            case NOTPRESENT: return "Not Present";
244            case EXAMPLE: return "Example";
245            case FRAGMENT: return "Fragment";
246            case COMPLETE: return "Complete";
247            default: return "?";
248          }
249        }
250    }
251
252  public static class CodeSystemContentModeEnumFactory implements EnumFactory<CodeSystemContentMode> {
253    public CodeSystemContentMode fromCode(String codeString) throws IllegalArgumentException {
254      if (codeString == null || "".equals(codeString))
255            if (codeString == null || "".equals(codeString))
256                return null;
257        if ("not-present".equals(codeString))
258          return CodeSystemContentMode.NOTPRESENT;
259        if ("example".equals(codeString))
260          return CodeSystemContentMode.EXAMPLE;
261        if ("fragment".equals(codeString))
262          return CodeSystemContentMode.FRAGMENT;
263        if ("complete".equals(codeString))
264          return CodeSystemContentMode.COMPLETE;
265        throw new IllegalArgumentException("Unknown CodeSystemContentMode code '"+codeString+"'");
266        }
267        public Enumeration<CodeSystemContentMode> fromType(Base code) throws FHIRException {
268          if (code == null)
269            return null;
270          if (code.isEmpty())
271            return new Enumeration<CodeSystemContentMode>(this);
272          String codeString = ((PrimitiveType) code).asStringValue();
273          if (codeString == null || "".equals(codeString))
274            return null;
275        if ("not-present".equals(codeString))
276          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.NOTPRESENT);
277        if ("example".equals(codeString))
278          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.EXAMPLE);
279        if ("fragment".equals(codeString))
280          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.FRAGMENT);
281        if ("complete".equals(codeString))
282          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.COMPLETE);
283        throw new FHIRException("Unknown CodeSystemContentMode code '"+codeString+"'");
284        }
285    public String toCode(CodeSystemContentMode code) {
286      if (code == CodeSystemContentMode.NOTPRESENT)
287        return "not-present";
288      if (code == CodeSystemContentMode.EXAMPLE)
289        return "example";
290      if (code == CodeSystemContentMode.FRAGMENT)
291        return "fragment";
292      if (code == CodeSystemContentMode.COMPLETE)
293        return "complete";
294      return "?";
295      }
296    public String toSystem(CodeSystemContentMode code) {
297      return code.getSystem();
298      }
299    }
300
301    public enum FilterOperator {
302        /**
303         * The specified property of the code equals the provided value.
304         */
305        EQUAL, 
306        /**
307         * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (i.e. include child codes)
308         */
309        ISA, 
310        /**
311         * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include child codes)
312         */
313        DESCENDENTOF, 
314        /**
315         * The specified property of the code does not have an is-a relationship with the provided value.
316         */
317        ISNOTA, 
318        /**
319         * The specified property of the code  matches the regex specified in the provided value.
320         */
321        REGEX, 
322        /**
323         * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).
324         */
325        IN, 
326        /**
327         * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).
328         */
329        NOTIN, 
330        /**
331         * Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (e.g. include parent codes)
332         */
333        GENERALIZES, 
334        /**
335         * The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values)
336         */
337        EXISTS, 
338        /**
339         * added to help the parsers with the generic types
340         */
341        NULL;
342        public static FilterOperator fromCode(String codeString) throws FHIRException {
343            if (codeString == null || "".equals(codeString))
344                return null;
345        if ("=".equals(codeString))
346          return EQUAL;
347        if ("is-a".equals(codeString))
348          return ISA;
349        if ("descendent-of".equals(codeString))
350          return DESCENDENTOF;
351        if ("is-not-a".equals(codeString))
352          return ISNOTA;
353        if ("regex".equals(codeString))
354          return REGEX;
355        if ("in".equals(codeString))
356          return IN;
357        if ("not-in".equals(codeString))
358          return NOTIN;
359        if ("generalizes".equals(codeString))
360          return GENERALIZES;
361        if ("exists".equals(codeString))
362          return EXISTS;
363        if (Configuration.isAcceptInvalidEnums())
364          return null;
365        else
366          throw new FHIRException("Unknown FilterOperator code '"+codeString+"'");
367        }
368        public String toCode() {
369          switch (this) {
370            case EQUAL: return "=";
371            case ISA: return "is-a";
372            case DESCENDENTOF: return "descendent-of";
373            case ISNOTA: return "is-not-a";
374            case REGEX: return "regex";
375            case IN: return "in";
376            case NOTIN: return "not-in";
377            case GENERALIZES: return "generalizes";
378            case EXISTS: return "exists";
379            default: return "?";
380          }
381        }
382        public String getSystem() {
383          switch (this) {
384            case EQUAL: return "http://hl7.org/fhir/filter-operator";
385            case ISA: return "http://hl7.org/fhir/filter-operator";
386            case DESCENDENTOF: return "http://hl7.org/fhir/filter-operator";
387            case ISNOTA: return "http://hl7.org/fhir/filter-operator";
388            case REGEX: return "http://hl7.org/fhir/filter-operator";
389            case IN: return "http://hl7.org/fhir/filter-operator";
390            case NOTIN: return "http://hl7.org/fhir/filter-operator";
391            case GENERALIZES: return "http://hl7.org/fhir/filter-operator";
392            case EXISTS: return "http://hl7.org/fhir/filter-operator";
393            default: return "?";
394          }
395        }
396        public String getDefinition() {
397          switch (this) {
398            case EQUAL: return "The specified property of the code equals the provided value.";
399            case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (i.e. include child codes)";
400            case DESCENDENTOF: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include child codes)";
401            case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value.";
402            case REGEX: return "The specified property of the code  matches the regex specified in the provided value.";
403            case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).";
404            case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).";
405            case GENERALIZES: return "Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (e.g. include parent codes)";
406            case EXISTS: return "The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values)";
407            default: return "?";
408          }
409        }
410        public String getDisplay() {
411          switch (this) {
412            case EQUAL: return "Equals";
413            case ISA: return "Is A (by subsumption)";
414            case DESCENDENTOF: return "Descendent Of (by subsumption)";
415            case ISNOTA: return "Not (Is A) (by subsumption)";
416            case REGEX: return "Regular Expression";
417            case IN: return "In Set";
418            case NOTIN: return "Not in Set";
419            case GENERALIZES: return "Generalizes (by Subsumption)";
420            case EXISTS: return "Exists";
421            default: return "?";
422          }
423        }
424    }
425
426  public static class FilterOperatorEnumFactory implements EnumFactory<FilterOperator> {
427    public FilterOperator fromCode(String codeString) throws IllegalArgumentException {
428      if (codeString == null || "".equals(codeString))
429            if (codeString == null || "".equals(codeString))
430                return null;
431        if ("=".equals(codeString))
432          return FilterOperator.EQUAL;
433        if ("is-a".equals(codeString))
434          return FilterOperator.ISA;
435        if ("descendent-of".equals(codeString))
436          return FilterOperator.DESCENDENTOF;
437        if ("is-not-a".equals(codeString))
438          return FilterOperator.ISNOTA;
439        if ("regex".equals(codeString))
440          return FilterOperator.REGEX;
441        if ("in".equals(codeString))
442          return FilterOperator.IN;
443        if ("not-in".equals(codeString))
444          return FilterOperator.NOTIN;
445        if ("generalizes".equals(codeString))
446          return FilterOperator.GENERALIZES;
447        if ("exists".equals(codeString))
448          return FilterOperator.EXISTS;
449        throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'");
450        }
451        public Enumeration<FilterOperator> fromType(Base code) throws FHIRException {
452          if (code == null)
453            return null;
454          if (code.isEmpty())
455            return new Enumeration<FilterOperator>(this);
456          String codeString = ((PrimitiveType) code).asStringValue();
457          if (codeString == null || "".equals(codeString))
458            return null;
459        if ("=".equals(codeString))
460          return new Enumeration<FilterOperator>(this, FilterOperator.EQUAL);
461        if ("is-a".equals(codeString))
462          return new Enumeration<FilterOperator>(this, FilterOperator.ISA);
463        if ("descendent-of".equals(codeString))
464          return new Enumeration<FilterOperator>(this, FilterOperator.DESCENDENTOF);
465        if ("is-not-a".equals(codeString))
466          return new Enumeration<FilterOperator>(this, FilterOperator.ISNOTA);
467        if ("regex".equals(codeString))
468          return new Enumeration<FilterOperator>(this, FilterOperator.REGEX);
469        if ("in".equals(codeString))
470          return new Enumeration<FilterOperator>(this, FilterOperator.IN);
471        if ("not-in".equals(codeString))
472          return new Enumeration<FilterOperator>(this, FilterOperator.NOTIN);
473        if ("generalizes".equals(codeString))
474          return new Enumeration<FilterOperator>(this, FilterOperator.GENERALIZES);
475        if ("exists".equals(codeString))
476          return new Enumeration<FilterOperator>(this, FilterOperator.EXISTS);
477        throw new FHIRException("Unknown FilterOperator code '"+codeString+"'");
478        }
479    public String toCode(FilterOperator code) {
480      if (code == FilterOperator.EQUAL)
481        return "=";
482      if (code == FilterOperator.ISA)
483        return "is-a";
484      if (code == FilterOperator.DESCENDENTOF)
485        return "descendent-of";
486      if (code == FilterOperator.ISNOTA)
487        return "is-not-a";
488      if (code == FilterOperator.REGEX)
489        return "regex";
490      if (code == FilterOperator.IN)
491        return "in";
492      if (code == FilterOperator.NOTIN)
493        return "not-in";
494      if (code == FilterOperator.GENERALIZES)
495        return "generalizes";
496      if (code == FilterOperator.EXISTS)
497        return "exists";
498      return "?";
499      }
500    public String toSystem(FilterOperator code) {
501      return code.getSystem();
502      }
503    }
504
505    public enum PropertyType {
506        /**
507         * The property value is a code that identifies a concept defined in the code system
508         */
509        CODE, 
510        /**
511         * The property  value is a code defined in an external code system. This may be used for translations, but is not the intent
512         */
513        CODING, 
514        /**
515         * The property value is a string
516         */
517        STRING, 
518        /**
519         * The property value is a string (often used to assign ranking values to concepts for supporting score assessments)
520         */
521        INTEGER, 
522        /**
523         * The property value is a boolean true | false
524         */
525        BOOLEAN, 
526        /**
527         * The property is a date or a date + time
528         */
529        DATETIME, 
530        /**
531         * added to help the parsers with the generic types
532         */
533        NULL;
534        public static PropertyType fromCode(String codeString) throws FHIRException {
535            if (codeString == null || "".equals(codeString))
536                return null;
537        if ("code".equals(codeString))
538          return CODE;
539        if ("Coding".equals(codeString))
540          return CODING;
541        if ("string".equals(codeString))
542          return STRING;
543        if ("integer".equals(codeString))
544          return INTEGER;
545        if ("boolean".equals(codeString))
546          return BOOLEAN;
547        if ("dateTime".equals(codeString))
548          return DATETIME;
549        if (Configuration.isAcceptInvalidEnums())
550          return null;
551        else
552          throw new FHIRException("Unknown PropertyType code '"+codeString+"'");
553        }
554        public String toCode() {
555          switch (this) {
556            case CODE: return "code";
557            case CODING: return "Coding";
558            case STRING: return "string";
559            case INTEGER: return "integer";
560            case BOOLEAN: return "boolean";
561            case DATETIME: return "dateTime";
562            default: return "?";
563          }
564        }
565        public String getSystem() {
566          switch (this) {
567            case CODE: return "http://hl7.org/fhir/concept-property-type";
568            case CODING: return "http://hl7.org/fhir/concept-property-type";
569            case STRING: return "http://hl7.org/fhir/concept-property-type";
570            case INTEGER: return "http://hl7.org/fhir/concept-property-type";
571            case BOOLEAN: return "http://hl7.org/fhir/concept-property-type";
572            case DATETIME: return "http://hl7.org/fhir/concept-property-type";
573            default: return "?";
574          }
575        }
576        public String getDefinition() {
577          switch (this) {
578            case CODE: return "The property value is a code that identifies a concept defined in the code system";
579            case CODING: return "The property  value is a code defined in an external code system. This may be used for translations, but is not the intent";
580            case STRING: return "The property value is a string";
581            case INTEGER: return "The property value is a string (often used to assign ranking values to concepts for supporting score assessments)";
582            case BOOLEAN: return "The property value is a boolean true | false";
583            case DATETIME: return "The property is a date or a date + time";
584            default: return "?";
585          }
586        }
587        public String getDisplay() {
588          switch (this) {
589            case CODE: return "code (internal reference)";
590            case CODING: return "Coding (external reference)";
591            case STRING: return "string";
592            case INTEGER: return "integer";
593            case BOOLEAN: return "boolean";
594            case DATETIME: return "dateTime";
595            default: return "?";
596          }
597        }
598    }
599
600  public static class PropertyTypeEnumFactory implements EnumFactory<PropertyType> {
601    public PropertyType fromCode(String codeString) throws IllegalArgumentException {
602      if (codeString == null || "".equals(codeString))
603            if (codeString == null || "".equals(codeString))
604                return null;
605        if ("code".equals(codeString))
606          return PropertyType.CODE;
607        if ("Coding".equals(codeString))
608          return PropertyType.CODING;
609        if ("string".equals(codeString))
610          return PropertyType.STRING;
611        if ("integer".equals(codeString))
612          return PropertyType.INTEGER;
613        if ("boolean".equals(codeString))
614          return PropertyType.BOOLEAN;
615        if ("dateTime".equals(codeString))
616          return PropertyType.DATETIME;
617        throw new IllegalArgumentException("Unknown PropertyType code '"+codeString+"'");
618        }
619        public Enumeration<PropertyType> fromType(Base code) throws FHIRException {
620          if (code == null)
621            return null;
622          if (code.isEmpty())
623            return new Enumeration<PropertyType>(this);
624          String codeString = ((PrimitiveType) code).asStringValue();
625          if (codeString == null || "".equals(codeString))
626            return null;
627        if ("code".equals(codeString))
628          return new Enumeration<PropertyType>(this, PropertyType.CODE);
629        if ("Coding".equals(codeString))
630          return new Enumeration<PropertyType>(this, PropertyType.CODING);
631        if ("string".equals(codeString))
632          return new Enumeration<PropertyType>(this, PropertyType.STRING);
633        if ("integer".equals(codeString))
634          return new Enumeration<PropertyType>(this, PropertyType.INTEGER);
635        if ("boolean".equals(codeString))
636          return new Enumeration<PropertyType>(this, PropertyType.BOOLEAN);
637        if ("dateTime".equals(codeString))
638          return new Enumeration<PropertyType>(this, PropertyType.DATETIME);
639        throw new FHIRException("Unknown PropertyType code '"+codeString+"'");
640        }
641    public String toCode(PropertyType code) {
642      if (code == PropertyType.CODE)
643        return "code";
644      if (code == PropertyType.CODING)
645        return "Coding";
646      if (code == PropertyType.STRING)
647        return "string";
648      if (code == PropertyType.INTEGER)
649        return "integer";
650      if (code == PropertyType.BOOLEAN)
651        return "boolean";
652      if (code == PropertyType.DATETIME)
653        return "dateTime";
654      return "?";
655      }
656    public String toSystem(PropertyType code) {
657      return code.getSystem();
658      }
659    }
660
661    @Block()
662    public static class CodeSystemFilterComponent extends BackboneElement implements IBaseBackboneElement {
663        /**
664         * The code that identifies this filter when it is used in the instance.
665         */
666        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
667        @Description(shortDefinition="Code that identifies the filter", formalDefinition="The code that identifies this filter when it is used in the instance." )
668        protected CodeType code;
669
670        /**
671         * A description of how or why the filter is used.
672         */
673        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
674        @Description(shortDefinition="How or why the filter is used", formalDefinition="A description of how or why the filter is used." )
675        protected StringType description;
676
677        /**
678         * A list of operators that can be used with the filter.
679         */
680        @Child(name = "operator", type = {CodeType.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
681        @Description(shortDefinition="Operators that can be used with filter", formalDefinition="A list of operators that can be used with the filter." )
682        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/filter-operator")
683        protected List<Enumeration<FilterOperator>> operator;
684
685        /**
686         * A description of what the value for the filter should be.
687         */
688        @Child(name = "value", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true)
689        @Description(shortDefinition="What to use for the value", formalDefinition="A description of what the value for the filter should be." )
690        protected StringType value;
691
692        private static final long serialVersionUID = -1087409836L;
693
694    /**
695     * Constructor
696     */
697      public CodeSystemFilterComponent() {
698        super();
699      }
700
701    /**
702     * Constructor
703     */
704      public CodeSystemFilterComponent(CodeType code, StringType value) {
705        super();
706        this.code = code;
707        this.value = value;
708      }
709
710        /**
711         * @return {@link #code} (The code that identifies this filter when it is used in the instance.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
712         */
713        public CodeType getCodeElement() { 
714          if (this.code == null)
715            if (Configuration.errorOnAutoCreate())
716              throw new Error("Attempt to auto-create CodeSystemFilterComponent.code");
717            else if (Configuration.doAutoCreate())
718              this.code = new CodeType(); // bb
719          return this.code;
720        }
721
722        public boolean hasCodeElement() { 
723          return this.code != null && !this.code.isEmpty();
724        }
725
726        public boolean hasCode() { 
727          return this.code != null && !this.code.isEmpty();
728        }
729
730        /**
731         * @param value {@link #code} (The code that identifies this filter when it is used in the instance.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
732         */
733        public CodeSystemFilterComponent setCodeElement(CodeType value) { 
734          this.code = value;
735          return this;
736        }
737
738        /**
739         * @return The code that identifies this filter when it is used in the instance.
740         */
741        public String getCode() { 
742          return this.code == null ? null : this.code.getValue();
743        }
744
745        /**
746         * @param value The code that identifies this filter when it is used in the instance.
747         */
748        public CodeSystemFilterComponent setCode(String value) { 
749            if (this.code == null)
750              this.code = new CodeType();
751            this.code.setValue(value);
752          return this;
753        }
754
755        /**
756         * @return {@link #description} (A description of how or why the filter is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
757         */
758        public StringType getDescriptionElement() { 
759          if (this.description == null)
760            if (Configuration.errorOnAutoCreate())
761              throw new Error("Attempt to auto-create CodeSystemFilterComponent.description");
762            else if (Configuration.doAutoCreate())
763              this.description = new StringType(); // bb
764          return this.description;
765        }
766
767        public boolean hasDescriptionElement() { 
768          return this.description != null && !this.description.isEmpty();
769        }
770
771        public boolean hasDescription() { 
772          return this.description != null && !this.description.isEmpty();
773        }
774
775        /**
776         * @param value {@link #description} (A description of how or why the filter is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
777         */
778        public CodeSystemFilterComponent setDescriptionElement(StringType value) { 
779          this.description = value;
780          return this;
781        }
782
783        /**
784         * @return A description of how or why the filter is used.
785         */
786        public String getDescription() { 
787          return this.description == null ? null : this.description.getValue();
788        }
789
790        /**
791         * @param value A description of how or why the filter is used.
792         */
793        public CodeSystemFilterComponent setDescription(String value) { 
794          if (Utilities.noString(value))
795            this.description = null;
796          else {
797            if (this.description == null)
798              this.description = new StringType();
799            this.description.setValue(value);
800          }
801          return this;
802        }
803
804        /**
805         * @return {@link #operator} (A list of operators that can be used with the filter.)
806         */
807        public List<Enumeration<FilterOperator>> getOperator() { 
808          if (this.operator == null)
809            this.operator = new ArrayList<Enumeration<FilterOperator>>();
810          return this.operator;
811        }
812
813        /**
814         * @return Returns a reference to <code>this</code> for easy method chaining
815         */
816        public CodeSystemFilterComponent setOperator(List<Enumeration<FilterOperator>> theOperator) { 
817          this.operator = theOperator;
818          return this;
819        }
820
821        public boolean hasOperator() { 
822          if (this.operator == null)
823            return false;
824          for (Enumeration<FilterOperator> item : this.operator)
825            if (!item.isEmpty())
826              return true;
827          return false;
828        }
829
830        /**
831         * @return {@link #operator} (A list of operators that can be used with the filter.)
832         */
833        public Enumeration<FilterOperator> addOperatorElement() {//2 
834          Enumeration<FilterOperator> t = new Enumeration<FilterOperator>(new FilterOperatorEnumFactory());
835          if (this.operator == null)
836            this.operator = new ArrayList<Enumeration<FilterOperator>>();
837          this.operator.add(t);
838          return t;
839        }
840
841        /**
842         * @param value {@link #operator} (A list of operators that can be used with the filter.)
843         */
844        public CodeSystemFilterComponent addOperator(FilterOperator value) { //1
845          Enumeration<FilterOperator> t = new Enumeration<FilterOperator>(new FilterOperatorEnumFactory());
846          t.setValue(value);
847          if (this.operator == null)
848            this.operator = new ArrayList<Enumeration<FilterOperator>>();
849          this.operator.add(t);
850          return this;
851        }
852
853        /**
854         * @param value {@link #operator} (A list of operators that can be used with the filter.)
855         */
856        public boolean hasOperator(FilterOperator value) { 
857          if (this.operator == null)
858            return false;
859          for (Enumeration<FilterOperator> v : this.operator)
860            if (v.getValue().equals(value)) // code
861              return true;
862          return false;
863        }
864
865        /**
866         * @return {@link #value} (A description of what the value for the filter should be.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
867         */
868        public StringType getValueElement() { 
869          if (this.value == null)
870            if (Configuration.errorOnAutoCreate())
871              throw new Error("Attempt to auto-create CodeSystemFilterComponent.value");
872            else if (Configuration.doAutoCreate())
873              this.value = new StringType(); // bb
874          return this.value;
875        }
876
877        public boolean hasValueElement() { 
878          return this.value != null && !this.value.isEmpty();
879        }
880
881        public boolean hasValue() { 
882          return this.value != null && !this.value.isEmpty();
883        }
884
885        /**
886         * @param value {@link #value} (A description of what the value for the filter should be.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
887         */
888        public CodeSystemFilterComponent setValueElement(StringType value) { 
889          this.value = value;
890          return this;
891        }
892
893        /**
894         * @return A description of what the value for the filter should be.
895         */
896        public String getValue() { 
897          return this.value == null ? null : this.value.getValue();
898        }
899
900        /**
901         * @param value A description of what the value for the filter should be.
902         */
903        public CodeSystemFilterComponent setValue(String value) { 
904            if (this.value == null)
905              this.value = new StringType();
906            this.value.setValue(value);
907          return this;
908        }
909
910        protected void listChildren(List<Property> childrenList) {
911          super.listChildren(childrenList);
912          childrenList.add(new Property("code", "code", "The code that identifies this filter when it is used in the instance.", 0, java.lang.Integer.MAX_VALUE, code));
913          childrenList.add(new Property("description", "string", "A description of how or why the filter is used.", 0, java.lang.Integer.MAX_VALUE, description));
914          childrenList.add(new Property("operator", "code", "A list of operators that can be used with the filter.", 0, java.lang.Integer.MAX_VALUE, operator));
915          childrenList.add(new Property("value", "string", "A description of what the value for the filter should be.", 0, java.lang.Integer.MAX_VALUE, value));
916        }
917
918      @Override
919      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
920        switch (hash) {
921        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType
922        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
923        case -500553564: /*operator*/ return this.operator == null ? new Base[0] : this.operator.toArray(new Base[this.operator.size()]); // Enumeration<FilterOperator>
924        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
925        default: return super.getProperty(hash, name, checkValid);
926        }
927
928      }
929
930      @Override
931      public Base setProperty(int hash, String name, Base value) throws FHIRException {
932        switch (hash) {
933        case 3059181: // code
934          this.code = castToCode(value); // CodeType
935          return value;
936        case -1724546052: // description
937          this.description = castToString(value); // StringType
938          return value;
939        case -500553564: // operator
940          value = new FilterOperatorEnumFactory().fromType(castToCode(value));
941          this.getOperator().add((Enumeration) value); // Enumeration<FilterOperator>
942          return value;
943        case 111972721: // value
944          this.value = castToString(value); // StringType
945          return value;
946        default: return super.setProperty(hash, name, value);
947        }
948
949      }
950
951      @Override
952      public Base setProperty(String name, Base value) throws FHIRException {
953        if (name.equals("code")) {
954          this.code = castToCode(value); // CodeType
955        } else if (name.equals("description")) {
956          this.description = castToString(value); // StringType
957        } else if (name.equals("operator")) {
958          value = new FilterOperatorEnumFactory().fromType(castToCode(value));
959          this.getOperator().add((Enumeration) value);
960        } else if (name.equals("value")) {
961          this.value = castToString(value); // StringType
962        } else
963          return super.setProperty(name, value);
964        return value;
965      }
966
967      @Override
968      public Base makeProperty(int hash, String name) throws FHIRException {
969        switch (hash) {
970        case 3059181:  return getCodeElement();
971        case -1724546052:  return getDescriptionElement();
972        case -500553564:  return addOperatorElement();
973        case 111972721:  return getValueElement();
974        default: return super.makeProperty(hash, name);
975        }
976
977      }
978
979      @Override
980      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
981        switch (hash) {
982        case 3059181: /*code*/ return new String[] {"code"};
983        case -1724546052: /*description*/ return new String[] {"string"};
984        case -500553564: /*operator*/ return new String[] {"code"};
985        case 111972721: /*value*/ return new String[] {"string"};
986        default: return super.getTypesForProperty(hash, name);
987        }
988
989      }
990
991      @Override
992      public Base addChild(String name) throws FHIRException {
993        if (name.equals("code")) {
994          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code");
995        }
996        else if (name.equals("description")) {
997          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description");
998        }
999        else if (name.equals("operator")) {
1000          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.operator");
1001        }
1002        else if (name.equals("value")) {
1003          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.value");
1004        }
1005        else
1006          return super.addChild(name);
1007      }
1008
1009      public CodeSystemFilterComponent copy() {
1010        CodeSystemFilterComponent dst = new CodeSystemFilterComponent();
1011        copyValues(dst);
1012        dst.code = code == null ? null : code.copy();
1013        dst.description = description == null ? null : description.copy();
1014        if (operator != null) {
1015          dst.operator = new ArrayList<Enumeration<FilterOperator>>();
1016          for (Enumeration<FilterOperator> i : operator)
1017            dst.operator.add(i.copy());
1018        };
1019        dst.value = value == null ? null : value.copy();
1020        return dst;
1021      }
1022
1023      @Override
1024      public boolean equalsDeep(Base other) {
1025        if (!super.equalsDeep(other))
1026          return false;
1027        if (!(other instanceof CodeSystemFilterComponent))
1028          return false;
1029        CodeSystemFilterComponent o = (CodeSystemFilterComponent) other;
1030        return compareDeep(code, o.code, true) && compareDeep(description, o.description, true) && compareDeep(operator, o.operator, true)
1031           && compareDeep(value, o.value, true);
1032      }
1033
1034      @Override
1035      public boolean equalsShallow(Base other) {
1036        if (!super.equalsShallow(other))
1037          return false;
1038        if (!(other instanceof CodeSystemFilterComponent))
1039          return false;
1040        CodeSystemFilterComponent o = (CodeSystemFilterComponent) other;
1041        return compareValues(code, o.code, true) && compareValues(description, o.description, true) && compareValues(operator, o.operator, true)
1042           && compareValues(value, o.value, true);
1043      }
1044
1045      public boolean isEmpty() {
1046        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, description, operator
1047          , value);
1048      }
1049
1050  public String fhirType() {
1051    return "CodeSystem.filter";
1052
1053  }
1054
1055  }
1056
1057    @Block()
1058    public static class PropertyComponent extends BackboneElement implements IBaseBackboneElement {
1059        /**
1060         * A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.
1061         */
1062        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1063        @Description(shortDefinition="Identifies the property on the concepts, and when referred to in operations", formalDefinition="A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters." )
1064        protected CodeType code;
1065
1066        /**
1067         * Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.
1068         */
1069        @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1070        @Description(shortDefinition="Formal identifier for the property", formalDefinition="Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system." )
1071        protected UriType uri;
1072
1073        /**
1074         * A description of the property- why it is defined, and how its value might be used.
1075         */
1076        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1077        @Description(shortDefinition="Why the property is defined, and/or what it conveys", formalDefinition="A description of the property- why it is defined, and how its value might be used." )
1078        protected StringType description;
1079
1080        /**
1081         * The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to anotherr defined concept).
1082         */
1083        @Child(name = "type", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true)
1084        @Description(shortDefinition="code | Coding | string | integer | boolean | dateTime", formalDefinition="The type of the property value. Properties of type \"code\" contain a code defined by the code system (e.g. a reference to anotherr defined concept)." )
1085        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/concept-property-type")
1086        protected Enumeration<PropertyType> type;
1087
1088        private static final long serialVersionUID = -1810713373L;
1089
1090    /**
1091     * Constructor
1092     */
1093      public PropertyComponent() {
1094        super();
1095      }
1096
1097    /**
1098     * Constructor
1099     */
1100      public PropertyComponent(CodeType code, Enumeration<PropertyType> type) {
1101        super();
1102        this.code = code;
1103        this.type = type;
1104      }
1105
1106        /**
1107         * @return {@link #code} (A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1108         */
1109        public CodeType getCodeElement() { 
1110          if (this.code == null)
1111            if (Configuration.errorOnAutoCreate())
1112              throw new Error("Attempt to auto-create PropertyComponent.code");
1113            else if (Configuration.doAutoCreate())
1114              this.code = new CodeType(); // bb
1115          return this.code;
1116        }
1117
1118        public boolean hasCodeElement() { 
1119          return this.code != null && !this.code.isEmpty();
1120        }
1121
1122        public boolean hasCode() { 
1123          return this.code != null && !this.code.isEmpty();
1124        }
1125
1126        /**
1127         * @param value {@link #code} (A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1128         */
1129        public PropertyComponent setCodeElement(CodeType value) { 
1130          this.code = value;
1131          return this;
1132        }
1133
1134        /**
1135         * @return A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.
1136         */
1137        public String getCode() { 
1138          return this.code == null ? null : this.code.getValue();
1139        }
1140
1141        /**
1142         * @param value A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.
1143         */
1144        public PropertyComponent setCode(String value) { 
1145            if (this.code == null)
1146              this.code = new CodeType();
1147            this.code.setValue(value);
1148          return this;
1149        }
1150
1151        /**
1152         * @return {@link #uri} (Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
1153         */
1154        public UriType getUriElement() { 
1155          if (this.uri == null)
1156            if (Configuration.errorOnAutoCreate())
1157              throw new Error("Attempt to auto-create PropertyComponent.uri");
1158            else if (Configuration.doAutoCreate())
1159              this.uri = new UriType(); // bb
1160          return this.uri;
1161        }
1162
1163        public boolean hasUriElement() { 
1164          return this.uri != null && !this.uri.isEmpty();
1165        }
1166
1167        public boolean hasUri() { 
1168          return this.uri != null && !this.uri.isEmpty();
1169        }
1170
1171        /**
1172         * @param value {@link #uri} (Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
1173         */
1174        public PropertyComponent setUriElement(UriType value) { 
1175          this.uri = value;
1176          return this;
1177        }
1178
1179        /**
1180         * @return Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.
1181         */
1182        public String getUri() { 
1183          return this.uri == null ? null : this.uri.getValue();
1184        }
1185
1186        /**
1187         * @param value Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.
1188         */
1189        public PropertyComponent setUri(String value) { 
1190          if (Utilities.noString(value))
1191            this.uri = null;
1192          else {
1193            if (this.uri == null)
1194              this.uri = new UriType();
1195            this.uri.setValue(value);
1196          }
1197          return this;
1198        }
1199
1200        /**
1201         * @return {@link #description} (A description of the property- why it is defined, and how its value might be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1202         */
1203        public StringType getDescriptionElement() { 
1204          if (this.description == null)
1205            if (Configuration.errorOnAutoCreate())
1206              throw new Error("Attempt to auto-create PropertyComponent.description");
1207            else if (Configuration.doAutoCreate())
1208              this.description = new StringType(); // bb
1209          return this.description;
1210        }
1211
1212        public boolean hasDescriptionElement() { 
1213          return this.description != null && !this.description.isEmpty();
1214        }
1215
1216        public boolean hasDescription() { 
1217          return this.description != null && !this.description.isEmpty();
1218        }
1219
1220        /**
1221         * @param value {@link #description} (A description of the property- why it is defined, and how its value might be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1222         */
1223        public PropertyComponent setDescriptionElement(StringType value) { 
1224          this.description = value;
1225          return this;
1226        }
1227
1228        /**
1229         * @return A description of the property- why it is defined, and how its value might be used.
1230         */
1231        public String getDescription() { 
1232          return this.description == null ? null : this.description.getValue();
1233        }
1234
1235        /**
1236         * @param value A description of the property- why it is defined, and how its value might be used.
1237         */
1238        public PropertyComponent setDescription(String value) { 
1239          if (Utilities.noString(value))
1240            this.description = null;
1241          else {
1242            if (this.description == null)
1243              this.description = new StringType();
1244            this.description.setValue(value);
1245          }
1246          return this;
1247        }
1248
1249        /**
1250         * @return {@link #type} (The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to anotherr defined concept).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1251         */
1252        public Enumeration<PropertyType> getTypeElement() { 
1253          if (this.type == null)
1254            if (Configuration.errorOnAutoCreate())
1255              throw new Error("Attempt to auto-create PropertyComponent.type");
1256            else if (Configuration.doAutoCreate())
1257              this.type = new Enumeration<PropertyType>(new PropertyTypeEnumFactory()); // bb
1258          return this.type;
1259        }
1260
1261        public boolean hasTypeElement() { 
1262          return this.type != null && !this.type.isEmpty();
1263        }
1264
1265        public boolean hasType() { 
1266          return this.type != null && !this.type.isEmpty();
1267        }
1268
1269        /**
1270         * @param value {@link #type} (The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to anotherr defined concept).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1271         */
1272        public PropertyComponent setTypeElement(Enumeration<PropertyType> value) { 
1273          this.type = value;
1274          return this;
1275        }
1276
1277        /**
1278         * @return The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to anotherr defined concept).
1279         */
1280        public PropertyType getType() { 
1281          return this.type == null ? null : this.type.getValue();
1282        }
1283
1284        /**
1285         * @param value The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to anotherr defined concept).
1286         */
1287        public PropertyComponent setType(PropertyType value) { 
1288            if (this.type == null)
1289              this.type = new Enumeration<PropertyType>(new PropertyTypeEnumFactory());
1290            this.type.setValue(value);
1291          return this;
1292        }
1293
1294        protected void listChildren(List<Property> childrenList) {
1295          super.listChildren(childrenList);
1296          childrenList.add(new Property("code", "code", "A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.", 0, java.lang.Integer.MAX_VALUE, code));
1297          childrenList.add(new Property("uri", "uri", "Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.", 0, java.lang.Integer.MAX_VALUE, uri));
1298          childrenList.add(new Property("description", "string", "A description of the property- why it is defined, and how its value might be used.", 0, java.lang.Integer.MAX_VALUE, description));
1299          childrenList.add(new Property("type", "code", "The type of the property value. Properties of type \"code\" contain a code defined by the code system (e.g. a reference to anotherr defined concept).", 0, java.lang.Integer.MAX_VALUE, type));
1300        }
1301
1302      @Override
1303      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1304        switch (hash) {
1305        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType
1306        case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType
1307        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1308        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<PropertyType>
1309        default: return super.getProperty(hash, name, checkValid);
1310        }
1311
1312      }
1313
1314      @Override
1315      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1316        switch (hash) {
1317        case 3059181: // code
1318          this.code = castToCode(value); // CodeType
1319          return value;
1320        case 116076: // uri
1321          this.uri = castToUri(value); // UriType
1322          return value;
1323        case -1724546052: // description
1324          this.description = castToString(value); // StringType
1325          return value;
1326        case 3575610: // type
1327          value = new PropertyTypeEnumFactory().fromType(castToCode(value));
1328          this.type = (Enumeration) value; // Enumeration<PropertyType>
1329          return value;
1330        default: return super.setProperty(hash, name, value);
1331        }
1332
1333      }
1334
1335      @Override
1336      public Base setProperty(String name, Base value) throws FHIRException {
1337        if (name.equals("code")) {
1338          this.code = castToCode(value); // CodeType
1339        } else if (name.equals("uri")) {
1340          this.uri = castToUri(value); // UriType
1341        } else if (name.equals("description")) {
1342          this.description = castToString(value); // StringType
1343        } else if (name.equals("type")) {
1344          value = new PropertyTypeEnumFactory().fromType(castToCode(value));
1345          this.type = (Enumeration) value; // Enumeration<PropertyType>
1346        } else
1347          return super.setProperty(name, value);
1348        return value;
1349      }
1350
1351      @Override
1352      public Base makeProperty(int hash, String name) throws FHIRException {
1353        switch (hash) {
1354        case 3059181:  return getCodeElement();
1355        case 116076:  return getUriElement();
1356        case -1724546052:  return getDescriptionElement();
1357        case 3575610:  return getTypeElement();
1358        default: return super.makeProperty(hash, name);
1359        }
1360
1361      }
1362
1363      @Override
1364      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1365        switch (hash) {
1366        case 3059181: /*code*/ return new String[] {"code"};
1367        case 116076: /*uri*/ return new String[] {"uri"};
1368        case -1724546052: /*description*/ return new String[] {"string"};
1369        case 3575610: /*type*/ return new String[] {"code"};
1370        default: return super.getTypesForProperty(hash, name);
1371        }
1372
1373      }
1374
1375      @Override
1376      public Base addChild(String name) throws FHIRException {
1377        if (name.equals("code")) {
1378          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code");
1379        }
1380        else if (name.equals("uri")) {
1381          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.uri");
1382        }
1383        else if (name.equals("description")) {
1384          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description");
1385        }
1386        else if (name.equals("type")) {
1387          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.type");
1388        }
1389        else
1390          return super.addChild(name);
1391      }
1392
1393      public PropertyComponent copy() {
1394        PropertyComponent dst = new PropertyComponent();
1395        copyValues(dst);
1396        dst.code = code == null ? null : code.copy();
1397        dst.uri = uri == null ? null : uri.copy();
1398        dst.description = description == null ? null : description.copy();
1399        dst.type = type == null ? null : type.copy();
1400        return dst;
1401      }
1402
1403      @Override
1404      public boolean equalsDeep(Base other) {
1405        if (!super.equalsDeep(other))
1406          return false;
1407        if (!(other instanceof PropertyComponent))
1408          return false;
1409        PropertyComponent o = (PropertyComponent) other;
1410        return compareDeep(code, o.code, true) && compareDeep(uri, o.uri, true) && compareDeep(description, o.description, true)
1411           && compareDeep(type, o.type, true);
1412      }
1413
1414      @Override
1415      public boolean equalsShallow(Base other) {
1416        if (!super.equalsShallow(other))
1417          return false;
1418        if (!(other instanceof PropertyComponent))
1419          return false;
1420        PropertyComponent o = (PropertyComponent) other;
1421        return compareValues(code, o.code, true) && compareValues(uri, o.uri, true) && compareValues(description, o.description, true)
1422           && compareValues(type, o.type, true);
1423      }
1424
1425      public boolean isEmpty() {
1426        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, uri, description, type
1427          );
1428      }
1429
1430  public String fhirType() {
1431    return "CodeSystem.property";
1432
1433  }
1434
1435  }
1436
1437    @Block()
1438    public static class ConceptDefinitionComponent extends BackboneElement implements IBaseBackboneElement {
1439        /**
1440         * A code - a text symbol - that uniquely identifies the concept within the code system.
1441         */
1442        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1443        @Description(shortDefinition="Code that identifies concept", formalDefinition="A code - a text symbol - that uniquely identifies the concept within the code system." )
1444        protected CodeType code;
1445
1446        /**
1447         * A human readable string that is the recommended default way to present this concept to a user.
1448         */
1449        @Child(name = "display", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1450        @Description(shortDefinition="Text to display to the user", formalDefinition="A human readable string that is the recommended default way to present this concept to a user." )
1451        protected StringType display;
1452
1453        /**
1454         * The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.
1455         */
1456        @Child(name = "definition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1457        @Description(shortDefinition="Formal definition", formalDefinition="The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept." )
1458        protected StringType definition;
1459
1460        /**
1461         * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.
1462         */
1463        @Child(name = "designation", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1464        @Description(shortDefinition="Additional representations for the concept", formalDefinition="Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc." )
1465        protected List<ConceptDefinitionDesignationComponent> designation;
1466
1467        /**
1468         * A property value for this concept.
1469         */
1470        @Child(name = "property", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1471        @Description(shortDefinition="Property value for the concept", formalDefinition="A property value for this concept." )
1472        protected List<ConceptPropertyComponent> property;
1473
1474        /**
1475         * Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.
1476         */
1477        @Child(name = "concept", type = {ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1478        @Description(shortDefinition="Child Concepts (is-a/contains/categorizes)", formalDefinition="Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning." )
1479        protected List<ConceptDefinitionComponent> concept;
1480
1481        private static final long serialVersionUID = 878320988L;
1482
1483    /**
1484     * Constructor
1485     */
1486      public ConceptDefinitionComponent() {
1487        super();
1488      }
1489
1490    /**
1491     * Constructor
1492     */
1493      public ConceptDefinitionComponent(CodeType code) {
1494        super();
1495        this.code = code;
1496      }
1497
1498        /**
1499         * @return {@link #code} (A code - a text symbol - that uniquely identifies the concept within the code system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1500         */
1501        public CodeType getCodeElement() { 
1502          if (this.code == null)
1503            if (Configuration.errorOnAutoCreate())
1504              throw new Error("Attempt to auto-create ConceptDefinitionComponent.code");
1505            else if (Configuration.doAutoCreate())
1506              this.code = new CodeType(); // bb
1507          return this.code;
1508        }
1509
1510        public boolean hasCodeElement() { 
1511          return this.code != null && !this.code.isEmpty();
1512        }
1513
1514        public boolean hasCode() { 
1515          return this.code != null && !this.code.isEmpty();
1516        }
1517
1518        /**
1519         * @param value {@link #code} (A code - a text symbol - that uniquely identifies the concept within the code system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1520         */
1521        public ConceptDefinitionComponent setCodeElement(CodeType value) { 
1522          this.code = value;
1523          return this;
1524        }
1525
1526        /**
1527         * @return A code - a text symbol - that uniquely identifies the concept within the code system.
1528         */
1529        public String getCode() { 
1530          return this.code == null ? null : this.code.getValue();
1531        }
1532
1533        /**
1534         * @param value A code - a text symbol - that uniquely identifies the concept within the code system.
1535         */
1536        public ConceptDefinitionComponent setCode(String value) { 
1537            if (this.code == null)
1538              this.code = new CodeType();
1539            this.code.setValue(value);
1540          return this;
1541        }
1542
1543        /**
1544         * @return {@link #display} (A human readable string that is the recommended default way to present this concept to a user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
1545         */
1546        public StringType getDisplayElement() { 
1547          if (this.display == null)
1548            if (Configuration.errorOnAutoCreate())
1549              throw new Error("Attempt to auto-create ConceptDefinitionComponent.display");
1550            else if (Configuration.doAutoCreate())
1551              this.display = new StringType(); // bb
1552          return this.display;
1553        }
1554
1555        public boolean hasDisplayElement() { 
1556          return this.display != null && !this.display.isEmpty();
1557        }
1558
1559        public boolean hasDisplay() { 
1560          return this.display != null && !this.display.isEmpty();
1561        }
1562
1563        /**
1564         * @param value {@link #display} (A human readable string that is the recommended default way to present this concept to a user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
1565         */
1566        public ConceptDefinitionComponent setDisplayElement(StringType value) { 
1567          this.display = value;
1568          return this;
1569        }
1570
1571        /**
1572         * @return A human readable string that is the recommended default way to present this concept to a user.
1573         */
1574        public String getDisplay() { 
1575          return this.display == null ? null : this.display.getValue();
1576        }
1577
1578        /**
1579         * @param value A human readable string that is the recommended default way to present this concept to a user.
1580         */
1581        public ConceptDefinitionComponent setDisplay(String value) { 
1582          if (Utilities.noString(value))
1583            this.display = null;
1584          else {
1585            if (this.display == null)
1586              this.display = new StringType();
1587            this.display.setValue(value);
1588          }
1589          return this;
1590        }
1591
1592        /**
1593         * @return {@link #definition} (The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
1594         */
1595        public StringType getDefinitionElement() { 
1596          if (this.definition == null)
1597            if (Configuration.errorOnAutoCreate())
1598              throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition");
1599            else if (Configuration.doAutoCreate())
1600              this.definition = new StringType(); // bb
1601          return this.definition;
1602        }
1603
1604        public boolean hasDefinitionElement() { 
1605          return this.definition != null && !this.definition.isEmpty();
1606        }
1607
1608        public boolean hasDefinition() { 
1609          return this.definition != null && !this.definition.isEmpty();
1610        }
1611
1612        /**
1613         * @param value {@link #definition} (The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
1614         */
1615        public ConceptDefinitionComponent setDefinitionElement(StringType value) { 
1616          this.definition = value;
1617          return this;
1618        }
1619
1620        /**
1621         * @return The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.
1622         */
1623        public String getDefinition() { 
1624          return this.definition == null ? null : this.definition.getValue();
1625        }
1626
1627        /**
1628         * @param value The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.
1629         */
1630        public ConceptDefinitionComponent setDefinition(String value) { 
1631          if (Utilities.noString(value))
1632            this.definition = null;
1633          else {
1634            if (this.definition == null)
1635              this.definition = new StringType();
1636            this.definition.setValue(value);
1637          }
1638          return this;
1639        }
1640
1641        /**
1642         * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.)
1643         */
1644        public List<ConceptDefinitionDesignationComponent> getDesignation() { 
1645          if (this.designation == null)
1646            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
1647          return this.designation;
1648        }
1649
1650        /**
1651         * @return Returns a reference to <code>this</code> for easy method chaining
1652         */
1653        public ConceptDefinitionComponent setDesignation(List<ConceptDefinitionDesignationComponent> theDesignation) { 
1654          this.designation = theDesignation;
1655          return this;
1656        }
1657
1658        public boolean hasDesignation() { 
1659          if (this.designation == null)
1660            return false;
1661          for (ConceptDefinitionDesignationComponent item : this.designation)
1662            if (!item.isEmpty())
1663              return true;
1664          return false;
1665        }
1666
1667        public ConceptDefinitionDesignationComponent addDesignation() { //3
1668          ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent();
1669          if (this.designation == null)
1670            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
1671          this.designation.add(t);
1672          return t;
1673        }
1674
1675        public ConceptDefinitionComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3
1676          if (t == null)
1677            return this;
1678          if (this.designation == null)
1679            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
1680          this.designation.add(t);
1681          return this;
1682        }
1683
1684        /**
1685         * @return The first repetition of repeating field {@link #designation}, creating it if it does not already exist
1686         */
1687        public ConceptDefinitionDesignationComponent getDesignationFirstRep() { 
1688          if (getDesignation().isEmpty()) {
1689            addDesignation();
1690          }
1691          return getDesignation().get(0);
1692        }
1693
1694        /**
1695         * @return {@link #property} (A property value for this concept.)
1696         */
1697        public List<ConceptPropertyComponent> getProperty() { 
1698          if (this.property == null)
1699            this.property = new ArrayList<ConceptPropertyComponent>();
1700          return this.property;
1701        }
1702
1703        /**
1704         * @return Returns a reference to <code>this</code> for easy method chaining
1705         */
1706        public ConceptDefinitionComponent setProperty(List<ConceptPropertyComponent> theProperty) { 
1707          this.property = theProperty;
1708          return this;
1709        }
1710
1711        public boolean hasProperty() { 
1712          if (this.property == null)
1713            return false;
1714          for (ConceptPropertyComponent item : this.property)
1715            if (!item.isEmpty())
1716              return true;
1717          return false;
1718        }
1719
1720        public ConceptPropertyComponent addProperty() { //3
1721          ConceptPropertyComponent t = new ConceptPropertyComponent();
1722          if (this.property == null)
1723            this.property = new ArrayList<ConceptPropertyComponent>();
1724          this.property.add(t);
1725          return t;
1726        }
1727
1728        public ConceptDefinitionComponent addProperty(ConceptPropertyComponent t) { //3
1729          if (t == null)
1730            return this;
1731          if (this.property == null)
1732            this.property = new ArrayList<ConceptPropertyComponent>();
1733          this.property.add(t);
1734          return this;
1735        }
1736
1737        /**
1738         * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist
1739         */
1740        public ConceptPropertyComponent getPropertyFirstRep() { 
1741          if (getProperty().isEmpty()) {
1742            addProperty();
1743          }
1744          return getProperty().get(0);
1745        }
1746
1747        /**
1748         * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.)
1749         */
1750        public List<ConceptDefinitionComponent> getConcept() { 
1751          if (this.concept == null)
1752            this.concept = new ArrayList<ConceptDefinitionComponent>();
1753          return this.concept;
1754        }
1755
1756        /**
1757         * @return Returns a reference to <code>this</code> for easy method chaining
1758         */
1759        public ConceptDefinitionComponent setConcept(List<ConceptDefinitionComponent> theConcept) { 
1760          this.concept = theConcept;
1761          return this;
1762        }
1763
1764        public boolean hasConcept() { 
1765          if (this.concept == null)
1766            return false;
1767          for (ConceptDefinitionComponent item : this.concept)
1768            if (!item.isEmpty())
1769              return true;
1770          return false;
1771        }
1772
1773        public ConceptDefinitionComponent addConcept() { //3
1774          ConceptDefinitionComponent t = new ConceptDefinitionComponent();
1775          if (this.concept == null)
1776            this.concept = new ArrayList<ConceptDefinitionComponent>();
1777          this.concept.add(t);
1778          return t;
1779        }
1780
1781        public ConceptDefinitionComponent addConcept(ConceptDefinitionComponent t) { //3
1782          if (t == null)
1783            return this;
1784          if (this.concept == null)
1785            this.concept = new ArrayList<ConceptDefinitionComponent>();
1786          this.concept.add(t);
1787          return this;
1788        }
1789
1790        /**
1791         * @return The first repetition of repeating field {@link #concept}, creating it if it does not already exist
1792         */
1793        public ConceptDefinitionComponent getConceptFirstRep() { 
1794          if (getConcept().isEmpty()) {
1795            addConcept();
1796          }
1797          return getConcept().get(0);
1798        }
1799
1800        protected void listChildren(List<Property> childrenList) {
1801          super.listChildren(childrenList);
1802          childrenList.add(new Property("code", "code", "A code - a text symbol - that uniquely identifies the concept within the code system.", 0, java.lang.Integer.MAX_VALUE, code));
1803          childrenList.add(new Property("display", "string", "A human readable string that is the recommended default way to present this concept to a user.", 0, java.lang.Integer.MAX_VALUE, display));
1804          childrenList.add(new Property("definition", "string", "The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition));
1805          childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation));
1806          childrenList.add(new Property("property", "", "A property value for this concept.", 0, java.lang.Integer.MAX_VALUE, property));
1807          childrenList.add(new Property("concept", "@CodeSystem.concept", "Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.", 0, java.lang.Integer.MAX_VALUE, concept));
1808        }
1809
1810      @Override
1811      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1812        switch (hash) {
1813        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType
1814        case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType
1815        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // StringType
1816        case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // ConceptDefinitionDesignationComponent
1817        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // ConceptPropertyComponent
1818        case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptDefinitionComponent
1819        default: return super.getProperty(hash, name, checkValid);
1820        }
1821
1822      }
1823
1824      @Override
1825      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1826        switch (hash) {
1827        case 3059181: // code
1828          this.code = castToCode(value); // CodeType
1829          return value;
1830        case 1671764162: // display
1831          this.display = castToString(value); // StringType
1832          return value;
1833        case -1014418093: // definition
1834          this.definition = castToString(value); // StringType
1835          return value;
1836        case -900931593: // designation
1837          this.getDesignation().add((ConceptDefinitionDesignationComponent) value); // ConceptDefinitionDesignationComponent
1838          return value;
1839        case -993141291: // property
1840          this.getProperty().add((ConceptPropertyComponent) value); // ConceptPropertyComponent
1841          return value;
1842        case 951024232: // concept
1843          this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent
1844          return value;
1845        default: return super.setProperty(hash, name, value);
1846        }
1847
1848      }
1849
1850      @Override
1851      public Base setProperty(String name, Base value) throws FHIRException {
1852        if (name.equals("code")) {
1853          this.code = castToCode(value); // CodeType
1854        } else if (name.equals("display")) {
1855          this.display = castToString(value); // StringType
1856        } else if (name.equals("definition")) {
1857          this.definition = castToString(value); // StringType
1858        } else if (name.equals("designation")) {
1859          this.getDesignation().add((ConceptDefinitionDesignationComponent) value);
1860        } else if (name.equals("property")) {
1861          this.getProperty().add((ConceptPropertyComponent) value);
1862        } else if (name.equals("concept")) {
1863          this.getConcept().add((ConceptDefinitionComponent) value);
1864        } else
1865          return super.setProperty(name, value);
1866        return value;
1867      }
1868
1869      @Override
1870      public Base makeProperty(int hash, String name) throws FHIRException {
1871        switch (hash) {
1872        case 3059181:  return getCodeElement();
1873        case 1671764162:  return getDisplayElement();
1874        case -1014418093:  return getDefinitionElement();
1875        case -900931593:  return addDesignation(); 
1876        case -993141291:  return addProperty(); 
1877        case 951024232:  return addConcept(); 
1878        default: return super.makeProperty(hash, name);
1879        }
1880
1881      }
1882
1883      @Override
1884      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1885        switch (hash) {
1886        case 3059181: /*code*/ return new String[] {"code"};
1887        case 1671764162: /*display*/ return new String[] {"string"};
1888        case -1014418093: /*definition*/ return new String[] {"string"};
1889        case -900931593: /*designation*/ return new String[] {};
1890        case -993141291: /*property*/ return new String[] {};
1891        case 951024232: /*concept*/ return new String[] {"@CodeSystem.concept"};
1892        default: return super.getTypesForProperty(hash, name);
1893        }
1894
1895      }
1896
1897      @Override
1898      public Base addChild(String name) throws FHIRException {
1899        if (name.equals("code")) {
1900          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code");
1901        }
1902        else if (name.equals("display")) {
1903          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.display");
1904        }
1905        else if (name.equals("definition")) {
1906          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.definition");
1907        }
1908        else if (name.equals("designation")) {
1909          return addDesignation();
1910        }
1911        else if (name.equals("property")) {
1912          return addProperty();
1913        }
1914        else if (name.equals("concept")) {
1915          return addConcept();
1916        }
1917        else
1918          return super.addChild(name);
1919      }
1920
1921      public ConceptDefinitionComponent copy() {
1922        ConceptDefinitionComponent dst = new ConceptDefinitionComponent();
1923        copyValues(dst);
1924        dst.code = code == null ? null : code.copy();
1925        dst.display = display == null ? null : display.copy();
1926        dst.definition = definition == null ? null : definition.copy();
1927        if (designation != null) {
1928          dst.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
1929          for (ConceptDefinitionDesignationComponent i : designation)
1930            dst.designation.add(i.copy());
1931        };
1932        if (property != null) {
1933          dst.property = new ArrayList<ConceptPropertyComponent>();
1934          for (ConceptPropertyComponent i : property)
1935            dst.property.add(i.copy());
1936        };
1937        if (concept != null) {
1938          dst.concept = new ArrayList<ConceptDefinitionComponent>();
1939          for (ConceptDefinitionComponent i : concept)
1940            dst.concept.add(i.copy());
1941        };
1942        return dst;
1943      }
1944
1945      @Override
1946      public boolean equalsDeep(Base other) {
1947        if (!super.equalsDeep(other))
1948          return false;
1949        if (!(other instanceof ConceptDefinitionComponent))
1950          return false;
1951        ConceptDefinitionComponent o = (ConceptDefinitionComponent) other;
1952        return compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(definition, o.definition, true)
1953           && compareDeep(designation, o.designation, true) && compareDeep(property, o.property, true) && compareDeep(concept, o.concept, true)
1954          ;
1955      }
1956
1957      @Override
1958      public boolean equalsShallow(Base other) {
1959        if (!super.equalsShallow(other))
1960          return false;
1961        if (!(other instanceof ConceptDefinitionComponent))
1962          return false;
1963        ConceptDefinitionComponent o = (ConceptDefinitionComponent) other;
1964        return compareValues(code, o.code, true) && compareValues(display, o.display, true) && compareValues(definition, o.definition, true)
1965          ;
1966      }
1967
1968      public boolean isEmpty() {
1969        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, display, definition
1970          , designation, property, concept);
1971      }
1972
1973  public String fhirType() {
1974    return "CodeSystem.concept";
1975
1976  }
1977
1978  }
1979
1980    @Block()
1981    public static class ConceptDefinitionDesignationComponent extends BackboneElement implements IBaseBackboneElement {
1982        /**
1983         * The language this designation is defined for.
1984         */
1985        @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1986        @Description(shortDefinition="Human language of the designation", formalDefinition="The language this designation is defined for." )
1987        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
1988        protected CodeType language;
1989
1990        /**
1991         * A code that details how this designation would be used.
1992         */
1993        @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false)
1994        @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." )
1995        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/designation-use")
1996        protected Coding use;
1997
1998        /**
1999         * The text value for this designation.
2000         */
2001        @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false)
2002        @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." )
2003        protected StringType value;
2004
2005        private static final long serialVersionUID = 1515662414L;
2006
2007    /**
2008     * Constructor
2009     */
2010      public ConceptDefinitionDesignationComponent() {
2011        super();
2012      }
2013
2014    /**
2015     * Constructor
2016     */
2017      public ConceptDefinitionDesignationComponent(StringType value) {
2018        super();
2019        this.value = value;
2020      }
2021
2022        /**
2023         * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
2024         */
2025        public CodeType getLanguageElement() { 
2026          if (this.language == null)
2027            if (Configuration.errorOnAutoCreate())
2028              throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language");
2029            else if (Configuration.doAutoCreate())
2030              this.language = new CodeType(); // bb
2031          return this.language;
2032        }
2033
2034        public boolean hasLanguageElement() { 
2035          return this.language != null && !this.language.isEmpty();
2036        }
2037
2038        public boolean hasLanguage() { 
2039          return this.language != null && !this.language.isEmpty();
2040        }
2041
2042        /**
2043         * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
2044         */
2045        public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) { 
2046          this.language = value;
2047          return this;
2048        }
2049
2050        /**
2051         * @return The language this designation is defined for.
2052         */
2053        public String getLanguage() { 
2054          return this.language == null ? null : this.language.getValue();
2055        }
2056
2057        /**
2058         * @param value The language this designation is defined for.
2059         */
2060        public ConceptDefinitionDesignationComponent setLanguage(String value) { 
2061          if (Utilities.noString(value))
2062            this.language = null;
2063          else {
2064            if (this.language == null)
2065              this.language = new CodeType();
2066            this.language.setValue(value);
2067          }
2068          return this;
2069        }
2070
2071        /**
2072         * @return {@link #use} (A code that details how this designation would be used.)
2073         */
2074        public Coding getUse() { 
2075          if (this.use == null)
2076            if (Configuration.errorOnAutoCreate())
2077              throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use");
2078            else if (Configuration.doAutoCreate())
2079              this.use = new Coding(); // cc
2080          return this.use;
2081        }
2082
2083        public boolean hasUse() { 
2084          return this.use != null && !this.use.isEmpty();
2085        }
2086
2087        /**
2088         * @param value {@link #use} (A code that details how this designation would be used.)
2089         */
2090        public ConceptDefinitionDesignationComponent setUse(Coding value) { 
2091          this.use = value;
2092          return this;
2093        }
2094
2095        /**
2096         * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2097         */
2098        public StringType getValueElement() { 
2099          if (this.value == null)
2100            if (Configuration.errorOnAutoCreate())
2101              throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value");
2102            else if (Configuration.doAutoCreate())
2103              this.value = new StringType(); // bb
2104          return this.value;
2105        }
2106
2107        public boolean hasValueElement() { 
2108          return this.value != null && !this.value.isEmpty();
2109        }
2110
2111        public boolean hasValue() { 
2112          return this.value != null && !this.value.isEmpty();
2113        }
2114
2115        /**
2116         * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2117         */
2118        public ConceptDefinitionDesignationComponent setValueElement(StringType value) { 
2119          this.value = value;
2120          return this;
2121        }
2122
2123        /**
2124         * @return The text value for this designation.
2125         */
2126        public String getValue() { 
2127          return this.value == null ? null : this.value.getValue();
2128        }
2129
2130        /**
2131         * @param value The text value for this designation.
2132         */
2133        public ConceptDefinitionDesignationComponent setValue(String value) { 
2134            if (this.value == null)
2135              this.value = new StringType();
2136            this.value.setValue(value);
2137          return this;
2138        }
2139
2140        protected void listChildren(List<Property> childrenList) {
2141          super.listChildren(childrenList);
2142          childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language));
2143          childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use));
2144          childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value));
2145        }
2146
2147      @Override
2148      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2149        switch (hash) {
2150        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType
2151        case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding
2152        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
2153        default: return super.getProperty(hash, name, checkValid);
2154        }
2155
2156      }
2157
2158      @Override
2159      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2160        switch (hash) {
2161        case -1613589672: // language
2162          this.language = castToCode(value); // CodeType
2163          return value;
2164        case 116103: // use
2165          this.use = castToCoding(value); // Coding
2166          return value;
2167        case 111972721: // value
2168          this.value = castToString(value); // StringType
2169          return value;
2170        default: return super.setProperty(hash, name, value);
2171        }
2172
2173      }
2174
2175      @Override
2176      public Base setProperty(String name, Base value) throws FHIRException {
2177        if (name.equals("language")) {
2178          this.language = castToCode(value); // CodeType
2179        } else if (name.equals("use")) {
2180          this.use = castToCoding(value); // Coding
2181        } else if (name.equals("value")) {
2182          this.value = castToString(value); // StringType
2183        } else
2184          return super.setProperty(name, value);
2185        return value;
2186      }
2187
2188      @Override
2189      public Base makeProperty(int hash, String name) throws FHIRException {
2190        switch (hash) {
2191        case -1613589672:  return getLanguageElement();
2192        case 116103:  return getUse(); 
2193        case 111972721:  return getValueElement();
2194        default: return super.makeProperty(hash, name);
2195        }
2196
2197      }
2198
2199      @Override
2200      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2201        switch (hash) {
2202        case -1613589672: /*language*/ return new String[] {"code"};
2203        case 116103: /*use*/ return new String[] {"Coding"};
2204        case 111972721: /*value*/ return new String[] {"string"};
2205        default: return super.getTypesForProperty(hash, name);
2206        }
2207
2208      }
2209
2210      @Override
2211      public Base addChild(String name) throws FHIRException {
2212        if (name.equals("language")) {
2213          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.language");
2214        }
2215        else if (name.equals("use")) {
2216          this.use = new Coding();
2217          return this.use;
2218        }
2219        else if (name.equals("value")) {
2220          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.value");
2221        }
2222        else
2223          return super.addChild(name);
2224      }
2225
2226      public ConceptDefinitionDesignationComponent copy() {
2227        ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent();
2228        copyValues(dst);
2229        dst.language = language == null ? null : language.copy();
2230        dst.use = use == null ? null : use.copy();
2231        dst.value = value == null ? null : value.copy();
2232        return dst;
2233      }
2234
2235      @Override
2236      public boolean equalsDeep(Base other) {
2237        if (!super.equalsDeep(other))
2238          return false;
2239        if (!(other instanceof ConceptDefinitionDesignationComponent))
2240          return false;
2241        ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other;
2242        return compareDeep(language, o.language, true) && compareDeep(use, o.use, true) && compareDeep(value, o.value, true)
2243          ;
2244      }
2245
2246      @Override
2247      public boolean equalsShallow(Base other) {
2248        if (!super.equalsShallow(other))
2249          return false;
2250        if (!(other instanceof ConceptDefinitionDesignationComponent))
2251          return false;
2252        ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other;
2253        return compareValues(language, o.language, true) && compareValues(value, o.value, true);
2254      }
2255
2256      public boolean isEmpty() {
2257        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(language, use, value);
2258      }
2259
2260  public String fhirType() {
2261    return "CodeSystem.concept.designation";
2262
2263  }
2264
2265  }
2266
2267    @Block()
2268    public static class ConceptPropertyComponent extends BackboneElement implements IBaseBackboneElement {
2269        /**
2270         * A code that is a reference to CodeSystem.property.code.
2271         */
2272        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2273        @Description(shortDefinition="Reference to CodeSystem.property.code", formalDefinition="A code that is a reference to CodeSystem.property.code." )
2274        protected CodeType code;
2275
2276        /**
2277         * The value of this property.
2278         */
2279        @Child(name = "value", type = {CodeType.class, Coding.class, StringType.class, IntegerType.class, BooleanType.class, DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
2280        @Description(shortDefinition="Value of the property for this concept", formalDefinition="The value of this property." )
2281        protected Type value;
2282
2283        private static final long serialVersionUID = 1742812311L;
2284
2285    /**
2286     * Constructor
2287     */
2288      public ConceptPropertyComponent() {
2289        super();
2290      }
2291
2292    /**
2293     * Constructor
2294     */
2295      public ConceptPropertyComponent(CodeType code, Type value) {
2296        super();
2297        this.code = code;
2298        this.value = value;
2299      }
2300
2301        /**
2302         * @return {@link #code} (A code that is a reference to CodeSystem.property.code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
2303         */
2304        public CodeType getCodeElement() { 
2305          if (this.code == null)
2306            if (Configuration.errorOnAutoCreate())
2307              throw new Error("Attempt to auto-create ConceptPropertyComponent.code");
2308            else if (Configuration.doAutoCreate())
2309              this.code = new CodeType(); // bb
2310          return this.code;
2311        }
2312
2313        public boolean hasCodeElement() { 
2314          return this.code != null && !this.code.isEmpty();
2315        }
2316
2317        public boolean hasCode() { 
2318          return this.code != null && !this.code.isEmpty();
2319        }
2320
2321        /**
2322         * @param value {@link #code} (A code that is a reference to CodeSystem.property.code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
2323         */
2324        public ConceptPropertyComponent setCodeElement(CodeType value) { 
2325          this.code = value;
2326          return this;
2327        }
2328
2329        /**
2330         * @return A code that is a reference to CodeSystem.property.code.
2331         */
2332        public String getCode() { 
2333          return this.code == null ? null : this.code.getValue();
2334        }
2335
2336        /**
2337         * @param value A code that is a reference to CodeSystem.property.code.
2338         */
2339        public ConceptPropertyComponent setCode(String value) { 
2340            if (this.code == null)
2341              this.code = new CodeType();
2342            this.code.setValue(value);
2343          return this;
2344        }
2345
2346        /**
2347         * @return {@link #value} (The value of this property.)
2348         */
2349        public Type getValue() { 
2350          return this.value;
2351        }
2352
2353        /**
2354         * @return {@link #value} (The value of this property.)
2355         */
2356        public CodeType getValueCodeType() throws FHIRException { 
2357          if (!(this.value instanceof CodeType))
2358            throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered");
2359          return (CodeType) this.value;
2360        }
2361
2362        public boolean hasValueCodeType() { 
2363          return this.value instanceof CodeType;
2364        }
2365
2366        /**
2367         * @return {@link #value} (The value of this property.)
2368         */
2369        public Coding getValueCoding() throws FHIRException { 
2370          if (!(this.value instanceof Coding))
2371            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
2372          return (Coding) this.value;
2373        }
2374
2375        public boolean hasValueCoding() { 
2376          return this.value instanceof Coding;
2377        }
2378
2379        /**
2380         * @return {@link #value} (The value of this property.)
2381         */
2382        public StringType getValueStringType() throws FHIRException { 
2383          if (!(this.value instanceof StringType))
2384            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
2385          return (StringType) this.value;
2386        }
2387
2388        public boolean hasValueStringType() { 
2389          return this.value instanceof StringType;
2390        }
2391
2392        /**
2393         * @return {@link #value} (The value of this property.)
2394         */
2395        public IntegerType getValueIntegerType() throws FHIRException { 
2396          if (!(this.value instanceof IntegerType))
2397            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
2398          return (IntegerType) this.value;
2399        }
2400
2401        public boolean hasValueIntegerType() { 
2402          return this.value instanceof IntegerType;
2403        }
2404
2405        /**
2406         * @return {@link #value} (The value of this property.)
2407         */
2408        public BooleanType getValueBooleanType() throws FHIRException { 
2409          if (!(this.value instanceof BooleanType))
2410            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
2411          return (BooleanType) this.value;
2412        }
2413
2414        public boolean hasValueBooleanType() { 
2415          return this.value instanceof BooleanType;
2416        }
2417
2418        /**
2419         * @return {@link #value} (The value of this property.)
2420         */
2421        public DateTimeType getValueDateTimeType() throws FHIRException { 
2422          if (!(this.value instanceof DateTimeType))
2423            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
2424          return (DateTimeType) this.value;
2425        }
2426
2427        public boolean hasValueDateTimeType() { 
2428          return this.value instanceof DateTimeType;
2429        }
2430
2431        public boolean hasValue() { 
2432          return this.value != null && !this.value.isEmpty();
2433        }
2434
2435        /**
2436         * @param value {@link #value} (The value of this property.)
2437         */
2438        public ConceptPropertyComponent setValue(Type value) { 
2439          this.value = value;
2440          return this;
2441        }
2442
2443        protected void listChildren(List<Property> childrenList) {
2444          super.listChildren(childrenList);
2445          childrenList.add(new Property("code", "code", "A code that is a reference to CodeSystem.property.code.", 0, java.lang.Integer.MAX_VALUE, code));
2446          childrenList.add(new Property("value[x]", "code|Coding|string|integer|boolean|dateTime", "The value of this property.", 0, java.lang.Integer.MAX_VALUE, value));
2447        }
2448
2449      @Override
2450      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2451        switch (hash) {
2452        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType
2453        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
2454        default: return super.getProperty(hash, name, checkValid);
2455        }
2456
2457      }
2458
2459      @Override
2460      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2461        switch (hash) {
2462        case 3059181: // code
2463          this.code = castToCode(value); // CodeType
2464          return value;
2465        case 111972721: // value
2466          this.value = castToType(value); // Type
2467          return value;
2468        default: return super.setProperty(hash, name, value);
2469        }
2470
2471      }
2472
2473      @Override
2474      public Base setProperty(String name, Base value) throws FHIRException {
2475        if (name.equals("code")) {
2476          this.code = castToCode(value); // CodeType
2477        } else if (name.equals("value[x]")) {
2478          this.value = castToType(value); // Type
2479        } else
2480          return super.setProperty(name, value);
2481        return value;
2482      }
2483
2484      @Override
2485      public Base makeProperty(int hash, String name) throws FHIRException {
2486        switch (hash) {
2487        case 3059181:  return getCodeElement();
2488        case -1410166417:  return getValue(); 
2489        case 111972721:  return getValue(); 
2490        default: return super.makeProperty(hash, name);
2491        }
2492
2493      }
2494
2495      @Override
2496      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2497        switch (hash) {
2498        case 3059181: /*code*/ return new String[] {"code"};
2499        case 111972721: /*value*/ return new String[] {"code", "Coding", "string", "integer", "boolean", "dateTime"};
2500        default: return super.getTypesForProperty(hash, name);
2501        }
2502
2503      }
2504
2505      @Override
2506      public Base addChild(String name) throws FHIRException {
2507        if (name.equals("code")) {
2508          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code");
2509        }
2510        else if (name.equals("valueCode")) {
2511          this.value = new CodeType();
2512          return this.value;
2513        }
2514        else if (name.equals("valueCoding")) {
2515          this.value = new Coding();
2516          return this.value;
2517        }
2518        else if (name.equals("valueString")) {
2519          this.value = new StringType();
2520          return this.value;
2521        }
2522        else if (name.equals("valueInteger")) {
2523          this.value = new IntegerType();
2524          return this.value;
2525        }
2526        else if (name.equals("valueBoolean")) {
2527          this.value = new BooleanType();
2528          return this.value;
2529        }
2530        else if (name.equals("valueDateTime")) {
2531          this.value = new DateTimeType();
2532          return this.value;
2533        }
2534        else
2535          return super.addChild(name);
2536      }
2537
2538      public ConceptPropertyComponent copy() {
2539        ConceptPropertyComponent dst = new ConceptPropertyComponent();
2540        copyValues(dst);
2541        dst.code = code == null ? null : code.copy();
2542        dst.value = value == null ? null : value.copy();
2543        return dst;
2544      }
2545
2546      @Override
2547      public boolean equalsDeep(Base other) {
2548        if (!super.equalsDeep(other))
2549          return false;
2550        if (!(other instanceof ConceptPropertyComponent))
2551          return false;
2552        ConceptPropertyComponent o = (ConceptPropertyComponent) other;
2553        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
2554      }
2555
2556      @Override
2557      public boolean equalsShallow(Base other) {
2558        if (!super.equalsShallow(other))
2559          return false;
2560        if (!(other instanceof ConceptPropertyComponent))
2561          return false;
2562        ConceptPropertyComponent o = (ConceptPropertyComponent) other;
2563        return compareValues(code, o.code, true);
2564      }
2565
2566      public boolean isEmpty() {
2567        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
2568      }
2569
2570  public String fhirType() {
2571    return "CodeSystem.concept.property";
2572
2573  }
2574
2575  }
2576
2577    /**
2578     * A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.
2579     */
2580    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
2581    @Description(shortDefinition="Additional identifier for the code system", formalDefinition="A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance." )
2582    protected Identifier identifier;
2583
2584    /**
2585     * Explaination of why this code system is needed and why it has been designed as it has.
2586     */
2587    @Child(name = "purpose", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2588    @Description(shortDefinition="Why this code system is defined", formalDefinition="Explaination of why this code system is needed and why it has been designed as it has." )
2589    protected MarkdownType purpose;
2590
2591    /**
2592     * A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.
2593     */
2594    @Child(name = "copyright", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2595    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system." )
2596    protected MarkdownType copyright;
2597
2598    /**
2599     * If code comparison is case sensitive when codes within this system are compared to each other.
2600     */
2601    @Child(name = "caseSensitive", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true)
2602    @Description(shortDefinition="If code comparison is case sensitive", formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other." )
2603    protected BooleanType caseSensitive;
2604
2605    /**
2606     * Canonical URL of value set that contains the entire code system.
2607     */
2608    @Child(name = "valueSet", type = {UriType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2609    @Description(shortDefinition="Canonical URL for value set with entire code system", formalDefinition="Canonical URL of value set that contains the entire code system." )
2610    protected UriType valueSet;
2611
2612    /**
2613     * The meaning of the hierarchy of concepts.
2614     */
2615    @Child(name = "hierarchyMeaning", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2616    @Description(shortDefinition="grouped-by | is-a | part-of | classified-with", formalDefinition="The meaning of the hierarchy of concepts." )
2617    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning")
2618    protected Enumeration<CodeSystemHierarchyMeaning> hierarchyMeaning;
2619
2620    /**
2621     * True If code system defines a post-composition grammar.
2622     */
2623    @Child(name = "compositional", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=true)
2624    @Description(shortDefinition="If code system defines a post-composition grammar", formalDefinition="True If code system defines a post-composition grammar." )
2625    protected BooleanType compositional;
2626
2627    /**
2628     * This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.
2629     */
2630    @Child(name = "versionNeeded", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=true)
2631    @Description(shortDefinition="If definitions are not stable", formalDefinition="This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system." )
2632    protected BooleanType versionNeeded;
2633
2634    /**
2635     * How much of the content of the code system - the concepts and codes it defines - are represented in this resource.
2636     */
2637    @Child(name = "content", type = {CodeType.class}, order=8, min=1, max=1, modifier=false, summary=true)
2638    @Description(shortDefinition="not-present | example | fragment | complete", formalDefinition="How much of the content of the code system - the concepts and codes it defines - are represented in this resource." )
2639    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/codesystem-content-mode")
2640    protected Enumeration<CodeSystemContentMode> content;
2641
2642    /**
2643     * The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.
2644     */
2645    @Child(name = "count", type = {UnsignedIntType.class}, order=9, min=0, max=1, modifier=false, summary=true)
2646    @Description(shortDefinition="Total concepts in the code system", formalDefinition="The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts." )
2647    protected UnsignedIntType count;
2648
2649    /**
2650     * A filter that can be used in a value set compose statement when selecting concepts using a filter.
2651     */
2652    @Child(name = "filter", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2653    @Description(shortDefinition="Filter that can be used in a value set", formalDefinition="A filter that can be used in a value set compose statement when selecting concepts using a filter." )
2654    protected List<CodeSystemFilterComponent> filter;
2655
2656    /**
2657     * A property defines an additional slot through which additional information can be provided about a concept.
2658     */
2659    @Child(name = "property", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2660    @Description(shortDefinition="Additional information supplied about each concept", formalDefinition="A property defines an additional slot through which additional information can be provided about a concept." )
2661    protected List<PropertyComponent> property;
2662
2663    /**
2664     * Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.
2665     */
2666    @Child(name = "concept", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2667    @Description(shortDefinition="Concepts in the code system", formalDefinition="Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are." )
2668    protected List<ConceptDefinitionComponent> concept;
2669
2670    private static final long serialVersionUID = -1344546572L;
2671
2672  /**
2673   * Constructor
2674   */
2675    public CodeSystem() {
2676      super();
2677    }
2678
2679  /**
2680   * Constructor
2681   */
2682    public CodeSystem(Enumeration<PublicationStatus> status, Enumeration<CodeSystemContentMode> content) {
2683      super();
2684      this.status = status;
2685      this.content = content;
2686    }
2687
2688    /**
2689     * @return {@link #url} (An absolute URI that is used to identify this code system 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 code system is (or will be) published. The URL SHOULD include the major version of the code system. For more information see [Technical and Business Versions](resource.html#versions). This is used in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2690     */
2691    public UriType getUrlElement() { 
2692      if (this.url == null)
2693        if (Configuration.errorOnAutoCreate())
2694          throw new Error("Attempt to auto-create CodeSystem.url");
2695        else if (Configuration.doAutoCreate())
2696          this.url = new UriType(); // bb
2697      return this.url;
2698    }
2699
2700    public boolean hasUrlElement() { 
2701      return this.url != null && !this.url.isEmpty();
2702    }
2703
2704    public boolean hasUrl() { 
2705      return this.url != null && !this.url.isEmpty();
2706    }
2707
2708    /**
2709     * @param value {@link #url} (An absolute URI that is used to identify this code system 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 code system is (or will be) published. The URL SHOULD include the major version of the code system. For more information see [Technical and Business Versions](resource.html#versions). This is used in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2710     */
2711    public CodeSystem setUrlElement(UriType value) { 
2712      this.url = value;
2713      return this;
2714    }
2715
2716    /**
2717     * @return An absolute URI that is used to identify this code system 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 code system is (or will be) published. The URL SHOULD include the major version of the code system. For more information see [Technical and Business Versions](resource.html#versions). This is used in [Coding]{datatypes.html#Coding}.system.
2718     */
2719    public String getUrl() { 
2720      return this.url == null ? null : this.url.getValue();
2721    }
2722
2723    /**
2724     * @param value An absolute URI that is used to identify this code system 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 code system is (or will be) published. The URL SHOULD include the major version of the code system. For more information see [Technical and Business Versions](resource.html#versions). This is used in [Coding]{datatypes.html#Coding}.system.
2725     */
2726    public CodeSystem setUrl(String value) { 
2727      if (Utilities.noString(value))
2728        this.url = null;
2729      else {
2730        if (this.url == null)
2731          this.url = new UriType();
2732        this.url.setValue(value);
2733      }
2734      return this;
2735    }
2736
2737    /**
2738     * @return {@link #identifier} (A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.)
2739     */
2740    public Identifier getIdentifier() { 
2741      if (this.identifier == null)
2742        if (Configuration.errorOnAutoCreate())
2743          throw new Error("Attempt to auto-create CodeSystem.identifier");
2744        else if (Configuration.doAutoCreate())
2745          this.identifier = new Identifier(); // cc
2746      return this.identifier;
2747    }
2748
2749    public boolean hasIdentifier() { 
2750      return this.identifier != null && !this.identifier.isEmpty();
2751    }
2752
2753    /**
2754     * @param value {@link #identifier} (A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.)
2755     */
2756    public CodeSystem setIdentifier(Identifier value) { 
2757      this.identifier = value;
2758      return this;
2759    }
2760
2761    /**
2762     * @return {@link #version} (The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding]{datatypes.html#Coding}.version.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2763     */
2764    public StringType getVersionElement() { 
2765      if (this.version == null)
2766        if (Configuration.errorOnAutoCreate())
2767          throw new Error("Attempt to auto-create CodeSystem.version");
2768        else if (Configuration.doAutoCreate())
2769          this.version = new StringType(); // bb
2770      return this.version;
2771    }
2772
2773    public boolean hasVersionElement() { 
2774      return this.version != null && !this.version.isEmpty();
2775    }
2776
2777    public boolean hasVersion() { 
2778      return this.version != null && !this.version.isEmpty();
2779    }
2780
2781    /**
2782     * @param value {@link #version} (The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding]{datatypes.html#Coding}.version.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2783     */
2784    public CodeSystem setVersionElement(StringType value) { 
2785      this.version = value;
2786      return this;
2787    }
2788
2789    /**
2790     * @return The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding]{datatypes.html#Coding}.version.
2791     */
2792    public String getVersion() { 
2793      return this.version == null ? null : this.version.getValue();
2794    }
2795
2796    /**
2797     * @param value The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding]{datatypes.html#Coding}.version.
2798     */
2799    public CodeSystem setVersion(String value) { 
2800      if (Utilities.noString(value))
2801        this.version = null;
2802      else {
2803        if (this.version == null)
2804          this.version = new StringType();
2805        this.version.setValue(value);
2806      }
2807      return this;
2808    }
2809
2810    /**
2811     * @return {@link #name} (A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2812     */
2813    public StringType getNameElement() { 
2814      if (this.name == null)
2815        if (Configuration.errorOnAutoCreate())
2816          throw new Error("Attempt to auto-create CodeSystem.name");
2817        else if (Configuration.doAutoCreate())
2818          this.name = new StringType(); // bb
2819      return this.name;
2820    }
2821
2822    public boolean hasNameElement() { 
2823      return this.name != null && !this.name.isEmpty();
2824    }
2825
2826    public boolean hasName() { 
2827      return this.name != null && !this.name.isEmpty();
2828    }
2829
2830    /**
2831     * @param value {@link #name} (A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2832     */
2833    public CodeSystem setNameElement(StringType value) { 
2834      this.name = value;
2835      return this;
2836    }
2837
2838    /**
2839     * @return A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2840     */
2841    public String getName() { 
2842      return this.name == null ? null : this.name.getValue();
2843    }
2844
2845    /**
2846     * @param value A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2847     */
2848    public CodeSystem setName(String value) { 
2849      if (Utilities.noString(value))
2850        this.name = null;
2851      else {
2852        if (this.name == null)
2853          this.name = new StringType();
2854        this.name.setValue(value);
2855      }
2856      return this;
2857    }
2858
2859    /**
2860     * @return {@link #title} (A short, descriptive, user-friendly title for the code system.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2861     */
2862    public StringType getTitleElement() { 
2863      if (this.title == null)
2864        if (Configuration.errorOnAutoCreate())
2865          throw new Error("Attempt to auto-create CodeSystem.title");
2866        else if (Configuration.doAutoCreate())
2867          this.title = new StringType(); // bb
2868      return this.title;
2869    }
2870
2871    public boolean hasTitleElement() { 
2872      return this.title != null && !this.title.isEmpty();
2873    }
2874
2875    public boolean hasTitle() { 
2876      return this.title != null && !this.title.isEmpty();
2877    }
2878
2879    /**
2880     * @param value {@link #title} (A short, descriptive, user-friendly title for the code system.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2881     */
2882    public CodeSystem setTitleElement(StringType value) { 
2883      this.title = value;
2884      return this;
2885    }
2886
2887    /**
2888     * @return A short, descriptive, user-friendly title for the code system.
2889     */
2890    public String getTitle() { 
2891      return this.title == null ? null : this.title.getValue();
2892    }
2893
2894    /**
2895     * @param value A short, descriptive, user-friendly title for the code system.
2896     */
2897    public CodeSystem setTitle(String value) { 
2898      if (Utilities.noString(value))
2899        this.title = null;
2900      else {
2901        if (this.title == null)
2902          this.title = new StringType();
2903        this.title.setValue(value);
2904      }
2905      return this;
2906    }
2907
2908    /**
2909     * @return {@link #status} (The status of this code system. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2910     */
2911    public Enumeration<PublicationStatus> getStatusElement() { 
2912      if (this.status == null)
2913        if (Configuration.errorOnAutoCreate())
2914          throw new Error("Attempt to auto-create CodeSystem.status");
2915        else if (Configuration.doAutoCreate())
2916          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2917      return this.status;
2918    }
2919
2920    public boolean hasStatusElement() { 
2921      return this.status != null && !this.status.isEmpty();
2922    }
2923
2924    public boolean hasStatus() { 
2925      return this.status != null && !this.status.isEmpty();
2926    }
2927
2928    /**
2929     * @param value {@link #status} (The status of this code system. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2930     */
2931    public CodeSystem setStatusElement(Enumeration<PublicationStatus> value) { 
2932      this.status = value;
2933      return this;
2934    }
2935
2936    /**
2937     * @return The status of this code system. Enables tracking the life-cycle of the content.
2938     */
2939    public PublicationStatus getStatus() { 
2940      return this.status == null ? null : this.status.getValue();
2941    }
2942
2943    /**
2944     * @param value The status of this code system. Enables tracking the life-cycle of the content.
2945     */
2946    public CodeSystem setStatus(PublicationStatus value) { 
2947        if (this.status == null)
2948          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2949        this.status.setValue(value);
2950      return this;
2951    }
2952
2953    /**
2954     * @return {@link #experimental} (A boolean value to indicate that this code system 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
2955     */
2956    public BooleanType getExperimentalElement() { 
2957      if (this.experimental == null)
2958        if (Configuration.errorOnAutoCreate())
2959          throw new Error("Attempt to auto-create CodeSystem.experimental");
2960        else if (Configuration.doAutoCreate())
2961          this.experimental = new BooleanType(); // bb
2962      return this.experimental;
2963    }
2964
2965    public boolean hasExperimentalElement() { 
2966      return this.experimental != null && !this.experimental.isEmpty();
2967    }
2968
2969    public boolean hasExperimental() { 
2970      return this.experimental != null && !this.experimental.isEmpty();
2971    }
2972
2973    /**
2974     * @param value {@link #experimental} (A boolean value to indicate that this code system 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
2975     */
2976    public CodeSystem setExperimentalElement(BooleanType value) { 
2977      this.experimental = value;
2978      return this;
2979    }
2980
2981    /**
2982     * @return A boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2983     */
2984    public boolean getExperimental() { 
2985      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
2986    }
2987
2988    /**
2989     * @param value A boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2990     */
2991    public CodeSystem setExperimental(boolean value) { 
2992        if (this.experimental == null)
2993          this.experimental = new BooleanType();
2994        this.experimental.setValue(value);
2995      return this;
2996    }
2997
2998    /**
2999     * @return {@link #date} (The date  (and optionally time) when the code system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
3000     */
3001    public DateTimeType getDateElement() { 
3002      if (this.date == null)
3003        if (Configuration.errorOnAutoCreate())
3004          throw new Error("Attempt to auto-create CodeSystem.date");
3005        else if (Configuration.doAutoCreate())
3006          this.date = new DateTimeType(); // bb
3007      return this.date;
3008    }
3009
3010    public boolean hasDateElement() { 
3011      return this.date != null && !this.date.isEmpty();
3012    }
3013
3014    public boolean hasDate() { 
3015      return this.date != null && !this.date.isEmpty();
3016    }
3017
3018    /**
3019     * @param value {@link #date} (The date  (and optionally time) when the code system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
3020     */
3021    public CodeSystem setDateElement(DateTimeType value) { 
3022      this.date = value;
3023      return this;
3024    }
3025
3026    /**
3027     * @return The date  (and optionally time) when the code system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes.
3028     */
3029    public Date getDate() { 
3030      return this.date == null ? null : this.date.getValue();
3031    }
3032
3033    /**
3034     * @param value The date  (and optionally time) when the code system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes.
3035     */
3036    public CodeSystem setDate(Date value) { 
3037      if (value == null)
3038        this.date = null;
3039      else {
3040        if (this.date == null)
3041          this.date = new DateTimeType();
3042        this.date.setValue(value);
3043      }
3044      return this;
3045    }
3046
3047    /**
3048     * @return {@link #publisher} (The name of the individual or organization that published the code system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
3049     */
3050    public StringType getPublisherElement() { 
3051      if (this.publisher == null)
3052        if (Configuration.errorOnAutoCreate())
3053          throw new Error("Attempt to auto-create CodeSystem.publisher");
3054        else if (Configuration.doAutoCreate())
3055          this.publisher = new StringType(); // bb
3056      return this.publisher;
3057    }
3058
3059    public boolean hasPublisherElement() { 
3060      return this.publisher != null && !this.publisher.isEmpty();
3061    }
3062
3063    public boolean hasPublisher() { 
3064      return this.publisher != null && !this.publisher.isEmpty();
3065    }
3066
3067    /**
3068     * @param value {@link #publisher} (The name of the individual or organization that published the code system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
3069     */
3070    public CodeSystem setPublisherElement(StringType value) { 
3071      this.publisher = value;
3072      return this;
3073    }
3074
3075    /**
3076     * @return The name of the individual or organization that published the code system.
3077     */
3078    public String getPublisher() { 
3079      return this.publisher == null ? null : this.publisher.getValue();
3080    }
3081
3082    /**
3083     * @param value The name of the individual or organization that published the code system.
3084     */
3085    public CodeSystem setPublisher(String value) { 
3086      if (Utilities.noString(value))
3087        this.publisher = null;
3088      else {
3089        if (this.publisher == null)
3090          this.publisher = new StringType();
3091        this.publisher.setValue(value);
3092      }
3093      return this;
3094    }
3095
3096    /**
3097     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
3098     */
3099    public List<ContactDetail> getContact() { 
3100      if (this.contact == null)
3101        this.contact = new ArrayList<ContactDetail>();
3102      return this.contact;
3103    }
3104
3105    /**
3106     * @return Returns a reference to <code>this</code> for easy method chaining
3107     */
3108    public CodeSystem setContact(List<ContactDetail> theContact) { 
3109      this.contact = theContact;
3110      return this;
3111    }
3112
3113    public boolean hasContact() { 
3114      if (this.contact == null)
3115        return false;
3116      for (ContactDetail item : this.contact)
3117        if (!item.isEmpty())
3118          return true;
3119      return false;
3120    }
3121
3122    public ContactDetail addContact() { //3
3123      ContactDetail t = new ContactDetail();
3124      if (this.contact == null)
3125        this.contact = new ArrayList<ContactDetail>();
3126      this.contact.add(t);
3127      return t;
3128    }
3129
3130    public CodeSystem addContact(ContactDetail t) { //3
3131      if (t == null)
3132        return this;
3133      if (this.contact == null)
3134        this.contact = new ArrayList<ContactDetail>();
3135      this.contact.add(t);
3136      return this;
3137    }
3138
3139    /**
3140     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
3141     */
3142    public ContactDetail getContactFirstRep() { 
3143      if (getContact().isEmpty()) {
3144        addContact();
3145      }
3146      return getContact().get(0);
3147    }
3148
3149    /**
3150     * @return {@link #description} (A free text natural language description of the code system from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3151     */
3152    public MarkdownType getDescriptionElement() { 
3153      if (this.description == null)
3154        if (Configuration.errorOnAutoCreate())
3155          throw new Error("Attempt to auto-create CodeSystem.description");
3156        else if (Configuration.doAutoCreate())
3157          this.description = new MarkdownType(); // bb
3158      return this.description;
3159    }
3160
3161    public boolean hasDescriptionElement() { 
3162      return this.description != null && !this.description.isEmpty();
3163    }
3164
3165    public boolean hasDescription() { 
3166      return this.description != null && !this.description.isEmpty();
3167    }
3168
3169    /**
3170     * @param value {@link #description} (A free text natural language description of the code system from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3171     */
3172    public CodeSystem setDescriptionElement(MarkdownType value) { 
3173      this.description = value;
3174      return this;
3175    }
3176
3177    /**
3178     * @return A free text natural language description of the code system from a consumer's perspective.
3179     */
3180    public String getDescription() { 
3181      return this.description == null ? null : this.description.getValue();
3182    }
3183
3184    /**
3185     * @param value A free text natural language description of the code system from a consumer's perspective.
3186     */
3187    public CodeSystem setDescription(String value) { 
3188      if (value == null)
3189        this.description = null;
3190      else {
3191        if (this.description == null)
3192          this.description = new MarkdownType();
3193        this.description.setValue(value);
3194      }
3195      return this;
3196    }
3197
3198    /**
3199     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate code system instances.)
3200     */
3201    public List<UsageContext> getUseContext() { 
3202      if (this.useContext == null)
3203        this.useContext = new ArrayList<UsageContext>();
3204      return this.useContext;
3205    }
3206
3207    /**
3208     * @return Returns a reference to <code>this</code> for easy method chaining
3209     */
3210    public CodeSystem setUseContext(List<UsageContext> theUseContext) { 
3211      this.useContext = theUseContext;
3212      return this;
3213    }
3214
3215    public boolean hasUseContext() { 
3216      if (this.useContext == null)
3217        return false;
3218      for (UsageContext item : this.useContext)
3219        if (!item.isEmpty())
3220          return true;
3221      return false;
3222    }
3223
3224    public UsageContext addUseContext() { //3
3225      UsageContext t = new UsageContext();
3226      if (this.useContext == null)
3227        this.useContext = new ArrayList<UsageContext>();
3228      this.useContext.add(t);
3229      return t;
3230    }
3231
3232    public CodeSystem addUseContext(UsageContext t) { //3
3233      if (t == null)
3234        return this;
3235      if (this.useContext == null)
3236        this.useContext = new ArrayList<UsageContext>();
3237      this.useContext.add(t);
3238      return this;
3239    }
3240
3241    /**
3242     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
3243     */
3244    public UsageContext getUseContextFirstRep() { 
3245      if (getUseContext().isEmpty()) {
3246        addUseContext();
3247      }
3248      return getUseContext().get(0);
3249    }
3250
3251    /**
3252     * @return {@link #jurisdiction} (A legal or geographic region in which the code system is intended to be used.)
3253     */
3254    public List<CodeableConcept> getJurisdiction() { 
3255      if (this.jurisdiction == null)
3256        this.jurisdiction = new ArrayList<CodeableConcept>();
3257      return this.jurisdiction;
3258    }
3259
3260    /**
3261     * @return Returns a reference to <code>this</code> for easy method chaining
3262     */
3263    public CodeSystem setJurisdiction(List<CodeableConcept> theJurisdiction) { 
3264      this.jurisdiction = theJurisdiction;
3265      return this;
3266    }
3267
3268    public boolean hasJurisdiction() { 
3269      if (this.jurisdiction == null)
3270        return false;
3271      for (CodeableConcept item : this.jurisdiction)
3272        if (!item.isEmpty())
3273          return true;
3274      return false;
3275    }
3276
3277    public CodeableConcept addJurisdiction() { //3
3278      CodeableConcept t = new CodeableConcept();
3279      if (this.jurisdiction == null)
3280        this.jurisdiction = new ArrayList<CodeableConcept>();
3281      this.jurisdiction.add(t);
3282      return t;
3283    }
3284
3285    public CodeSystem addJurisdiction(CodeableConcept t) { //3
3286      if (t == null)
3287        return this;
3288      if (this.jurisdiction == null)
3289        this.jurisdiction = new ArrayList<CodeableConcept>();
3290      this.jurisdiction.add(t);
3291      return this;
3292    }
3293
3294    /**
3295     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
3296     */
3297    public CodeableConcept getJurisdictionFirstRep() { 
3298      if (getJurisdiction().isEmpty()) {
3299        addJurisdiction();
3300      }
3301      return getJurisdiction().get(0);
3302    }
3303
3304    /**
3305     * @return {@link #purpose} (Explaination of why this code system is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
3306     */
3307    public MarkdownType getPurposeElement() { 
3308      if (this.purpose == null)
3309        if (Configuration.errorOnAutoCreate())
3310          throw new Error("Attempt to auto-create CodeSystem.purpose");
3311        else if (Configuration.doAutoCreate())
3312          this.purpose = new MarkdownType(); // bb
3313      return this.purpose;
3314    }
3315
3316    public boolean hasPurposeElement() { 
3317      return this.purpose != null && !this.purpose.isEmpty();
3318    }
3319
3320    public boolean hasPurpose() { 
3321      return this.purpose != null && !this.purpose.isEmpty();
3322    }
3323
3324    /**
3325     * @param value {@link #purpose} (Explaination of why this code system is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
3326     */
3327    public CodeSystem setPurposeElement(MarkdownType value) { 
3328      this.purpose = value;
3329      return this;
3330    }
3331
3332    /**
3333     * @return Explaination of why this code system is needed and why it has been designed as it has.
3334     */
3335    public String getPurpose() { 
3336      return this.purpose == null ? null : this.purpose.getValue();
3337    }
3338
3339    /**
3340     * @param value Explaination of why this code system is needed and why it has been designed as it has.
3341     */
3342    public CodeSystem setPurpose(String value) { 
3343      if (value == null)
3344        this.purpose = null;
3345      else {
3346        if (this.purpose == null)
3347          this.purpose = new MarkdownType();
3348        this.purpose.setValue(value);
3349      }
3350      return this;
3351    }
3352
3353    /**
3354     * @return {@link #copyright} (A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3355     */
3356    public MarkdownType getCopyrightElement() { 
3357      if (this.copyright == null)
3358        if (Configuration.errorOnAutoCreate())
3359          throw new Error("Attempt to auto-create CodeSystem.copyright");
3360        else if (Configuration.doAutoCreate())
3361          this.copyright = new MarkdownType(); // bb
3362      return this.copyright;
3363    }
3364
3365    public boolean hasCopyrightElement() { 
3366      return this.copyright != null && !this.copyright.isEmpty();
3367    }
3368
3369    public boolean hasCopyright() { 
3370      return this.copyright != null && !this.copyright.isEmpty();
3371    }
3372
3373    /**
3374     * @param value {@link #copyright} (A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3375     */
3376    public CodeSystem setCopyrightElement(MarkdownType value) { 
3377      this.copyright = value;
3378      return this;
3379    }
3380
3381    /**
3382     * @return A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.
3383     */
3384    public String getCopyright() { 
3385      return this.copyright == null ? null : this.copyright.getValue();
3386    }
3387
3388    /**
3389     * @param value A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.
3390     */
3391    public CodeSystem setCopyright(String value) { 
3392      if (value == null)
3393        this.copyright = null;
3394      else {
3395        if (this.copyright == null)
3396          this.copyright = new MarkdownType();
3397        this.copyright.setValue(value);
3398      }
3399      return this;
3400    }
3401
3402    /**
3403     * @return {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value
3404     */
3405    public BooleanType getCaseSensitiveElement() { 
3406      if (this.caseSensitive == null)
3407        if (Configuration.errorOnAutoCreate())
3408          throw new Error("Attempt to auto-create CodeSystem.caseSensitive");
3409        else if (Configuration.doAutoCreate())
3410          this.caseSensitive = new BooleanType(); // bb
3411      return this.caseSensitive;
3412    }
3413
3414    public boolean hasCaseSensitiveElement() { 
3415      return this.caseSensitive != null && !this.caseSensitive.isEmpty();
3416    }
3417
3418    public boolean hasCaseSensitive() { 
3419      return this.caseSensitive != null && !this.caseSensitive.isEmpty();
3420    }
3421
3422    /**
3423     * @param value {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value
3424     */
3425    public CodeSystem setCaseSensitiveElement(BooleanType value) { 
3426      this.caseSensitive = value;
3427      return this;
3428    }
3429
3430    /**
3431     * @return If code comparison is case sensitive when codes within this system are compared to each other.
3432     */
3433    public boolean getCaseSensitive() { 
3434      return this.caseSensitive == null || this.caseSensitive.isEmpty() ? false : this.caseSensitive.getValue();
3435    }
3436
3437    /**
3438     * @param value If code comparison is case sensitive when codes within this system are compared to each other.
3439     */
3440    public CodeSystem setCaseSensitive(boolean value) { 
3441        if (this.caseSensitive == null)
3442          this.caseSensitive = new BooleanType();
3443        this.caseSensitive.setValue(value);
3444      return this;
3445    }
3446
3447    /**
3448     * @return {@link #valueSet} (Canonical URL of value set that contains the entire code system.). This is the underlying object with id, value and extensions. The accessor "getValueSet" gives direct access to the value
3449     */
3450    public UriType getValueSetElement() { 
3451      if (this.valueSet == null)
3452        if (Configuration.errorOnAutoCreate())
3453          throw new Error("Attempt to auto-create CodeSystem.valueSet");
3454        else if (Configuration.doAutoCreate())
3455          this.valueSet = new UriType(); // bb
3456      return this.valueSet;
3457    }
3458
3459    public boolean hasValueSetElement() { 
3460      return this.valueSet != null && !this.valueSet.isEmpty();
3461    }
3462
3463    public boolean hasValueSet() { 
3464      return this.valueSet != null && !this.valueSet.isEmpty();
3465    }
3466
3467    /**
3468     * @param value {@link #valueSet} (Canonical URL of value set that contains the entire code system.). This is the underlying object with id, value and extensions. The accessor "getValueSet" gives direct access to the value
3469     */
3470    public CodeSystem setValueSetElement(UriType value) { 
3471      this.valueSet = value;
3472      return this;
3473    }
3474
3475    /**
3476     * @return Canonical URL of value set that contains the entire code system.
3477     */
3478    public String getValueSet() { 
3479      return this.valueSet == null ? null : this.valueSet.getValue();
3480    }
3481
3482    /**
3483     * @param value Canonical URL of value set that contains the entire code system.
3484     */
3485    public CodeSystem setValueSet(String value) { 
3486      if (Utilities.noString(value))
3487        this.valueSet = null;
3488      else {
3489        if (this.valueSet == null)
3490          this.valueSet = new UriType();
3491        this.valueSet.setValue(value);
3492      }
3493      return this;
3494    }
3495
3496    /**
3497     * @return {@link #hierarchyMeaning} (The meaning of the hierarchy of concepts.). This is the underlying object with id, value and extensions. The accessor "getHierarchyMeaning" gives direct access to the value
3498     */
3499    public Enumeration<CodeSystemHierarchyMeaning> getHierarchyMeaningElement() { 
3500      if (this.hierarchyMeaning == null)
3501        if (Configuration.errorOnAutoCreate())
3502          throw new Error("Attempt to auto-create CodeSystem.hierarchyMeaning");
3503        else if (Configuration.doAutoCreate())
3504          this.hierarchyMeaning = new Enumeration<CodeSystemHierarchyMeaning>(new CodeSystemHierarchyMeaningEnumFactory()); // bb
3505      return this.hierarchyMeaning;
3506    }
3507
3508    public boolean hasHierarchyMeaningElement() { 
3509      return this.hierarchyMeaning != null && !this.hierarchyMeaning.isEmpty();
3510    }
3511
3512    public boolean hasHierarchyMeaning() { 
3513      return this.hierarchyMeaning != null && !this.hierarchyMeaning.isEmpty();
3514    }
3515
3516    /**
3517     * @param value {@link #hierarchyMeaning} (The meaning of the hierarchy of concepts.). This is the underlying object with id, value and extensions. The accessor "getHierarchyMeaning" gives direct access to the value
3518     */
3519    public CodeSystem setHierarchyMeaningElement(Enumeration<CodeSystemHierarchyMeaning> value) { 
3520      this.hierarchyMeaning = value;
3521      return this;
3522    }
3523
3524    /**
3525     * @return The meaning of the hierarchy of concepts.
3526     */
3527    public CodeSystemHierarchyMeaning getHierarchyMeaning() { 
3528      return this.hierarchyMeaning == null ? null : this.hierarchyMeaning.getValue();
3529    }
3530
3531    /**
3532     * @param value The meaning of the hierarchy of concepts.
3533     */
3534    public CodeSystem setHierarchyMeaning(CodeSystemHierarchyMeaning value) { 
3535      if (value == null)
3536        this.hierarchyMeaning = null;
3537      else {
3538        if (this.hierarchyMeaning == null)
3539          this.hierarchyMeaning = new Enumeration<CodeSystemHierarchyMeaning>(new CodeSystemHierarchyMeaningEnumFactory());
3540        this.hierarchyMeaning.setValue(value);
3541      }
3542      return this;
3543    }
3544
3545    /**
3546     * @return {@link #compositional} (True If code system defines a post-composition grammar.). This is the underlying object with id, value and extensions. The accessor "getCompositional" gives direct access to the value
3547     */
3548    public BooleanType getCompositionalElement() { 
3549      if (this.compositional == null)
3550        if (Configuration.errorOnAutoCreate())
3551          throw new Error("Attempt to auto-create CodeSystem.compositional");
3552        else if (Configuration.doAutoCreate())
3553          this.compositional = new BooleanType(); // bb
3554      return this.compositional;
3555    }
3556
3557    public boolean hasCompositionalElement() { 
3558      return this.compositional != null && !this.compositional.isEmpty();
3559    }
3560
3561    public boolean hasCompositional() { 
3562      return this.compositional != null && !this.compositional.isEmpty();
3563    }
3564
3565    /**
3566     * @param value {@link #compositional} (True If code system defines a post-composition grammar.). This is the underlying object with id, value and extensions. The accessor "getCompositional" gives direct access to the value
3567     */
3568    public CodeSystem setCompositionalElement(BooleanType value) { 
3569      this.compositional = value;
3570      return this;
3571    }
3572
3573    /**
3574     * @return True If code system defines a post-composition grammar.
3575     */
3576    public boolean getCompositional() { 
3577      return this.compositional == null || this.compositional.isEmpty() ? false : this.compositional.getValue();
3578    }
3579
3580    /**
3581     * @param value True If code system defines a post-composition grammar.
3582     */
3583    public CodeSystem setCompositional(boolean value) { 
3584        if (this.compositional == null)
3585          this.compositional = new BooleanType();
3586        this.compositional.setValue(value);
3587      return this;
3588    }
3589
3590    /**
3591     * @return {@link #versionNeeded} (This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.). This is the underlying object with id, value and extensions. The accessor "getVersionNeeded" gives direct access to the value
3592     */
3593    public BooleanType getVersionNeededElement() { 
3594      if (this.versionNeeded == null)
3595        if (Configuration.errorOnAutoCreate())
3596          throw new Error("Attempt to auto-create CodeSystem.versionNeeded");
3597        else if (Configuration.doAutoCreate())
3598          this.versionNeeded = new BooleanType(); // bb
3599      return this.versionNeeded;
3600    }
3601
3602    public boolean hasVersionNeededElement() { 
3603      return this.versionNeeded != null && !this.versionNeeded.isEmpty();
3604    }
3605
3606    public boolean hasVersionNeeded() { 
3607      return this.versionNeeded != null && !this.versionNeeded.isEmpty();
3608    }
3609
3610    /**
3611     * @param value {@link #versionNeeded} (This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.). This is the underlying object with id, value and extensions. The accessor "getVersionNeeded" gives direct access to the value
3612     */
3613    public CodeSystem setVersionNeededElement(BooleanType value) { 
3614      this.versionNeeded = value;
3615      return this;
3616    }
3617
3618    /**
3619     * @return This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.
3620     */
3621    public boolean getVersionNeeded() { 
3622      return this.versionNeeded == null || this.versionNeeded.isEmpty() ? false : this.versionNeeded.getValue();
3623    }
3624
3625    /**
3626     * @param value This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.
3627     */
3628    public CodeSystem setVersionNeeded(boolean value) { 
3629        if (this.versionNeeded == null)
3630          this.versionNeeded = new BooleanType();
3631        this.versionNeeded.setValue(value);
3632      return this;
3633    }
3634
3635    /**
3636     * @return {@link #content} (How much of the content of the code system - the concepts and codes it defines - are represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value
3637     */
3638    public Enumeration<CodeSystemContentMode> getContentElement() { 
3639      if (this.content == null)
3640        if (Configuration.errorOnAutoCreate())
3641          throw new Error("Attempt to auto-create CodeSystem.content");
3642        else if (Configuration.doAutoCreate())
3643          this.content = new Enumeration<CodeSystemContentMode>(new CodeSystemContentModeEnumFactory()); // bb
3644      return this.content;
3645    }
3646
3647    public boolean hasContentElement() { 
3648      return this.content != null && !this.content.isEmpty();
3649    }
3650
3651    public boolean hasContent() { 
3652      return this.content != null && !this.content.isEmpty();
3653    }
3654
3655    /**
3656     * @param value {@link #content} (How much of the content of the code system - the concepts and codes it defines - are represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value
3657     */
3658    public CodeSystem setContentElement(Enumeration<CodeSystemContentMode> value) { 
3659      this.content = value;
3660      return this;
3661    }
3662
3663    /**
3664     * @return How much of the content of the code system - the concepts and codes it defines - are represented in this resource.
3665     */
3666    public CodeSystemContentMode getContent() { 
3667      return this.content == null ? null : this.content.getValue();
3668    }
3669
3670    /**
3671     * @param value How much of the content of the code system - the concepts and codes it defines - are represented in this resource.
3672     */
3673    public CodeSystem setContent(CodeSystemContentMode value) { 
3674        if (this.content == null)
3675          this.content = new Enumeration<CodeSystemContentMode>(new CodeSystemContentModeEnumFactory());
3676        this.content.setValue(value);
3677      return this;
3678    }
3679
3680    /**
3681     * @return {@link #count} (The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value
3682     */
3683    public UnsignedIntType getCountElement() { 
3684      if (this.count == null)
3685        if (Configuration.errorOnAutoCreate())
3686          throw new Error("Attempt to auto-create CodeSystem.count");
3687        else if (Configuration.doAutoCreate())
3688          this.count = new UnsignedIntType(); // bb
3689      return this.count;
3690    }
3691
3692    public boolean hasCountElement() { 
3693      return this.count != null && !this.count.isEmpty();
3694    }
3695
3696    public boolean hasCount() { 
3697      return this.count != null && !this.count.isEmpty();
3698    }
3699
3700    /**
3701     * @param value {@link #count} (The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value
3702     */
3703    public CodeSystem setCountElement(UnsignedIntType value) { 
3704      this.count = value;
3705      return this;
3706    }
3707
3708    /**
3709     * @return The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.
3710     */
3711    public int getCount() { 
3712      return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue();
3713    }
3714
3715    /**
3716     * @param value The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.
3717     */
3718    public CodeSystem setCount(int value) { 
3719        if (this.count == null)
3720          this.count = new UnsignedIntType();
3721        this.count.setValue(value);
3722      return this;
3723    }
3724
3725    /**
3726     * @return {@link #filter} (A filter that can be used in a value set compose statement when selecting concepts using a filter.)
3727     */
3728    public List<CodeSystemFilterComponent> getFilter() { 
3729      if (this.filter == null)
3730        this.filter = new ArrayList<CodeSystemFilterComponent>();
3731      return this.filter;
3732    }
3733
3734    /**
3735     * @return Returns a reference to <code>this</code> for easy method chaining
3736     */
3737    public CodeSystem setFilter(List<CodeSystemFilterComponent> theFilter) { 
3738      this.filter = theFilter;
3739      return this;
3740    }
3741
3742    public boolean hasFilter() { 
3743      if (this.filter == null)
3744        return false;
3745      for (CodeSystemFilterComponent item : this.filter)
3746        if (!item.isEmpty())
3747          return true;
3748      return false;
3749    }
3750
3751    public CodeSystemFilterComponent addFilter() { //3
3752      CodeSystemFilterComponent t = new CodeSystemFilterComponent();
3753      if (this.filter == null)
3754        this.filter = new ArrayList<CodeSystemFilterComponent>();
3755      this.filter.add(t);
3756      return t;
3757    }
3758
3759    public CodeSystem addFilter(CodeSystemFilterComponent t) { //3
3760      if (t == null)
3761        return this;
3762      if (this.filter == null)
3763        this.filter = new ArrayList<CodeSystemFilterComponent>();
3764      this.filter.add(t);
3765      return this;
3766    }
3767
3768    /**
3769     * @return The first repetition of repeating field {@link #filter}, creating it if it does not already exist
3770     */
3771    public CodeSystemFilterComponent getFilterFirstRep() { 
3772      if (getFilter().isEmpty()) {
3773        addFilter();
3774      }
3775      return getFilter().get(0);
3776    }
3777
3778    /**
3779     * @return {@link #property} (A property defines an additional slot through which additional information can be provided about a concept.)
3780     */
3781    public List<PropertyComponent> getProperty() { 
3782      if (this.property == null)
3783        this.property = new ArrayList<PropertyComponent>();
3784      return this.property;
3785    }
3786
3787    /**
3788     * @return Returns a reference to <code>this</code> for easy method chaining
3789     */
3790    public CodeSystem setProperty(List<PropertyComponent> theProperty) { 
3791      this.property = theProperty;
3792      return this;
3793    }
3794
3795    public boolean hasProperty() { 
3796      if (this.property == null)
3797        return false;
3798      for (PropertyComponent item : this.property)
3799        if (!item.isEmpty())
3800          return true;
3801      return false;
3802    }
3803
3804    public PropertyComponent addProperty() { //3
3805      PropertyComponent t = new PropertyComponent();
3806      if (this.property == null)
3807        this.property = new ArrayList<PropertyComponent>();
3808      this.property.add(t);
3809      return t;
3810    }
3811
3812    public CodeSystem addProperty(PropertyComponent t) { //3
3813      if (t == null)
3814        return this;
3815      if (this.property == null)
3816        this.property = new ArrayList<PropertyComponent>();
3817      this.property.add(t);
3818      return this;
3819    }
3820
3821    /**
3822     * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist
3823     */
3824    public PropertyComponent getPropertyFirstRep() { 
3825      if (getProperty().isEmpty()) {
3826        addProperty();
3827      }
3828      return getProperty().get(0);
3829    }
3830
3831    /**
3832     * @return {@link #concept} (Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.)
3833     */
3834    public List<ConceptDefinitionComponent> getConcept() { 
3835      if (this.concept == null)
3836        this.concept = new ArrayList<ConceptDefinitionComponent>();
3837      return this.concept;
3838    }
3839
3840    /**
3841     * @return Returns a reference to <code>this</code> for easy method chaining
3842     */
3843    public CodeSystem setConcept(List<ConceptDefinitionComponent> theConcept) { 
3844      this.concept = theConcept;
3845      return this;
3846    }
3847
3848    public boolean hasConcept() { 
3849      if (this.concept == null)
3850        return false;
3851      for (ConceptDefinitionComponent item : this.concept)
3852        if (!item.isEmpty())
3853          return true;
3854      return false;
3855    }
3856
3857    public ConceptDefinitionComponent addConcept() { //3
3858      ConceptDefinitionComponent t = new ConceptDefinitionComponent();
3859      if (this.concept == null)
3860        this.concept = new ArrayList<ConceptDefinitionComponent>();
3861      this.concept.add(t);
3862      return t;
3863    }
3864
3865    public CodeSystem addConcept(ConceptDefinitionComponent t) { //3
3866      if (t == null)
3867        return this;
3868      if (this.concept == null)
3869        this.concept = new ArrayList<ConceptDefinitionComponent>();
3870      this.concept.add(t);
3871      return this;
3872    }
3873
3874    /**
3875     * @return The first repetition of repeating field {@link #concept}, creating it if it does not already exist
3876     */
3877    public ConceptDefinitionComponent getConceptFirstRep() { 
3878      if (getConcept().isEmpty()) {
3879        addConcept();
3880      }
3881      return getConcept().get(0);
3882    }
3883
3884      protected void listChildren(List<Property> childrenList) {
3885        super.listChildren(childrenList);
3886        childrenList.add(new Property("url", "uri", "An absolute URI that is used to identify this code system 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 code system is (or will be) published. The URL SHOULD include the major version of the code system. For more information see [Technical and Business Versions](resource.html#versions). This is used in [Coding]{datatypes.html#Coding}.system.", 0, java.lang.Integer.MAX_VALUE, url));
3887        childrenList.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
3888        childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding]{datatypes.html#Coding}.version.", 0, java.lang.Integer.MAX_VALUE, version));
3889        childrenList.add(new Property("name", "string", "A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, java.lang.Integer.MAX_VALUE, name));
3890        childrenList.add(new Property("title", "string", "A short, descriptive, user-friendly title for the code system.", 0, java.lang.Integer.MAX_VALUE, title));
3891        childrenList.add(new Property("status", "code", "The status of this code system. Enables tracking the life-cycle of the content.", 0, java.lang.Integer.MAX_VALUE, status));
3892        childrenList.add(new Property("experimental", "boolean", "A boolean value to indicate that this code system 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));
3893        childrenList.add(new Property("date", "dateTime", "The date  (and optionally time) when the code system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes.", 0, java.lang.Integer.MAX_VALUE, date));
3894        childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the code system.", 0, java.lang.Integer.MAX_VALUE, publisher));
3895        childrenList.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
3896        childrenList.add(new Property("description", "markdown", "A free text natural language description of the code system from a consumer's perspective.", 0, java.lang.Integer.MAX_VALUE, description));
3897        childrenList.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate code system instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
3898        childrenList.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the code system is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
3899        childrenList.add(new Property("purpose", "markdown", "Explaination of why this code system is needed and why it has been designed as it has.", 0, java.lang.Integer.MAX_VALUE, purpose));
3900        childrenList.add(new Property("copyright", "markdown", "A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.", 0, java.lang.Integer.MAX_VALUE, copyright));
3901        childrenList.add(new Property("caseSensitive", "boolean", "If code comparison is case sensitive when codes within this system are compared to each other.", 0, java.lang.Integer.MAX_VALUE, caseSensitive));
3902        childrenList.add(new Property("valueSet", "uri", "Canonical URL of value set that contains the entire code system.", 0, java.lang.Integer.MAX_VALUE, valueSet));
3903        childrenList.add(new Property("hierarchyMeaning", "code", "The meaning of the hierarchy of concepts.", 0, java.lang.Integer.MAX_VALUE, hierarchyMeaning));
3904        childrenList.add(new Property("compositional", "boolean", "True If code system defines a post-composition grammar.", 0, java.lang.Integer.MAX_VALUE, compositional));
3905        childrenList.add(new Property("versionNeeded", "boolean", "This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.", 0, java.lang.Integer.MAX_VALUE, versionNeeded));
3906        childrenList.add(new Property("content", "code", "How much of the content of the code system - the concepts and codes it defines - are represented in this resource.", 0, java.lang.Integer.MAX_VALUE, content));
3907        childrenList.add(new Property("count", "unsignedInt", "The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.", 0, java.lang.Integer.MAX_VALUE, count));
3908        childrenList.add(new Property("filter", "", "A filter that can be used in a value set compose statement when selecting concepts using a filter.", 0, java.lang.Integer.MAX_VALUE, filter));
3909        childrenList.add(new Property("property", "", "A property defines an additional slot through which additional information can be provided about a concept.", 0, java.lang.Integer.MAX_VALUE, property));
3910        childrenList.add(new Property("concept", "", "Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.", 0, java.lang.Integer.MAX_VALUE, concept));
3911      }
3912
3913      @Override
3914      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3915        switch (hash) {
3916        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3917        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
3918        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
3919        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3920        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
3921        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
3922        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
3923        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
3924        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
3925        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3926        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3927        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3928        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
3929        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
3930        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3931        case -35616442: /*caseSensitive*/ return this.caseSensitive == null ? new Base[0] : new Base[] {this.caseSensitive}; // BooleanType
3932        case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // UriType
3933        case 1913078280: /*hierarchyMeaning*/ return this.hierarchyMeaning == null ? new Base[0] : new Base[] {this.hierarchyMeaning}; // Enumeration<CodeSystemHierarchyMeaning>
3934        case 1248023381: /*compositional*/ return this.compositional == null ? new Base[0] : new Base[] {this.compositional}; // BooleanType
3935        case 617270957: /*versionNeeded*/ return this.versionNeeded == null ? new Base[0] : new Base[] {this.versionNeeded}; // BooleanType
3936        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Enumeration<CodeSystemContentMode>
3937        case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // UnsignedIntType
3938        case -1274492040: /*filter*/ return this.filter == null ? new Base[0] : this.filter.toArray(new Base[this.filter.size()]); // CodeSystemFilterComponent
3939        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // PropertyComponent
3940        case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptDefinitionComponent
3941        default: return super.getProperty(hash, name, checkValid);
3942        }
3943
3944      }
3945
3946      @Override
3947      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3948        switch (hash) {
3949        case 116079: // url
3950          this.url = castToUri(value); // UriType
3951          return value;
3952        case -1618432855: // identifier
3953          this.identifier = castToIdentifier(value); // Identifier
3954          return value;
3955        case 351608024: // version
3956          this.version = castToString(value); // StringType
3957          return value;
3958        case 3373707: // name
3959          this.name = castToString(value); // StringType
3960          return value;
3961        case 110371416: // title
3962          this.title = castToString(value); // StringType
3963          return value;
3964        case -892481550: // status
3965          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3966          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3967          return value;
3968        case -404562712: // experimental
3969          this.experimental = castToBoolean(value); // BooleanType
3970          return value;
3971        case 3076014: // date
3972          this.date = castToDateTime(value); // DateTimeType
3973          return value;
3974        case 1447404028: // publisher
3975          this.publisher = castToString(value); // StringType
3976          return value;
3977        case 951526432: // contact
3978          this.getContact().add(castToContactDetail(value)); // ContactDetail
3979          return value;
3980        case -1724546052: // description
3981          this.description = castToMarkdown(value); // MarkdownType
3982          return value;
3983        case -669707736: // useContext
3984          this.getUseContext().add(castToUsageContext(value)); // UsageContext
3985          return value;
3986        case -507075711: // jurisdiction
3987          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
3988          return value;
3989        case -220463842: // purpose
3990          this.purpose = castToMarkdown(value); // MarkdownType
3991          return value;
3992        case 1522889671: // copyright
3993          this.copyright = castToMarkdown(value); // MarkdownType
3994          return value;
3995        case -35616442: // caseSensitive
3996          this.caseSensitive = castToBoolean(value); // BooleanType
3997          return value;
3998        case -1410174671: // valueSet
3999          this.valueSet = castToUri(value); // UriType
4000          return value;
4001        case 1913078280: // hierarchyMeaning
4002          value = new CodeSystemHierarchyMeaningEnumFactory().fromType(castToCode(value));
4003          this.hierarchyMeaning = (Enumeration) value; // Enumeration<CodeSystemHierarchyMeaning>
4004          return value;
4005        case 1248023381: // compositional
4006          this.compositional = castToBoolean(value); // BooleanType
4007          return value;
4008        case 617270957: // versionNeeded
4009          this.versionNeeded = castToBoolean(value); // BooleanType
4010          return value;
4011        case 951530617: // content
4012          value = new CodeSystemContentModeEnumFactory().fromType(castToCode(value));
4013          this.content = (Enumeration) value; // Enumeration<CodeSystemContentMode>
4014          return value;
4015        case 94851343: // count
4016          this.count = castToUnsignedInt(value); // UnsignedIntType
4017          return value;
4018        case -1274492040: // filter
4019          this.getFilter().add((CodeSystemFilterComponent) value); // CodeSystemFilterComponent
4020          return value;
4021        case -993141291: // property
4022          this.getProperty().add((PropertyComponent) value); // PropertyComponent
4023          return value;
4024        case 951024232: // concept
4025          this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent
4026          return value;
4027        default: return super.setProperty(hash, name, value);
4028        }
4029
4030      }
4031
4032      @Override
4033      public Base setProperty(String name, Base value) throws FHIRException {
4034        if (name.equals("url")) {
4035          this.url = castToUri(value); // UriType
4036        } else if (name.equals("identifier")) {
4037          this.identifier = castToIdentifier(value); // Identifier
4038        } else if (name.equals("version")) {
4039          this.version = castToString(value); // StringType
4040        } else if (name.equals("name")) {
4041          this.name = castToString(value); // StringType
4042        } else if (name.equals("title")) {
4043          this.title = castToString(value); // StringType
4044        } else if (name.equals("status")) {
4045          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
4046          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4047        } else if (name.equals("experimental")) {
4048          this.experimental = castToBoolean(value); // BooleanType
4049        } else if (name.equals("date")) {
4050          this.date = castToDateTime(value); // DateTimeType
4051        } else if (name.equals("publisher")) {
4052          this.publisher = castToString(value); // StringType
4053        } else if (name.equals("contact")) {
4054          this.getContact().add(castToContactDetail(value));
4055        } else if (name.equals("description")) {
4056          this.description = castToMarkdown(value); // MarkdownType
4057        } else if (name.equals("useContext")) {
4058          this.getUseContext().add(castToUsageContext(value));
4059        } else if (name.equals("jurisdiction")) {
4060          this.getJurisdiction().add(castToCodeableConcept(value));
4061        } else if (name.equals("purpose")) {
4062          this.purpose = castToMarkdown(value); // MarkdownType
4063        } else if (name.equals("copyright")) {
4064          this.copyright = castToMarkdown(value); // MarkdownType
4065        } else if (name.equals("caseSensitive")) {
4066          this.caseSensitive = castToBoolean(value); // BooleanType
4067        } else if (name.equals("valueSet")) {
4068          this.valueSet = castToUri(value); // UriType
4069        } else if (name.equals("hierarchyMeaning")) {
4070          value = new CodeSystemHierarchyMeaningEnumFactory().fromType(castToCode(value));
4071          this.hierarchyMeaning = (Enumeration) value; // Enumeration<CodeSystemHierarchyMeaning>
4072        } else if (name.equals("compositional")) {
4073          this.compositional = castToBoolean(value); // BooleanType
4074        } else if (name.equals("versionNeeded")) {
4075          this.versionNeeded = castToBoolean(value); // BooleanType
4076        } else if (name.equals("content")) {
4077          value = new CodeSystemContentModeEnumFactory().fromType(castToCode(value));
4078          this.content = (Enumeration) value; // Enumeration<CodeSystemContentMode>
4079        } else if (name.equals("count")) {
4080          this.count = castToUnsignedInt(value); // UnsignedIntType
4081        } else if (name.equals("filter")) {
4082          this.getFilter().add((CodeSystemFilterComponent) value);
4083        } else if (name.equals("property")) {
4084          this.getProperty().add((PropertyComponent) value);
4085        } else if (name.equals("concept")) {
4086          this.getConcept().add((ConceptDefinitionComponent) value);
4087        } else
4088          return super.setProperty(name, value);
4089        return value;
4090      }
4091
4092      @Override
4093      public Base makeProperty(int hash, String name) throws FHIRException {
4094        switch (hash) {
4095        case 116079:  return getUrlElement();
4096        case -1618432855:  return getIdentifier(); 
4097        case 351608024:  return getVersionElement();
4098        case 3373707:  return getNameElement();
4099        case 110371416:  return getTitleElement();
4100        case -892481550:  return getStatusElement();
4101        case -404562712:  return getExperimentalElement();
4102        case 3076014:  return getDateElement();
4103        case 1447404028:  return getPublisherElement();
4104        case 951526432:  return addContact(); 
4105        case -1724546052:  return getDescriptionElement();
4106        case -669707736:  return addUseContext(); 
4107        case -507075711:  return addJurisdiction(); 
4108        case -220463842:  return getPurposeElement();
4109        case 1522889671:  return getCopyrightElement();
4110        case -35616442:  return getCaseSensitiveElement();
4111        case -1410174671:  return getValueSetElement();
4112        case 1913078280:  return getHierarchyMeaningElement();
4113        case 1248023381:  return getCompositionalElement();
4114        case 617270957:  return getVersionNeededElement();
4115        case 951530617:  return getContentElement();
4116        case 94851343:  return getCountElement();
4117        case -1274492040:  return addFilter(); 
4118        case -993141291:  return addProperty(); 
4119        case 951024232:  return addConcept(); 
4120        default: return super.makeProperty(hash, name);
4121        }
4122
4123      }
4124
4125      @Override
4126      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4127        switch (hash) {
4128        case 116079: /*url*/ return new String[] {"uri"};
4129        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
4130        case 351608024: /*version*/ return new String[] {"string"};
4131        case 3373707: /*name*/ return new String[] {"string"};
4132        case 110371416: /*title*/ return new String[] {"string"};
4133        case -892481550: /*status*/ return new String[] {"code"};
4134        case -404562712: /*experimental*/ return new String[] {"boolean"};
4135        case 3076014: /*date*/ return new String[] {"dateTime"};
4136        case 1447404028: /*publisher*/ return new String[] {"string"};
4137        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
4138        case -1724546052: /*description*/ return new String[] {"markdown"};
4139        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
4140        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
4141        case -220463842: /*purpose*/ return new String[] {"markdown"};
4142        case 1522889671: /*copyright*/ return new String[] {"markdown"};
4143        case -35616442: /*caseSensitive*/ return new String[] {"boolean"};
4144        case -1410174671: /*valueSet*/ return new String[] {"uri"};
4145        case 1913078280: /*hierarchyMeaning*/ return new String[] {"code"};
4146        case 1248023381: /*compositional*/ return new String[] {"boolean"};
4147        case 617270957: /*versionNeeded*/ return new String[] {"boolean"};
4148        case 951530617: /*content*/ return new String[] {"code"};
4149        case 94851343: /*count*/ return new String[] {"unsignedInt"};
4150        case -1274492040: /*filter*/ return new String[] {};
4151        case -993141291: /*property*/ return new String[] {};
4152        case 951024232: /*concept*/ return new String[] {};
4153        default: return super.getTypesForProperty(hash, name);
4154        }
4155
4156      }
4157
4158      @Override
4159      public Base addChild(String name) throws FHIRException {
4160        if (name.equals("url")) {
4161          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.url");
4162        }
4163        else if (name.equals("identifier")) {
4164          this.identifier = new Identifier();
4165          return this.identifier;
4166        }
4167        else if (name.equals("version")) {
4168          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.version");
4169        }
4170        else if (name.equals("name")) {
4171          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.name");
4172        }
4173        else if (name.equals("title")) {
4174          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.title");
4175        }
4176        else if (name.equals("status")) {
4177          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.status");
4178        }
4179        else if (name.equals("experimental")) {
4180          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.experimental");
4181        }
4182        else if (name.equals("date")) {
4183          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.date");
4184        }
4185        else if (name.equals("publisher")) {
4186          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.publisher");
4187        }
4188        else if (name.equals("contact")) {
4189          return addContact();
4190        }
4191        else if (name.equals("description")) {
4192          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description");
4193        }
4194        else if (name.equals("useContext")) {
4195          return addUseContext();
4196        }
4197        else if (name.equals("jurisdiction")) {
4198          return addJurisdiction();
4199        }
4200        else if (name.equals("purpose")) {
4201          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.purpose");
4202        }
4203        else if (name.equals("copyright")) {
4204          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.copyright");
4205        }
4206        else if (name.equals("caseSensitive")) {
4207          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.caseSensitive");
4208        }
4209        else if (name.equals("valueSet")) {
4210          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.valueSet");
4211        }
4212        else if (name.equals("hierarchyMeaning")) {
4213          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.hierarchyMeaning");
4214        }
4215        else if (name.equals("compositional")) {
4216          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.compositional");
4217        }
4218        else if (name.equals("versionNeeded")) {
4219          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.versionNeeded");
4220        }
4221        else if (name.equals("content")) {
4222          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.content");
4223        }
4224        else if (name.equals("count")) {
4225          throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.count");
4226        }
4227        else if (name.equals("filter")) {
4228          return addFilter();
4229        }
4230        else if (name.equals("property")) {
4231          return addProperty();
4232        }
4233        else if (name.equals("concept")) {
4234          return addConcept();
4235        }
4236        else
4237          return super.addChild(name);
4238      }
4239
4240  public String fhirType() {
4241    return "CodeSystem";
4242
4243  }
4244
4245      public CodeSystem copy() {
4246        CodeSystem dst = new CodeSystem();
4247        copyValues(dst);
4248        dst.url = url == null ? null : url.copy();
4249        dst.identifier = identifier == null ? null : identifier.copy();
4250        dst.version = version == null ? null : version.copy();
4251        dst.name = name == null ? null : name.copy();
4252        dst.title = title == null ? null : title.copy();
4253        dst.status = status == null ? null : status.copy();
4254        dst.experimental = experimental == null ? null : experimental.copy();
4255        dst.date = date == null ? null : date.copy();
4256        dst.publisher = publisher == null ? null : publisher.copy();
4257        if (contact != null) {
4258          dst.contact = new ArrayList<ContactDetail>();
4259          for (ContactDetail i : contact)
4260            dst.contact.add(i.copy());
4261        };
4262        dst.description = description == null ? null : description.copy();
4263        if (useContext != null) {
4264          dst.useContext = new ArrayList<UsageContext>();
4265          for (UsageContext i : useContext)
4266            dst.useContext.add(i.copy());
4267        };
4268        if (jurisdiction != null) {
4269          dst.jurisdiction = new ArrayList<CodeableConcept>();
4270          for (CodeableConcept i : jurisdiction)
4271            dst.jurisdiction.add(i.copy());
4272        };
4273        dst.purpose = purpose == null ? null : purpose.copy();
4274        dst.copyright = copyright == null ? null : copyright.copy();
4275        dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy();
4276        dst.valueSet = valueSet == null ? null : valueSet.copy();
4277        dst.hierarchyMeaning = hierarchyMeaning == null ? null : hierarchyMeaning.copy();
4278        dst.compositional = compositional == null ? null : compositional.copy();
4279        dst.versionNeeded = versionNeeded == null ? null : versionNeeded.copy();
4280        dst.content = content == null ? null : content.copy();
4281        dst.count = count == null ? null : count.copy();
4282        if (filter != null) {
4283          dst.filter = new ArrayList<CodeSystemFilterComponent>();
4284          for (CodeSystemFilterComponent i : filter)
4285            dst.filter.add(i.copy());
4286        };
4287        if (property != null) {
4288          dst.property = new ArrayList<PropertyComponent>();
4289          for (PropertyComponent i : property)
4290            dst.property.add(i.copy());
4291        };
4292        if (concept != null) {
4293          dst.concept = new ArrayList<ConceptDefinitionComponent>();
4294          for (ConceptDefinitionComponent i : concept)
4295            dst.concept.add(i.copy());
4296        };
4297        return dst;
4298      }
4299
4300      protected CodeSystem typedCopy() {
4301        return copy();
4302      }
4303
4304      @Override
4305      public boolean equalsDeep(Base other) {
4306        if (!super.equalsDeep(other))
4307          return false;
4308        if (!(other instanceof CodeSystem))
4309          return false;
4310        CodeSystem o = (CodeSystem) other;
4311        return compareDeep(identifier, o.identifier, true) && compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true)
4312           && compareDeep(caseSensitive, o.caseSensitive, true) && compareDeep(valueSet, o.valueSet, true)
4313           && compareDeep(hierarchyMeaning, o.hierarchyMeaning, true) && compareDeep(compositional, o.compositional, true)
4314           && compareDeep(versionNeeded, o.versionNeeded, true) && compareDeep(content, o.content, true) && compareDeep(count, o.count, true)
4315           && compareDeep(filter, o.filter, true) && compareDeep(property, o.property, true) && compareDeep(concept, o.concept, true)
4316          ;
4317      }
4318
4319      @Override
4320      public boolean equalsShallow(Base other) {
4321        if (!super.equalsShallow(other))
4322          return false;
4323        if (!(other instanceof CodeSystem))
4324          return false;
4325        CodeSystem o = (CodeSystem) other;
4326        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(caseSensitive, o.caseSensitive, true)
4327           && compareValues(valueSet, o.valueSet, true) && compareValues(hierarchyMeaning, o.hierarchyMeaning, true)
4328           && compareValues(compositional, o.compositional, true) && compareValues(versionNeeded, o.versionNeeded, true)
4329           && compareValues(content, o.content, true) && compareValues(count, o.count, true);
4330      }
4331
4332      public boolean isEmpty() {
4333        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, purpose, copyright
4334          , caseSensitive, valueSet, hierarchyMeaning, compositional, versionNeeded, content
4335          , count, filter, property, concept);
4336      }
4337
4338  @Override
4339  public ResourceType getResourceType() {
4340    return ResourceType.CodeSystem;
4341   }
4342
4343 /**
4344   * Search parameter: <b>date</b>
4345   * <p>
4346   * Description: <b>The code system publication date</b><br>
4347   * Type: <b>date</b><br>
4348   * Path: <b>CodeSystem.date</b><br>
4349   * </p>
4350   */
4351  @SearchParamDefinition(name="date", path="CodeSystem.date", description="The code system publication date", type="date" )
4352  public static final String SP_DATE = "date";
4353 /**
4354   * <b>Fluent Client</b> search parameter constant for <b>date</b>
4355   * <p>
4356   * Description: <b>The code system publication date</b><br>
4357   * Type: <b>date</b><br>
4358   * Path: <b>CodeSystem.date</b><br>
4359   * </p>
4360   */
4361  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
4362
4363 /**
4364   * Search parameter: <b>identifier</b>
4365   * <p>
4366   * Description: <b>External identifier for the code system</b><br>
4367   * Type: <b>token</b><br>
4368   * Path: <b>CodeSystem.identifier</b><br>
4369   * </p>
4370   */
4371  @SearchParamDefinition(name="identifier", path="CodeSystem.identifier", description="External identifier for the code system", type="token" )
4372  public static final String SP_IDENTIFIER = "identifier";
4373 /**
4374   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4375   * <p>
4376   * Description: <b>External identifier for the code system</b><br>
4377   * Type: <b>token</b><br>
4378   * Path: <b>CodeSystem.identifier</b><br>
4379   * </p>
4380   */
4381  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4382
4383 /**
4384   * Search parameter: <b>code</b>
4385   * <p>
4386   * Description: <b>A code defined in the code system</b><br>
4387   * Type: <b>token</b><br>
4388   * Path: <b>CodeSystem.concept.code</b><br>
4389   * </p>
4390   */
4391  @SearchParamDefinition(name="code", path="CodeSystem.concept.code", description="A code defined in the code system", type="token" )
4392  public static final String SP_CODE = "code";
4393 /**
4394   * <b>Fluent Client</b> search parameter constant for <b>code</b>
4395   * <p>
4396   * Description: <b>A code defined in the code system</b><br>
4397   * Type: <b>token</b><br>
4398   * Path: <b>CodeSystem.concept.code</b><br>
4399   * </p>
4400   */
4401  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
4402
4403 /**
4404   * Search parameter: <b>content-mode</b>
4405   * <p>
4406   * Description: <b>not-present | example | fragment | complete</b><br>
4407   * Type: <b>token</b><br>
4408   * Path: <b>CodeSystem.content</b><br>
4409   * </p>
4410   */
4411  @SearchParamDefinition(name="content-mode", path="CodeSystem.content", description="not-present | example | fragment | complete", type="token" )
4412  public static final String SP_CONTENT_MODE = "content-mode";
4413 /**
4414   * <b>Fluent Client</b> search parameter constant for <b>content-mode</b>
4415   * <p>
4416   * Description: <b>not-present | example | fragment | complete</b><br>
4417   * Type: <b>token</b><br>
4418   * Path: <b>CodeSystem.content</b><br>
4419   * </p>
4420   */
4421  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTENT_MODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTENT_MODE);
4422
4423 /**
4424   * Search parameter: <b>jurisdiction</b>
4425   * <p>
4426   * Description: <b>Intended jurisdiction for the code system</b><br>
4427   * Type: <b>token</b><br>
4428   * Path: <b>CodeSystem.jurisdiction</b><br>
4429   * </p>
4430   */
4431  @SearchParamDefinition(name="jurisdiction", path="CodeSystem.jurisdiction", description="Intended jurisdiction for the code system", type="token" )
4432  public static final String SP_JURISDICTION = "jurisdiction";
4433 /**
4434   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
4435   * <p>
4436   * Description: <b>Intended jurisdiction for the code system</b><br>
4437   * Type: <b>token</b><br>
4438   * Path: <b>CodeSystem.jurisdiction</b><br>
4439   * </p>
4440   */
4441  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
4442
4443 /**
4444   * Search parameter: <b>description</b>
4445   * <p>
4446   * Description: <b>The description of the code system</b><br>
4447   * Type: <b>string</b><br>
4448   * Path: <b>CodeSystem.description</b><br>
4449   * </p>
4450   */
4451  @SearchParamDefinition(name="description", path="CodeSystem.description", description="The description of the code system", type="string" )
4452  public static final String SP_DESCRIPTION = "description";
4453 /**
4454   * <b>Fluent Client</b> search parameter constant for <b>description</b>
4455   * <p>
4456   * Description: <b>The description of the code system</b><br>
4457   * Type: <b>string</b><br>
4458   * Path: <b>CodeSystem.description</b><br>
4459   * </p>
4460   */
4461  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
4462
4463 /**
4464   * Search parameter: <b>language</b>
4465   * <p>
4466   * Description: <b>A language in which a designation is provided</b><br>
4467   * Type: <b>token</b><br>
4468   * Path: <b>CodeSystem.concept.designation.language</b><br>
4469   * </p>
4470   */
4471  @SearchParamDefinition(name="language", path="CodeSystem.concept.designation.language", description="A language in which a designation is provided", type="token" )
4472  public static final String SP_LANGUAGE = "language";
4473 /**
4474   * <b>Fluent Client</b> search parameter constant for <b>language</b>
4475   * <p>
4476   * Description: <b>A language in which a designation is provided</b><br>
4477   * Type: <b>token</b><br>
4478   * Path: <b>CodeSystem.concept.designation.language</b><br>
4479   * </p>
4480   */
4481  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE);
4482
4483 /**
4484   * Search parameter: <b>title</b>
4485   * <p>
4486   * Description: <b>The human-friendly name of the code system</b><br>
4487   * Type: <b>string</b><br>
4488   * Path: <b>CodeSystem.title</b><br>
4489   * </p>
4490   */
4491  @SearchParamDefinition(name="title", path="CodeSystem.title", description="The human-friendly name of the code system", type="string" )
4492  public static final String SP_TITLE = "title";
4493 /**
4494   * <b>Fluent Client</b> search parameter constant for <b>title</b>
4495   * <p>
4496   * Description: <b>The human-friendly name of the code system</b><br>
4497   * Type: <b>string</b><br>
4498   * Path: <b>CodeSystem.title</b><br>
4499   * </p>
4500   */
4501  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
4502
4503 /**
4504   * Search parameter: <b>version</b>
4505   * <p>
4506   * Description: <b>The business version of the code system</b><br>
4507   * Type: <b>token</b><br>
4508   * Path: <b>CodeSystem.version</b><br>
4509   * </p>
4510   */
4511  @SearchParamDefinition(name="version", path="CodeSystem.version", description="The business version of the code system", type="token" )
4512  public static final String SP_VERSION = "version";
4513 /**
4514   * <b>Fluent Client</b> search parameter constant for <b>version</b>
4515   * <p>
4516   * Description: <b>The business version of the code system</b><br>
4517   * Type: <b>token</b><br>
4518   * Path: <b>CodeSystem.version</b><br>
4519   * </p>
4520   */
4521  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
4522
4523 /**
4524   * Search parameter: <b>url</b>
4525   * <p>
4526   * Description: <b>The uri that identifies the code system</b><br>
4527   * Type: <b>uri</b><br>
4528   * Path: <b>CodeSystem.url</b><br>
4529   * </p>
4530   */
4531  @SearchParamDefinition(name="url", path="CodeSystem.url", description="The uri that identifies the code system", type="uri" )
4532  public static final String SP_URL = "url";
4533 /**
4534   * <b>Fluent Client</b> search parameter constant for <b>url</b>
4535   * <p>
4536   * Description: <b>The uri that identifies the code system</b><br>
4537   * Type: <b>uri</b><br>
4538   * Path: <b>CodeSystem.url</b><br>
4539   * </p>
4540   */
4541  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
4542
4543 /**
4544   * Search parameter: <b>system</b>
4545   * <p>
4546   * Description: <b>The system for any codes defined by this code system (same as 'url')</b><br>
4547   * Type: <b>uri</b><br>
4548   * Path: <b>CodeSystem.url</b><br>
4549   * </p>
4550   */
4551  @SearchParamDefinition(name="system", path="CodeSystem.url", description="The system for any codes defined by this code system (same as 'url')", type="uri" )
4552  public static final String SP_SYSTEM = "system";
4553 /**
4554   * <b>Fluent Client</b> search parameter constant for <b>system</b>
4555   * <p>
4556   * Description: <b>The system for any codes defined by this code system (same as 'url')</b><br>
4557   * Type: <b>uri</b><br>
4558   * Path: <b>CodeSystem.url</b><br>
4559   * </p>
4560   */
4561  public static final ca.uhn.fhir.rest.gclient.UriClientParam SYSTEM = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SYSTEM);
4562
4563 /**
4564   * Search parameter: <b>name</b>
4565   * <p>
4566   * Description: <b>Computationally friendly name of the code system</b><br>
4567   * Type: <b>string</b><br>
4568   * Path: <b>CodeSystem.name</b><br>
4569   * </p>
4570   */
4571  @SearchParamDefinition(name="name", path="CodeSystem.name", description="Computationally friendly name of the code system", type="string" )
4572  public static final String SP_NAME = "name";
4573 /**
4574   * <b>Fluent Client</b> search parameter constant for <b>name</b>
4575   * <p>
4576   * Description: <b>Computationally friendly name of the code system</b><br>
4577   * Type: <b>string</b><br>
4578   * Path: <b>CodeSystem.name</b><br>
4579   * </p>
4580   */
4581  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
4582
4583 /**
4584   * Search parameter: <b>publisher</b>
4585   * <p>
4586   * Description: <b>Name of the publisher of the code system</b><br>
4587   * Type: <b>string</b><br>
4588   * Path: <b>CodeSystem.publisher</b><br>
4589   * </p>
4590   */
4591  @SearchParamDefinition(name="publisher", path="CodeSystem.publisher", description="Name of the publisher of the code system", type="string" )
4592  public static final String SP_PUBLISHER = "publisher";
4593 /**
4594   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
4595   * <p>
4596   * Description: <b>Name of the publisher of the code system</b><br>
4597   * Type: <b>string</b><br>
4598   * Path: <b>CodeSystem.publisher</b><br>
4599   * </p>
4600   */
4601  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
4602
4603 /**
4604   * Search parameter: <b>status</b>
4605   * <p>
4606   * Description: <b>The current status of the code system</b><br>
4607   * Type: <b>token</b><br>
4608   * Path: <b>CodeSystem.status</b><br>
4609   * </p>
4610   */
4611  @SearchParamDefinition(name="status", path="CodeSystem.status", description="The current status of the code system", type="token" )
4612  public static final String SP_STATUS = "status";
4613 /**
4614   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4615   * <p>
4616   * Description: <b>The current status of the code system</b><br>
4617   * Type: <b>token</b><br>
4618   * Path: <b>CodeSystem.status</b><br>
4619   * </p>
4620   */
4621  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4622
4623
4624}
4625