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