001package org.hl7.fhir.r4.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 Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Collections;
035import java.util.Comparator;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.r4.model.Enumerations.PublicationStatus;
042import org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.ResourceDef;
050import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
051
052/**
053 * The CodeSystem resource is used to declare the existence of and describe a
054 * code system or code system supplement and its key properties, and optionally
055 * define a part or all of its content.
056 */
057@ResourceDef(name = "CodeSystem", profile = "http://hl7.org/fhir/StructureDefinition/CodeSystem")
058@ChildOrder(names = { "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher",
059    "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "caseSensitive", "valueSet",
060    "hierarchyMeaning", "compositional", "versionNeeded", "content", "supplements", "count", "filter", "property",
061    "concept" })
062public class CodeSystem extends MetadataResource {
063
064  public enum CodeSystemHierarchyMeaning {
065    /**
066     * No particular relationship between the concepts can be assumed, except what
067     * can be determined by inspection of the definitions of the elements (possible
068     * reasons to use this: importing from a source where this is not defined, or
069     * where various parts of the hierarchy have different meanings).
070     */
071    GROUPEDBY,
072    /**
073     * A hierarchy where the child concepts have an IS-A relationship with the
074     * parents - that is, all the properties of the parent are also true for its
075     * child concepts. Not that is-a is a property of the concepts, so additional
076     * subsumption relationships may be defined using properties or the
077     * [subsumes](extension-codesystem-subsumes.html) extension.
078     */
079    ISA,
080    /**
081     * Child elements list the individual parts of a composite whole (e.g. body
082     * site).
083     */
084    PARTOF,
085    /**
086     * Child concepts in the hierarchy may have only one parent, and there is a
087     * presumption that the code system is a "closed world" meaning all things must
088     * be in the hierarchy. This results in concepts such as "not otherwise
089     * classified.".
090     */
091    CLASSIFIEDWITH,
092    /**
093     * added to help the parsers with the generic types
094     */
095    NULL;
096
097    public static CodeSystemHierarchyMeaning fromCode(String codeString) throws FHIRException {
098      if (codeString == null || "".equals(codeString))
099        return null;
100      if ("grouped-by".equals(codeString))
101        return GROUPEDBY;
102      if ("is-a".equals(codeString))
103        return ISA;
104      if ("part-of".equals(codeString))
105        return PARTOF;
106      if ("classified-with".equals(codeString))
107        return CLASSIFIEDWITH;
108      if (Configuration.isAcceptInvalidEnums())
109        return null;
110      else
111        throw new FHIRException("Unknown CodeSystemHierarchyMeaning code '" + codeString + "'");
112    }
113
114    public String toCode() {
115      switch (this) {
116      case GROUPEDBY:
117        return "grouped-by";
118      case ISA:
119        return "is-a";
120      case PARTOF:
121        return "part-of";
122      case CLASSIFIEDWITH:
123        return "classified-with";
124      case NULL:
125        return null;
126      default:
127        return "?";
128      }
129    }
130
131    public String getSystem() {
132      switch (this) {
133      case GROUPEDBY:
134        return "http://hl7.org/fhir/codesystem-hierarchy-meaning";
135      case ISA:
136        return "http://hl7.org/fhir/codesystem-hierarchy-meaning";
137      case PARTOF:
138        return "http://hl7.org/fhir/codesystem-hierarchy-meaning";
139      case CLASSIFIEDWITH:
140        return "http://hl7.org/fhir/codesystem-hierarchy-meaning";
141      case NULL:
142        return null;
143      default:
144        return "?";
145      }
146    }
147
148    public String getDefinition() {
149      switch (this) {
150      case GROUPEDBY:
151        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).";
152      case ISA:
153        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. Not that is-a is a property of the concepts, so additional subsumption relationships may be defined using properties or the [subsumes](extension-codesystem-subsumes.html) extension.";
154      case PARTOF:
155        return "Child elements list the individual parts of a composite whole (e.g. body site).";
156      case CLASSIFIEDWITH:
157        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.\".";
158      case NULL:
159        return null;
160      default:
161        return "?";
162      }
163    }
164
165    public String getDisplay() {
166      switch (this) {
167      case GROUPEDBY:
168        return "Grouped By";
169      case ISA:
170        return "Is-A";
171      case PARTOF:
172        return "Part Of";
173      case CLASSIFIEDWITH:
174        return "Classified With";
175      case NULL:
176        return null;
177      default:
178        return "?";
179      }
180    }
181  }
182
183  public static class CodeSystemHierarchyMeaningEnumFactory implements EnumFactory<CodeSystemHierarchyMeaning> {
184    public CodeSystemHierarchyMeaning fromCode(String codeString) throws IllegalArgumentException {
185      if (codeString == null || "".equals(codeString))
186        if (codeString == null || "".equals(codeString))
187          return null;
188      if ("grouped-by".equals(codeString))
189        return CodeSystemHierarchyMeaning.GROUPEDBY;
190      if ("is-a".equals(codeString))
191        return CodeSystemHierarchyMeaning.ISA;
192      if ("part-of".equals(codeString))
193        return CodeSystemHierarchyMeaning.PARTOF;
194      if ("classified-with".equals(codeString))
195        return CodeSystemHierarchyMeaning.CLASSIFIEDWITH;
196      throw new IllegalArgumentException("Unknown CodeSystemHierarchyMeaning code '" + codeString + "'");
197    }
198
199    public Enumeration<CodeSystemHierarchyMeaning> fromType(PrimitiveType<?> code) throws FHIRException {
200      if (code == null)
201        return null;
202      if (code.isEmpty())
203        return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.NULL, code);
204      String codeString = code.asStringValue();
205      if (codeString == null || "".equals(codeString))
206        return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.NULL, code);
207      if ("grouped-by".equals(codeString))
208        return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.GROUPEDBY, code);
209      if ("is-a".equals(codeString))
210        return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.ISA, code);
211      if ("part-of".equals(codeString))
212        return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.PARTOF, code);
213      if ("classified-with".equals(codeString))
214        return new Enumeration<CodeSystemHierarchyMeaning>(this, CodeSystemHierarchyMeaning.CLASSIFIEDWITH, code);
215      throw new FHIRException("Unknown CodeSystemHierarchyMeaning code '" + codeString + "'");
216    }
217
218    public String toCode(CodeSystemHierarchyMeaning code) {
219      if (code == CodeSystemHierarchyMeaning.GROUPEDBY)
220        return "grouped-by";
221      if (code == CodeSystemHierarchyMeaning.ISA)
222        return "is-a";
223      if (code == CodeSystemHierarchyMeaning.PARTOF)
224        return "part-of";
225      if (code == CodeSystemHierarchyMeaning.CLASSIFIEDWITH)
226        return "classified-with";
227      return "?";
228    }
229
230    public String toSystem(CodeSystemHierarchyMeaning code) {
231      return code.getSystem();
232    }
233  }
234
235  public enum CodeSystemContentMode {
236    /**
237     * None of the concepts defined by the code system are included in the code
238     * system resource.
239     */
240    NOTPRESENT,
241    /**
242     * A few representative concepts are included in the code system resource. There
243     * is no useful intent in the subset choice and there's no process to make it
244     * workable: it's not intended to be workable.
245     */
246    EXAMPLE,
247    /**
248     * A subset of the code system concepts are included in the code system
249     * resource. This is a curated subset released for a specific purpose under the
250     * governance of the code system steward, and that the intent, bounds and
251     * consequences of the fragmentation are clearly defined in the fragment or the
252     * code system documentation. Fragments are also known as partitions.
253     */
254    FRAGMENT,
255    /**
256     * All the concepts defined by the code system are included in the code system
257     * resource.
258     */
259    COMPLETE,
260    /**
261     * The resource doesn't define any new concepts; it just provides additional
262     * designations and properties to another code system.
263     */
264    SUPPLEMENT,
265    /**
266     * added to help the parsers with the generic types
267     */
268    NULL;
269
270    public static CodeSystemContentMode fromCode(String codeString) throws FHIRException {
271      if (codeString == null || "".equals(codeString))
272        return null;
273      if ("not-present".equals(codeString))
274        return NOTPRESENT;
275      if ("example".equals(codeString))
276        return EXAMPLE;
277      if ("fragment".equals(codeString))
278        return FRAGMENT;
279      if ("complete".equals(codeString))
280        return COMPLETE;
281      if ("supplement".equals(codeString))
282        return SUPPLEMENT;
283      if (Configuration.isAcceptInvalidEnums())
284        return null;
285      else
286        throw new FHIRException("Unknown CodeSystemContentMode code '" + codeString + "'");
287    }
288
289    public String toCode() {
290      switch (this) {
291      case NOTPRESENT:
292        return "not-present";
293      case EXAMPLE:
294        return "example";
295      case FRAGMENT:
296        return "fragment";
297      case COMPLETE:
298        return "complete";
299      case SUPPLEMENT:
300        return "supplement";
301      case NULL:
302        return null;
303      default:
304        return "?";
305      }
306    }
307
308    public String getSystem() {
309      switch (this) {
310      case NOTPRESENT:
311        return "http://hl7.org/fhir/codesystem-content-mode";
312      case EXAMPLE:
313        return "http://hl7.org/fhir/codesystem-content-mode";
314      case FRAGMENT:
315        return "http://hl7.org/fhir/codesystem-content-mode";
316      case COMPLETE:
317        return "http://hl7.org/fhir/codesystem-content-mode";
318      case SUPPLEMENT:
319        return "http://hl7.org/fhir/codesystem-content-mode";
320      case NULL:
321        return null;
322      default:
323        return "?";
324      }
325    }
326
327    public String getDefinition() {
328      switch (this) {
329      case NOTPRESENT:
330        return "None of the concepts defined by the code system are included in the code system resource.";
331      case EXAMPLE:
332        return "A few representative concepts are included in the code system resource. There is no useful intent in the subset choice and there's no process to make it workable: it's not intended to be workable.";
333      case FRAGMENT:
334        return "A subset of the code system concepts are included in the code system resource. This is a curated subset released for a specific purpose under the governance of the code system steward, and that the intent, bounds and consequences of the fragmentation are clearly defined in the fragment or the code system documentation. Fragments are also known as partitions.";
335      case COMPLETE:
336        return "All the concepts defined by the code system are included in the code system resource.";
337      case SUPPLEMENT:
338        return "The resource doesn't define any new concepts; it just provides additional designations and properties to another code system.";
339      case NULL:
340        return null;
341      default:
342        return "?";
343      }
344    }
345
346    public String getDisplay() {
347      switch (this) {
348      case NOTPRESENT:
349        return "Not Present";
350      case EXAMPLE:
351        return "Example";
352      case FRAGMENT:
353        return "Fragment";
354      case COMPLETE:
355        return "Complete";
356      case SUPPLEMENT:
357        return "Supplement";
358      case NULL:
359        return null;
360      default:
361        return "?";
362      }
363    }
364  }
365
366  public static class CodeSystemContentModeEnumFactory implements EnumFactory<CodeSystemContentMode> {
367    public CodeSystemContentMode fromCode(String codeString) throws IllegalArgumentException {
368      if (codeString == null || "".equals(codeString))
369        if (codeString == null || "".equals(codeString))
370          return null;
371      if ("not-present".equals(codeString))
372        return CodeSystemContentMode.NOTPRESENT;
373      if ("example".equals(codeString))
374        return CodeSystemContentMode.EXAMPLE;
375      if ("fragment".equals(codeString))
376        return CodeSystemContentMode.FRAGMENT;
377      if ("complete".equals(codeString))
378        return CodeSystemContentMode.COMPLETE;
379      if ("supplement".equals(codeString))
380        return CodeSystemContentMode.SUPPLEMENT;
381      throw new IllegalArgumentException("Unknown CodeSystemContentMode code '" + codeString + "'");
382    }
383
384    public Enumeration<CodeSystemContentMode> fromType(PrimitiveType<?> code) throws FHIRException {
385      if (code == null)
386        return null;
387      if (code.isEmpty())
388        return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.NULL, code);
389      String codeString = code.asStringValue();
390      if (codeString == null || "".equals(codeString))
391        return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.NULL, code);
392      if ("not-present".equals(codeString))
393        return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.NOTPRESENT, code);
394      if ("example".equals(codeString))
395        return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.EXAMPLE, code);
396      if ("fragment".equals(codeString))
397        return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.FRAGMENT, code);
398      if ("complete".equals(codeString))
399        return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.COMPLETE, code);
400      if ("supplement".equals(codeString))
401        return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.SUPPLEMENT, code);
402      throw new FHIRException("Unknown CodeSystemContentMode code '" + codeString + "'");
403    }
404
405    public String toCode(CodeSystemContentMode code) {
406      if (code == CodeSystemContentMode.NOTPRESENT)
407        return "not-present";
408      if (code == CodeSystemContentMode.EXAMPLE)
409        return "example";
410      if (code == CodeSystemContentMode.FRAGMENT)
411        return "fragment";
412      if (code == CodeSystemContentMode.COMPLETE)
413        return "complete";
414      if (code == CodeSystemContentMode.SUPPLEMENT)
415        return "supplement";
416      return "?";
417    }
418
419    public String toSystem(CodeSystemContentMode code) {
420      return code.getSystem();
421    }
422  }
423
424  public enum FilterOperator {
425    /**
426     * The specified property of the code equals the provided value.
427     */
428    EQUAL,
429    /**
430     * Includes all concept ids that have a transitive is-a relationship with the
431     * concept Id provided as the value, including the provided concept itself
432     * (include descendant codes and self).
433     */
434    ISA,
435    /**
436     * Includes all concept ids that have a transitive is-a relationship with the
437     * concept Id provided as the value, excluding the provided concept itself i.e.
438     * include descendant codes only).
439     */
440    DESCENDENTOF,
441    /**
442     * The specified property of the code does not have an is-a relationship with
443     * the provided value.
444     */
445    ISNOTA,
446    /**
447     * The specified property of the code matches the regex specified in the
448     * provided value.
449     */
450    REGEX,
451    /**
452     * The specified property of the code is in the set of codes or concepts
453     * specified in the provided value (comma separated list).
454     */
455    IN,
456    /**
457     * The specified property of the code is not in the set of codes or concepts
458     * specified in the provided value (comma separated list).
459     */
460    NOTIN,
461    /**
462     * Includes all concept ids that have a transitive is-a relationship from the
463     * concept Id provided as the value, including the provided concept itself (i.e.
464     * include ancestor codes and self).
465     */
466    GENERALIZES,
467    /**
468     * The specified property of the code has at least one value (if the specified
469     * value is true; if the specified value is false, then matches when the
470     * specified property of the code has no values).
471     */
472    EXISTS,
473    /**
474     * added to help the parsers with the generic types
475     */
476    NULL;
477
478    public static FilterOperator fromCode(String codeString) throws FHIRException {
479      if (codeString == null || "".equals(codeString))
480        return null;
481      if ("=".equals(codeString))
482        return EQUAL;
483      if ("is-a".equals(codeString))
484        return ISA;
485      if ("descendent-of".equals(codeString))
486        return DESCENDENTOF;
487      if ("is-not-a".equals(codeString))
488        return ISNOTA;
489      if ("regex".equals(codeString))
490        return REGEX;
491      if ("in".equals(codeString))
492        return IN;
493      if ("not-in".equals(codeString))
494        return NOTIN;
495      if ("generalizes".equals(codeString))
496        return GENERALIZES;
497      if ("exists".equals(codeString))
498        return EXISTS;
499      if (Configuration.isAcceptInvalidEnums())
500        return null;
501      else
502        throw new FHIRException("Unknown FilterOperator code '" + codeString + "'");
503    }
504
505    public String toCode() {
506      switch (this) {
507      case EQUAL:
508        return "=";
509      case ISA:
510        return "is-a";
511      case DESCENDENTOF:
512        return "descendent-of";
513      case ISNOTA:
514        return "is-not-a";
515      case REGEX:
516        return "regex";
517      case IN:
518        return "in";
519      case NOTIN:
520        return "not-in";
521      case GENERALIZES:
522        return "generalizes";
523      case EXISTS:
524        return "exists";
525      case NULL:
526        return null;
527      default:
528        return "?";
529      }
530    }
531
532    public String getSystem() {
533      switch (this) {
534      case EQUAL:
535        return "http://hl7.org/fhir/filter-operator";
536      case ISA:
537        return "http://hl7.org/fhir/filter-operator";
538      case DESCENDENTOF:
539        return "http://hl7.org/fhir/filter-operator";
540      case ISNOTA:
541        return "http://hl7.org/fhir/filter-operator";
542      case REGEX:
543        return "http://hl7.org/fhir/filter-operator";
544      case IN:
545        return "http://hl7.org/fhir/filter-operator";
546      case NOTIN:
547        return "http://hl7.org/fhir/filter-operator";
548      case GENERALIZES:
549        return "http://hl7.org/fhir/filter-operator";
550      case EXISTS:
551        return "http://hl7.org/fhir/filter-operator";
552      case NULL:
553        return null;
554      default:
555        return "?";
556      }
557    }
558
559    public String getDefinition() {
560      switch (this) {
561      case EQUAL:
562        return "The specified property of the code equals the provided value.";
563      case ISA:
564        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 (include descendant codes and self).";
565      case DESCENDENTOF:
566        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 descendant codes only).";
567      case ISNOTA:
568        return "The specified property of the code does not have an is-a relationship with the provided value.";
569      case REGEX:
570        return "The specified property of the code  matches the regex specified in the provided value.";
571      case IN:
572        return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).";
573      case NOTIN:
574        return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).";
575      case GENERALIZES:
576        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 (i.e. include ancestor codes and self).";
577      case EXISTS:
578        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).";
579      case NULL:
580        return null;
581      default:
582        return "?";
583      }
584    }
585
586    public String getDisplay() {
587      switch (this) {
588      case EQUAL:
589        return "Equals";
590      case ISA:
591        return "Is A (by subsumption)";
592      case DESCENDENTOF:
593        return "Descendent Of (by subsumption)";
594      case ISNOTA:
595        return "Not (Is A) (by subsumption)";
596      case REGEX:
597        return "Regular Expression";
598      case IN:
599        return "In Set";
600      case NOTIN:
601        return "Not in Set";
602      case GENERALIZES:
603        return "Generalizes (by Subsumption)";
604      case EXISTS:
605        return "Exists";
606      case NULL:
607        return null;
608      default:
609        return "?";
610      }
611    }
612  }
613
614  public static class FilterOperatorEnumFactory implements EnumFactory<FilterOperator> {
615    public FilterOperator fromCode(String codeString) throws IllegalArgumentException {
616      if (codeString == null || "".equals(codeString))
617        if (codeString == null || "".equals(codeString))
618          return null;
619      if ("=".equals(codeString))
620        return FilterOperator.EQUAL;
621      if ("is-a".equals(codeString))
622        return FilterOperator.ISA;
623      if ("descendent-of".equals(codeString))
624        return FilterOperator.DESCENDENTOF;
625      if ("is-not-a".equals(codeString))
626        return FilterOperator.ISNOTA;
627      if ("regex".equals(codeString))
628        return FilterOperator.REGEX;
629      if ("in".equals(codeString))
630        return FilterOperator.IN;
631      if ("not-in".equals(codeString))
632        return FilterOperator.NOTIN;
633      if ("generalizes".equals(codeString))
634        return FilterOperator.GENERALIZES;
635      if ("exists".equals(codeString))
636        return FilterOperator.EXISTS;
637      throw new IllegalArgumentException("Unknown FilterOperator code '" + codeString + "'");
638    }
639
640    public Enumeration<FilterOperator> fromType(PrimitiveType<?> code) throws FHIRException {
641      if (code == null)
642        return null;
643      if (code.isEmpty())
644        return new Enumeration<FilterOperator>(this, FilterOperator.NULL, code);
645      String codeString = code.asStringValue();
646      if (codeString == null || "".equals(codeString))
647        return new Enumeration<FilterOperator>(this, FilterOperator.NULL, code);
648      if ("=".equals(codeString))
649        return new Enumeration<FilterOperator>(this, FilterOperator.EQUAL, code);
650      if ("is-a".equals(codeString))
651        return new Enumeration<FilterOperator>(this, FilterOperator.ISA, code);
652      if ("descendent-of".equals(codeString))
653        return new Enumeration<FilterOperator>(this, FilterOperator.DESCENDENTOF, code);
654      if ("is-not-a".equals(codeString))
655        return new Enumeration<FilterOperator>(this, FilterOperator.ISNOTA, code);
656      if ("regex".equals(codeString))
657        return new Enumeration<FilterOperator>(this, FilterOperator.REGEX, code);
658      if ("in".equals(codeString))
659        return new Enumeration<FilterOperator>(this, FilterOperator.IN, code);
660      if ("not-in".equals(codeString))
661        return new Enumeration<FilterOperator>(this, FilterOperator.NOTIN, code);
662      if ("generalizes".equals(codeString))
663        return new Enumeration<FilterOperator>(this, FilterOperator.GENERALIZES, code);
664      if ("exists".equals(codeString))
665        return new Enumeration<FilterOperator>(this, FilterOperator.EXISTS, code);
666      throw new FHIRException("Unknown FilterOperator code '" + codeString + "'");
667    }
668
669    public String toCode(FilterOperator code) {
670      if (code == FilterOperator.EQUAL)
671        return "=";
672      if (code == FilterOperator.ISA)
673        return "is-a";
674      if (code == FilterOperator.DESCENDENTOF)
675        return "descendent-of";
676      if (code == FilterOperator.ISNOTA)
677        return "is-not-a";
678      if (code == FilterOperator.REGEX)
679        return "regex";
680      if (code == FilterOperator.IN)
681        return "in";
682      if (code == FilterOperator.NOTIN)
683        return "not-in";
684      if (code == FilterOperator.GENERALIZES)
685        return "generalizes";
686      if (code == FilterOperator.EXISTS)
687        return "exists";
688      return "?";
689    }
690
691    public String toSystem(FilterOperator code) {
692      return code.getSystem();
693    }
694  }
695
696  public enum PropertyType {
697    /**
698     * The property value is a code that identifies a concept defined in the code
699     * system.
700     */
701    CODE,
702    /**
703     * The property value is a code defined in an external code system. This may be
704     * used for translations, but is not the intent.
705     */
706    CODING,
707    /**
708     * The property value is a string.
709     */
710    STRING,
711    /**
712     * The property value is a string (often used to assign ranking values to
713     * concepts for supporting score assessments).
714     */
715    INTEGER,
716    /**
717     * The property value is a boolean true | false.
718     */
719    BOOLEAN,
720    /**
721     * The property is a date or a date + time.
722     */
723    DATETIME,
724    /**
725     * The property value is a decimal number.
726     */
727    DECIMAL,
728    /**
729     * added to help the parsers with the generic types
730     */
731    NULL;
732
733    public static PropertyType fromCode(String codeString) throws FHIRException {
734      if (codeString == null || "".equals(codeString))
735        return null;
736      if ("code".equals(codeString))
737        return CODE;
738      if ("Coding".equals(codeString))
739        return CODING;
740      if ("string".equals(codeString))
741        return STRING;
742      if ("integer".equals(codeString))
743        return INTEGER;
744      if ("boolean".equals(codeString))
745        return BOOLEAN;
746      if ("dateTime".equals(codeString))
747        return DATETIME;
748      if ("decimal".equals(codeString))
749        return DECIMAL;
750      if (Configuration.isAcceptInvalidEnums())
751        return null;
752      else
753        throw new FHIRException("Unknown PropertyType code '" + codeString + "'");
754    }
755
756    public String toCode() {
757      switch (this) {
758      case CODE:
759        return "code";
760      case CODING:
761        return "Coding";
762      case STRING:
763        return "string";
764      case INTEGER:
765        return "integer";
766      case BOOLEAN:
767        return "boolean";
768      case DATETIME:
769        return "dateTime";
770      case DECIMAL:
771        return "decimal";
772      case NULL:
773        return null;
774      default:
775        return "?";
776      }
777    }
778
779    public String getSystem() {
780      switch (this) {
781      case CODE:
782        return "http://hl7.org/fhir/concept-property-type";
783      case CODING:
784        return "http://hl7.org/fhir/concept-property-type";
785      case STRING:
786        return "http://hl7.org/fhir/concept-property-type";
787      case INTEGER:
788        return "http://hl7.org/fhir/concept-property-type";
789      case BOOLEAN:
790        return "http://hl7.org/fhir/concept-property-type";
791      case DATETIME:
792        return "http://hl7.org/fhir/concept-property-type";
793      case DECIMAL:
794        return "http://hl7.org/fhir/concept-property-type";
795      case NULL:
796        return null;
797      default:
798        return "?";
799      }
800    }
801
802    public String getDefinition() {
803      switch (this) {
804      case CODE:
805        return "The property value is a code that identifies a concept defined in the code system.";
806      case CODING:
807        return "The property  value is a code defined in an external code system. This may be used for translations, but is not the intent.";
808      case STRING:
809        return "The property value is a string.";
810      case INTEGER:
811        return "The property value is a string (often used to assign ranking values to concepts for supporting score assessments).";
812      case BOOLEAN:
813        return "The property value is a boolean true | false.";
814      case DATETIME:
815        return "The property is a date or a date + time.";
816      case DECIMAL:
817        return "The property value is a decimal number.";
818      case NULL:
819        return null;
820      default:
821        return "?";
822      }
823    }
824
825    public String getDisplay() {
826      switch (this) {
827      case CODE:
828        return "code (internal reference)";
829      case CODING:
830        return "Coding (external reference)";
831      case STRING:
832        return "string";
833      case INTEGER:
834        return "integer";
835      case BOOLEAN:
836        return "boolean";
837      case DATETIME:
838        return "dateTime";
839      case DECIMAL:
840        return "decimal";
841      case NULL:
842        return null;
843      default:
844        return "?";
845      }
846    }
847  }
848
849  public static class PropertyTypeEnumFactory implements EnumFactory<PropertyType> {
850    public PropertyType fromCode(String codeString) throws IllegalArgumentException {
851      if (codeString == null || "".equals(codeString))
852        if (codeString == null || "".equals(codeString))
853          return null;
854      if ("code".equals(codeString))
855        return PropertyType.CODE;
856      if ("Coding".equals(codeString))
857        return PropertyType.CODING;
858      if ("string".equals(codeString))
859        return PropertyType.STRING;
860      if ("integer".equals(codeString))
861        return PropertyType.INTEGER;
862      if ("boolean".equals(codeString))
863        return PropertyType.BOOLEAN;
864      if ("dateTime".equals(codeString))
865        return PropertyType.DATETIME;
866      if ("decimal".equals(codeString))
867        return PropertyType.DECIMAL;
868      throw new IllegalArgumentException("Unknown PropertyType code '" + codeString + "'");
869    }
870
871    public Enumeration<PropertyType> fromType(PrimitiveType<?> code) throws FHIRException {
872      if (code == null)
873        return null;
874      if (code.isEmpty())
875        return new Enumeration<PropertyType>(this, PropertyType.NULL, code);
876      String codeString = code.asStringValue();
877      if (codeString == null || "".equals(codeString))
878        return new Enumeration<PropertyType>(this, PropertyType.NULL, code);
879      if ("code".equals(codeString))
880        return new Enumeration<PropertyType>(this, PropertyType.CODE, code);
881      if ("Coding".equals(codeString))
882        return new Enumeration<PropertyType>(this, PropertyType.CODING, code);
883      if ("string".equals(codeString))
884        return new Enumeration<PropertyType>(this, PropertyType.STRING, code);
885      if ("integer".equals(codeString))
886        return new Enumeration<PropertyType>(this, PropertyType.INTEGER, code);
887      if ("boolean".equals(codeString))
888        return new Enumeration<PropertyType>(this, PropertyType.BOOLEAN, code);
889      if ("dateTime".equals(codeString))
890        return new Enumeration<PropertyType>(this, PropertyType.DATETIME, code);
891      if ("decimal".equals(codeString))
892        return new Enumeration<PropertyType>(this, PropertyType.DECIMAL, code);
893      throw new FHIRException("Unknown PropertyType code '" + codeString + "'");
894    }
895
896    public String toCode(PropertyType code) {
897      if (code == PropertyType.CODE)
898        return "code";
899      if (code == PropertyType.CODING)
900        return "Coding";
901      if (code == PropertyType.STRING)
902        return "string";
903      if (code == PropertyType.INTEGER)
904        return "integer";
905      if (code == PropertyType.BOOLEAN)
906        return "boolean";
907      if (code == PropertyType.DATETIME)
908        return "dateTime";
909      if (code == PropertyType.DECIMAL)
910        return "decimal";
911      return "?";
912    }
913
914    public String toSystem(PropertyType code) {
915      return code.getSystem();
916    }
917  }
918
919  @Block()
920  public static class CodeSystemFilterComponent extends BackboneElement implements IBaseBackboneElement {
921    /**
922     * The code that identifies this filter when it is used as a filter in
923     * [[[ValueSet]]].compose.include.filter.
924     */
925    @Child(name = "code", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
926    @Description(shortDefinition = "Code that identifies the filter", formalDefinition = "The code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filter.")
927    protected CodeType code;
928
929    /**
930     * A description of how or why the filter is used.
931     */
932    @Child(name = "description", type = {
933        StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
934    @Description(shortDefinition = "How or why the filter is used", formalDefinition = "A description of how or why the filter is used.")
935    protected StringType description;
936
937    /**
938     * A list of operators that can be used with the filter.
939     */
940    @Child(name = "operator", type = {
941        CodeType.class }, order = 3, min = 1, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
942    @Description(shortDefinition = "= | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | exists", formalDefinition = "A list of operators that can be used with the filter.")
943    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/filter-operator")
944    protected List<Enumeration<FilterOperator>> operator;
945
946    /**
947     * A description of what the value for the filter should be.
948     */
949    @Child(name = "value", type = { StringType.class }, order = 4, min = 1, max = 1, modifier = false, summary = true)
950    @Description(shortDefinition = "What to use for the value", formalDefinition = "A description of what the value for the filter should be.")
951    protected StringType value;
952
953    private static final long serialVersionUID = -1087409836L;
954
955    /**
956     * Constructor
957     */
958    public CodeSystemFilterComponent() {
959      super();
960    }
961
962    /**
963     * Constructor
964     */
965    public CodeSystemFilterComponent(CodeType code, StringType value) {
966      super();
967      this.code = code;
968      this.value = value;
969    }
970
971    /**
972     * @return {@link #code} (The code that identifies this filter when it is used
973     *         as a filter in [[[ValueSet]]].compose.include.filter.). This is the
974     *         underlying object with id, value and extensions. The accessor
975     *         "getCode" gives direct access to the value
976     */
977    public CodeType getCodeElement() {
978      if (this.code == null)
979        if (Configuration.errorOnAutoCreate())
980          throw new Error("Attempt to auto-create CodeSystemFilterComponent.code");
981        else if (Configuration.doAutoCreate())
982          this.code = new CodeType(); // bb
983      return this.code;
984    }
985
986    public boolean hasCodeElement() {
987      return this.code != null && !this.code.isEmpty();
988    }
989
990    public boolean hasCode() {
991      return this.code != null && !this.code.isEmpty();
992    }
993
994    /**
995     * @param value {@link #code} (The code that identifies this filter when it is
996     *              used as a filter in [[[ValueSet]]].compose.include.filter.).
997     *              This is the underlying object with id, value and extensions. The
998     *              accessor "getCode" gives direct access to the value
999     */
1000    public CodeSystemFilterComponent setCodeElement(CodeType value) {
1001      this.code = value;
1002      return this;
1003    }
1004
1005    /**
1006     * @return The code that identifies this filter when it is used as a filter in
1007     *         [[[ValueSet]]].compose.include.filter.
1008     */
1009    public String getCode() {
1010      return this.code == null ? null : this.code.getValue();
1011    }
1012
1013    /**
1014     * @param value The code that identifies this filter when it is used as a filter
1015     *              in [[[ValueSet]]].compose.include.filter.
1016     */
1017    public CodeSystemFilterComponent setCode(String value) {
1018      if (this.code == null)
1019        this.code = new CodeType();
1020      this.code.setValue(value);
1021      return this;
1022    }
1023
1024    /**
1025     * @return {@link #description} (A description of how or why the filter is
1026     *         used.). This is the underlying object with id, value and extensions.
1027     *         The accessor "getDescription" gives direct access to the value
1028     */
1029    public StringType getDescriptionElement() {
1030      if (this.description == null)
1031        if (Configuration.errorOnAutoCreate())
1032          throw new Error("Attempt to auto-create CodeSystemFilterComponent.description");
1033        else if (Configuration.doAutoCreate())
1034          this.description = new StringType(); // bb
1035      return this.description;
1036    }
1037
1038    public boolean hasDescriptionElement() {
1039      return this.description != null && !this.description.isEmpty();
1040    }
1041
1042    public boolean hasDescription() {
1043      return this.description != null && !this.description.isEmpty();
1044    }
1045
1046    /**
1047     * @param value {@link #description} (A description of how or why the filter is
1048     *              used.). This is the underlying object with id, value and
1049     *              extensions. The accessor "getDescription" gives direct access to
1050     *              the value
1051     */
1052    public CodeSystemFilterComponent setDescriptionElement(StringType value) {
1053      this.description = value;
1054      return this;
1055    }
1056
1057    /**
1058     * @return A description of how or why the filter is used.
1059     */
1060    public String getDescription() {
1061      return this.description == null ? null : this.description.getValue();
1062    }
1063
1064    /**
1065     * @param value A description of how or why the filter is used.
1066     */
1067    public CodeSystemFilterComponent setDescription(String value) {
1068      if (Utilities.noString(value))
1069        this.description = null;
1070      else {
1071        if (this.description == null)
1072          this.description = new StringType();
1073        this.description.setValue(value);
1074      }
1075      return this;
1076    }
1077
1078    /**
1079     * @return {@link #operator} (A list of operators that can be used with the
1080     *         filter.)
1081     */
1082    public List<Enumeration<FilterOperator>> getOperator() {
1083      if (this.operator == null)
1084        this.operator = new ArrayList<Enumeration<FilterOperator>>();
1085      return this.operator;
1086    }
1087
1088    /**
1089     * @return Returns a reference to <code>this</code> for easy method chaining
1090     */
1091    public CodeSystemFilterComponent setOperator(List<Enumeration<FilterOperator>> theOperator) {
1092      this.operator = theOperator;
1093      return this;
1094    }
1095
1096    public boolean hasOperator() {
1097      if (this.operator == null)
1098        return false;
1099      for (Enumeration<FilterOperator> item : this.operator)
1100        if (!item.isEmpty())
1101          return true;
1102      return false;
1103    }
1104
1105    /**
1106     * @return {@link #operator} (A list of operators that can be used with the
1107     *         filter.)
1108     */
1109    public Enumeration<FilterOperator> addOperatorElement() {// 2
1110      Enumeration<FilterOperator> t = new Enumeration<FilterOperator>(new FilterOperatorEnumFactory());
1111      if (this.operator == null)
1112        this.operator = new ArrayList<Enumeration<FilterOperator>>();
1113      this.operator.add(t);
1114      return t;
1115    }
1116
1117    /**
1118     * @param value {@link #operator} (A list of operators that can be used with the
1119     *              filter.)
1120     */
1121    public CodeSystemFilterComponent addOperator(FilterOperator value) { // 1
1122      Enumeration<FilterOperator> t = new Enumeration<FilterOperator>(new FilterOperatorEnumFactory());
1123      t.setValue(value);
1124      if (this.operator == null)
1125        this.operator = new ArrayList<Enumeration<FilterOperator>>();
1126      this.operator.add(t);
1127      return this;
1128    }
1129
1130    /**
1131     * @param value {@link #operator} (A list of operators that can be used with the
1132     *              filter.)
1133     */
1134    public boolean hasOperator(FilterOperator value) {
1135      if (this.operator == null)
1136        return false;
1137      for (Enumeration<FilterOperator> v : this.operator)
1138        if (v.getValue().equals(value)) // code
1139          return true;
1140      return false;
1141    }
1142
1143    /**
1144     * @return {@link #value} (A description of what the value for the filter should
1145     *         be.). This is the underlying object with id, value and extensions.
1146     *         The accessor "getValue" gives direct access to the value
1147     */
1148    public StringType getValueElement() {
1149      if (this.value == null)
1150        if (Configuration.errorOnAutoCreate())
1151          throw new Error("Attempt to auto-create CodeSystemFilterComponent.value");
1152        else if (Configuration.doAutoCreate())
1153          this.value = new StringType(); // bb
1154      return this.value;
1155    }
1156
1157    public boolean hasValueElement() {
1158      return this.value != null && !this.value.isEmpty();
1159    }
1160
1161    public boolean hasValue() {
1162      return this.value != null && !this.value.isEmpty();
1163    }
1164
1165    /**
1166     * @param value {@link #value} (A description of what the value for the filter
1167     *              should be.). This is the underlying object with id, value and
1168     *              extensions. The accessor "getValue" gives direct access to the
1169     *              value
1170     */
1171    public CodeSystemFilterComponent setValueElement(StringType value) {
1172      this.value = value;
1173      return this;
1174    }
1175
1176    /**
1177     * @return A description of what the value for the filter should be.
1178     */
1179    public String getValue() {
1180      return this.value == null ? null : this.value.getValue();
1181    }
1182
1183    /**
1184     * @param value A description of what the value for the filter should be.
1185     */
1186    public CodeSystemFilterComponent setValue(String value) {
1187      if (this.value == null)
1188        this.value = new StringType();
1189      this.value.setValue(value);
1190      return this;
1191    }
1192
1193    protected void listChildren(List<Property> children) {
1194      super.listChildren(children);
1195      children.add(new Property("code", "code",
1196          "The code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filter.",
1197          0, 1, code));
1198      children.add(
1199          new Property("description", "string", "A description of how or why the filter is used.", 0, 1, description));
1200      children.add(new Property("operator", "code", "A list of operators that can be used with the filter.", 0,
1201          java.lang.Integer.MAX_VALUE, operator));
1202      children.add(
1203          new Property("value", "string", "A description of what the value for the filter should be.", 0, 1, value));
1204    }
1205
1206    @Override
1207    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1208      switch (_hash) {
1209      case 3059181:
1210        /* code */ return new Property("code", "code",
1211            "The code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filter.",
1212            0, 1, code);
1213      case -1724546052:
1214        /* description */ return new Property("description", "string",
1215            "A description of how or why the filter is used.", 0, 1, description);
1216      case -500553564:
1217        /* operator */ return new Property("operator", "code", "A list of operators that can be used with the filter.",
1218            0, java.lang.Integer.MAX_VALUE, operator);
1219      case 111972721:
1220        /* value */ return new Property("value", "string", "A description of what the value for the filter should be.",
1221            0, 1, value);
1222      default:
1223        return super.getNamedProperty(_hash, _name, _checkValid);
1224      }
1225
1226    }
1227
1228    @Override
1229    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1230      switch (hash) {
1231      case 3059181:
1232        /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeType
1233      case -1724546052:
1234        /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // StringType
1235      case -500553564:
1236        /* operator */ return this.operator == null ? new Base[0]
1237            : this.operator.toArray(new Base[this.operator.size()]); // Enumeration<FilterOperator>
1238      case 111972721:
1239        /* value */ return this.value == null ? new Base[0] : new Base[] { this.value }; // StringType
1240      default:
1241        return super.getProperty(hash, name, checkValid);
1242      }
1243
1244    }
1245
1246    @Override
1247    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1248      switch (hash) {
1249      case 3059181: // code
1250        this.code = castToCode(value); // CodeType
1251        return value;
1252      case -1724546052: // description
1253        this.description = castToString(value); // StringType
1254        return value;
1255      case -500553564: // operator
1256        value = new FilterOperatorEnumFactory().fromType(castToCode(value));
1257        this.getOperator().add((Enumeration) value); // Enumeration<FilterOperator>
1258        return value;
1259      case 111972721: // value
1260        this.value = castToString(value); // StringType
1261        return value;
1262      default:
1263        return super.setProperty(hash, name, value);
1264      }
1265
1266    }
1267
1268    @Override
1269    public Base setProperty(String name, Base value) throws FHIRException {
1270      if (name.equals("code")) {
1271        this.code = castToCode(value); // CodeType
1272      } else if (name.equals("description")) {
1273        this.description = castToString(value); // StringType
1274      } else if (name.equals("operator")) {
1275        value = new FilterOperatorEnumFactory().fromType(castToCode(value));
1276        this.getOperator().add((Enumeration) value);
1277      } else if (name.equals("value")) {
1278        this.value = castToString(value); // StringType
1279      } else
1280        return super.setProperty(name, value);
1281      return value;
1282    }
1283
1284    @Override
1285    public Base makeProperty(int hash, String name) throws FHIRException {
1286      switch (hash) {
1287      case 3059181:
1288        return getCodeElement();
1289      case -1724546052:
1290        return getDescriptionElement();
1291      case -500553564:
1292        return addOperatorElement();
1293      case 111972721:
1294        return getValueElement();
1295      default:
1296        return super.makeProperty(hash, name);
1297      }
1298
1299    }
1300
1301    @Override
1302    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1303      switch (hash) {
1304      case 3059181:
1305        /* code */ return new String[] { "code" };
1306      case -1724546052:
1307        /* description */ return new String[] { "string" };
1308      case -500553564:
1309        /* operator */ return new String[] { "code" };
1310      case 111972721:
1311        /* value */ return new String[] { "string" };
1312      default:
1313        return super.getTypesForProperty(hash, name);
1314      }
1315
1316    }
1317
1318    @Override
1319    public Base addChild(String name) throws FHIRException {
1320      if (name.equals("code")) {
1321        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.code");
1322      } else if (name.equals("description")) {
1323        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.description");
1324      } else if (name.equals("operator")) {
1325        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.operator");
1326      } else if (name.equals("value")) {
1327        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.value");
1328      } else
1329        return super.addChild(name);
1330    }
1331
1332    public CodeSystemFilterComponent copy() {
1333      CodeSystemFilterComponent dst = new CodeSystemFilterComponent();
1334      copyValues(dst);
1335      return dst;
1336    }
1337
1338    public void copyValues(CodeSystemFilterComponent dst) {
1339      super.copyValues(dst);
1340      dst.code = code == null ? null : code.copy();
1341      dst.description = description == null ? null : description.copy();
1342      if (operator != null) {
1343        dst.operator = new ArrayList<Enumeration<FilterOperator>>();
1344        for (Enumeration<FilterOperator> i : operator)
1345          dst.operator.add(i.copy());
1346      }
1347      ;
1348      dst.value = value == null ? null : value.copy();
1349    }
1350
1351    @Override
1352    public boolean equalsDeep(Base other_) {
1353      if (!super.equalsDeep(other_))
1354        return false;
1355      if (!(other_ instanceof CodeSystemFilterComponent))
1356        return false;
1357      CodeSystemFilterComponent o = (CodeSystemFilterComponent) other_;
1358      return compareDeep(code, o.code, true) && compareDeep(description, o.description, true)
1359          && compareDeep(operator, o.operator, true) && compareDeep(value, o.value, true);
1360    }
1361
1362    @Override
1363    public boolean equalsShallow(Base other_) {
1364      if (!super.equalsShallow(other_))
1365        return false;
1366      if (!(other_ instanceof CodeSystemFilterComponent))
1367        return false;
1368      CodeSystemFilterComponent o = (CodeSystemFilterComponent) other_;
1369      return compareValues(code, o.code, true) && compareValues(description, o.description, true)
1370          && compareValues(operator, o.operator, true) && compareValues(value, o.value, true);
1371    }
1372
1373    public boolean isEmpty() {
1374      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, description, operator, value);
1375    }
1376
1377    public String fhirType() {
1378      return "CodeSystem.filter";
1379
1380    }
1381
1382  }
1383
1384  @Block()
1385  public static class PropertyComponent extends BackboneElement implements IBaseBackboneElement {
1386    /**
1387     * A code that is used to identify the property. The code is used internally (in
1388     * CodeSystem.concept.property.code) and also externally, such as in property
1389     * filters.
1390     */
1391    @Child(name = "code", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
1392    @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.")
1393    protected CodeType code;
1394
1395    /**
1396     * Reference to the formal meaning of the property. One possible source of
1397     * meaning is the [Concept Properties](codesystem-concept-properties.html) code
1398     * system.
1399     */
1400    @Child(name = "uri", type = { UriType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
1401    @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.")
1402    protected UriType uri;
1403
1404    /**
1405     * A description of the property- why it is defined, and how its value might be
1406     * used.
1407     */
1408    @Child(name = "description", type = {
1409        StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
1410    @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.")
1411    protected StringType description;
1412
1413    /**
1414     * The type of the property value. Properties of type "code" contain a code
1415     * defined by the code system (e.g. a reference to another defined concept).
1416     */
1417    @Child(name = "type", type = { CodeType.class }, order = 4, min = 1, max = 1, modifier = false, summary = true)
1418    @Description(shortDefinition = "code | Coding | string | integer | boolean | dateTime | decimal", formalDefinition = "The type of the property value. Properties of type \"code\" contain a code defined by the code system (e.g. a reference to another defined concept).")
1419    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/concept-property-type")
1420    protected Enumeration<PropertyType> type;
1421
1422    private static final long serialVersionUID = -1810713373L;
1423
1424    /**
1425     * Constructor
1426     */
1427    public PropertyComponent() {
1428      super();
1429    }
1430
1431    /**
1432     * Constructor
1433     */
1434    public PropertyComponent(CodeType code, Enumeration<PropertyType> type) {
1435      super();
1436      this.code = code;
1437      this.type = type;
1438    }
1439
1440    /**
1441     * @return {@link #code} (A code that is used to identify the property. The code
1442     *         is used internally (in CodeSystem.concept.property.code) and also
1443     *         externally, such as in property filters.). This is the underlying
1444     *         object with id, value and extensions. The accessor "getCode" gives
1445     *         direct access to the value
1446     */
1447    public CodeType getCodeElement() {
1448      if (this.code == null)
1449        if (Configuration.errorOnAutoCreate())
1450          throw new Error("Attempt to auto-create PropertyComponent.code");
1451        else if (Configuration.doAutoCreate())
1452          this.code = new CodeType(); // bb
1453      return this.code;
1454    }
1455
1456    public boolean hasCodeElement() {
1457      return this.code != null && !this.code.isEmpty();
1458    }
1459
1460    public boolean hasCode() {
1461      return this.code != null && !this.code.isEmpty();
1462    }
1463
1464    /**
1465     * @param value {@link #code} (A code that is used to identify the property. The
1466     *              code is used internally (in CodeSystem.concept.property.code)
1467     *              and also externally, such as in property filters.). This is the
1468     *              underlying object with id, value and extensions. The accessor
1469     *              "getCode" gives direct access to the value
1470     */
1471    public PropertyComponent setCodeElement(CodeType value) {
1472      this.code = value;
1473      return this;
1474    }
1475
1476    /**
1477     * @return A code that is used to identify the property. The code is used
1478     *         internally (in CodeSystem.concept.property.code) and also externally,
1479     *         such as in property filters.
1480     */
1481    public String getCode() {
1482      return this.code == null ? null : this.code.getValue();
1483    }
1484
1485    /**
1486     * @param value A code that is used to identify the property. The code is used
1487     *              internally (in CodeSystem.concept.property.code) and also
1488     *              externally, such as in property filters.
1489     */
1490    public PropertyComponent setCode(String value) {
1491      if (this.code == null)
1492        this.code = new CodeType();
1493      this.code.setValue(value);
1494      return this;
1495    }
1496
1497    /**
1498     * @return {@link #uri} (Reference to the formal meaning of the property. One
1499     *         possible source of meaning is the [Concept
1500     *         Properties](codesystem-concept-properties.html) code system.). This
1501     *         is the underlying object with id, value and extensions. The accessor
1502     *         "getUri" gives direct access to the value
1503     */
1504    public UriType getUriElement() {
1505      if (this.uri == null)
1506        if (Configuration.errorOnAutoCreate())
1507          throw new Error("Attempt to auto-create PropertyComponent.uri");
1508        else if (Configuration.doAutoCreate())
1509          this.uri = new UriType(); // bb
1510      return this.uri;
1511    }
1512
1513    public boolean hasUriElement() {
1514      return this.uri != null && !this.uri.isEmpty();
1515    }
1516
1517    public boolean hasUri() {
1518      return this.uri != null && !this.uri.isEmpty();
1519    }
1520
1521    /**
1522     * @param value {@link #uri} (Reference to the formal meaning of the property.
1523     *              One possible source of meaning is the [Concept
1524     *              Properties](codesystem-concept-properties.html) code system.).
1525     *              This is the underlying object with id, value and extensions. The
1526     *              accessor "getUri" gives direct access to the value
1527     */
1528    public PropertyComponent setUriElement(UriType value) {
1529      this.uri = value;
1530      return this;
1531    }
1532
1533    /**
1534     * @return Reference to the formal meaning of the property. One possible source
1535     *         of meaning is the [Concept
1536     *         Properties](codesystem-concept-properties.html) code system.
1537     */
1538    public String getUri() {
1539      return this.uri == null ? null : this.uri.getValue();
1540    }
1541
1542    /**
1543     * @param value Reference to the formal meaning of the property. One possible
1544     *              source of meaning is the [Concept
1545     *              Properties](codesystem-concept-properties.html) code system.
1546     */
1547    public PropertyComponent setUri(String value) {
1548      if (Utilities.noString(value))
1549        this.uri = null;
1550      else {
1551        if (this.uri == null)
1552          this.uri = new UriType();
1553        this.uri.setValue(value);
1554      }
1555      return this;
1556    }
1557
1558    /**
1559     * @return {@link #description} (A description of the property- why it is
1560     *         defined, and how its value might be used.). This is the underlying
1561     *         object with id, value and extensions. The accessor "getDescription"
1562     *         gives direct access to the value
1563     */
1564    public StringType getDescriptionElement() {
1565      if (this.description == null)
1566        if (Configuration.errorOnAutoCreate())
1567          throw new Error("Attempt to auto-create PropertyComponent.description");
1568        else if (Configuration.doAutoCreate())
1569          this.description = new StringType(); // bb
1570      return this.description;
1571    }
1572
1573    public boolean hasDescriptionElement() {
1574      return this.description != null && !this.description.isEmpty();
1575    }
1576
1577    public boolean hasDescription() {
1578      return this.description != null && !this.description.isEmpty();
1579    }
1580
1581    /**
1582     * @param value {@link #description} (A description of the property- why it is
1583     *              defined, and how its value might be used.). This is the
1584     *              underlying object with id, value and extensions. The accessor
1585     *              "getDescription" gives direct access to the value
1586     */
1587    public PropertyComponent setDescriptionElement(StringType value) {
1588      this.description = value;
1589      return this;
1590    }
1591
1592    /**
1593     * @return A description of the property- why it is defined, and how its value
1594     *         might be used.
1595     */
1596    public String getDescription() {
1597      return this.description == null ? null : this.description.getValue();
1598    }
1599
1600    /**
1601     * @param value A description of the property- why it is defined, and how its
1602     *              value might be used.
1603     */
1604    public PropertyComponent setDescription(String value) {
1605      if (Utilities.noString(value))
1606        this.description = null;
1607      else {
1608        if (this.description == null)
1609          this.description = new StringType();
1610        this.description.setValue(value);
1611      }
1612      return this;
1613    }
1614
1615    /**
1616     * @return {@link #type} (The type of the property value. Properties of type
1617     *         "code" contain a code defined by the code system (e.g. a reference to
1618     *         another defined concept).). This is the underlying object with id,
1619     *         value and extensions. The accessor "getType" gives direct access to
1620     *         the value
1621     */
1622    public Enumeration<PropertyType> getTypeElement() {
1623      if (this.type == null)
1624        if (Configuration.errorOnAutoCreate())
1625          throw new Error("Attempt to auto-create PropertyComponent.type");
1626        else if (Configuration.doAutoCreate())
1627          this.type = new Enumeration<PropertyType>(new PropertyTypeEnumFactory()); // bb
1628      return this.type;
1629    }
1630
1631    public boolean hasTypeElement() {
1632      return this.type != null && !this.type.isEmpty();
1633    }
1634
1635    public boolean hasType() {
1636      return this.type != null && !this.type.isEmpty();
1637    }
1638
1639    /**
1640     * @param value {@link #type} (The type of the property value. Properties of
1641     *              type "code" contain a code defined by the code system (e.g. a
1642     *              reference to another defined concept).). This is the underlying
1643     *              object with id, value and extensions. The accessor "getType"
1644     *              gives direct access to the value
1645     */
1646    public PropertyComponent setTypeElement(Enumeration<PropertyType> value) {
1647      this.type = value;
1648      return this;
1649    }
1650
1651    /**
1652     * @return The type of the property value. Properties of type "code" contain a
1653     *         code defined by the code system (e.g. a reference to another defined
1654     *         concept).
1655     */
1656    public PropertyType getType() {
1657      return this.type == null ? null : this.type.getValue();
1658    }
1659
1660    /**
1661     * @param value The type of the property value. Properties of type "code"
1662     *              contain a code defined by the code system (e.g. a reference to
1663     *              another defined concept).
1664     */
1665    public PropertyComponent setType(PropertyType value) {
1666      if (this.type == null)
1667        this.type = new Enumeration<PropertyType>(new PropertyTypeEnumFactory());
1668      this.type.setValue(value);
1669      return this;
1670    }
1671
1672    protected void listChildren(List<Property> children) {
1673      super.listChildren(children);
1674      children.add(new Property("code", "code",
1675          "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.",
1676          0, 1, code));
1677      children.add(new Property("uri", "uri",
1678          "Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.",
1679          0, 1, uri));
1680      children.add(new Property("description", "string",
1681          "A description of the property- why it is defined, and how its value might be used.", 0, 1, description));
1682      children.add(new Property("type", "code",
1683          "The type of the property value. Properties of type \"code\" contain a code defined by the code system (e.g. a reference to another defined concept).",
1684          0, 1, type));
1685    }
1686
1687    @Override
1688    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1689      switch (_hash) {
1690      case 3059181:
1691        /* code */ return new Property("code", "code",
1692            "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.",
1693            0, 1, code);
1694      case 116076:
1695        /* uri */ return new Property("uri", "uri",
1696            "Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.",
1697            0, 1, uri);
1698      case -1724546052:
1699        /* description */ return new Property("description", "string",
1700            "A description of the property- why it is defined, and how its value might be used.", 0, 1, description);
1701      case 3575610:
1702        /* type */ return new Property("type", "code",
1703            "The type of the property value. Properties of type \"code\" contain a code defined by the code system (e.g. a reference to another defined concept).",
1704            0, 1, type);
1705      default:
1706        return super.getNamedProperty(_hash, _name, _checkValid);
1707      }
1708
1709    }
1710
1711    @Override
1712    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1713      switch (hash) {
1714      case 3059181:
1715        /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeType
1716      case 116076:
1717        /* uri */ return this.uri == null ? new Base[0] : new Base[] { this.uri }; // UriType
1718      case -1724546052:
1719        /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // StringType
1720      case 3575610:
1721        /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<PropertyType>
1722      default:
1723        return super.getProperty(hash, name, checkValid);
1724      }
1725
1726    }
1727
1728    @Override
1729    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1730      switch (hash) {
1731      case 3059181: // code
1732        this.code = castToCode(value); // CodeType
1733        return value;
1734      case 116076: // uri
1735        this.uri = castToUri(value); // UriType
1736        return value;
1737      case -1724546052: // description
1738        this.description = castToString(value); // StringType
1739        return value;
1740      case 3575610: // type
1741        value = new PropertyTypeEnumFactory().fromType(castToCode(value));
1742        this.type = (Enumeration) value; // Enumeration<PropertyType>
1743        return value;
1744      default:
1745        return super.setProperty(hash, name, value);
1746      }
1747
1748    }
1749
1750    @Override
1751    public Base setProperty(String name, Base value) throws FHIRException {
1752      if (name.equals("code")) {
1753        this.code = castToCode(value); // CodeType
1754      } else if (name.equals("uri")) {
1755        this.uri = castToUri(value); // UriType
1756      } else if (name.equals("description")) {
1757        this.description = castToString(value); // StringType
1758      } else if (name.equals("type")) {
1759        value = new PropertyTypeEnumFactory().fromType(castToCode(value));
1760        this.type = (Enumeration) value; // Enumeration<PropertyType>
1761      } else
1762        return super.setProperty(name, value);
1763      return value;
1764    }
1765
1766    @Override
1767    public Base makeProperty(int hash, String name) throws FHIRException {
1768      switch (hash) {
1769      case 3059181:
1770        return getCodeElement();
1771      case 116076:
1772        return getUriElement();
1773      case -1724546052:
1774        return getDescriptionElement();
1775      case 3575610:
1776        return getTypeElement();
1777      default:
1778        return super.makeProperty(hash, name);
1779      }
1780
1781    }
1782
1783    @Override
1784    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1785      switch (hash) {
1786      case 3059181:
1787        /* code */ return new String[] { "code" };
1788      case 116076:
1789        /* uri */ return new String[] { "uri" };
1790      case -1724546052:
1791        /* description */ return new String[] { "string" };
1792      case 3575610:
1793        /* type */ return new String[] { "code" };
1794      default:
1795        return super.getTypesForProperty(hash, name);
1796      }
1797
1798    }
1799
1800    @Override
1801    public Base addChild(String name) throws FHIRException {
1802      if (name.equals("code")) {
1803        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.code");
1804      } else if (name.equals("uri")) {
1805        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.uri");
1806      } else if (name.equals("description")) {
1807        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.description");
1808      } else if (name.equals("type")) {
1809        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.type");
1810      } else
1811        return super.addChild(name);
1812    }
1813
1814    public PropertyComponent copy() {
1815      PropertyComponent dst = new PropertyComponent();
1816      copyValues(dst);
1817      return dst;
1818    }
1819
1820    public void copyValues(PropertyComponent dst) {
1821      super.copyValues(dst);
1822      dst.code = code == null ? null : code.copy();
1823      dst.uri = uri == null ? null : uri.copy();
1824      dst.description = description == null ? null : description.copy();
1825      dst.type = type == null ? null : type.copy();
1826    }
1827
1828    @Override
1829    public boolean equalsDeep(Base other_) {
1830      if (!super.equalsDeep(other_))
1831        return false;
1832      if (!(other_ instanceof PropertyComponent))
1833        return false;
1834      PropertyComponent o = (PropertyComponent) other_;
1835      return compareDeep(code, o.code, true) && compareDeep(uri, o.uri, true)
1836          && compareDeep(description, o.description, true) && compareDeep(type, o.type, true);
1837    }
1838
1839    @Override
1840    public boolean equalsShallow(Base other_) {
1841      if (!super.equalsShallow(other_))
1842        return false;
1843      if (!(other_ instanceof PropertyComponent))
1844        return false;
1845      PropertyComponent o = (PropertyComponent) other_;
1846      return compareValues(code, o.code, true) && compareValues(uri, o.uri, true)
1847          && compareValues(description, o.description, true) && compareValues(type, o.type, true);
1848    }
1849
1850    public boolean isEmpty() {
1851      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, uri, description, type);
1852    }
1853
1854    public String fhirType() {
1855      return "CodeSystem.property";
1856
1857    }
1858
1859  }
1860
1861  @Block()
1862  public static class ConceptDefinitionComponent extends BackboneElement implements IBaseBackboneElement {
1863    /**
1864     * A code - a text symbol - that uniquely identifies the concept within the code
1865     * system.
1866     */
1867    @Child(name = "code", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
1868    @Description(shortDefinition = "Code that identifies concept", formalDefinition = "A code - a text symbol - that uniquely identifies the concept within the code system.")
1869    protected CodeType code;
1870
1871    /**
1872     * A human readable string that is the recommended default way to present this
1873     * concept to a user.
1874     */
1875    @Child(name = "display", type = {
1876        StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
1877    @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.")
1878    protected StringType display;
1879
1880    /**
1881     * The formal definition of the concept. The code system resource does not make
1882     * formal definitions required, because of the prevalence of legacy systems.
1883     * However, they are highly recommended, as without them there is no formal
1884     * meaning associated with the concept.
1885     */
1886    @Child(name = "definition", type = {
1887        StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
1888    @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.")
1889    protected StringType definition;
1890
1891    /**
1892     * Additional representations for the concept - other languages, aliases,
1893     * specialized purposes, used for particular purposes, etc.
1894     */
1895    @Child(name = "designation", type = {}, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1896    @Description(shortDefinition = "Additional representations for the concept", formalDefinition = "Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.")
1897    protected List<ConceptDefinitionDesignationComponent> designation;
1898
1899    /**
1900     * A property value for this concept.
1901     */
1902    @Child(name = "property", type = {}, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1903    @Description(shortDefinition = "Property value for the concept", formalDefinition = "A property value for this concept.")
1904    protected List<ConceptPropertyComponent> property;
1905
1906    /**
1907     * Defines children of a concept to produce a hierarchy of concepts. The nature
1908     * of the relationships is variable (is-a/contains/categorizes) - see
1909     * hierarchyMeaning.
1910     */
1911    @Child(name = "concept", type = {
1912        ConceptDefinitionComponent.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1913    @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.")
1914    protected List<ConceptDefinitionComponent> concept;
1915
1916    private static final long serialVersionUID = 878320988L;
1917
1918    /**
1919     * Constructor
1920     */
1921    public ConceptDefinitionComponent() {
1922      super();
1923    }
1924
1925    /**
1926     * Constructor
1927     */
1928    public ConceptDefinitionComponent(CodeType code) {
1929      super();
1930      this.code = code;
1931    }
1932
1933    /**
1934     * @return {@link #code} (A code - a text symbol - that uniquely identifies the
1935     *         concept within the code system.). This is the underlying object with
1936     *         id, value and extensions. The accessor "getCode" gives direct access
1937     *         to the value
1938     */
1939    public CodeType getCodeElement() {
1940      if (this.code == null)
1941        if (Configuration.errorOnAutoCreate())
1942          throw new Error("Attempt to auto-create ConceptDefinitionComponent.code");
1943        else if (Configuration.doAutoCreate())
1944          this.code = new CodeType(); // bb
1945      return this.code;
1946    }
1947
1948    public boolean hasCodeElement() {
1949      return this.code != null && !this.code.isEmpty();
1950    }
1951
1952    public boolean hasCode() {
1953      return this.code != null && !this.code.isEmpty();
1954    }
1955
1956    /**
1957     * @param value {@link #code} (A code - a text symbol - that uniquely identifies
1958     *              the concept within the code system.). This is the underlying
1959     *              object with id, value and extensions. The accessor "getCode"
1960     *              gives direct access to the value
1961     */
1962    public ConceptDefinitionComponent setCodeElement(CodeType value) {
1963      this.code = value;
1964      return this;
1965    }
1966
1967    /**
1968     * @return A code - a text symbol - that uniquely identifies the concept within
1969     *         the code system.
1970     */
1971    public String getCode() {
1972      return this.code == null ? null : this.code.getValue();
1973    }
1974
1975    /**
1976     * @param value A code - a text symbol - that uniquely identifies the concept
1977     *              within the code system.
1978     */
1979    public ConceptDefinitionComponent setCode(String value) {
1980      if (this.code == null)
1981        this.code = new CodeType();
1982      this.code.setValue(value);
1983      return this;
1984    }
1985
1986    /**
1987     * @return {@link #display} (A human readable string that is the recommended
1988     *         default way to present this concept to a user.). This is the
1989     *         underlying object with id, value and extensions. The accessor
1990     *         "getDisplay" gives direct access to the value
1991     */
1992    public StringType getDisplayElement() {
1993      if (this.display == null)
1994        if (Configuration.errorOnAutoCreate())
1995          throw new Error("Attempt to auto-create ConceptDefinitionComponent.display");
1996        else if (Configuration.doAutoCreate())
1997          this.display = new StringType(); // bb
1998      return this.display;
1999    }
2000
2001    public boolean hasDisplayElement() {
2002      return this.display != null && !this.display.isEmpty();
2003    }
2004
2005    public boolean hasDisplay() {
2006      return this.display != null && !this.display.isEmpty();
2007    }
2008
2009    /**
2010     * @param value {@link #display} (A human readable string that is the
2011     *              recommended default way to present this concept to a user.).
2012     *              This is the underlying object with id, value and extensions. The
2013     *              accessor "getDisplay" gives direct access to the value
2014     */
2015    public ConceptDefinitionComponent setDisplayElement(StringType value) {
2016      this.display = value;
2017      return this;
2018    }
2019
2020    /**
2021     * @return A human readable string that is the recommended default way to
2022     *         present this concept to a user.
2023     */
2024    public String getDisplay() {
2025      return this.display == null ? null : this.display.getValue();
2026    }
2027
2028    /**
2029     * @param value A human readable string that is the recommended default way to
2030     *              present this concept to a user.
2031     */
2032    public ConceptDefinitionComponent setDisplay(String value) {
2033      if (Utilities.noString(value))
2034        this.display = null;
2035      else {
2036        if (this.display == null)
2037          this.display = new StringType();
2038        this.display.setValue(value);
2039      }
2040      return this;
2041    }
2042
2043    /**
2044     * @return {@link #definition} (The formal definition of the concept. The code
2045     *         system resource does not make formal definitions required, because of
2046     *         the prevalence of legacy systems. However, they are highly
2047     *         recommended, as without them there is no formal meaning associated
2048     *         with the concept.). This is the underlying object with id, value and
2049     *         extensions. The accessor "getDefinition" gives direct access to the
2050     *         value
2051     */
2052    public StringType getDefinitionElement() {
2053      if (this.definition == null)
2054        if (Configuration.errorOnAutoCreate())
2055          throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition");
2056        else if (Configuration.doAutoCreate())
2057          this.definition = new StringType(); // bb
2058      return this.definition;
2059    }
2060
2061    public boolean hasDefinitionElement() {
2062      return this.definition != null && !this.definition.isEmpty();
2063    }
2064
2065    public boolean hasDefinition() {
2066      return this.definition != null && !this.definition.isEmpty();
2067    }
2068
2069    /**
2070     * @param value {@link #definition} (The formal definition of the concept. The
2071     *              code system resource does not make formal definitions required,
2072     *              because of the prevalence of legacy systems. However, they are
2073     *              highly recommended, as without them there is no formal meaning
2074     *              associated with the concept.). This is the underlying object
2075     *              with id, value and extensions. The accessor "getDefinition"
2076     *              gives direct access to the value
2077     */
2078    public ConceptDefinitionComponent setDefinitionElement(StringType value) {
2079      this.definition = value;
2080      return this;
2081    }
2082
2083    /**
2084     * @return The formal definition of the concept. The code system resource does
2085     *         not make formal definitions required, because of the prevalence of
2086     *         legacy systems. However, they are highly recommended, as without them
2087     *         there is no formal meaning associated with the concept.
2088     */
2089    public String getDefinition() {
2090      return this.definition == null ? null : this.definition.getValue();
2091    }
2092
2093    /**
2094     * @param value The formal definition of the concept. The code system resource
2095     *              does not make formal definitions required, because of the
2096     *              prevalence of legacy systems. However, they are highly
2097     *              recommended, as without them there is no formal meaning
2098     *              associated with the concept.
2099     */
2100    public ConceptDefinitionComponent setDefinition(String value) {
2101      if (Utilities.noString(value))
2102        this.definition = null;
2103      else {
2104        if (this.definition == null)
2105          this.definition = new StringType();
2106        this.definition.setValue(value);
2107      }
2108      return this;
2109    }
2110
2111    /**
2112     * @return {@link #designation} (Additional representations for the concept -
2113     *         other languages, aliases, specialized purposes, used for particular
2114     *         purposes, etc.)
2115     */
2116    public List<ConceptDefinitionDesignationComponent> getDesignation() {
2117      if (this.designation == null)
2118        this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
2119      return this.designation;
2120    }
2121
2122    /**
2123     * @return Returns a reference to <code>this</code> for easy method chaining
2124     */
2125    public ConceptDefinitionComponent setDesignation(List<ConceptDefinitionDesignationComponent> theDesignation) {
2126      this.designation = theDesignation;
2127      return this;
2128    }
2129
2130    public boolean hasDesignation() {
2131      if (this.designation == null)
2132        return false;
2133      for (ConceptDefinitionDesignationComponent item : this.designation)
2134        if (!item.isEmpty())
2135          return true;
2136      return false;
2137    }
2138
2139    public ConceptDefinitionDesignationComponent addDesignation() { // 3
2140      ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent();
2141      if (this.designation == null)
2142        this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
2143      this.designation.add(t);
2144      return t;
2145    }
2146
2147    public ConceptDefinitionComponent addDesignation(ConceptDefinitionDesignationComponent t) { // 3
2148      if (t == null)
2149        return this;
2150      if (this.designation == null)
2151        this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
2152      this.designation.add(t);
2153      return this;
2154    }
2155
2156    /**
2157     * @return The first repetition of repeating field {@link #designation},
2158     *         creating it if it does not already exist
2159     */
2160    public ConceptDefinitionDesignationComponent getDesignationFirstRep() {
2161      if (getDesignation().isEmpty()) {
2162        addDesignation();
2163      }
2164      return getDesignation().get(0);
2165    }
2166
2167    /**
2168     * @return {@link #property} (A property value for this concept.)
2169     */
2170    public List<ConceptPropertyComponent> getProperty() {
2171      if (this.property == null)
2172        this.property = new ArrayList<ConceptPropertyComponent>();
2173      return this.property;
2174    }
2175
2176    /**
2177     * @return Returns a reference to <code>this</code> for easy method chaining
2178     */
2179    public ConceptDefinitionComponent setProperty(List<ConceptPropertyComponent> theProperty) {
2180      this.property = theProperty;
2181      return this;
2182    }
2183
2184    public boolean hasProperty() {
2185      if (this.property == null)
2186        return false;
2187      for (ConceptPropertyComponent item : this.property)
2188        if (!item.isEmpty())
2189          return true;
2190      return false;
2191    }
2192
2193    public ConceptPropertyComponent addProperty() { // 3
2194      ConceptPropertyComponent t = new ConceptPropertyComponent();
2195      if (this.property == null)
2196        this.property = new ArrayList<ConceptPropertyComponent>();
2197      this.property.add(t);
2198      return t;
2199    }
2200
2201    public ConceptDefinitionComponent addProperty(ConceptPropertyComponent t) { // 3
2202      if (t == null)
2203        return this;
2204      if (this.property == null)
2205        this.property = new ArrayList<ConceptPropertyComponent>();
2206      this.property.add(t);
2207      return this;
2208    }
2209
2210    /**
2211     * @return The first repetition of repeating field {@link #property}, creating
2212     *         it if it does not already exist
2213     */
2214    public ConceptPropertyComponent getPropertyFirstRep() {
2215      if (getProperty().isEmpty()) {
2216        addProperty();
2217      }
2218      return getProperty().get(0);
2219    }
2220
2221    /**
2222     * @return {@link #concept} (Defines children of a concept to produce a
2223     *         hierarchy of concepts. The nature of the relationships is variable
2224     *         (is-a/contains/categorizes) - see hierarchyMeaning.)
2225     */
2226    public List<ConceptDefinitionComponent> getConcept() {
2227      if (this.concept == null)
2228        this.concept = new ArrayList<ConceptDefinitionComponent>();
2229      return this.concept;
2230    }
2231
2232    /**
2233     * @return Returns a reference to <code>this</code> for easy method chaining
2234     */
2235    public ConceptDefinitionComponent setConcept(List<ConceptDefinitionComponent> theConcept) {
2236      this.concept = theConcept;
2237      return this;
2238    }
2239
2240    public boolean hasConcept() {
2241      if (this.concept == null)
2242        return false;
2243      for (ConceptDefinitionComponent item : this.concept)
2244        if (!item.isEmpty())
2245          return true;
2246      return false;
2247    }
2248
2249    public ConceptDefinitionComponent addConcept() { // 3
2250      ConceptDefinitionComponent t = new ConceptDefinitionComponent();
2251      if (this.concept == null)
2252        this.concept = new ArrayList<ConceptDefinitionComponent>();
2253      this.concept.add(t);
2254      return t;
2255    }
2256
2257    public ConceptDefinitionComponent addConcept(ConceptDefinitionComponent t) { // 3
2258      if (t == null)
2259        return this;
2260      if (this.concept == null)
2261        this.concept = new ArrayList<ConceptDefinitionComponent>();
2262      this.concept.add(t);
2263      return this;
2264    }
2265
2266    /**
2267     * @return The first repetition of repeating field {@link #concept}, creating it
2268     *         if it does not already exist
2269     */
2270    public ConceptDefinitionComponent getConceptFirstRep() {
2271      if (getConcept().isEmpty()) {
2272        addConcept();
2273      }
2274      return getConcept().get(0);
2275    }
2276
2277    protected void listChildren(List<Property> children) {
2278      super.listChildren(children);
2279      children.add(new Property("code", "code",
2280          "A code - a text symbol - that uniquely identifies the concept within the code system.", 0, 1, code));
2281      children.add(new Property("display", "string",
2282          "A human readable string that is the recommended default way to present this concept to a user.", 0, 1,
2283          display));
2284      children.add(new Property("definition", "string",
2285          "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.",
2286          0, 1, definition));
2287      children.add(new Property("designation", "",
2288          "Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.",
2289          0, java.lang.Integer.MAX_VALUE, designation));
2290      children.add(
2291          new Property("property", "", "A property value for this concept.", 0, java.lang.Integer.MAX_VALUE, property));
2292      children.add(new Property("concept", "@CodeSystem.concept",
2293          "Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.",
2294          0, java.lang.Integer.MAX_VALUE, concept));
2295    }
2296
2297    @Override
2298    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2299      switch (_hash) {
2300      case 3059181:
2301        /* code */ return new Property("code", "code",
2302            "A code - a text symbol - that uniquely identifies the concept within the code system.", 0, 1, code);
2303      case 1671764162:
2304        /* display */ return new Property("display", "string",
2305            "A human readable string that is the recommended default way to present this concept to a user.", 0, 1,
2306            display);
2307      case -1014418093:
2308        /* definition */ return new Property("definition", "string",
2309            "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.",
2310            0, 1, definition);
2311      case -900931593:
2312        /* designation */ return new Property("designation", "",
2313            "Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.",
2314            0, java.lang.Integer.MAX_VALUE, designation);
2315      case -993141291:
2316        /* property */ return new Property("property", "", "A property value for this concept.", 0,
2317            java.lang.Integer.MAX_VALUE, property);
2318      case 951024232:
2319        /* concept */ return new Property("concept", "@CodeSystem.concept",
2320            "Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.",
2321            0, java.lang.Integer.MAX_VALUE, concept);
2322      default:
2323        return super.getNamedProperty(_hash, _name, _checkValid);
2324      }
2325
2326    }
2327
2328    @Override
2329    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2330      switch (hash) {
2331      case 3059181:
2332        /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeType
2333      case 1671764162:
2334        /* display */ return this.display == null ? new Base[0] : new Base[] { this.display }; // StringType
2335      case -1014418093:
2336        /* definition */ return this.definition == null ? new Base[0] : new Base[] { this.definition }; // StringType
2337      case -900931593:
2338        /* designation */ return this.designation == null ? new Base[0]
2339            : this.designation.toArray(new Base[this.designation.size()]); // ConceptDefinitionDesignationComponent
2340      case -993141291:
2341        /* property */ return this.property == null ? new Base[0]
2342            : this.property.toArray(new Base[this.property.size()]); // ConceptPropertyComponent
2343      case 951024232:
2344        /* concept */ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptDefinitionComponent
2345      default:
2346        return super.getProperty(hash, name, checkValid);
2347      }
2348
2349    }
2350
2351    @Override
2352    public Base setProperty(int hash, String name, Base value) throws FHIRException {
2353      switch (hash) {
2354      case 3059181: // code
2355        this.code = castToCode(value); // CodeType
2356        return value;
2357      case 1671764162: // display
2358        this.display = castToString(value); // StringType
2359        return value;
2360      case -1014418093: // definition
2361        this.definition = castToString(value); // StringType
2362        return value;
2363      case -900931593: // designation
2364        this.getDesignation().add((ConceptDefinitionDesignationComponent) value); // ConceptDefinitionDesignationComponent
2365        return value;
2366      case -993141291: // property
2367        this.getProperty().add((ConceptPropertyComponent) value); // ConceptPropertyComponent
2368        return value;
2369      case 951024232: // concept
2370        this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent
2371        return value;
2372      default:
2373        return super.setProperty(hash, name, value);
2374      }
2375
2376    }
2377
2378    @Override
2379    public Base setProperty(String name, Base value) throws FHIRException {
2380      if (name.equals("code")) {
2381        this.code = castToCode(value); // CodeType
2382      } else if (name.equals("display")) {
2383        this.display = castToString(value); // StringType
2384      } else if (name.equals("definition")) {
2385        this.definition = castToString(value); // StringType
2386      } else if (name.equals("designation")) {
2387        this.getDesignation().add((ConceptDefinitionDesignationComponent) value);
2388      } else if (name.equals("property")) {
2389        this.getProperty().add((ConceptPropertyComponent) value);
2390      } else if (name.equals("concept")) {
2391        this.getConcept().add((ConceptDefinitionComponent) value);
2392      } else
2393        return super.setProperty(name, value);
2394      return value;
2395    }
2396
2397    @Override
2398    public Base makeProperty(int hash, String name) throws FHIRException {
2399      switch (hash) {
2400      case 3059181:
2401        return getCodeElement();
2402      case 1671764162:
2403        return getDisplayElement();
2404      case -1014418093:
2405        return getDefinitionElement();
2406      case -900931593:
2407        return addDesignation();
2408      case -993141291:
2409        return addProperty();
2410      case 951024232:
2411        return addConcept();
2412      default:
2413        return super.makeProperty(hash, name);
2414      }
2415
2416    }
2417
2418    @Override
2419    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2420      switch (hash) {
2421      case 3059181:
2422        /* code */ return new String[] { "code" };
2423      case 1671764162:
2424        /* display */ return new String[] { "string" };
2425      case -1014418093:
2426        /* definition */ return new String[] { "string" };
2427      case -900931593:
2428        /* designation */ return new String[] {};
2429      case -993141291:
2430        /* property */ return new String[] {};
2431      case 951024232:
2432        /* concept */ return new String[] { "@CodeSystem.concept" };
2433      default:
2434        return super.getTypesForProperty(hash, name);
2435      }
2436
2437    }
2438
2439    @Override
2440    public Base addChild(String name) throws FHIRException {
2441      if (name.equals("code")) {
2442        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.code");
2443      } else if (name.equals("display")) {
2444        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.display");
2445      } else if (name.equals("definition")) {
2446        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.definition");
2447      } else if (name.equals("designation")) {
2448        return addDesignation();
2449      } else if (name.equals("property")) {
2450        return addProperty();
2451      } else if (name.equals("concept")) {
2452        return addConcept();
2453      } else
2454        return super.addChild(name);
2455    }
2456
2457    public ConceptDefinitionComponent copy() {
2458      ConceptDefinitionComponent dst = new ConceptDefinitionComponent();
2459      copyValues(dst);
2460      return dst;
2461    }
2462
2463    public void copyValues(ConceptDefinitionComponent dst) {
2464      super.copyValues(dst);
2465      dst.code = code == null ? null : code.copy();
2466      dst.display = display == null ? null : display.copy();
2467      dst.definition = definition == null ? null : definition.copy();
2468      if (designation != null) {
2469        dst.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
2470        for (ConceptDefinitionDesignationComponent i : designation)
2471          dst.designation.add(i.copy());
2472      }
2473      ;
2474      if (property != null) {
2475        dst.property = new ArrayList<ConceptPropertyComponent>();
2476        for (ConceptPropertyComponent i : property)
2477          dst.property.add(i.copy());
2478      }
2479      ;
2480      if (concept != null) {
2481        dst.concept = new ArrayList<ConceptDefinitionComponent>();
2482        for (ConceptDefinitionComponent i : concept)
2483          dst.concept.add(i.copy());
2484      }
2485      ;
2486    }
2487
2488    @Override
2489    public boolean equalsDeep(Base other_) {
2490      if (!super.equalsDeep(other_))
2491        return false;
2492      if (!(other_ instanceof ConceptDefinitionComponent))
2493        return false;
2494      ConceptDefinitionComponent o = (ConceptDefinitionComponent) other_;
2495      return compareDeep(code, o.code, true) && compareDeep(display, o.display, true)
2496          && compareDeep(definition, o.definition, true) && compareDeep(designation, o.designation, true)
2497          && compareDeep(property, o.property, true) && compareDeep(concept, o.concept, true);
2498    }
2499
2500    @Override
2501    public boolean equalsShallow(Base other_) {
2502      if (!super.equalsShallow(other_))
2503        return false;
2504      if (!(other_ instanceof ConceptDefinitionComponent))
2505        return false;
2506      ConceptDefinitionComponent o = (ConceptDefinitionComponent) other_;
2507      return compareValues(code, o.code, true) && compareValues(display, o.display, true)
2508          && compareValues(definition, o.definition, true);
2509    }
2510
2511    public boolean isEmpty() {
2512      return super.isEmpty()
2513          && ca.uhn.fhir.util.ElementUtil.isEmpty(code, display, definition, designation, property, concept);
2514    }
2515
2516    public String fhirType() {
2517      return "CodeSystem.concept";
2518
2519    }
2520
2521  }
2522
2523  @Block()
2524  public static class ConceptDefinitionDesignationComponent extends BackboneElement implements IBaseBackboneElement {
2525    /**
2526     * The language this designation is defined for.
2527     */
2528    @Child(name = "language", type = { CodeType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
2529    @Description(shortDefinition = "Human language of the designation", formalDefinition = "The language this designation is defined for.")
2530    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/languages")
2531    protected CodeType language;
2532
2533    /**
2534     * A code that details how this designation would be used.
2535     */
2536    @Child(name = "use", type = { Coding.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
2537    @Description(shortDefinition = "Details how this designation would be used", formalDefinition = "A code that details how this designation would be used.")
2538    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/designation-use")
2539    protected Coding use;
2540
2541    /**
2542     * The text value for this designation.
2543     */
2544    @Child(name = "value", type = { StringType.class }, order = 3, min = 1, max = 1, modifier = false, summary = false)
2545    @Description(shortDefinition = "The text value for this designation", formalDefinition = "The text value for this designation.")
2546    protected StringType value;
2547
2548    private static final long serialVersionUID = 1515662414L;
2549
2550    /**
2551     * Constructor
2552     */
2553    public ConceptDefinitionDesignationComponent() {
2554      super();
2555    }
2556
2557    /**
2558     * Constructor
2559     */
2560    public ConceptDefinitionDesignationComponent(StringType value) {
2561      super();
2562      this.value = value;
2563    }
2564
2565    /**
2566     * @return {@link #language} (The language this designation is defined for.).
2567     *         This is the underlying object with id, value and extensions. The
2568     *         accessor "getLanguage" gives direct access to the value
2569     */
2570    public CodeType getLanguageElement() {
2571      if (this.language == null)
2572        if (Configuration.errorOnAutoCreate())
2573          throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language");
2574        else if (Configuration.doAutoCreate())
2575          this.language = new CodeType(); // bb
2576      return this.language;
2577    }
2578
2579    public boolean hasLanguageElement() {
2580      return this.language != null && !this.language.isEmpty();
2581    }
2582
2583    public boolean hasLanguage() {
2584      return this.language != null && !this.language.isEmpty();
2585    }
2586
2587    /**
2588     * @param value {@link #language} (The language this designation is defined
2589     *              for.). This is the underlying object with id, value and
2590     *              extensions. The accessor "getLanguage" gives direct access to
2591     *              the value
2592     */
2593    public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) {
2594      this.language = value;
2595      return this;
2596    }
2597
2598    /**
2599     * @return The language this designation is defined for.
2600     */
2601    public String getLanguage() {
2602      return this.language == null ? null : this.language.getValue();
2603    }
2604
2605    /**
2606     * @param value The language this designation is defined for.
2607     */
2608    public ConceptDefinitionDesignationComponent setLanguage(String value) {
2609      if (Utilities.noString(value))
2610        this.language = null;
2611      else {
2612        if (this.language == null)
2613          this.language = new CodeType();
2614        this.language.setValue(value);
2615      }
2616      return this;
2617    }
2618
2619    /**
2620     * @return {@link #use} (A code that details how this designation would be
2621     *         used.)
2622     */
2623    public Coding getUse() {
2624      if (this.use == null)
2625        if (Configuration.errorOnAutoCreate())
2626          throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use");
2627        else if (Configuration.doAutoCreate())
2628          this.use = new Coding(); // cc
2629      return this.use;
2630    }
2631
2632    public boolean hasUse() {
2633      return this.use != null && !this.use.isEmpty();
2634    }
2635
2636    /**
2637     * @param value {@link #use} (A code that details how this designation would be
2638     *              used.)
2639     */
2640    public ConceptDefinitionDesignationComponent setUse(Coding value) {
2641      this.use = value;
2642      return this;
2643    }
2644
2645    /**
2646     * @return {@link #value} (The text value for this designation.). This is the
2647     *         underlying object with id, value and extensions. The accessor
2648     *         "getValue" gives direct access to the value
2649     */
2650    public StringType getValueElement() {
2651      if (this.value == null)
2652        if (Configuration.errorOnAutoCreate())
2653          throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value");
2654        else if (Configuration.doAutoCreate())
2655          this.value = new StringType(); // bb
2656      return this.value;
2657    }
2658
2659    public boolean hasValueElement() {
2660      return this.value != null && !this.value.isEmpty();
2661    }
2662
2663    public boolean hasValue() {
2664      return this.value != null && !this.value.isEmpty();
2665    }
2666
2667    /**
2668     * @param value {@link #value} (The text value for this designation.). This is
2669     *              the underlying object with id, value and extensions. The
2670     *              accessor "getValue" gives direct access to the value
2671     */
2672    public ConceptDefinitionDesignationComponent setValueElement(StringType value) {
2673      this.value = value;
2674      return this;
2675    }
2676
2677    /**
2678     * @return The text value for this designation.
2679     */
2680    public String getValue() {
2681      return this.value == null ? null : this.value.getValue();
2682    }
2683
2684    /**
2685     * @param value The text value for this designation.
2686     */
2687    public ConceptDefinitionDesignationComponent setValue(String value) {
2688      if (this.value == null)
2689        this.value = new StringType();
2690      this.value.setValue(value);
2691      return this;
2692    }
2693
2694    protected void listChildren(List<Property> children) {
2695      super.listChildren(children);
2696      children.add(new Property("language", "code", "The language this designation is defined for.", 0, 1, language));
2697      children.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, 1, use));
2698      children.add(new Property("value", "string", "The text value for this designation.", 0, 1, value));
2699    }
2700
2701    @Override
2702    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2703      switch (_hash) {
2704      case -1613589672:
2705        /* language */ return new Property("language", "code", "The language this designation is defined for.", 0, 1,
2706            language);
2707      case 116103:
2708        /* use */ return new Property("use", "Coding", "A code that details how this designation would be used.", 0, 1,
2709            use);
2710      case 111972721:
2711        /* value */ return new Property("value", "string", "The text value for this designation.", 0, 1, value);
2712      default:
2713        return super.getNamedProperty(_hash, _name, _checkValid);
2714      }
2715
2716    }
2717
2718    @Override
2719    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2720      switch (hash) {
2721      case -1613589672:
2722        /* language */ return this.language == null ? new Base[0] : new Base[] { this.language }; // CodeType
2723      case 116103:
2724        /* use */ return this.use == null ? new Base[0] : new Base[] { this.use }; // Coding
2725      case 111972721:
2726        /* value */ return this.value == null ? new Base[0] : new Base[] { this.value }; // StringType
2727      default:
2728        return super.getProperty(hash, name, checkValid);
2729      }
2730
2731    }
2732
2733    @Override
2734    public Base setProperty(int hash, String name, Base value) throws FHIRException {
2735      switch (hash) {
2736      case -1613589672: // language
2737        this.language = castToCode(value); // CodeType
2738        return value;
2739      case 116103: // use
2740        this.use = castToCoding(value); // Coding
2741        return value;
2742      case 111972721: // value
2743        this.value = castToString(value); // StringType
2744        return value;
2745      default:
2746        return super.setProperty(hash, name, value);
2747      }
2748
2749    }
2750
2751    @Override
2752    public Base setProperty(String name, Base value) throws FHIRException {
2753      if (name.equals("language")) {
2754        this.language = castToCode(value); // CodeType
2755      } else if (name.equals("use")) {
2756        this.use = castToCoding(value); // Coding
2757      } else if (name.equals("value")) {
2758        this.value = castToString(value); // StringType
2759      } else
2760        return super.setProperty(name, value);
2761      return value;
2762    }
2763
2764    @Override
2765    public Base makeProperty(int hash, String name) throws FHIRException {
2766      switch (hash) {
2767      case -1613589672:
2768        return getLanguageElement();
2769      case 116103:
2770        return getUse();
2771      case 111972721:
2772        return getValueElement();
2773      default:
2774        return super.makeProperty(hash, name);
2775      }
2776
2777    }
2778
2779    @Override
2780    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2781      switch (hash) {
2782      case -1613589672:
2783        /* language */ return new String[] { "code" };
2784      case 116103:
2785        /* use */ return new String[] { "Coding" };
2786      case 111972721:
2787        /* value */ return new String[] { "string" };
2788      default:
2789        return super.getTypesForProperty(hash, name);
2790      }
2791
2792    }
2793
2794    @Override
2795    public Base addChild(String name) throws FHIRException {
2796      if (name.equals("language")) {
2797        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.language");
2798      } else if (name.equals("use")) {
2799        this.use = new Coding();
2800        return this.use;
2801      } else if (name.equals("value")) {
2802        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.value");
2803      } else
2804        return super.addChild(name);
2805    }
2806
2807    public ConceptDefinitionDesignationComponent copy() {
2808      ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent();
2809      copyValues(dst);
2810      return dst;
2811    }
2812
2813    public void copyValues(ConceptDefinitionDesignationComponent dst) {
2814      super.copyValues(dst);
2815      dst.language = language == null ? null : language.copy();
2816      dst.use = use == null ? null : use.copy();
2817      dst.value = value == null ? null : value.copy();
2818    }
2819
2820    @Override
2821    public boolean equalsDeep(Base other_) {
2822      if (!super.equalsDeep(other_))
2823        return false;
2824      if (!(other_ instanceof ConceptDefinitionDesignationComponent))
2825        return false;
2826      ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other_;
2827      return compareDeep(language, o.language, true) && compareDeep(use, o.use, true)
2828          && compareDeep(value, o.value, true);
2829    }
2830
2831    @Override
2832    public boolean equalsShallow(Base other_) {
2833      if (!super.equalsShallow(other_))
2834        return false;
2835      if (!(other_ instanceof ConceptDefinitionDesignationComponent))
2836        return false;
2837      ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other_;
2838      return compareValues(language, o.language, true) && compareValues(value, o.value, true);
2839    }
2840
2841    public boolean isEmpty() {
2842      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(language, use, value);
2843    }
2844
2845    public String fhirType() {
2846      return "CodeSystem.concept.designation";
2847
2848    }
2849
2850  }
2851
2852  @Block()
2853  public static class ConceptPropertyComponent extends BackboneElement implements IBaseBackboneElement {
2854    /**
2855     * A code that is a reference to CodeSystem.property.code.
2856     */
2857    @Child(name = "code", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
2858    @Description(shortDefinition = "Reference to CodeSystem.property.code", formalDefinition = "A code that is a reference to CodeSystem.property.code.")
2859    protected CodeType code;
2860
2861    /**
2862     * The value of this property.
2863     */
2864    @Child(name = "value", type = { CodeType.class, Coding.class, StringType.class, IntegerType.class,
2865        BooleanType.class, DateTimeType.class,
2866        DecimalType.class }, order = 2, min = 1, max = 1, modifier = false, summary = false)
2867    @Description(shortDefinition = "Value of the property for this concept", formalDefinition = "The value of this property.")
2868    protected Type value;
2869
2870    private static final long serialVersionUID = 1742812311L;
2871
2872    /**
2873     * Constructor
2874     */
2875    public ConceptPropertyComponent() {
2876      super();
2877    }
2878
2879    /**
2880     * Constructor
2881     */
2882    public ConceptPropertyComponent(CodeType code, Type value) {
2883      super();
2884      this.code = code;
2885      this.value = value;
2886    }
2887
2888    /**
2889     * @return {@link #code} (A code that is a reference to
2890     *         CodeSystem.property.code.). This is the underlying object with id,
2891     *         value and extensions. The accessor "getCode" gives direct access to
2892     *         the value
2893     */
2894    public CodeType getCodeElement() {
2895      if (this.code == null)
2896        if (Configuration.errorOnAutoCreate())
2897          throw new Error("Attempt to auto-create ConceptPropertyComponent.code");
2898        else if (Configuration.doAutoCreate())
2899          this.code = new CodeType(); // bb
2900      return this.code;
2901    }
2902
2903    public boolean hasCodeElement() {
2904      return this.code != null && !this.code.isEmpty();
2905    }
2906
2907    public boolean hasCode() {
2908      return this.code != null && !this.code.isEmpty();
2909    }
2910
2911    /**
2912     * @param value {@link #code} (A code that is a reference to
2913     *              CodeSystem.property.code.). This is the underlying object with
2914     *              id, value and extensions. The accessor "getCode" gives direct
2915     *              access to the value
2916     */
2917    public ConceptPropertyComponent setCodeElement(CodeType value) {
2918      this.code = value;
2919      return this;
2920    }
2921
2922    /**
2923     * @return A code that is a reference to CodeSystem.property.code.
2924     */
2925    public String getCode() {
2926      return this.code == null ? null : this.code.getValue();
2927    }
2928
2929    /**
2930     * @param value A code that is a reference to CodeSystem.property.code.
2931     */
2932    public ConceptPropertyComponent setCode(String value) {
2933      if (this.code == null)
2934        this.code = new CodeType();
2935      this.code.setValue(value);
2936      return this;
2937    }
2938
2939    /**
2940     * @return {@link #value} (The value of this property.)
2941     */
2942    public Type getValue() {
2943      return this.value;
2944    }
2945
2946    /**
2947     * @return {@link #value} (The value of this property.)
2948     */
2949    public CodeType getValueCodeType() throws FHIRException {
2950      if (this.value == null)
2951        this.value = new CodeType();
2952      if (!(this.value instanceof CodeType))
2953        throw new FHIRException("Type mismatch: the type CodeType was expected, but " + this.value.getClass().getName()
2954            + " was encountered");
2955      return (CodeType) this.value;
2956    }
2957
2958    public boolean hasValueCodeType() {
2959      return this != null && this.value instanceof CodeType;
2960    }
2961
2962    /**
2963     * @return {@link #value} (The value of this property.)
2964     */
2965    public Coding getValueCoding() throws FHIRException {
2966      if (this.value == null)
2967        this.value = new Coding();
2968      if (!(this.value instanceof Coding))
2969        throw new FHIRException(
2970            "Type mismatch: the type Coding was expected, but " + this.value.getClass().getName() + " was encountered");
2971      return (Coding) this.value;
2972    }
2973
2974    public boolean hasValueCoding() {
2975      return this != null && this.value instanceof Coding;
2976    }
2977
2978    /**
2979     * @return {@link #value} (The value of this property.)
2980     */
2981    public StringType getValueStringType() throws FHIRException {
2982      if (this.value == null)
2983        this.value = new StringType();
2984      if (!(this.value instanceof StringType))
2985        throw new FHIRException("Type mismatch: the type StringType was expected, but "
2986            + this.value.getClass().getName() + " was encountered");
2987      return (StringType) this.value;
2988    }
2989
2990    public boolean hasValueStringType() {
2991      return this != null && this.value instanceof StringType;
2992    }
2993
2994    /**
2995     * @return {@link #value} (The value of this property.)
2996     */
2997    public IntegerType getValueIntegerType() throws FHIRException {
2998      if (this.value == null)
2999        this.value = new IntegerType();
3000      if (!(this.value instanceof IntegerType))
3001        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "
3002            + this.value.getClass().getName() + " was encountered");
3003      return (IntegerType) this.value;
3004    }
3005
3006    public boolean hasValueIntegerType() {
3007      return this != null && this.value instanceof IntegerType;
3008    }
3009
3010    /**
3011     * @return {@link #value} (The value of this property.)
3012     */
3013    public BooleanType getValueBooleanType() throws FHIRException {
3014      if (this.value == null)
3015        this.value = new BooleanType();
3016      if (!(this.value instanceof BooleanType))
3017        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "
3018            + this.value.getClass().getName() + " was encountered");
3019      return (BooleanType) this.value;
3020    }
3021
3022    public boolean hasValueBooleanType() {
3023      return this != null && this.value instanceof BooleanType;
3024    }
3025
3026    /**
3027     * @return {@link #value} (The value of this property.)
3028     */
3029    public DateTimeType getValueDateTimeType() throws FHIRException {
3030      if (this.value == null)
3031        this.value = new DateTimeType();
3032      if (!(this.value instanceof DateTimeType))
3033        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
3034            + this.value.getClass().getName() + " was encountered");
3035      return (DateTimeType) this.value;
3036    }
3037
3038    public boolean hasValueDateTimeType() {
3039      return this != null && this.value instanceof DateTimeType;
3040    }
3041
3042    /**
3043     * @return {@link #value} (The value of this property.)
3044     */
3045    public DecimalType getValueDecimalType() throws FHIRException {
3046      if (this.value == null)
3047        this.value = new DecimalType();
3048      if (!(this.value instanceof DecimalType))
3049        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "
3050            + this.value.getClass().getName() + " was encountered");
3051      return (DecimalType) this.value;
3052    }
3053
3054    public boolean hasValueDecimalType() {
3055      return this != null && this.value instanceof DecimalType;
3056    }
3057
3058    public boolean hasValue() {
3059      return this.value != null && !this.value.isEmpty();
3060    }
3061
3062    /**
3063     * @param value {@link #value} (The value of this property.)
3064     */
3065    public ConceptPropertyComponent setValue(Type value) {
3066      if (value != null && !(value instanceof CodeType || value instanceof Coding || value instanceof StringType
3067          || value instanceof IntegerType || value instanceof BooleanType || value instanceof DateTimeType
3068          || value instanceof DecimalType))
3069        throw new Error("Not the right type for CodeSystem.concept.property.value[x]: " + value.fhirType());
3070      this.value = value;
3071      return this;
3072    }
3073
3074    protected void listChildren(List<Property> children) {
3075      super.listChildren(children);
3076      children.add(new Property("code", "code", "A code that is a reference to CodeSystem.property.code.", 0, 1, code));
3077      children.add(new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3078          "The value of this property.", 0, 1, value));
3079    }
3080
3081    @Override
3082    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3083      switch (_hash) {
3084      case 3059181:
3085        /* code */ return new Property("code", "code", "A code that is a reference to CodeSystem.property.code.", 0, 1,
3086            code);
3087      case -1410166417:
3088        /* value[x] */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3089            "The value of this property.", 0, 1, value);
3090      case 111972721:
3091        /* value */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3092            "The value of this property.", 0, 1, value);
3093      case -766209282:
3094        /* valueCode */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3095            "The value of this property.", 0, 1, value);
3096      case -1887705029:
3097        /* valueCoding */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3098            "The value of this property.", 0, 1, value);
3099      case -1424603934:
3100        /* valueString */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3101            "The value of this property.", 0, 1, value);
3102      case -1668204915:
3103        /* valueInteger */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3104            "The value of this property.", 0, 1, value);
3105      case 733421943:
3106        /* valueBoolean */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3107            "The value of this property.", 0, 1, value);
3108      case 1047929900:
3109        /* valueDateTime */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3110            "The value of this property.", 0, 1, value);
3111      case -2083993440:
3112        /* valueDecimal */ return new Property("value[x]", "code|Coding|string|integer|boolean|dateTime|decimal",
3113            "The value of this property.", 0, 1, value);
3114      default:
3115        return super.getNamedProperty(_hash, _name, _checkValid);
3116      }
3117
3118    }
3119
3120    @Override
3121    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3122      switch (hash) {
3123      case 3059181:
3124        /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeType
3125      case 111972721:
3126        /* value */ return this.value == null ? new Base[0] : new Base[] { this.value }; // Type
3127      default:
3128        return super.getProperty(hash, name, checkValid);
3129      }
3130
3131    }
3132
3133    @Override
3134    public Base setProperty(int hash, String name, Base value) throws FHIRException {
3135      switch (hash) {
3136      case 3059181: // code
3137        this.code = castToCode(value); // CodeType
3138        return value;
3139      case 111972721: // value
3140        this.value = castToType(value); // Type
3141        return value;
3142      default:
3143        return super.setProperty(hash, name, value);
3144      }
3145
3146    }
3147
3148    @Override
3149    public Base setProperty(String name, Base value) throws FHIRException {
3150      if (name.equals("code")) {
3151        this.code = castToCode(value); // CodeType
3152      } else if (name.equals("value[x]")) {
3153        this.value = castToType(value); // Type
3154      } else
3155        return super.setProperty(name, value);
3156      return value;
3157    }
3158
3159    @Override
3160    public Base makeProperty(int hash, String name) throws FHIRException {
3161      switch (hash) {
3162      case 3059181:
3163        return getCodeElement();
3164      case -1410166417:
3165        return getValue();
3166      case 111972721:
3167        return getValue();
3168      default:
3169        return super.makeProperty(hash, name);
3170      }
3171
3172    }
3173
3174    @Override
3175    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3176      switch (hash) {
3177      case 3059181:
3178        /* code */ return new String[] { "code" };
3179      case 111972721:
3180        /* value */ return new String[] { "code", "Coding", "string", "integer", "boolean", "dateTime", "decimal" };
3181      default:
3182        return super.getTypesForProperty(hash, name);
3183      }
3184
3185    }
3186
3187    @Override
3188    public Base addChild(String name) throws FHIRException {
3189      if (name.equals("code")) {
3190        throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.code");
3191      } else if (name.equals("valueCode")) {
3192        this.value = new CodeType();
3193        return this.value;
3194      } else if (name.equals("valueCoding")) {
3195        this.value = new Coding();
3196        return this.value;
3197      } else if (name.equals("valueString")) {
3198        this.value = new StringType();
3199        return this.value;
3200      } else if (name.equals("valueInteger")) {
3201        this.value = new IntegerType();
3202        return this.value;
3203      } else if (name.equals("valueBoolean")) {
3204        this.value = new BooleanType();
3205        return this.value;
3206      } else if (name.equals("valueDateTime")) {
3207        this.value = new DateTimeType();
3208        return this.value;
3209      } else if (name.equals("valueDecimal")) {
3210        this.value = new DecimalType();
3211        return this.value;
3212      } else
3213        return super.addChild(name);
3214    }
3215
3216    public ConceptPropertyComponent copy() {
3217      ConceptPropertyComponent dst = new ConceptPropertyComponent();
3218      copyValues(dst);
3219      return dst;
3220    }
3221
3222    public void copyValues(ConceptPropertyComponent dst) {
3223      super.copyValues(dst);
3224      dst.code = code == null ? null : code.copy();
3225      dst.value = value == null ? null : value.copy();
3226    }
3227
3228    @Override
3229    public boolean equalsDeep(Base other_) {
3230      if (!super.equalsDeep(other_))
3231        return false;
3232      if (!(other_ instanceof ConceptPropertyComponent))
3233        return false;
3234      ConceptPropertyComponent o = (ConceptPropertyComponent) other_;
3235      return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
3236    }
3237
3238    @Override
3239    public boolean equalsShallow(Base other_) {
3240      if (!super.equalsShallow(other_))
3241        return false;
3242      if (!(other_ instanceof ConceptPropertyComponent))
3243        return false;
3244      ConceptPropertyComponent o = (ConceptPropertyComponent) other_;
3245      return compareValues(code, o.code, true);
3246    }
3247
3248    public boolean isEmpty() {
3249      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
3250    }
3251
3252    public String fhirType() {
3253      return "CodeSystem.concept.property";
3254
3255    }
3256
3257  }
3258
3259  /**
3260   * A formal identifier that is used to identify this code system when it is
3261   * represented in other formats, or referenced in a specification, model, design
3262   * or an instance.
3263   */
3264  @Child(name = "identifier", type = {
3265      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3266  @Description(shortDefinition = "Additional identifier for the code system (business identifier)", 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.")
3267  protected List<Identifier> identifier;
3268
3269  /**
3270   * Explanation of why this code system is needed and why it has been designed as
3271   * it has.
3272   */
3273  @Child(name = "purpose", type = {
3274      MarkdownType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
3275  @Description(shortDefinition = "Why this code system is defined", formalDefinition = "Explanation of why this code system is needed and why it has been designed as it has.")
3276  protected MarkdownType purpose;
3277
3278  /**
3279   * A copyright statement relating to the code system and/or its contents.
3280   * Copyright statements are generally legal restrictions on the use and
3281   * publishing of the code system.
3282   */
3283  @Child(name = "copyright", type = {
3284      MarkdownType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
3285  @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.")
3286  protected MarkdownType copyright;
3287
3288  /**
3289   * If code comparison is case sensitive when codes within this system are
3290   * compared to each other.
3291   */
3292  @Child(name = "caseSensitive", type = {
3293      BooleanType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
3294  @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.")
3295  protected BooleanType caseSensitive;
3296
3297  /**
3298   * Canonical reference to the value set that contains the entire code system.
3299   */
3300  @Child(name = "valueSet", type = {
3301      CanonicalType.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
3302  @Description(shortDefinition = "Canonical reference to the value set with entire code system", formalDefinition = "Canonical reference to the value set that contains the entire code system.")
3303  protected CanonicalType valueSet;
3304
3305  /**
3306   * The meaning of the hierarchy of concepts as represented in this resource.
3307   */
3308  @Child(name = "hierarchyMeaning", type = {
3309      CodeType.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
3310  @Description(shortDefinition = "grouped-by | is-a | part-of | classified-with", formalDefinition = "The meaning of the hierarchy of concepts as represented in this resource.")
3311  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning")
3312  protected Enumeration<CodeSystemHierarchyMeaning> hierarchyMeaning;
3313
3314  /**
3315   * The code system defines a compositional (post-coordination) grammar.
3316   */
3317  @Child(name = "compositional", type = {
3318      BooleanType.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
3319  @Description(shortDefinition = "If code system defines a compositional grammar", formalDefinition = "The code system defines a compositional (post-coordination) grammar.")
3320  protected BooleanType compositional;
3321
3322  /**
3323   * This flag is used to signify that the code system does not commit to concept
3324   * permanence across versions. If true, a version must be specified when
3325   * referencing this code system.
3326   */
3327  @Child(name = "versionNeeded", type = {
3328      BooleanType.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
3329  @Description(shortDefinition = "If definitions are not stable", formalDefinition = "This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code system.")
3330  protected BooleanType versionNeeded;
3331
3332  /**
3333   * The extent of the content of the code system (the concepts and codes it
3334   * defines) are represented in this resource instance.
3335   */
3336  @Child(name = "content", type = { CodeType.class }, order = 8, min = 1, max = 1, modifier = false, summary = true)
3337  @Description(shortDefinition = "not-present | example | fragment | complete | supplement", formalDefinition = "The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instance.")
3338  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/codesystem-content-mode")
3339  protected Enumeration<CodeSystemContentMode> content;
3340
3341  /**
3342   * The canonical URL of the code system that this code system supplement is
3343   * adding designations and properties to.
3344   */
3345  @Child(name = "supplements", type = {
3346      CanonicalType.class }, order = 9, min = 0, max = 1, modifier = false, summary = true)
3347  @Description(shortDefinition = "Canonical URL of Code System this adds designations and properties to", formalDefinition = "The canonical URL of the code system that this code system supplement is adding designations and properties to.")
3348  protected CanonicalType supplements;
3349
3350  /**
3351   * The total number of concepts defined by the code system. Where the code
3352   * system has a compositional grammar, the basis of this count is defined by the
3353   * system steward.
3354   */
3355  @Child(name = "count", type = {
3356      UnsignedIntType.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
3357  @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 basis of this count is defined by the system steward.")
3358  protected UnsignedIntType count;
3359
3360  /**
3361   * A filter that can be used in a value set compose statement when selecting
3362   * concepts using a filter.
3363   */
3364  @Child(name = "filter", type = {}, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3365  @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.")
3366  protected List<CodeSystemFilterComponent> filter;
3367
3368  /**
3369   * A property defines an additional slot through which additional information
3370   * can be provided about a concept.
3371   */
3372  @Child(name = "property", type = {}, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3373  @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.")
3374  protected List<PropertyComponent> property;
3375
3376  /**
3377   * Concepts that are in the code system. The concept definitions are inherently
3378   * hierarchical, but the definitions must be consulted to determine what the
3379   * meanings of the hierarchical relationships are.
3380   */
3381  @Child(name = "concept", type = {}, order = 13, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
3382  @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 meanings of the hierarchical relationships are.")
3383  protected List<ConceptDefinitionComponent> concept;
3384
3385  private static final long serialVersionUID = -1735124584L;
3386
3387  /**
3388   * Constructor
3389   */
3390  public CodeSystem() {
3391    super();
3392  }
3393
3394  /**
3395   * Constructor
3396   */
3397  public CodeSystem(Enumeration<PublicationStatus> status, Enumeration<CodeSystemContentMode> content) {
3398    super();
3399    this.status = status;
3400    this.content = content;
3401  }
3402
3403  /**
3404   * @return {@link #url} (An absolute URI that is used to identify this code
3405   *         system when it is referenced in a specification, model, design or an
3406   *         instance; also called its canonical identifier. This SHOULD be
3407   *         globally unique and SHOULD be a literal address at which at which an
3408   *         authoritative instance of this code system is (or will be) published.
3409   *         This URL can be the target of a canonical reference. It SHALL remain
3410   *         the same when the code system is stored on different servers. This is
3411   *         used in [Coding](datatypes.html#Coding).system.). This is the
3412   *         underlying object with id, value and extensions. The accessor
3413   *         "getUrl" gives direct access to the value
3414   */
3415  public UriType getUrlElement() {
3416    if (this.url == null)
3417      if (Configuration.errorOnAutoCreate())
3418        throw new Error("Attempt to auto-create CodeSystem.url");
3419      else if (Configuration.doAutoCreate())
3420        this.url = new UriType(); // bb
3421    return this.url;
3422  }
3423
3424  public boolean hasUrlElement() {
3425    return this.url != null && !this.url.isEmpty();
3426  }
3427
3428  public boolean hasUrl() {
3429    return this.url != null && !this.url.isEmpty();
3430  }
3431
3432  /**
3433   * @param value {@link #url} (An absolute URI that is used to identify this code
3434   *              system when it is referenced in a specification, model, design
3435   *              or an instance; also called its canonical identifier. This
3436   *              SHOULD be globally unique and SHOULD be a literal address at
3437   *              which at which an authoritative instance of this code system is
3438   *              (or will be) published. This URL can be the target of a
3439   *              canonical reference. It SHALL remain the same when the code
3440   *              system is stored on different servers. This is used in
3441   *              [Coding](datatypes.html#Coding).system.). This is the underlying
3442   *              object with id, value and extensions. The accessor "getUrl"
3443   *              gives direct access to the value
3444   */
3445  public CodeSystem setUrlElement(UriType value) {
3446    this.url = value;
3447    return this;
3448  }
3449
3450  /**
3451   * @return An absolute URI that is used to identify this code system when it is
3452   *         referenced in a specification, model, design or an instance; also
3453   *         called its canonical identifier. This SHOULD be globally unique and
3454   *         SHOULD be a literal address at which at which an authoritative
3455   *         instance of this code system is (or will be) published. This URL can
3456   *         be the target of a canonical reference. It SHALL remain the same when
3457   *         the code system is stored on different servers. This is used in
3458   *         [Coding](datatypes.html#Coding).system.
3459   */
3460  public String getUrl() {
3461    return this.url == null ? null : this.url.getValue();
3462  }
3463
3464  /**
3465   * @param value An absolute URI that is used to identify this code system when
3466   *              it is referenced in a specification, model, design or an
3467   *              instance; also called its canonical identifier. This SHOULD be
3468   *              globally unique and SHOULD be a literal address at which at
3469   *              which an authoritative instance of this code system is (or will
3470   *              be) published. This URL can be the target of a canonical
3471   *              reference. It SHALL remain the same when the code system is
3472   *              stored on different servers. This is used in
3473   *              [Coding](datatypes.html#Coding).system.
3474   */
3475  public CodeSystem setUrl(String value) {
3476    if (Utilities.noString(value))
3477      this.url = null;
3478    else {
3479      if (this.url == null)
3480        this.url = new UriType();
3481      this.url.setValue(value);
3482    }
3483    return this;
3484  }
3485
3486  /**
3487   * @return {@link #identifier} (A formal identifier that is used to identify
3488   *         this code system when it is represented in other formats, or
3489   *         referenced in a specification, model, design or an instance.)
3490   */
3491  public List<Identifier> getIdentifier() {
3492    if (this.identifier == null)
3493      this.identifier = new ArrayList<Identifier>();
3494    return this.identifier;
3495  }
3496
3497  /**
3498   * @return Returns a reference to <code>this</code> for easy method chaining
3499   */
3500  public CodeSystem setIdentifier(List<Identifier> theIdentifier) {
3501    this.identifier = theIdentifier;
3502    return this;
3503  }
3504
3505  public boolean hasIdentifier() {
3506    if (this.identifier == null)
3507      return false;
3508    for (Identifier item : this.identifier)
3509      if (!item.isEmpty())
3510        return true;
3511    return false;
3512  }
3513
3514  public Identifier addIdentifier() { // 3
3515    Identifier t = new Identifier();
3516    if (this.identifier == null)
3517      this.identifier = new ArrayList<Identifier>();
3518    this.identifier.add(t);
3519    return t;
3520  }
3521
3522  public CodeSystem addIdentifier(Identifier t) { // 3
3523    if (t == null)
3524      return this;
3525    if (this.identifier == null)
3526      this.identifier = new ArrayList<Identifier>();
3527    this.identifier.add(t);
3528    return this;
3529  }
3530
3531  /**
3532   * @return The first repetition of repeating field {@link #identifier}, creating
3533   *         it if it does not already exist
3534   */
3535  public Identifier getIdentifierFirstRep() {
3536    if (getIdentifier().isEmpty()) {
3537      addIdentifier();
3538    }
3539    return getIdentifier().get(0);
3540  }
3541
3542  /**
3543   * @return {@link #version} (The identifier that is used to identify this
3544   *         version of the code system when it is referenced in a specification,
3545   *         model, design or instance. This is an arbitrary value managed by the
3546   *         code system author and is not expected to be globally unique. For
3547   *         example, it might be a timestamp (e.g. yyyymmdd) if a managed version
3548   *         is not available. There is also no expectation that versions can be
3549   *         placed in a lexicographical sequence. This is used in
3550   *         [Coding](datatypes.html#Coding).version.). This is the underlying
3551   *         object with id, value and extensions. The accessor "getVersion" gives
3552   *         direct access to the value
3553   */
3554  public StringType getVersionElement() {
3555    if (this.version == null)
3556      if (Configuration.errorOnAutoCreate())
3557        throw new Error("Attempt to auto-create CodeSystem.version");
3558      else if (Configuration.doAutoCreate())
3559        this.version = new StringType(); // bb
3560    return this.version;
3561  }
3562
3563  public boolean hasVersionElement() {
3564    return this.version != null && !this.version.isEmpty();
3565  }
3566
3567  public boolean hasVersion() {
3568    return this.version != null && !this.version.isEmpty();
3569  }
3570
3571  /**
3572   * @param value {@link #version} (The identifier that is used to identify this
3573   *              version of the code system when it is referenced in a
3574   *              specification, model, design or instance. This is an arbitrary
3575   *              value managed by the code system author and is not expected to
3576   *              be globally unique. For example, it might be a timestamp (e.g.
3577   *              yyyymmdd) if a managed version is not available. There is also
3578   *              no expectation that versions can be placed in a lexicographical
3579   *              sequence. This is used in
3580   *              [Coding](datatypes.html#Coding).version.). This is the
3581   *              underlying object with id, value and extensions. The accessor
3582   *              "getVersion" gives direct access to the value
3583   */
3584  public CodeSystem setVersionElement(StringType value) {
3585    this.version = value;
3586    return this;
3587  }
3588
3589  /**
3590   * @return The identifier that is used to identify this version of the code
3591   *         system when it is referenced in a specification, model, design or
3592   *         instance. This is an arbitrary value managed by the code system
3593   *         author and is not expected to be globally unique. For example, it
3594   *         might be a timestamp (e.g. yyyymmdd) if a managed version is not
3595   *         available. There is also no expectation that versions can be placed
3596   *         in a lexicographical sequence. This is used in
3597   *         [Coding](datatypes.html#Coding).version.
3598   */
3599  public String getVersion() {
3600    return this.version == null ? null : this.version.getValue();
3601  }
3602
3603  /**
3604   * @param value The identifier that is used to identify this version of the code
3605   *              system when it is referenced in a specification, model, design
3606   *              or instance. This is an arbitrary value managed by the code
3607   *              system author and is not expected to be globally unique. For
3608   *              example, it might be a timestamp (e.g. yyyymmdd) if a managed
3609   *              version is not available. There is also no expectation that
3610   *              versions can be placed in a lexicographical sequence. This is
3611   *              used in [Coding](datatypes.html#Coding).version.
3612   */
3613  public CodeSystem setVersion(String value) {
3614    if (Utilities.noString(value))
3615      this.version = null;
3616    else {
3617      if (this.version == null)
3618        this.version = new StringType();
3619      this.version.setValue(value);
3620    }
3621    return this;
3622  }
3623
3624  /**
3625   * @return {@link #name} (A natural language name identifying the code system.
3626   *         This name should be usable as an identifier for the module by machine
3627   *         processing applications such as code generation.). This is the
3628   *         underlying object with id, value and extensions. The accessor
3629   *         "getName" gives direct access to the value
3630   */
3631  public StringType getNameElement() {
3632    if (this.name == null)
3633      if (Configuration.errorOnAutoCreate())
3634        throw new Error("Attempt to auto-create CodeSystem.name");
3635      else if (Configuration.doAutoCreate())
3636        this.name = new StringType(); // bb
3637    return this.name;
3638  }
3639
3640  public boolean hasNameElement() {
3641    return this.name != null && !this.name.isEmpty();
3642  }
3643
3644  public boolean hasName() {
3645    return this.name != null && !this.name.isEmpty();
3646  }
3647
3648  /**
3649   * @param value {@link #name} (A natural language name identifying the code
3650   *              system. This name should be usable as an identifier for the
3651   *              module by machine processing applications such as code
3652   *              generation.). This is the underlying object with id, value and
3653   *              extensions. The accessor "getName" gives direct access to the
3654   *              value
3655   */
3656  public CodeSystem setNameElement(StringType value) {
3657    this.name = value;
3658    return this;
3659  }
3660
3661  /**
3662   * @return A natural language name identifying the code system. This name should
3663   *         be usable as an identifier for the module by machine processing
3664   *         applications such as code generation.
3665   */
3666  public String getName() {
3667    return this.name == null ? null : this.name.getValue();
3668  }
3669
3670  /**
3671   * @param value A natural language name identifying the code system. This name
3672   *              should be usable as an identifier for the module by machine
3673   *              processing applications such as code generation.
3674   */
3675  public CodeSystem setName(String value) {
3676    if (Utilities.noString(value))
3677      this.name = null;
3678    else {
3679      if (this.name == null)
3680        this.name = new StringType();
3681      this.name.setValue(value);
3682    }
3683    return this;
3684  }
3685
3686  /**
3687   * @return {@link #title} (A short, descriptive, user-friendly title for the
3688   *         code system.). This is the underlying object with id, value and
3689   *         extensions. The accessor "getTitle" gives direct access to the value
3690   */
3691  public StringType getTitleElement() {
3692    if (this.title == null)
3693      if (Configuration.errorOnAutoCreate())
3694        throw new Error("Attempt to auto-create CodeSystem.title");
3695      else if (Configuration.doAutoCreate())
3696        this.title = new StringType(); // bb
3697    return this.title;
3698  }
3699
3700  public boolean hasTitleElement() {
3701    return this.title != null && !this.title.isEmpty();
3702  }
3703
3704  public boolean hasTitle() {
3705    return this.title != null && !this.title.isEmpty();
3706  }
3707
3708  /**
3709   * @param value {@link #title} (A short, descriptive, user-friendly title for
3710   *              the code system.). This is the underlying object with id, value
3711   *              and extensions. The accessor "getTitle" gives direct access to
3712   *              the value
3713   */
3714  public CodeSystem setTitleElement(StringType value) {
3715    this.title = value;
3716    return this;
3717  }
3718
3719  /**
3720   * @return A short, descriptive, user-friendly title for the code system.
3721   */
3722  public String getTitle() {
3723    return this.title == null ? null : this.title.getValue();
3724  }
3725
3726  /**
3727   * @param value A short, descriptive, user-friendly title for the code system.
3728   */
3729  public CodeSystem setTitle(String value) {
3730    if (Utilities.noString(value))
3731      this.title = null;
3732    else {
3733      if (this.title == null)
3734        this.title = new StringType();
3735      this.title.setValue(value);
3736    }
3737    return this;
3738  }
3739
3740  /**
3741   * @return {@link #status} (The date (and optionally time) when the code system
3742   *         resource was created or revised.). This is the underlying object with
3743   *         id, value and extensions. The accessor "getStatus" gives direct
3744   *         access to the value
3745   */
3746  public Enumeration<PublicationStatus> getStatusElement() {
3747    if (this.status == null)
3748      if (Configuration.errorOnAutoCreate())
3749        throw new Error("Attempt to auto-create CodeSystem.status");
3750      else if (Configuration.doAutoCreate())
3751        this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
3752    return this.status;
3753  }
3754
3755  public boolean hasStatusElement() {
3756    return this.status != null && !this.status.isEmpty();
3757  }
3758
3759  public boolean hasStatus() {
3760    return this.status != null && !this.status.isEmpty();
3761  }
3762
3763  /**
3764   * @param value {@link #status} (The date (and optionally time) when the code
3765   *              system resource was created or revised.). This is the underlying
3766   *              object with id, value and extensions. The accessor "getStatus"
3767   *              gives direct access to the value
3768   */
3769  public CodeSystem setStatusElement(Enumeration<PublicationStatus> value) {
3770    this.status = value;
3771    return this;
3772  }
3773
3774  /**
3775   * @return The date (and optionally time) when the code system resource was
3776   *         created or revised.
3777   */
3778  public PublicationStatus getStatus() {
3779    return this.status == null ? null : this.status.getValue();
3780  }
3781
3782  /**
3783   * @param value The date (and optionally time) when the code system resource was
3784   *              created or revised.
3785   */
3786  public CodeSystem setStatus(PublicationStatus value) {
3787    if (this.status == null)
3788      this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
3789    this.status.setValue(value);
3790    return this;
3791  }
3792
3793  /**
3794   * @return {@link #experimental} (A Boolean value to indicate that this code
3795   *         system is authored for testing purposes (or
3796   *         education/evaluation/marketing) and is not intended to be used for
3797   *         genuine usage.). This is the underlying object with id, value and
3798   *         extensions. The accessor "getExperimental" gives direct access to the
3799   *         value
3800   */
3801  public BooleanType getExperimentalElement() {
3802    if (this.experimental == null)
3803      if (Configuration.errorOnAutoCreate())
3804        throw new Error("Attempt to auto-create CodeSystem.experimental");
3805      else if (Configuration.doAutoCreate())
3806        this.experimental = new BooleanType(); // bb
3807    return this.experimental;
3808  }
3809
3810  public boolean hasExperimentalElement() {
3811    return this.experimental != null && !this.experimental.isEmpty();
3812  }
3813
3814  public boolean hasExperimental() {
3815    return this.experimental != null && !this.experimental.isEmpty();
3816  }
3817
3818  /**
3819   * @param value {@link #experimental} (A Boolean value to indicate that this
3820   *              code system is authored for testing purposes (or
3821   *              education/evaluation/marketing) and is not intended to be used
3822   *              for genuine usage.). This is the underlying object with id,
3823   *              value and extensions. The accessor "getExperimental" gives
3824   *              direct access to the value
3825   */
3826  public CodeSystem setExperimentalElement(BooleanType value) {
3827    this.experimental = value;
3828    return this;
3829  }
3830
3831  /**
3832   * @return A Boolean value to indicate that this code system is authored for
3833   *         testing purposes (or education/evaluation/marketing) and is not
3834   *         intended to be used for genuine usage.
3835   */
3836  public boolean getExperimental() {
3837    return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
3838  }
3839
3840  /**
3841   * @param value A Boolean value to indicate that this code system is authored
3842   *              for testing purposes (or education/evaluation/marketing) and is
3843   *              not intended to be used for genuine usage.
3844   */
3845  public CodeSystem setExperimental(boolean value) {
3846    if (this.experimental == null)
3847      this.experimental = new BooleanType();
3848    this.experimental.setValue(value);
3849    return this;
3850  }
3851
3852  /**
3853   * @return {@link #date} (The date (and optionally time) when the code system
3854   *         was published. The date must change when the business version changes
3855   *         and it must change if the status code changes. In addition, it should
3856   *         change when the substantive content of the code system changes.).
3857   *         This is the underlying object with id, value and extensions. The
3858   *         accessor "getDate" gives direct access to the value
3859   */
3860  public DateTimeType getDateElement() {
3861    if (this.date == null)
3862      if (Configuration.errorOnAutoCreate())
3863        throw new Error("Attempt to auto-create CodeSystem.date");
3864      else if (Configuration.doAutoCreate())
3865        this.date = new DateTimeType(); // bb
3866    return this.date;
3867  }
3868
3869  public boolean hasDateElement() {
3870    return this.date != null && !this.date.isEmpty();
3871  }
3872
3873  public boolean hasDate() {
3874    return this.date != null && !this.date.isEmpty();
3875  }
3876
3877  /**
3878   * @param value {@link #date} (The date (and optionally time) when the code
3879   *              system was published. The date must change when the business
3880   *              version changes and it must change if the status code changes.
3881   *              In addition, it should change when the substantive content of
3882   *              the code system changes.). This is the underlying object with
3883   *              id, value and extensions. The accessor "getDate" gives direct
3884   *              access to the value
3885   */
3886  public CodeSystem setDateElement(DateTimeType value) {
3887    this.date = value;
3888    return this;
3889  }
3890
3891  /**
3892   * @return The date (and optionally time) when the code system was published.
3893   *         The date must change when the business version changes and it must
3894   *         change if the status code changes. In addition, it should change when
3895   *         the substantive content of the code system changes.
3896   */
3897  public Date getDate() {
3898    return this.date == null ? null : this.date.getValue();
3899  }
3900
3901  /**
3902   * @param value The date (and optionally time) when the code system was
3903   *              published. The date must change when the business version
3904   *              changes and it must change if the status code changes. In
3905   *              addition, it should change when the substantive content of the
3906   *              code system changes.
3907   */
3908  public CodeSystem setDate(Date value) {
3909    if (value == null)
3910      this.date = null;
3911    else {
3912      if (this.date == null)
3913        this.date = new DateTimeType();
3914      this.date.setValue(value);
3915    }
3916    return this;
3917  }
3918
3919  /**
3920   * @return {@link #publisher} (The name of the organization or individual that
3921   *         published the code system.). This is the underlying object with id,
3922   *         value and extensions. The accessor "getPublisher" gives direct access
3923   *         to the value
3924   */
3925  public StringType getPublisherElement() {
3926    if (this.publisher == null)
3927      if (Configuration.errorOnAutoCreate())
3928        throw new Error("Attempt to auto-create CodeSystem.publisher");
3929      else if (Configuration.doAutoCreate())
3930        this.publisher = new StringType(); // bb
3931    return this.publisher;
3932  }
3933
3934  public boolean hasPublisherElement() {
3935    return this.publisher != null && !this.publisher.isEmpty();
3936  }
3937
3938  public boolean hasPublisher() {
3939    return this.publisher != null && !this.publisher.isEmpty();
3940  }
3941
3942  /**
3943   * @param value {@link #publisher} (The name of the organization or individual
3944   *              that published the code system.). This is the underlying object
3945   *              with id, value and extensions. The accessor "getPublisher" gives
3946   *              direct access to the value
3947   */
3948  public CodeSystem setPublisherElement(StringType value) {
3949    this.publisher = value;
3950    return this;
3951  }
3952
3953  /**
3954   * @return The name of the organization or individual that published the code
3955   *         system.
3956   */
3957  public String getPublisher() {
3958    return this.publisher == null ? null : this.publisher.getValue();
3959  }
3960
3961  /**
3962   * @param value The name of the organization or individual that published the
3963   *              code system.
3964   */
3965  public CodeSystem setPublisher(String value) {
3966    if (Utilities.noString(value))
3967      this.publisher = null;
3968    else {
3969      if (this.publisher == null)
3970        this.publisher = new StringType();
3971      this.publisher.setValue(value);
3972    }
3973    return this;
3974  }
3975
3976  /**
3977   * @return {@link #contact} (Contact details to assist a user in finding and
3978   *         communicating with the publisher.)
3979   */
3980  public List<ContactDetail> getContact() {
3981    if (this.contact == null)
3982      this.contact = new ArrayList<ContactDetail>();
3983    return this.contact;
3984  }
3985
3986  /**
3987   * @return Returns a reference to <code>this</code> for easy method chaining
3988   */
3989  public CodeSystem setContact(List<ContactDetail> theContact) {
3990    this.contact = theContact;
3991    return this;
3992  }
3993
3994  public boolean hasContact() {
3995    if (this.contact == null)
3996      return false;
3997    for (ContactDetail item : this.contact)
3998      if (!item.isEmpty())
3999        return true;
4000    return false;
4001  }
4002
4003  public ContactDetail addContact() { // 3
4004    ContactDetail t = new ContactDetail();
4005    if (this.contact == null)
4006      this.contact = new ArrayList<ContactDetail>();
4007    this.contact.add(t);
4008    return t;
4009  }
4010
4011  public CodeSystem addContact(ContactDetail t) { // 3
4012    if (t == null)
4013      return this;
4014    if (this.contact == null)
4015      this.contact = new ArrayList<ContactDetail>();
4016    this.contact.add(t);
4017    return this;
4018  }
4019
4020  /**
4021   * @return The first repetition of repeating field {@link #contact}, creating it
4022   *         if it does not already exist
4023   */
4024  public ContactDetail getContactFirstRep() {
4025    if (getContact().isEmpty()) {
4026      addContact();
4027    }
4028    return getContact().get(0);
4029  }
4030
4031  /**
4032   * @return {@link #description} (A free text natural language description of the
4033   *         code system from a consumer's perspective.). This is the underlying
4034   *         object with id, value and extensions. The accessor "getDescription"
4035   *         gives direct access to the value
4036   */
4037  public MarkdownType getDescriptionElement() {
4038    if (this.description == null)
4039      if (Configuration.errorOnAutoCreate())
4040        throw new Error("Attempt to auto-create CodeSystem.description");
4041      else if (Configuration.doAutoCreate())
4042        this.description = new MarkdownType(); // bb
4043    return this.description;
4044  }
4045
4046  public boolean hasDescriptionElement() {
4047    return this.description != null && !this.description.isEmpty();
4048  }
4049
4050  public boolean hasDescription() {
4051    return this.description != null && !this.description.isEmpty();
4052  }
4053
4054  /**
4055   * @param value {@link #description} (A free text natural language description
4056   *              of the code system from a consumer's perspective.). This is the
4057   *              underlying object with id, value and extensions. The accessor
4058   *              "getDescription" gives direct access to the value
4059   */
4060  public CodeSystem setDescriptionElement(MarkdownType value) {
4061    this.description = value;
4062    return this;
4063  }
4064
4065  /**
4066   * @return A free text natural language description of the code system from a
4067   *         consumer's perspective.
4068   */
4069  public String getDescription() {
4070    return this.description == null ? null : this.description.getValue();
4071  }
4072
4073  /**
4074   * @param value A free text natural language description of the code system from
4075   *              a consumer's perspective.
4076   */
4077  public CodeSystem setDescription(String value) {
4078    if (value == null)
4079      this.description = null;
4080    else {
4081      if (this.description == null)
4082        this.description = new MarkdownType();
4083      this.description.setValue(value);
4084    }
4085    return this;
4086  }
4087
4088  /**
4089   * @return {@link #useContext} (The content was developed with a focus and
4090   *         intent of supporting the contexts that are listed. These contexts may
4091   *         be general categories (gender, age, ...) or may be references to
4092   *         specific programs (insurance plans, studies, ...) and may be used to
4093   *         assist with indexing and searching for appropriate code system
4094   *         instances.)
4095   */
4096  public List<UsageContext> getUseContext() {
4097    if (this.useContext == null)
4098      this.useContext = new ArrayList<UsageContext>();
4099    return this.useContext;
4100  }
4101
4102  /**
4103   * @return Returns a reference to <code>this</code> for easy method chaining
4104   */
4105  public CodeSystem setUseContext(List<UsageContext> theUseContext) {
4106    this.useContext = theUseContext;
4107    return this;
4108  }
4109
4110  public boolean hasUseContext() {
4111    if (this.useContext == null)
4112      return false;
4113    for (UsageContext item : this.useContext)
4114      if (!item.isEmpty())
4115        return true;
4116    return false;
4117  }
4118
4119  public UsageContext addUseContext() { // 3
4120    UsageContext t = new UsageContext();
4121    if (this.useContext == null)
4122      this.useContext = new ArrayList<UsageContext>();
4123    this.useContext.add(t);
4124    return t;
4125  }
4126
4127  public CodeSystem addUseContext(UsageContext t) { // 3
4128    if (t == null)
4129      return this;
4130    if (this.useContext == null)
4131      this.useContext = new ArrayList<UsageContext>();
4132    this.useContext.add(t);
4133    return this;
4134  }
4135
4136  /**
4137   * @return The first repetition of repeating field {@link #useContext}, creating
4138   *         it if it does not already exist
4139   */
4140  public UsageContext getUseContextFirstRep() {
4141    if (getUseContext().isEmpty()) {
4142      addUseContext();
4143    }
4144    return getUseContext().get(0);
4145  }
4146
4147  /**
4148   * @return {@link #jurisdiction} (A legal or geographic region in which the code
4149   *         system is intended to be used.)
4150   */
4151  public List<CodeableConcept> getJurisdiction() {
4152    if (this.jurisdiction == null)
4153      this.jurisdiction = new ArrayList<CodeableConcept>();
4154    return this.jurisdiction;
4155  }
4156
4157  /**
4158   * @return Returns a reference to <code>this</code> for easy method chaining
4159   */
4160  public CodeSystem setJurisdiction(List<CodeableConcept> theJurisdiction) {
4161    this.jurisdiction = theJurisdiction;
4162    return this;
4163  }
4164
4165  public boolean hasJurisdiction() {
4166    if (this.jurisdiction == null)
4167      return false;
4168    for (CodeableConcept item : this.jurisdiction)
4169      if (!item.isEmpty())
4170        return true;
4171    return false;
4172  }
4173
4174  public CodeableConcept addJurisdiction() { // 3
4175    CodeableConcept t = new CodeableConcept();
4176    if (this.jurisdiction == null)
4177      this.jurisdiction = new ArrayList<CodeableConcept>();
4178    this.jurisdiction.add(t);
4179    return t;
4180  }
4181
4182  public CodeSystem addJurisdiction(CodeableConcept t) { // 3
4183    if (t == null)
4184      return this;
4185    if (this.jurisdiction == null)
4186      this.jurisdiction = new ArrayList<CodeableConcept>();
4187    this.jurisdiction.add(t);
4188    return this;
4189  }
4190
4191  /**
4192   * @return The first repetition of repeating field {@link #jurisdiction},
4193   *         creating it if it does not already exist
4194   */
4195  public CodeableConcept getJurisdictionFirstRep() {
4196    if (getJurisdiction().isEmpty()) {
4197      addJurisdiction();
4198    }
4199    return getJurisdiction().get(0);
4200  }
4201
4202  /**
4203   * @return {@link #purpose} (Explanation of why this code system is needed and
4204   *         why it has been designed as it has.). This is the underlying object
4205   *         with id, value and extensions. The accessor "getPurpose" gives direct
4206   *         access to the value
4207   */
4208  public MarkdownType getPurposeElement() {
4209    if (this.purpose == null)
4210      if (Configuration.errorOnAutoCreate())
4211        throw new Error("Attempt to auto-create CodeSystem.purpose");
4212      else if (Configuration.doAutoCreate())
4213        this.purpose = new MarkdownType(); // bb
4214    return this.purpose;
4215  }
4216
4217  public boolean hasPurposeElement() {
4218    return this.purpose != null && !this.purpose.isEmpty();
4219  }
4220
4221  public boolean hasPurpose() {
4222    return this.purpose != null && !this.purpose.isEmpty();
4223  }
4224
4225  /**
4226   * @param value {@link #purpose} (Explanation of why this code system is needed
4227   *              and why it has been designed as it has.). This is the underlying
4228   *              object with id, value and extensions. The accessor "getPurpose"
4229   *              gives direct access to the value
4230   */
4231  public CodeSystem setPurposeElement(MarkdownType value) {
4232    this.purpose = value;
4233    return this;
4234  }
4235
4236  /**
4237   * @return Explanation of why this code system is needed and why it has been
4238   *         designed as it has.
4239   */
4240  public String getPurpose() {
4241    return this.purpose == null ? null : this.purpose.getValue();
4242  }
4243
4244  /**
4245   * @param value Explanation of why this code system is needed and why it has
4246   *              been designed as it has.
4247   */
4248  public CodeSystem setPurpose(String value) {
4249    if (value == null)
4250      this.purpose = null;
4251    else {
4252      if (this.purpose == null)
4253        this.purpose = new MarkdownType();
4254      this.purpose.setValue(value);
4255    }
4256    return this;
4257  }
4258
4259  /**
4260   * @return {@link #copyright} (A copyright statement relating to the code system
4261   *         and/or its contents. Copyright statements are generally legal
4262   *         restrictions on the use and publishing of the code system.). This is
4263   *         the underlying object with id, value and extensions. The accessor
4264   *         "getCopyright" gives direct access to the value
4265   */
4266  public MarkdownType getCopyrightElement() {
4267    if (this.copyright == null)
4268      if (Configuration.errorOnAutoCreate())
4269        throw new Error("Attempt to auto-create CodeSystem.copyright");
4270      else if (Configuration.doAutoCreate())
4271        this.copyright = new MarkdownType(); // bb
4272    return this.copyright;
4273  }
4274
4275  public boolean hasCopyrightElement() {
4276    return this.copyright != null && !this.copyright.isEmpty();
4277  }
4278
4279  public boolean hasCopyright() {
4280    return this.copyright != null && !this.copyright.isEmpty();
4281  }
4282
4283  /**
4284   * @param value {@link #copyright} (A copyright statement relating to the code
4285   *              system and/or its contents. Copyright statements are generally
4286   *              legal restrictions on the use and publishing of the code
4287   *              system.). This is the underlying object with id, value and
4288   *              extensions. The accessor "getCopyright" gives direct access to
4289   *              the value
4290   */
4291  public CodeSystem setCopyrightElement(MarkdownType value) {
4292    this.copyright = value;
4293    return this;
4294  }
4295
4296  /**
4297   * @return A copyright statement relating to the code system and/or its
4298   *         contents. Copyright statements are generally legal restrictions on
4299   *         the use and publishing of the code system.
4300   */
4301  public String getCopyright() {
4302    return this.copyright == null ? null : this.copyright.getValue();
4303  }
4304
4305  /**
4306   * @param value A copyright statement relating to the code system and/or its
4307   *              contents. Copyright statements are generally legal restrictions
4308   *              on the use and publishing of the code system.
4309   */
4310  public CodeSystem setCopyright(String value) {
4311    if (value == null)
4312      this.copyright = null;
4313    else {
4314      if (this.copyright == null)
4315        this.copyright = new MarkdownType();
4316      this.copyright.setValue(value);
4317    }
4318    return this;
4319  }
4320
4321  /**
4322   * @return {@link #caseSensitive} (If code comparison is case sensitive when
4323   *         codes within this system are compared to each other.). This is the
4324   *         underlying object with id, value and extensions. The accessor
4325   *         "getCaseSensitive" gives direct access to the value
4326   */
4327  public BooleanType getCaseSensitiveElement() {
4328    if (this.caseSensitive == null)
4329      if (Configuration.errorOnAutoCreate())
4330        throw new Error("Attempt to auto-create CodeSystem.caseSensitive");
4331      else if (Configuration.doAutoCreate())
4332        this.caseSensitive = new BooleanType(); // bb
4333    return this.caseSensitive;
4334  }
4335
4336  public boolean hasCaseSensitiveElement() {
4337    return this.caseSensitive != null && !this.caseSensitive.isEmpty();
4338  }
4339
4340  public boolean hasCaseSensitive() {
4341    return this.caseSensitive != null && !this.caseSensitive.isEmpty();
4342  }
4343
4344  /**
4345   * @param value {@link #caseSensitive} (If code comparison is case sensitive
4346   *              when codes within this system are compared to each other.). This
4347   *              is the underlying object with id, value and extensions. The
4348   *              accessor "getCaseSensitive" gives direct access to the value
4349   */
4350  public CodeSystem setCaseSensitiveElement(BooleanType value) {
4351    this.caseSensitive = value;
4352    return this;
4353  }
4354
4355  /**
4356   * @return If code comparison is case sensitive when codes within this system
4357   *         are compared to each other.
4358   */
4359  public boolean getCaseSensitive() {
4360    return this.caseSensitive == null || this.caseSensitive.isEmpty() ? false : this.caseSensitive.getValue();
4361  }
4362
4363  /**
4364   * @param value If code comparison is case sensitive when codes within this
4365   *              system are compared to each other.
4366   */
4367  public CodeSystem setCaseSensitive(boolean value) {
4368    if (this.caseSensitive == null)
4369      this.caseSensitive = new BooleanType();
4370    this.caseSensitive.setValue(value);
4371    return this;
4372  }
4373
4374  /**
4375   * @return {@link #valueSet} (Canonical reference to the value set that contains
4376   *         the entire code system.). This is the underlying object with id,
4377   *         value and extensions. The accessor "getValueSet" gives direct access
4378   *         to the value
4379   */
4380  public CanonicalType getValueSetElement() {
4381    if (this.valueSet == null)
4382      if (Configuration.errorOnAutoCreate())
4383        throw new Error("Attempt to auto-create CodeSystem.valueSet");
4384      else if (Configuration.doAutoCreate())
4385        this.valueSet = new CanonicalType(); // bb
4386    return this.valueSet;
4387  }
4388
4389  public boolean hasValueSetElement() {
4390    return this.valueSet != null && !this.valueSet.isEmpty();
4391  }
4392
4393  public boolean hasValueSet() {
4394    return this.valueSet != null && !this.valueSet.isEmpty();
4395  }
4396
4397  /**
4398   * @param value {@link #valueSet} (Canonical reference to the value set that
4399   *              contains the entire code system.). This is the underlying object
4400   *              with id, value and extensions. The accessor "getValueSet" gives
4401   *              direct access to the value
4402   */
4403  public CodeSystem setValueSetElement(CanonicalType value) {
4404    this.valueSet = value;
4405    return this;
4406  }
4407
4408  /**
4409   * @return Canonical reference to the value set that contains the entire code
4410   *         system.
4411   */
4412  public String getValueSet() {
4413    return this.valueSet == null ? null : this.valueSet.getValue();
4414  }
4415
4416  /**
4417   * @param value Canonical reference to the value set that contains the entire
4418   *              code system.
4419   */
4420  public CodeSystem setValueSet(String value) {
4421    if (Utilities.noString(value))
4422      this.valueSet = null;
4423    else {
4424      if (this.valueSet == null)
4425        this.valueSet = new CanonicalType();
4426      this.valueSet.setValue(value);
4427    }
4428    return this;
4429  }
4430
4431  /**
4432   * @return {@link #hierarchyMeaning} (The meaning of the hierarchy of concepts
4433   *         as represented in this resource.). This is the underlying object with
4434   *         id, value and extensions. The accessor "getHierarchyMeaning" gives
4435   *         direct access to the value
4436   */
4437  public Enumeration<CodeSystemHierarchyMeaning> getHierarchyMeaningElement() {
4438    if (this.hierarchyMeaning == null)
4439      if (Configuration.errorOnAutoCreate())
4440        throw new Error("Attempt to auto-create CodeSystem.hierarchyMeaning");
4441      else if (Configuration.doAutoCreate())
4442        this.hierarchyMeaning = new Enumeration<CodeSystemHierarchyMeaning>(
4443            new CodeSystemHierarchyMeaningEnumFactory()); // bb
4444    return this.hierarchyMeaning;
4445  }
4446
4447  public boolean hasHierarchyMeaningElement() {
4448    return this.hierarchyMeaning != null && !this.hierarchyMeaning.isEmpty();
4449  }
4450
4451  public boolean hasHierarchyMeaning() {
4452    return this.hierarchyMeaning != null && !this.hierarchyMeaning.isEmpty();
4453  }
4454
4455  /**
4456   * @param value {@link #hierarchyMeaning} (The meaning of the hierarchy of
4457   *              concepts as represented in this resource.). This is the
4458   *              underlying object with id, value and extensions. The accessor
4459   *              "getHierarchyMeaning" gives direct access to the value
4460   */
4461  public CodeSystem setHierarchyMeaningElement(Enumeration<CodeSystemHierarchyMeaning> value) {
4462    this.hierarchyMeaning = value;
4463    return this;
4464  }
4465
4466  /**
4467   * @return The meaning of the hierarchy of concepts as represented in this
4468   *         resource.
4469   */
4470  public CodeSystemHierarchyMeaning getHierarchyMeaning() {
4471    return this.hierarchyMeaning == null ? null : this.hierarchyMeaning.getValue();
4472  }
4473
4474  /**
4475   * @param value The meaning of the hierarchy of concepts as represented in this
4476   *              resource.
4477   */
4478  public CodeSystem setHierarchyMeaning(CodeSystemHierarchyMeaning value) {
4479    if (value == null)
4480      this.hierarchyMeaning = null;
4481    else {
4482      if (this.hierarchyMeaning == null)
4483        this.hierarchyMeaning = new Enumeration<CodeSystemHierarchyMeaning>(
4484            new CodeSystemHierarchyMeaningEnumFactory());
4485      this.hierarchyMeaning.setValue(value);
4486    }
4487    return this;
4488  }
4489
4490  /**
4491   * @return {@link #compositional} (The code system defines a compositional
4492   *         (post-coordination) grammar.). This is the underlying object with id,
4493   *         value and extensions. The accessor "getCompositional" gives direct
4494   *         access to the value
4495   */
4496  public BooleanType getCompositionalElement() {
4497    if (this.compositional == null)
4498      if (Configuration.errorOnAutoCreate())
4499        throw new Error("Attempt to auto-create CodeSystem.compositional");
4500      else if (Configuration.doAutoCreate())
4501        this.compositional = new BooleanType(); // bb
4502    return this.compositional;
4503  }
4504
4505  public boolean hasCompositionalElement() {
4506    return this.compositional != null && !this.compositional.isEmpty();
4507  }
4508
4509  public boolean hasCompositional() {
4510    return this.compositional != null && !this.compositional.isEmpty();
4511  }
4512
4513  /**
4514   * @param value {@link #compositional} (The code system defines a compositional
4515   *              (post-coordination) grammar.). This is the underlying object
4516   *              with id, value and extensions. The accessor "getCompositional"
4517   *              gives direct access to the value
4518   */
4519  public CodeSystem setCompositionalElement(BooleanType value) {
4520    this.compositional = value;
4521    return this;
4522  }
4523
4524  /**
4525   * @return The code system defines a compositional (post-coordination) grammar.
4526   */
4527  public boolean getCompositional() {
4528    return this.compositional == null || this.compositional.isEmpty() ? false : this.compositional.getValue();
4529  }
4530
4531  /**
4532   * @param value The code system defines a compositional (post-coordination)
4533   *              grammar.
4534   */
4535  public CodeSystem setCompositional(boolean value) {
4536    if (this.compositional == null)
4537      this.compositional = new BooleanType();
4538    this.compositional.setValue(value);
4539    return this;
4540  }
4541
4542  /**
4543   * @return {@link #versionNeeded} (This flag is used to signify that the code
4544   *         system does not commit to concept permanence across versions. If
4545   *         true, a version must be specified when referencing this code
4546   *         system.). This is the underlying object with id, value and
4547   *         extensions. The accessor "getVersionNeeded" gives direct access to
4548   *         the value
4549   */
4550  public BooleanType getVersionNeededElement() {
4551    if (this.versionNeeded == null)
4552      if (Configuration.errorOnAutoCreate())
4553        throw new Error("Attempt to auto-create CodeSystem.versionNeeded");
4554      else if (Configuration.doAutoCreate())
4555        this.versionNeeded = new BooleanType(); // bb
4556    return this.versionNeeded;
4557  }
4558
4559  public boolean hasVersionNeededElement() {
4560    return this.versionNeeded != null && !this.versionNeeded.isEmpty();
4561  }
4562
4563  public boolean hasVersionNeeded() {
4564    return this.versionNeeded != null && !this.versionNeeded.isEmpty();
4565  }
4566
4567  /**
4568   * @param value {@link #versionNeeded} (This flag is used to signify that the
4569   *              code system does not commit to concept permanence across
4570   *              versions. If true, a version must be specified when referencing
4571   *              this code system.). This is the underlying object with id, value
4572   *              and extensions. The accessor "getVersionNeeded" gives direct
4573   *              access to the value
4574   */
4575  public CodeSystem setVersionNeededElement(BooleanType value) {
4576    this.versionNeeded = value;
4577    return this;
4578  }
4579
4580  /**
4581   * @return This flag is used to signify that the code system does not commit to
4582   *         concept permanence across versions. If true, a version must be
4583   *         specified when referencing this code system.
4584   */
4585  public boolean getVersionNeeded() {
4586    return this.versionNeeded == null || this.versionNeeded.isEmpty() ? false : this.versionNeeded.getValue();
4587  }
4588
4589  /**
4590   * @param value This flag is used to signify that the code system does not
4591   *              commit to concept permanence across versions. If true, a version
4592   *              must be specified when referencing this code system.
4593   */
4594  public CodeSystem setVersionNeeded(boolean value) {
4595    if (this.versionNeeded == null)
4596      this.versionNeeded = new BooleanType();
4597    this.versionNeeded.setValue(value);
4598    return this;
4599  }
4600
4601  /**
4602   * @return {@link #content} (The extent of the content of the code system (the
4603   *         concepts and codes it defines) are represented in this resource
4604   *         instance.). This is the underlying object with id, value and
4605   *         extensions. The accessor "getContent" gives direct access to the
4606   *         value
4607   */
4608  public Enumeration<CodeSystemContentMode> getContentElement() {
4609    if (this.content == null)
4610      if (Configuration.errorOnAutoCreate())
4611        throw new Error("Attempt to auto-create CodeSystem.content");
4612      else if (Configuration.doAutoCreate())
4613        this.content = new Enumeration<CodeSystemContentMode>(new CodeSystemContentModeEnumFactory()); // bb
4614    return this.content;
4615  }
4616
4617  public boolean hasContentElement() {
4618    return this.content != null && !this.content.isEmpty();
4619  }
4620
4621  public boolean hasContent() {
4622    return this.content != null && !this.content.isEmpty();
4623  }
4624
4625  /**
4626   * @param value {@link #content} (The extent of the content of the code system
4627   *              (the concepts and codes it defines) are represented in this
4628   *              resource instance.). This is the underlying object with id,
4629   *              value and extensions. The accessor "getContent" gives direct
4630   *              access to the value
4631   */
4632  public CodeSystem setContentElement(Enumeration<CodeSystemContentMode> value) {
4633    this.content = value;
4634    return this;
4635  }
4636
4637  /**
4638   * @return The extent of the content of the code system (the concepts and codes
4639   *         it defines) are represented in this resource instance.
4640   */
4641  public CodeSystemContentMode getContent() {
4642    return this.content == null ? null : this.content.getValue();
4643  }
4644
4645  /**
4646   * @param value The extent of the content of the code system (the concepts and
4647   *              codes it defines) are represented in this resource instance.
4648   */
4649  public CodeSystem setContent(CodeSystemContentMode value) {
4650    if (this.content == null)
4651      this.content = new Enumeration<CodeSystemContentMode>(new CodeSystemContentModeEnumFactory());
4652    this.content.setValue(value);
4653    return this;
4654  }
4655
4656  /**
4657   * @return {@link #supplements} (The canonical URL of the code system that this
4658   *         code system supplement is adding designations and properties to.).
4659   *         This is the underlying object with id, value and extensions. The
4660   *         accessor "getSupplements" gives direct access to the value
4661   */
4662  public CanonicalType getSupplementsElement() {
4663    if (this.supplements == null)
4664      if (Configuration.errorOnAutoCreate())
4665        throw new Error("Attempt to auto-create CodeSystem.supplements");
4666      else if (Configuration.doAutoCreate())
4667        this.supplements = new CanonicalType(); // bb
4668    return this.supplements;
4669  }
4670
4671  public boolean hasSupplementsElement() {
4672    return this.supplements != null && !this.supplements.isEmpty();
4673  }
4674
4675  public boolean hasSupplements() {
4676    return this.supplements != null && !this.supplements.isEmpty();
4677  }
4678
4679  /**
4680   * @param value {@link #supplements} (The canonical URL of the code system that
4681   *              this code system supplement is adding designations and
4682   *              properties to.). This is the underlying object with id, value
4683   *              and extensions. The accessor "getSupplements" gives direct
4684   *              access to the value
4685   */
4686  public CodeSystem setSupplementsElement(CanonicalType value) {
4687    this.supplements = value;
4688    return this;
4689  }
4690
4691  /**
4692   * @return The canonical URL of the code system that this code system supplement
4693   *         is adding designations and properties to.
4694   */
4695  public String getSupplements() {
4696    return this.supplements == null ? null : this.supplements.getValue();
4697  }
4698
4699  /**
4700   * @param value The canonical URL of the code system that this code system
4701   *              supplement is adding designations and properties to.
4702   */
4703  public CodeSystem setSupplements(String value) {
4704    if (Utilities.noString(value))
4705      this.supplements = null;
4706    else {
4707      if (this.supplements == null)
4708        this.supplements = new CanonicalType();
4709      this.supplements.setValue(value);
4710    }
4711    return this;
4712  }
4713
4714  /**
4715   * @return {@link #count} (The total number of concepts defined by the code
4716   *         system. Where the code system has a compositional grammar, the basis
4717   *         of this count is defined by the system steward.). This is the
4718   *         underlying object with id, value and extensions. The accessor
4719   *         "getCount" gives direct access to the value
4720   */
4721  public UnsignedIntType getCountElement() {
4722    if (this.count == null)
4723      if (Configuration.errorOnAutoCreate())
4724        throw new Error("Attempt to auto-create CodeSystem.count");
4725      else if (Configuration.doAutoCreate())
4726        this.count = new UnsignedIntType(); // bb
4727    return this.count;
4728  }
4729
4730  public boolean hasCountElement() {
4731    return this.count != null && !this.count.isEmpty();
4732  }
4733
4734  public boolean hasCount() {
4735    return this.count != null && !this.count.isEmpty();
4736  }
4737
4738  /**
4739   * @param value {@link #count} (The total number of concepts defined by the code
4740   *              system. Where the code system has a compositional grammar, the
4741   *              basis of this count is defined by the system steward.). This is
4742   *              the underlying object with id, value and extensions. The
4743   *              accessor "getCount" gives direct access to the value
4744   */
4745  public CodeSystem setCountElement(UnsignedIntType value) {
4746    this.count = value;
4747    return this;
4748  }
4749
4750  /**
4751   * @return The total number of concepts defined by the code system. Where the
4752   *         code system has a compositional grammar, the basis of this count is
4753   *         defined by the system steward.
4754   */
4755  public int getCount() {
4756    return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue();
4757  }
4758
4759  /**
4760   * @param value The total number of concepts defined by the code system. Where
4761   *              the code system has a compositional grammar, the basis of this
4762   *              count is defined by the system steward.
4763   */
4764  public CodeSystem setCount(int value) {
4765    if (this.count == null)
4766      this.count = new UnsignedIntType();
4767    this.count.setValue(value);
4768    return this;
4769  }
4770
4771  /**
4772   * @return {@link #filter} (A filter that can be used in a value set compose
4773   *         statement when selecting concepts using a filter.)
4774   */
4775  public List<CodeSystemFilterComponent> getFilter() {
4776    if (this.filter == null)
4777      this.filter = new ArrayList<CodeSystemFilterComponent>();
4778    return this.filter;
4779  }
4780
4781  /**
4782   * @return Returns a reference to <code>this</code> for easy method chaining
4783   */
4784  public CodeSystem setFilter(List<CodeSystemFilterComponent> theFilter) {
4785    this.filter = theFilter;
4786    return this;
4787  }
4788
4789  public boolean hasFilter() {
4790    if (this.filter == null)
4791      return false;
4792    for (CodeSystemFilterComponent item : this.filter)
4793      if (!item.isEmpty())
4794        return true;
4795    return false;
4796  }
4797
4798  public CodeSystemFilterComponent addFilter() { // 3
4799    CodeSystemFilterComponent t = new CodeSystemFilterComponent();
4800    if (this.filter == null)
4801      this.filter = new ArrayList<CodeSystemFilterComponent>();
4802    this.filter.add(t);
4803    return t;
4804  }
4805
4806  public CodeSystem addFilter(CodeSystemFilterComponent t) { // 3
4807    if (t == null)
4808      return this;
4809    if (this.filter == null)
4810      this.filter = new ArrayList<CodeSystemFilterComponent>();
4811    this.filter.add(t);
4812    return this;
4813  }
4814
4815  /**
4816   * @return The first repetition of repeating field {@link #filter}, creating it
4817   *         if it does not already exist
4818   */
4819  public CodeSystemFilterComponent getFilterFirstRep() {
4820    if (getFilter().isEmpty()) {
4821      addFilter();
4822    }
4823    return getFilter().get(0);
4824  }
4825
4826  /**
4827   * @return {@link #property} (A property defines an additional slot through
4828   *         which additional information can be provided about a concept.)
4829   */
4830  public List<PropertyComponent> getProperty() {
4831    if (this.property == null)
4832      this.property = new ArrayList<PropertyComponent>();
4833    return this.property;
4834  }
4835
4836  /**
4837   * @return Returns a reference to <code>this</code> for easy method chaining
4838   */
4839  public CodeSystem setProperty(List<PropertyComponent> theProperty) {
4840    this.property = theProperty;
4841    return this;
4842  }
4843
4844  public boolean hasProperty() {
4845    if (this.property == null)
4846      return false;
4847    for (PropertyComponent item : this.property)
4848      if (!item.isEmpty())
4849        return true;
4850    return false;
4851  }
4852
4853  public PropertyComponent addProperty() { // 3
4854    PropertyComponent t = new PropertyComponent();
4855    if (this.property == null)
4856      this.property = new ArrayList<PropertyComponent>();
4857    this.property.add(t);
4858    return t;
4859  }
4860
4861  public CodeSystem addProperty(PropertyComponent t) { // 3
4862    if (t == null)
4863      return this;
4864    if (this.property == null)
4865      this.property = new ArrayList<PropertyComponent>();
4866    this.property.add(t);
4867    return this;
4868  }
4869
4870  /**
4871   * @return The first repetition of repeating field {@link #property}, creating
4872   *         it if it does not already exist
4873   */
4874  public PropertyComponent getPropertyFirstRep() {
4875    if (getProperty().isEmpty()) {
4876      addProperty();
4877    }
4878    return getProperty().get(0);
4879  }
4880
4881  /**
4882   * @return {@link #concept} (Concepts that are in the code system. The concept
4883   *         definitions are inherently hierarchical, but the definitions must be
4884   *         consulted to determine what the meanings of the hierarchical
4885   *         relationships are.)
4886   */
4887  public List<ConceptDefinitionComponent> getConcept() {
4888    if (this.concept == null)
4889      this.concept = new ArrayList<ConceptDefinitionComponent>();
4890    return this.concept;
4891  }
4892
4893  /**
4894   * @return Returns a reference to <code>this</code> for easy method chaining
4895   */
4896  public CodeSystem setConcept(List<ConceptDefinitionComponent> theConcept) {
4897    this.concept = theConcept;
4898    return this;
4899  }
4900
4901  public boolean hasConcept() {
4902    if (this.concept == null)
4903      return false;
4904    for (ConceptDefinitionComponent item : this.concept)
4905      if (!item.isEmpty())
4906        return true;
4907    return false;
4908  }
4909
4910  public ConceptDefinitionComponent addConcept() { // 3
4911    ConceptDefinitionComponent t = new ConceptDefinitionComponent();
4912    if (this.concept == null)
4913      this.concept = new ArrayList<ConceptDefinitionComponent>();
4914    this.concept.add(t);
4915    return t;
4916  }
4917
4918  public CodeSystem addConcept(ConceptDefinitionComponent t) { // 3
4919    if (t == null)
4920      return this;
4921    if (this.concept == null)
4922      this.concept = new ArrayList<ConceptDefinitionComponent>();
4923    this.concept.add(t);
4924    return this;
4925  }
4926
4927  /**
4928   * @return The first repetition of repeating field {@link #concept}, creating it
4929   *         if it does not already exist
4930   */
4931  public ConceptDefinitionComponent getConceptFirstRep() {
4932    if (getConcept().isEmpty()) {
4933      addConcept();
4934    }
4935    return getConcept().get(0);
4936  }
4937
4938  protected void listChildren(List<Property> children) {
4939    super.listChildren(children);
4940    children.add(new Property("url", "uri",
4941        "An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this code system is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the code system is stored on different servers. This is used in [Coding](datatypes.html#Coding).system.",
4942        0, 1, url));
4943    children.add(new Property("identifier", "Identifier",
4944        "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.",
4945        0, java.lang.Integer.MAX_VALUE, identifier));
4946    children.add(new Property("version", "string",
4947        "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.",
4948        0, 1, version));
4949    children.add(new Property("name", "string",
4950        "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.",
4951        0, 1, name));
4952    children.add(
4953        new Property("title", "string", "A short, descriptive, user-friendly title for the code system.", 0, 1, title));
4954    children.add(new Property("status", "code",
4955        "The date (and optionally time) when the code system resource was created or revised.", 0, 1, status));
4956    children.add(new Property("experimental", "boolean",
4957        "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.",
4958        0, 1, experimental));
4959    children.add(new Property("date", "dateTime",
4960        "The date  (and optionally time) when the code system was published. The date must change 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.",
4961        0, 1, date));
4962    children.add(new Property("publisher", "string",
4963        "The name of the organization or individual that published the code system.", 0, 1, publisher));
4964    children.add(new Property("contact", "ContactDetail",
4965        "Contact details to assist a user in finding and communicating with the publisher.", 0,
4966        java.lang.Integer.MAX_VALUE, contact));
4967    children.add(new Property("description", "markdown",
4968        "A free text natural language description of the code system from a consumer's perspective.", 0, 1,
4969        description));
4970    children.add(new Property("useContext", "UsageContext",
4971        "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate code system instances.",
4972        0, java.lang.Integer.MAX_VALUE, useContext));
4973    children.add(new Property("jurisdiction", "CodeableConcept",
4974        "A legal or geographic region in which the code system is intended to be used.", 0, java.lang.Integer.MAX_VALUE,
4975        jurisdiction));
4976    children.add(new Property("purpose", "markdown",
4977        "Explanation of why this code system is needed and why it has been designed as it has.", 0, 1, purpose));
4978    children.add(new Property("copyright", "markdown",
4979        "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.",
4980        0, 1, copyright));
4981    children.add(new Property("caseSensitive", "boolean",
4982        "If code comparison is case sensitive when codes within this system are compared to each other.", 0, 1,
4983        caseSensitive));
4984    children.add(new Property("valueSet", "canonical(ValueSet)",
4985        "Canonical reference to the value set that contains the entire code system.", 0, 1, valueSet));
4986    children.add(new Property("hierarchyMeaning", "code",
4987        "The meaning of the hierarchy of concepts as represented in this resource.", 0, 1, hierarchyMeaning));
4988    children.add(new Property("compositional", "boolean",
4989        "The code system defines a compositional (post-coordination) grammar.", 0, 1, compositional));
4990    children.add(new Property("versionNeeded", "boolean",
4991        "This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code system.",
4992        0, 1, versionNeeded));
4993    children.add(new Property("content", "code",
4994        "The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instance.",
4995        0, 1, content));
4996    children.add(new Property("supplements", "canonical(CodeSystem)",
4997        "The canonical URL of the code system that this code system supplement is adding designations and properties to.",
4998        0, 1, supplements));
4999    children.add(new Property("count", "unsignedInt",
5000        "The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system steward.",
5001        0, 1, count));
5002    children.add(new Property("filter", "",
5003        "A filter that can be used in a value set compose statement when selecting concepts using a filter.", 0,
5004        java.lang.Integer.MAX_VALUE, filter));
5005    children.add(new Property("property", "",
5006        "A property defines an additional slot through which additional information can be provided about a concept.",
5007        0, java.lang.Integer.MAX_VALUE, property));
5008    children.add(new Property("concept", "",
5009        "Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships are.",
5010        0, java.lang.Integer.MAX_VALUE, concept));
5011  }
5012
5013  @Override
5014  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5015    switch (_hash) {
5016    case 116079:
5017      /* url */ return new Property("url", "uri",
5018          "An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this code system is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the code system is stored on different servers. This is used in [Coding](datatypes.html#Coding).system.",
5019          0, 1, url);
5020    case -1618432855:
5021      /* identifier */ return new Property("identifier", "Identifier",
5022          "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.",
5023          0, java.lang.Integer.MAX_VALUE, identifier);
5024    case 351608024:
5025      /* version */ return new Property("version", "string",
5026          "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.",
5027          0, 1, version);
5028    case 3373707:
5029      /* name */ return new Property("name", "string",
5030          "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.",
5031          0, 1, name);
5032    case 110371416:
5033      /* title */ return new Property("title", "string",
5034          "A short, descriptive, user-friendly title for the code system.", 0, 1, title);
5035    case -892481550:
5036      /* status */ return new Property("status", "code",
5037          "The date (and optionally time) when the code system resource was created or revised.", 0, 1, status);
5038    case -404562712:
5039      /* experimental */ return new Property("experimental", "boolean",
5040          "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.",
5041          0, 1, experimental);
5042    case 3076014:
5043      /* date */ return new Property("date", "dateTime",
5044          "The date  (and optionally time) when the code system was published. The date must change 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.",
5045          0, 1, date);
5046    case 1447404028:
5047      /* publisher */ return new Property("publisher", "string",
5048          "The name of the organization or individual that published the code system.", 0, 1, publisher);
5049    case 951526432:
5050      /* contact */ return new Property("contact", "ContactDetail",
5051          "Contact details to assist a user in finding and communicating with the publisher.", 0,
5052          java.lang.Integer.MAX_VALUE, contact);
5053    case -1724546052:
5054      /* description */ return new Property("description", "markdown",
5055          "A free text natural language description of the code system from a consumer's perspective.", 0, 1,
5056          description);
5057    case -669707736:
5058      /* useContext */ return new Property("useContext", "UsageContext",
5059          "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate code system instances.",
5060          0, java.lang.Integer.MAX_VALUE, useContext);
5061    case -507075711:
5062      /* jurisdiction */ return new Property("jurisdiction", "CodeableConcept",
5063          "A legal or geographic region in which the code system is intended to be used.", 0,
5064          java.lang.Integer.MAX_VALUE, jurisdiction);
5065    case -220463842:
5066      /* purpose */ return new Property("purpose", "markdown",
5067          "Explanation of why this code system is needed and why it has been designed as it has.", 0, 1, purpose);
5068    case 1522889671:
5069      /* copyright */ return new Property("copyright", "markdown",
5070          "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.",
5071          0, 1, copyright);
5072    case -35616442:
5073      /* caseSensitive */ return new Property("caseSensitive", "boolean",
5074          "If code comparison is case sensitive when codes within this system are compared to each other.", 0, 1,
5075          caseSensitive);
5076    case -1410174671:
5077      /* valueSet */ return new Property("valueSet", "canonical(ValueSet)",
5078          "Canonical reference to the value set that contains the entire code system.", 0, 1, valueSet);
5079    case 1913078280:
5080      /* hierarchyMeaning */ return new Property("hierarchyMeaning", "code",
5081          "The meaning of the hierarchy of concepts as represented in this resource.", 0, 1, hierarchyMeaning);
5082    case 1248023381:
5083      /* compositional */ return new Property("compositional", "boolean",
5084          "The code system defines a compositional (post-coordination) grammar.", 0, 1, compositional);
5085    case 617270957:
5086      /* versionNeeded */ return new Property("versionNeeded", "boolean",
5087          "This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code system.",
5088          0, 1, versionNeeded);
5089    case 951530617:
5090      /* content */ return new Property("content", "code",
5091          "The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instance.",
5092          0, 1, content);
5093    case -596951334:
5094      /* supplements */ return new Property("supplements", "canonical(CodeSystem)",
5095          "The canonical URL of the code system that this code system supplement is adding designations and properties to.",
5096          0, 1, supplements);
5097    case 94851343:
5098      /* count */ return new Property("count", "unsignedInt",
5099          "The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system steward.",
5100          0, 1, count);
5101    case -1274492040:
5102      /* filter */ return new Property("filter", "",
5103          "A filter that can be used in a value set compose statement when selecting concepts using a filter.", 0,
5104          java.lang.Integer.MAX_VALUE, filter);
5105    case -993141291:
5106      /* property */ return new Property("property", "",
5107          "A property defines an additional slot through which additional information can be provided about a concept.",
5108          0, java.lang.Integer.MAX_VALUE, property);
5109    case 951024232:
5110      /* concept */ return new Property("concept", "",
5111          "Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships are.",
5112          0, java.lang.Integer.MAX_VALUE, concept);
5113    default:
5114      return super.getNamedProperty(_hash, _name, _checkValid);
5115    }
5116
5117  }
5118
5119  @Override
5120  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5121    switch (hash) {
5122    case 116079:
5123      /* url */ return this.url == null ? new Base[0] : new Base[] { this.url }; // UriType
5124    case -1618432855:
5125      /* identifier */ return this.identifier == null ? new Base[0]
5126          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
5127    case 351608024:
5128      /* version */ return this.version == null ? new Base[0] : new Base[] { this.version }; // StringType
5129    case 3373707:
5130      /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // StringType
5131    case 110371416:
5132      /* title */ return this.title == null ? new Base[0] : new Base[] { this.title }; // StringType
5133    case -892481550:
5134      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<PublicationStatus>
5135    case -404562712:
5136      /* experimental */ return this.experimental == null ? new Base[0] : new Base[] { this.experimental }; // BooleanType
5137    case 3076014:
5138      /* date */ return this.date == null ? new Base[0] : new Base[] { this.date }; // DateTimeType
5139    case 1447404028:
5140      /* publisher */ return this.publisher == null ? new Base[0] : new Base[] { this.publisher }; // StringType
5141    case 951526432:
5142      /* contact */ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
5143    case -1724546052:
5144      /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // MarkdownType
5145    case -669707736:
5146      /* useContext */ return this.useContext == null ? new Base[0]
5147          : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
5148    case -507075711:
5149      /* jurisdiction */ return this.jurisdiction == null ? new Base[0]
5150          : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
5151    case -220463842:
5152      /* purpose */ return this.purpose == null ? new Base[0] : new Base[] { this.purpose }; // MarkdownType
5153    case 1522889671:
5154      /* copyright */ return this.copyright == null ? new Base[0] : new Base[] { this.copyright }; // MarkdownType
5155    case -35616442:
5156      /* caseSensitive */ return this.caseSensitive == null ? new Base[0] : new Base[] { this.caseSensitive }; // BooleanType
5157    case -1410174671:
5158      /* valueSet */ return this.valueSet == null ? new Base[0] : new Base[] { this.valueSet }; // CanonicalType
5159    case 1913078280:
5160      /* hierarchyMeaning */ return this.hierarchyMeaning == null ? new Base[0] : new Base[] { this.hierarchyMeaning }; // Enumeration<CodeSystemHierarchyMeaning>
5161    case 1248023381:
5162      /* compositional */ return this.compositional == null ? new Base[0] : new Base[] { this.compositional }; // BooleanType
5163    case 617270957:
5164      /* versionNeeded */ return this.versionNeeded == null ? new Base[0] : new Base[] { this.versionNeeded }; // BooleanType
5165    case 951530617:
5166      /* content */ return this.content == null ? new Base[0] : new Base[] { this.content }; // Enumeration<CodeSystemContentMode>
5167    case -596951334:
5168      /* supplements */ return this.supplements == null ? new Base[0] : new Base[] { this.supplements }; // CanonicalType
5169    case 94851343:
5170      /* count */ return this.count == null ? new Base[0] : new Base[] { this.count }; // UnsignedIntType
5171    case -1274492040:
5172      /* filter */ return this.filter == null ? new Base[0] : this.filter.toArray(new Base[this.filter.size()]); // CodeSystemFilterComponent
5173    case -993141291:
5174      /* property */ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // PropertyComponent
5175    case 951024232:
5176      /* concept */ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptDefinitionComponent
5177    default:
5178      return super.getProperty(hash, name, checkValid);
5179    }
5180
5181  }
5182
5183  @Override
5184  public Base setProperty(int hash, String name, Base value) throws FHIRException {
5185    switch (hash) {
5186    case 116079: // url
5187      this.url = castToUri(value); // UriType
5188      return value;
5189    case -1618432855: // identifier
5190      this.getIdentifier().add(castToIdentifier(value)); // Identifier
5191      return value;
5192    case 351608024: // version
5193      this.version = castToString(value); // StringType
5194      return value;
5195    case 3373707: // name
5196      this.name = castToString(value); // StringType
5197      return value;
5198    case 110371416: // title
5199      this.title = castToString(value); // StringType
5200      return value;
5201    case -892481550: // status
5202      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
5203      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
5204      return value;
5205    case -404562712: // experimental
5206      this.experimental = castToBoolean(value); // BooleanType
5207      return value;
5208    case 3076014: // date
5209      this.date = castToDateTime(value); // DateTimeType
5210      return value;
5211    case 1447404028: // publisher
5212      this.publisher = castToString(value); // StringType
5213      return value;
5214    case 951526432: // contact
5215      this.getContact().add(castToContactDetail(value)); // ContactDetail
5216      return value;
5217    case -1724546052: // description
5218      this.description = castToMarkdown(value); // MarkdownType
5219      return value;
5220    case -669707736: // useContext
5221      this.getUseContext().add(castToUsageContext(value)); // UsageContext
5222      return value;
5223    case -507075711: // jurisdiction
5224      this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
5225      return value;
5226    case -220463842: // purpose
5227      this.purpose = castToMarkdown(value); // MarkdownType
5228      return value;
5229    case 1522889671: // copyright
5230      this.copyright = castToMarkdown(value); // MarkdownType
5231      return value;
5232    case -35616442: // caseSensitive
5233      this.caseSensitive = castToBoolean(value); // BooleanType
5234      return value;
5235    case -1410174671: // valueSet
5236      this.valueSet = castToCanonical(value); // CanonicalType
5237      return value;
5238    case 1913078280: // hierarchyMeaning
5239      value = new CodeSystemHierarchyMeaningEnumFactory().fromType(castToCode(value));
5240      this.hierarchyMeaning = (Enumeration) value; // Enumeration<CodeSystemHierarchyMeaning>
5241      return value;
5242    case 1248023381: // compositional
5243      this.compositional = castToBoolean(value); // BooleanType
5244      return value;
5245    case 617270957: // versionNeeded
5246      this.versionNeeded = castToBoolean(value); // BooleanType
5247      return value;
5248    case 951530617: // content
5249      value = new CodeSystemContentModeEnumFactory().fromType(castToCode(value));
5250      this.content = (Enumeration) value; // Enumeration<CodeSystemContentMode>
5251      return value;
5252    case -596951334: // supplements
5253      this.supplements = castToCanonical(value); // CanonicalType
5254      return value;
5255    case 94851343: // count
5256      this.count = castToUnsignedInt(value); // UnsignedIntType
5257      return value;
5258    case -1274492040: // filter
5259      this.getFilter().add((CodeSystemFilterComponent) value); // CodeSystemFilterComponent
5260      return value;
5261    case -993141291: // property
5262      this.getProperty().add((PropertyComponent) value); // PropertyComponent
5263      return value;
5264    case 951024232: // concept
5265      this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent
5266      return value;
5267    default:
5268      return super.setProperty(hash, name, value);
5269    }
5270
5271  }
5272
5273  @Override
5274  public Base setProperty(String name, Base value) throws FHIRException {
5275    if (name.equals("url")) {
5276      this.url = castToUri(value); // UriType
5277    } else if (name.equals("identifier")) {
5278      this.getIdentifier().add(castToIdentifier(value));
5279    } else if (name.equals("version")) {
5280      this.version = castToString(value); // StringType
5281    } else if (name.equals("name")) {
5282      this.name = castToString(value); // StringType
5283    } else if (name.equals("title")) {
5284      this.title = castToString(value); // StringType
5285    } else if (name.equals("status")) {
5286      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
5287      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
5288    } else if (name.equals("experimental")) {
5289      this.experimental = castToBoolean(value); // BooleanType
5290    } else if (name.equals("date")) {
5291      this.date = castToDateTime(value); // DateTimeType
5292    } else if (name.equals("publisher")) {
5293      this.publisher = castToString(value); // StringType
5294    } else if (name.equals("contact")) {
5295      this.getContact().add(castToContactDetail(value));
5296    } else if (name.equals("description")) {
5297      this.description = castToMarkdown(value); // MarkdownType
5298    } else if (name.equals("useContext")) {
5299      this.getUseContext().add(castToUsageContext(value));
5300    } else if (name.equals("jurisdiction")) {
5301      this.getJurisdiction().add(castToCodeableConcept(value));
5302    } else if (name.equals("purpose")) {
5303      this.purpose = castToMarkdown(value); // MarkdownType
5304    } else if (name.equals("copyright")) {
5305      this.copyright = castToMarkdown(value); // MarkdownType
5306    } else if (name.equals("caseSensitive")) {
5307      this.caseSensitive = castToBoolean(value); // BooleanType
5308    } else if (name.equals("valueSet")) {
5309      this.valueSet = castToCanonical(value); // CanonicalType
5310    } else if (name.equals("hierarchyMeaning")) {
5311      value = new CodeSystemHierarchyMeaningEnumFactory().fromType(castToCode(value));
5312      this.hierarchyMeaning = (Enumeration) value; // Enumeration<CodeSystemHierarchyMeaning>
5313    } else if (name.equals("compositional")) {
5314      this.compositional = castToBoolean(value); // BooleanType
5315    } else if (name.equals("versionNeeded")) {
5316      this.versionNeeded = castToBoolean(value); // BooleanType
5317    } else if (name.equals("content")) {
5318      value = new CodeSystemContentModeEnumFactory().fromType(castToCode(value));
5319      this.content = (Enumeration) value; // Enumeration<CodeSystemContentMode>
5320    } else if (name.equals("supplements")) {
5321      this.supplements = castToCanonical(value); // CanonicalType
5322    } else if (name.equals("count")) {
5323      this.count = castToUnsignedInt(value); // UnsignedIntType
5324    } else if (name.equals("filter")) {
5325      this.getFilter().add((CodeSystemFilterComponent) value);
5326    } else if (name.equals("property")) {
5327      this.getProperty().add((PropertyComponent) value);
5328    } else if (name.equals("concept")) {
5329      this.getConcept().add((ConceptDefinitionComponent) value);
5330    } else
5331      return super.setProperty(name, value);
5332    return value;
5333  }
5334
5335  @Override
5336  public Base makeProperty(int hash, String name) throws FHIRException {
5337    switch (hash) {
5338    case 116079:
5339      return getUrlElement();
5340    case -1618432855:
5341      return addIdentifier();
5342    case 351608024:
5343      return getVersionElement();
5344    case 3373707:
5345      return getNameElement();
5346    case 110371416:
5347      return getTitleElement();
5348    case -892481550:
5349      return getStatusElement();
5350    case -404562712:
5351      return getExperimentalElement();
5352    case 3076014:
5353      return getDateElement();
5354    case 1447404028:
5355      return getPublisherElement();
5356    case 951526432:
5357      return addContact();
5358    case -1724546052:
5359      return getDescriptionElement();
5360    case -669707736:
5361      return addUseContext();
5362    case -507075711:
5363      return addJurisdiction();
5364    case -220463842:
5365      return getPurposeElement();
5366    case 1522889671:
5367      return getCopyrightElement();
5368    case -35616442:
5369      return getCaseSensitiveElement();
5370    case -1410174671:
5371      return getValueSetElement();
5372    case 1913078280:
5373      return getHierarchyMeaningElement();
5374    case 1248023381:
5375      return getCompositionalElement();
5376    case 617270957:
5377      return getVersionNeededElement();
5378    case 951530617:
5379      return getContentElement();
5380    case -596951334:
5381      return getSupplementsElement();
5382    case 94851343:
5383      return getCountElement();
5384    case -1274492040:
5385      return addFilter();
5386    case -993141291:
5387      return addProperty();
5388    case 951024232:
5389      return addConcept();
5390    default:
5391      return super.makeProperty(hash, name);
5392    }
5393
5394  }
5395
5396  @Override
5397  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5398    switch (hash) {
5399    case 116079:
5400      /* url */ return new String[] { "uri" };
5401    case -1618432855:
5402      /* identifier */ return new String[] { "Identifier" };
5403    case 351608024:
5404      /* version */ return new String[] { "string" };
5405    case 3373707:
5406      /* name */ return new String[] { "string" };
5407    case 110371416:
5408      /* title */ return new String[] { "string" };
5409    case -892481550:
5410      /* status */ return new String[] { "code" };
5411    case -404562712:
5412      /* experimental */ return new String[] { "boolean" };
5413    case 3076014:
5414      /* date */ return new String[] { "dateTime" };
5415    case 1447404028:
5416      /* publisher */ return new String[] { "string" };
5417    case 951526432:
5418      /* contact */ return new String[] { "ContactDetail" };
5419    case -1724546052:
5420      /* description */ return new String[] { "markdown" };
5421    case -669707736:
5422      /* useContext */ return new String[] { "UsageContext" };
5423    case -507075711:
5424      /* jurisdiction */ return new String[] { "CodeableConcept" };
5425    case -220463842:
5426      /* purpose */ return new String[] { "markdown" };
5427    case 1522889671:
5428      /* copyright */ return new String[] { "markdown" };
5429    case -35616442:
5430      /* caseSensitive */ return new String[] { "boolean" };
5431    case -1410174671:
5432      /* valueSet */ return new String[] { "canonical" };
5433    case 1913078280:
5434      /* hierarchyMeaning */ return new String[] { "code" };
5435    case 1248023381:
5436      /* compositional */ return new String[] { "boolean" };
5437    case 617270957:
5438      /* versionNeeded */ return new String[] { "boolean" };
5439    case 951530617:
5440      /* content */ return new String[] { "code" };
5441    case -596951334:
5442      /* supplements */ return new String[] { "canonical" };
5443    case 94851343:
5444      /* count */ return new String[] { "unsignedInt" };
5445    case -1274492040:
5446      /* filter */ return new String[] {};
5447    case -993141291:
5448      /* property */ return new String[] {};
5449    case 951024232:
5450      /* concept */ return new String[] {};
5451    default:
5452      return super.getTypesForProperty(hash, name);
5453    }
5454
5455  }
5456
5457  @Override
5458  public Base addChild(String name) throws FHIRException {
5459    if (name.equals("url")) {
5460      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.url");
5461    } else if (name.equals("identifier")) {
5462      return addIdentifier();
5463    } else if (name.equals("version")) {
5464      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.version");
5465    } else if (name.equals("name")) {
5466      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.name");
5467    } else if (name.equals("title")) {
5468      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.title");
5469    } else if (name.equals("status")) {
5470      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.status");
5471    } else if (name.equals("experimental")) {
5472      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.experimental");
5473    } else if (name.equals("date")) {
5474      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.date");
5475    } else if (name.equals("publisher")) {
5476      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.publisher");
5477    } else if (name.equals("contact")) {
5478      return addContact();
5479    } else if (name.equals("description")) {
5480      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.description");
5481    } else if (name.equals("useContext")) {
5482      return addUseContext();
5483    } else if (name.equals("jurisdiction")) {
5484      return addJurisdiction();
5485    } else if (name.equals("purpose")) {
5486      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.purpose");
5487    } else if (name.equals("copyright")) {
5488      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.copyright");
5489    } else if (name.equals("caseSensitive")) {
5490      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.caseSensitive");
5491    } else if (name.equals("valueSet")) {
5492      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.valueSet");
5493    } else if (name.equals("hierarchyMeaning")) {
5494      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.hierarchyMeaning");
5495    } else if (name.equals("compositional")) {
5496      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.compositional");
5497    } else if (name.equals("versionNeeded")) {
5498      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.versionNeeded");
5499    } else if (name.equals("content")) {
5500      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.content");
5501    } else if (name.equals("supplements")) {
5502      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.supplements");
5503    } else if (name.equals("count")) {
5504      throw new FHIRException("Cannot call addChild on a singleton property CodeSystem.count");
5505    } else if (name.equals("filter")) {
5506      return addFilter();
5507    } else if (name.equals("property")) {
5508      return addProperty();
5509    } else if (name.equals("concept")) {
5510      return addConcept();
5511    } else
5512      return super.addChild(name);
5513  }
5514
5515  public String fhirType() {
5516    return "CodeSystem";
5517
5518  }
5519
5520  public CodeSystem copy() {
5521    CodeSystem dst = new CodeSystem();
5522    copyValues(dst);
5523    return dst;
5524  }
5525
5526  public void copyValues(CodeSystem dst) {
5527    super.copyValues(dst);
5528    dst.url = url == null ? null : url.copy();
5529    if (identifier != null) {
5530      dst.identifier = new ArrayList<Identifier>();
5531      for (Identifier i : identifier)
5532        dst.identifier.add(i.copy());
5533    }
5534    ;
5535    dst.version = version == null ? null : version.copy();
5536    dst.name = name == null ? null : name.copy();
5537    dst.title = title == null ? null : title.copy();
5538    dst.status = status == null ? null : status.copy();
5539    dst.experimental = experimental == null ? null : experimental.copy();
5540    dst.date = date == null ? null : date.copy();
5541    dst.publisher = publisher == null ? null : publisher.copy();
5542    if (contact != null) {
5543      dst.contact = new ArrayList<ContactDetail>();
5544      for (ContactDetail i : contact)
5545        dst.contact.add(i.copy());
5546    }
5547    ;
5548    dst.description = description == null ? null : description.copy();
5549    if (useContext != null) {
5550      dst.useContext = new ArrayList<UsageContext>();
5551      for (UsageContext i : useContext)
5552        dst.useContext.add(i.copy());
5553    }
5554    ;
5555    if (jurisdiction != null) {
5556      dst.jurisdiction = new ArrayList<CodeableConcept>();
5557      for (CodeableConcept i : jurisdiction)
5558        dst.jurisdiction.add(i.copy());
5559    }
5560    ;
5561    dst.purpose = purpose == null ? null : purpose.copy();
5562    dst.copyright = copyright == null ? null : copyright.copy();
5563    dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy();
5564    dst.valueSet = valueSet == null ? null : valueSet.copy();
5565    dst.hierarchyMeaning = hierarchyMeaning == null ? null : hierarchyMeaning.copy();
5566    dst.compositional = compositional == null ? null : compositional.copy();
5567    dst.versionNeeded = versionNeeded == null ? null : versionNeeded.copy();
5568    dst.content = content == null ? null : content.copy();
5569    dst.supplements = supplements == null ? null : supplements.copy();
5570    dst.count = count == null ? null : count.copy();
5571    if (filter != null) {
5572      dst.filter = new ArrayList<CodeSystemFilterComponent>();
5573      for (CodeSystemFilterComponent i : filter)
5574        dst.filter.add(i.copy());
5575    }
5576    ;
5577    if (property != null) {
5578      dst.property = new ArrayList<PropertyComponent>();
5579      for (PropertyComponent i : property)
5580        dst.property.add(i.copy());
5581    }
5582    ;
5583    if (concept != null) {
5584      dst.concept = new ArrayList<ConceptDefinitionComponent>();
5585      for (ConceptDefinitionComponent i : concept)
5586        dst.concept.add(i.copy());
5587    }
5588    ;
5589  }
5590
5591  protected CodeSystem typedCopy() {
5592    return copy();
5593  }
5594
5595  @Override
5596  public boolean equalsDeep(Base other_) {
5597    if (!super.equalsDeep(other_))
5598      return false;
5599    if (!(other_ instanceof CodeSystem))
5600      return false;
5601    CodeSystem o = (CodeSystem) other_;
5602    return compareDeep(identifier, o.identifier, true) && compareDeep(purpose, o.purpose, true)
5603        && compareDeep(copyright, o.copyright, true) && compareDeep(caseSensitive, o.caseSensitive, true)
5604        && compareDeep(valueSet, o.valueSet, true) && compareDeep(hierarchyMeaning, o.hierarchyMeaning, true)
5605        && compareDeep(compositional, o.compositional, true) && compareDeep(versionNeeded, o.versionNeeded, true)
5606        && compareDeep(content, o.content, true) && compareDeep(supplements, o.supplements, true)
5607        && compareDeep(count, o.count, true) && compareDeep(filter, o.filter, true)
5608        && compareDeep(property, o.property, true) && compareDeep(concept, o.concept, true);
5609  }
5610
5611  @Override
5612  public boolean equalsShallow(Base other_) {
5613    if (!super.equalsShallow(other_))
5614      return false;
5615    if (!(other_ instanceof CodeSystem))
5616      return false;
5617    CodeSystem o = (CodeSystem) other_;
5618    return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true)
5619        && compareValues(caseSensitive, o.caseSensitive, true)
5620        && compareValues(hierarchyMeaning, o.hierarchyMeaning, true)
5621        && compareValues(compositional, o.compositional, true) && compareValues(versionNeeded, o.versionNeeded, true)
5622        && compareValues(content, o.content, true) && compareValues(count, o.count, true);
5623  }
5624
5625  public boolean isEmpty() {
5626    return super.isEmpty()
5627        && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, purpose, copyright, caseSensitive, valueSet,
5628            hierarchyMeaning, compositional, versionNeeded, content, supplements, count, filter, property, concept);
5629  }
5630
5631  @Override
5632  public ResourceType getResourceType() {
5633    return ResourceType.CodeSystem;
5634  }
5635
5636  /**
5637   * Search parameter: <b>date</b>
5638   * <p>
5639   * Description: <b>The code system publication date</b><br>
5640   * Type: <b>date</b><br>
5641   * Path: <b>CodeSystem.date</b><br>
5642   * </p>
5643   */
5644  @SearchParamDefinition(name = "date", path = "CodeSystem.date", description = "The code system publication date", type = "date")
5645  public static final String SP_DATE = "date";
5646  /**
5647   * <b>Fluent Client</b> search parameter constant for <b>date</b>
5648   * <p>
5649   * Description: <b>The code system publication date</b><br>
5650   * Type: <b>date</b><br>
5651   * Path: <b>CodeSystem.date</b><br>
5652   * </p>
5653   */
5654  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
5655      SP_DATE);
5656
5657  /**
5658   * Search parameter: <b>identifier</b>
5659   * <p>
5660   * Description: <b>External identifier for the code system</b><br>
5661   * Type: <b>token</b><br>
5662   * Path: <b>CodeSystem.identifier</b><br>
5663   * </p>
5664   */
5665  @SearchParamDefinition(name = "identifier", path = "CodeSystem.identifier", description = "External identifier for the code system", type = "token")
5666  public static final String SP_IDENTIFIER = "identifier";
5667  /**
5668   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
5669   * <p>
5670   * Description: <b>External identifier for the code system</b><br>
5671   * Type: <b>token</b><br>
5672   * Path: <b>CodeSystem.identifier</b><br>
5673   * </p>
5674   */
5675  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5676      SP_IDENTIFIER);
5677
5678  /**
5679   * Search parameter: <b>code</b>
5680   * <p>
5681   * Description: <b>A code defined in the code system</b><br>
5682   * Type: <b>token</b><br>
5683   * Path: <b>CodeSystem.concept.code</b><br>
5684   * </p>
5685   */
5686  @SearchParamDefinition(name = "code", path = "CodeSystem.concept.code", description = "A code defined in the code system", type = "token")
5687  public static final String SP_CODE = "code";
5688  /**
5689   * <b>Fluent Client</b> search parameter constant for <b>code</b>
5690   * <p>
5691   * Description: <b>A code defined in the code system</b><br>
5692   * Type: <b>token</b><br>
5693   * Path: <b>CodeSystem.concept.code</b><br>
5694   * </p>
5695   */
5696  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5697      SP_CODE);
5698
5699  /**
5700   * Search parameter: <b>context-type-value</b>
5701   * <p>
5702   * Description: <b>A use context type and value assigned to the code
5703   * system</b><br>
5704   * Type: <b>composite</b><br>
5705   * Path: <b></b><br>
5706   * </p>
5707   */
5708  @SearchParamDefinition(name = "context-type-value", path = "CodeSystem.useContext", description = "A use context type and value assigned to the code system", type = "composite", compositeOf = {
5709      "context-type", "context" })
5710  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
5711  /**
5712   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
5713   * <p>
5714   * Description: <b>A use context type and value assigned to the code
5715   * system</b><br>
5716   * Type: <b>composite</b><br>
5717   * Path: <b></b><br>
5718   * </p>
5719   */
5720  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(
5721      SP_CONTEXT_TYPE_VALUE);
5722
5723  /**
5724   * Search parameter: <b>content-mode</b>
5725   * <p>
5726   * Description: <b>not-present | example | fragment | complete |
5727   * supplement</b><br>
5728   * Type: <b>token</b><br>
5729   * Path: <b>CodeSystem.content</b><br>
5730   * </p>
5731   */
5732  @SearchParamDefinition(name = "content-mode", path = "CodeSystem.content", description = "not-present | example | fragment | complete | supplement", type = "token")
5733  public static final String SP_CONTENT_MODE = "content-mode";
5734  /**
5735   * <b>Fluent Client</b> search parameter constant for <b>content-mode</b>
5736   * <p>
5737   * Description: <b>not-present | example | fragment | complete |
5738   * supplement</b><br>
5739   * Type: <b>token</b><br>
5740   * Path: <b>CodeSystem.content</b><br>
5741   * </p>
5742   */
5743  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTENT_MODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5744      SP_CONTENT_MODE);
5745
5746  /**
5747   * Search parameter: <b>jurisdiction</b>
5748   * <p>
5749   * Description: <b>Intended jurisdiction for the code system</b><br>
5750   * Type: <b>token</b><br>
5751   * Path: <b>CodeSystem.jurisdiction</b><br>
5752   * </p>
5753   */
5754  @SearchParamDefinition(name = "jurisdiction", path = "CodeSystem.jurisdiction", description = "Intended jurisdiction for the code system", type = "token")
5755  public static final String SP_JURISDICTION = "jurisdiction";
5756  /**
5757   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
5758   * <p>
5759   * Description: <b>Intended jurisdiction for the code system</b><br>
5760   * Type: <b>token</b><br>
5761   * Path: <b>CodeSystem.jurisdiction</b><br>
5762   * </p>
5763   */
5764  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5765      SP_JURISDICTION);
5766
5767  /**
5768   * Search parameter: <b>description</b>
5769   * <p>
5770   * Description: <b>The description of the code system</b><br>
5771   * Type: <b>string</b><br>
5772   * Path: <b>CodeSystem.description</b><br>
5773   * </p>
5774   */
5775  @SearchParamDefinition(name = "description", path = "CodeSystem.description", description = "The description of the code system", type = "string")
5776  public static final String SP_DESCRIPTION = "description";
5777  /**
5778   * <b>Fluent Client</b> search parameter constant for <b>description</b>
5779   * <p>
5780   * Description: <b>The description of the code system</b><br>
5781   * Type: <b>string</b><br>
5782   * Path: <b>CodeSystem.description</b><br>
5783   * </p>
5784   */
5785  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(
5786      SP_DESCRIPTION);
5787
5788  /**
5789   * Search parameter: <b>context-type</b>
5790   * <p>
5791   * Description: <b>A type of use context assigned to the code system</b><br>
5792   * Type: <b>token</b><br>
5793   * Path: <b>CodeSystem.useContext.code</b><br>
5794   * </p>
5795   */
5796  @SearchParamDefinition(name = "context-type", path = "CodeSystem.useContext.code", description = "A type of use context assigned to the code system", type = "token")
5797  public static final String SP_CONTEXT_TYPE = "context-type";
5798  /**
5799   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
5800   * <p>
5801   * Description: <b>A type of use context assigned to the code system</b><br>
5802   * Type: <b>token</b><br>
5803   * Path: <b>CodeSystem.useContext.code</b><br>
5804   * </p>
5805   */
5806  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5807      SP_CONTEXT_TYPE);
5808
5809  /**
5810   * Search parameter: <b>language</b>
5811   * <p>
5812   * Description: <b>A language in which a designation is provided</b><br>
5813   * Type: <b>token</b><br>
5814   * Path: <b>CodeSystem.concept.designation.language</b><br>
5815   * </p>
5816   */
5817  @SearchParamDefinition(name = "language", path = "CodeSystem.concept.designation.language", description = "A language in which a designation is provided", type = "token")
5818  public static final String SP_LANGUAGE = "language";
5819  /**
5820   * <b>Fluent Client</b> search parameter constant for <b>language</b>
5821   * <p>
5822   * Description: <b>A language in which a designation is provided</b><br>
5823   * Type: <b>token</b><br>
5824   * Path: <b>CodeSystem.concept.designation.language</b><br>
5825   * </p>
5826   */
5827  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5828      SP_LANGUAGE);
5829
5830  /**
5831   * Search parameter: <b>title</b>
5832   * <p>
5833   * Description: <b>The human-friendly name of the code system</b><br>
5834   * Type: <b>string</b><br>
5835   * Path: <b>CodeSystem.title</b><br>
5836   * </p>
5837   */
5838  @SearchParamDefinition(name = "title", path = "CodeSystem.title", description = "The human-friendly name of the code system", type = "string")
5839  public static final String SP_TITLE = "title";
5840  /**
5841   * <b>Fluent Client</b> search parameter constant for <b>title</b>
5842   * <p>
5843   * Description: <b>The human-friendly name of the code system</b><br>
5844   * Type: <b>string</b><br>
5845   * Path: <b>CodeSystem.title</b><br>
5846   * </p>
5847   */
5848  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(
5849      SP_TITLE);
5850
5851  /**
5852   * Search parameter: <b>version</b>
5853   * <p>
5854   * Description: <b>The business version of the code system</b><br>
5855   * Type: <b>token</b><br>
5856   * Path: <b>CodeSystem.version</b><br>
5857   * </p>
5858   */
5859  @SearchParamDefinition(name = "version", path = "CodeSystem.version", description = "The business version of the code system", type = "token")
5860  public static final String SP_VERSION = "version";
5861  /**
5862   * <b>Fluent Client</b> search parameter constant for <b>version</b>
5863   * <p>
5864   * Description: <b>The business version of the code system</b><br>
5865   * Type: <b>token</b><br>
5866   * Path: <b>CodeSystem.version</b><br>
5867   * </p>
5868   */
5869  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5870      SP_VERSION);
5871
5872  /**
5873   * Search parameter: <b>url</b>
5874   * <p>
5875   * Description: <b>The uri that identifies the code system</b><br>
5876   * Type: <b>uri</b><br>
5877   * Path: <b>CodeSystem.url</b><br>
5878   * </p>
5879   */
5880  @SearchParamDefinition(name = "url", path = "CodeSystem.url", description = "The uri that identifies the code system", type = "uri")
5881  public static final String SP_URL = "url";
5882  /**
5883   * <b>Fluent Client</b> search parameter constant for <b>url</b>
5884   * <p>
5885   * Description: <b>The uri that identifies the code system</b><br>
5886   * Type: <b>uri</b><br>
5887   * Path: <b>CodeSystem.url</b><br>
5888   * </p>
5889   */
5890  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
5891
5892  /**
5893   * Search parameter: <b>context-quantity</b>
5894   * <p>
5895   * Description: <b>A quantity- or range-valued use context assigned to the code
5896   * system</b><br>
5897   * Type: <b>quantity</b><br>
5898   * Path: <b>CodeSystem.useContext.valueQuantity,
5899   * CodeSystem.useContext.valueRange</b><br>
5900   * </p>
5901   */
5902  @SearchParamDefinition(name = "context-quantity", path = "(CodeSystem.useContext.value as Quantity) | (CodeSystem.useContext.value as Range)", description = "A quantity- or range-valued use context assigned to the code system", type = "quantity")
5903  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
5904  /**
5905   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
5906   * <p>
5907   * Description: <b>A quantity- or range-valued use context assigned to the code
5908   * system</b><br>
5909   * Type: <b>quantity</b><br>
5910   * Path: <b>CodeSystem.useContext.valueQuantity,
5911   * CodeSystem.useContext.valueRange</b><br>
5912   * </p>
5913   */
5914  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(
5915      SP_CONTEXT_QUANTITY);
5916
5917  /**
5918   * Search parameter: <b>supplements</b>
5919   * <p>
5920   * Description: <b>Find code system supplements for the referenced code
5921   * system</b><br>
5922   * Type: <b>reference</b><br>
5923   * Path: <b>CodeSystem.supplements</b><br>
5924   * </p>
5925   */
5926  @SearchParamDefinition(name = "supplements", path = "CodeSystem.supplements", description = "Find code system supplements for the referenced code system", type = "reference", target = {
5927      CodeSystem.class })
5928  public static final String SP_SUPPLEMENTS = "supplements";
5929  /**
5930   * <b>Fluent Client</b> search parameter constant for <b>supplements</b>
5931   * <p>
5932   * Description: <b>Find code system supplements for the referenced code
5933   * system</b><br>
5934   * Type: <b>reference</b><br>
5935   * Path: <b>CodeSystem.supplements</b><br>
5936   * </p>
5937   */
5938  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPLEMENTS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
5939      SP_SUPPLEMENTS);
5940
5941  /**
5942   * Constant for fluent queries to be used to add include statements. Specifies
5943   * the path value of "<b>CodeSystem:supplements</b>".
5944   */
5945  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPLEMENTS = new ca.uhn.fhir.model.api.Include(
5946      "CodeSystem:supplements").toLocked();
5947
5948  /**
5949   * Search parameter: <b>system</b>
5950   * <p>
5951   * Description: <b>The system for any codes defined by this code system (same as
5952   * 'url')</b><br>
5953   * Type: <b>uri</b><br>
5954   * Path: <b>CodeSystem.url</b><br>
5955   * </p>
5956   */
5957  @SearchParamDefinition(name = "system", path = "CodeSystem.url", description = "The system for any codes defined by this code system (same as 'url')", type = "uri")
5958  public static final String SP_SYSTEM = "system";
5959  /**
5960   * <b>Fluent Client</b> search parameter constant for <b>system</b>
5961   * <p>
5962   * Description: <b>The system for any codes defined by this code system (same as
5963   * 'url')</b><br>
5964   * Type: <b>uri</b><br>
5965   * Path: <b>CodeSystem.url</b><br>
5966   * </p>
5967   */
5968  public static final ca.uhn.fhir.rest.gclient.UriClientParam SYSTEM = new ca.uhn.fhir.rest.gclient.UriClientParam(
5969      SP_SYSTEM);
5970
5971  /**
5972   * Search parameter: <b>name</b>
5973   * <p>
5974   * Description: <b>Computationally friendly name of the code system</b><br>
5975   * Type: <b>string</b><br>
5976   * Path: <b>CodeSystem.name</b><br>
5977   * </p>
5978   */
5979  @SearchParamDefinition(name = "name", path = "CodeSystem.name", description = "Computationally friendly name of the code system", type = "string")
5980  public static final String SP_NAME = "name";
5981  /**
5982   * <b>Fluent Client</b> search parameter constant for <b>name</b>
5983   * <p>
5984   * Description: <b>Computationally friendly name of the code system</b><br>
5985   * Type: <b>string</b><br>
5986   * Path: <b>CodeSystem.name</b><br>
5987   * </p>
5988   */
5989  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(
5990      SP_NAME);
5991
5992  /**
5993   * Search parameter: <b>context</b>
5994   * <p>
5995   * Description: <b>A use context assigned to the code system</b><br>
5996   * Type: <b>token</b><br>
5997   * Path: <b>CodeSystem.useContext.valueCodeableConcept</b><br>
5998   * </p>
5999   */
6000  @SearchParamDefinition(name = "context", path = "(CodeSystem.useContext.value as CodeableConcept)", description = "A use context assigned to the code system", type = "token")
6001  public static final String SP_CONTEXT = "context";
6002  /**
6003   * <b>Fluent Client</b> search parameter constant for <b>context</b>
6004   * <p>
6005   * Description: <b>A use context assigned to the code system</b><br>
6006   * Type: <b>token</b><br>
6007   * Path: <b>CodeSystem.useContext.valueCodeableConcept</b><br>
6008   * </p>
6009   */
6010  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6011      SP_CONTEXT);
6012
6013  /**
6014   * Search parameter: <b>publisher</b>
6015   * <p>
6016   * Description: <b>Name of the publisher of the code system</b><br>
6017   * Type: <b>string</b><br>
6018   * Path: <b>CodeSystem.publisher</b><br>
6019   * </p>
6020   */
6021  @SearchParamDefinition(name = "publisher", path = "CodeSystem.publisher", description = "Name of the publisher of the code system", type = "string")
6022  public static final String SP_PUBLISHER = "publisher";
6023  /**
6024   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
6025   * <p>
6026   * Description: <b>Name of the publisher of the code system</b><br>
6027   * Type: <b>string</b><br>
6028   * Path: <b>CodeSystem.publisher</b><br>
6029   * </p>
6030   */
6031  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(
6032      SP_PUBLISHER);
6033
6034  /**
6035   * Search parameter: <b>context-type-quantity</b>
6036   * <p>
6037   * Description: <b>A use context type and quantity- or range-based value
6038   * assigned to the code system</b><br>
6039   * Type: <b>composite</b><br>
6040   * Path: <b></b><br>
6041   * </p>
6042   */
6043  @SearchParamDefinition(name = "context-type-quantity", path = "CodeSystem.useContext", description = "A use context type and quantity- or range-based value assigned to the code system", type = "composite", compositeOf = {
6044      "context-type", "context-quantity" })
6045  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
6046  /**
6047   * <b>Fluent Client</b> search parameter constant for
6048   * <b>context-type-quantity</b>
6049   * <p>
6050   * Description: <b>A use context type and quantity- or range-based value
6051   * assigned to the code system</b><br>
6052   * Type: <b>composite</b><br>
6053   * Path: <b></b><br>
6054   * </p>
6055   */
6056  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(
6057      SP_CONTEXT_TYPE_QUANTITY);
6058
6059  /**
6060   * Search parameter: <b>status</b>
6061   * <p>
6062   * Description: <b>The current status of the code system</b><br>
6063   * Type: <b>token</b><br>
6064   * Path: <b>CodeSystem.status</b><br>
6065   * </p>
6066   */
6067  @SearchParamDefinition(name = "status", path = "CodeSystem.status", description = "The current status of the code system", type = "token")
6068  public static final String SP_STATUS = "status";
6069  /**
6070   * <b>Fluent Client</b> search parameter constant for <b>status</b>
6071   * <p>
6072   * Description: <b>The current status of the code system</b><br>
6073   * Type: <b>token</b><br>
6074   * Path: <b>CodeSystem.status</b><br>
6075   * </p>
6076   */
6077  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6078      SP_STATUS);
6079
6080// added from java-adornments.txt:
6081  public PropertyComponent getProperty(String code) {
6082    for (PropertyComponent pd : getProperty()) {
6083      if (pd.getCode().equalsIgnoreCase(code))
6084        return pd;
6085    }
6086    return null;
6087  }
6088
6089  public class ConceptDefinitionComponentSorter implements Comparator<ConceptDefinitionComponent> {
6090    @Override
6091    public int compare(ConceptDefinitionComponent l, ConceptDefinitionComponent r) {
6092      return l.getCode().compareTo(r.getCode());
6093    }
6094  }
6095
6096  public void sort() {
6097    sort(getConcept(), new ConceptDefinitionComponentSorter());
6098  }
6099
6100  public void sort(List<ConceptDefinitionComponent> list, Comparator<ConceptDefinitionComponent> comp) {
6101    Collections.sort(list, comp);
6102    for (ConceptDefinitionComponent def : list) {
6103      if (def.hasConcept()) {
6104        sort(def.getConcept(), comp);
6105      }
6106    }
6107  }
6108
6109  public void sort(Comparator<ConceptDefinitionComponent> comp) {
6110    sort(getConcept(), comp);
6111  }
6112
6113// end addition
6114
6115}