001package org.hl7.fhir.dstu3.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu3
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 Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
053import java.util.ArrayList;
054import java.util.Date;
055import java.util.List;
056
057import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus;
058import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory;
059import org.hl7.fhir.exceptions.FHIRException;
060import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
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 * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a "System" used within the Identifier and Coding data types.
071 */
072@ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem")
073@ChildOrder(names={"name", "status", "kind", "date", "publisher", "contact", "responsible", "type", "description", "useContext", "jurisdiction", "usage", "uniqueId", "replacedBy"})
074public class NamingSystem extends MetadataResource {
075
076    public enum NamingSystemType {
077        /**
078         * The naming system is used to define concepts and symbols to represent those concepts; e.g. UCUM, LOINC, NDC code, local lab codes, etc.
079         */
080        CODESYSTEM, 
081        /**
082         * The naming system is used to manage identifiers (e.g. license numbers, order numbers, etc.).
083         */
084        IDENTIFIER, 
085        /**
086         * The naming system is used as the root for other identifiers and naming systems.
087         */
088        ROOT, 
089        /**
090         * added to help the parsers with the generic types
091         */
092        NULL;
093        public static NamingSystemType fromCode(String codeString) throws FHIRException {
094            if (codeString == null || "".equals(codeString))
095                return null;
096        if ("codesystem".equals(codeString))
097          return CODESYSTEM;
098        if ("identifier".equals(codeString))
099          return IDENTIFIER;
100        if ("root".equals(codeString))
101          return ROOT;
102        if (Configuration.isAcceptInvalidEnums())
103          return null;
104        else
105          throw new FHIRException("Unknown NamingSystemType code '"+codeString+"'");
106        }
107        public String toCode() {
108          switch (this) {
109            case CODESYSTEM: return "codesystem";
110            case IDENTIFIER: return "identifier";
111            case ROOT: return "root";
112            default: return "?";
113          }
114        }
115        public String getSystem() {
116          switch (this) {
117            case CODESYSTEM: return "http://hl7.org/fhir/namingsystem-type";
118            case IDENTIFIER: return "http://hl7.org/fhir/namingsystem-type";
119            case ROOT: return "http://hl7.org/fhir/namingsystem-type";
120            default: return "?";
121          }
122        }
123        public String getDefinition() {
124          switch (this) {
125            case CODESYSTEM: return "The naming system is used to define concepts and symbols to represent those concepts; e.g. UCUM, LOINC, NDC code, local lab codes, etc.";
126            case IDENTIFIER: return "The naming system is used to manage identifiers (e.g. license numbers, order numbers, etc.).";
127            case ROOT: return "The naming system is used as the root for other identifiers and naming systems.";
128            default: return "?";
129          }
130        }
131        public String getDisplay() {
132          switch (this) {
133            case CODESYSTEM: return "Code System";
134            case IDENTIFIER: return "Identifier";
135            case ROOT: return "Root";
136            default: return "?";
137          }
138        }
139    }
140
141  public static class NamingSystemTypeEnumFactory implements EnumFactory<NamingSystemType> {
142    public NamingSystemType fromCode(String codeString) throws IllegalArgumentException {
143      if (codeString == null || "".equals(codeString))
144            if (codeString == null || "".equals(codeString))
145                return null;
146        if ("codesystem".equals(codeString))
147          return NamingSystemType.CODESYSTEM;
148        if ("identifier".equals(codeString))
149          return NamingSystemType.IDENTIFIER;
150        if ("root".equals(codeString))
151          return NamingSystemType.ROOT;
152        throw new IllegalArgumentException("Unknown NamingSystemType code '"+codeString+"'");
153        }
154        public Enumeration<NamingSystemType> fromType(Base code) throws FHIRException {
155          if (code == null)
156            return null;
157          if (code.isEmpty())
158            return new Enumeration<NamingSystemType>(this);
159          String codeString = ((PrimitiveType) code).asStringValue();
160          if (codeString == null || "".equals(codeString))
161            return null;
162        if ("codesystem".equals(codeString))
163          return new Enumeration<NamingSystemType>(this, NamingSystemType.CODESYSTEM);
164        if ("identifier".equals(codeString))
165          return new Enumeration<NamingSystemType>(this, NamingSystemType.IDENTIFIER);
166        if ("root".equals(codeString))
167          return new Enumeration<NamingSystemType>(this, NamingSystemType.ROOT);
168        throw new FHIRException("Unknown NamingSystemType code '"+codeString+"'");
169        }
170    public String toCode(NamingSystemType code) {
171      if (code == NamingSystemType.CODESYSTEM)
172        return "codesystem";
173      if (code == NamingSystemType.IDENTIFIER)
174        return "identifier";
175      if (code == NamingSystemType.ROOT)
176        return "root";
177      return "?";
178      }
179    public String toSystem(NamingSystemType code) {
180      return code.getSystem();
181      }
182    }
183
184    public enum NamingSystemIdentifierType {
185        /**
186         * An ISO object identifier; e.g. 1.2.3.4.5.
187         */
188        OID, 
189        /**
190         * A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11.
191         */
192        UUID, 
193        /**
194         * A uniform resource identifier (ideally a URL - uniform resource locator); e.g. http://unitsofmeasure.org.
195         */
196        URI, 
197        /**
198         * Some other type of unique identifier; e.g. HL7-assigned reserved string such as LN for LOINC.
199         */
200        OTHER, 
201        /**
202         * added to help the parsers with the generic types
203         */
204        NULL;
205        public static NamingSystemIdentifierType fromCode(String codeString) throws FHIRException {
206            if (codeString == null || "".equals(codeString))
207                return null;
208        if ("oid".equals(codeString))
209          return OID;
210        if ("uuid".equals(codeString))
211          return UUID;
212        if ("uri".equals(codeString))
213          return URI;
214        if ("other".equals(codeString))
215          return OTHER;
216        if (Configuration.isAcceptInvalidEnums())
217          return null;
218        else
219          throw new FHIRException("Unknown NamingSystemIdentifierType code '"+codeString+"'");
220        }
221        public String toCode() {
222          switch (this) {
223            case OID: return "oid";
224            case UUID: return "uuid";
225            case URI: return "uri";
226            case OTHER: return "other";
227            default: return "?";
228          }
229        }
230        public String getSystem() {
231          switch (this) {
232            case OID: return "http://hl7.org/fhir/namingsystem-identifier-type";
233            case UUID: return "http://hl7.org/fhir/namingsystem-identifier-type";
234            case URI: return "http://hl7.org/fhir/namingsystem-identifier-type";
235            case OTHER: return "http://hl7.org/fhir/namingsystem-identifier-type";
236            default: return "?";
237          }
238        }
239        public String getDefinition() {
240          switch (this) {
241            case OID: return "An ISO object identifier; e.g. 1.2.3.4.5.";
242            case UUID: return "A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11.";
243            case URI: return "A uniform resource identifier (ideally a URL - uniform resource locator); e.g. http://unitsofmeasure.org.";
244            case OTHER: return "Some other type of unique identifier; e.g. HL7-assigned reserved string such as LN for LOINC.";
245            default: return "?";
246          }
247        }
248        public String getDisplay() {
249          switch (this) {
250            case OID: return "OID";
251            case UUID: return "UUID";
252            case URI: return "URI";
253            case OTHER: return "Other";
254            default: return "?";
255          }
256        }
257    }
258
259  public static class NamingSystemIdentifierTypeEnumFactory implements EnumFactory<NamingSystemIdentifierType> {
260    public NamingSystemIdentifierType fromCode(String codeString) throws IllegalArgumentException {
261      if (codeString == null || "".equals(codeString))
262            if (codeString == null || "".equals(codeString))
263                return null;
264        if ("oid".equals(codeString))
265          return NamingSystemIdentifierType.OID;
266        if ("uuid".equals(codeString))
267          return NamingSystemIdentifierType.UUID;
268        if ("uri".equals(codeString))
269          return NamingSystemIdentifierType.URI;
270        if ("other".equals(codeString))
271          return NamingSystemIdentifierType.OTHER;
272        throw new IllegalArgumentException("Unknown NamingSystemIdentifierType code '"+codeString+"'");
273        }
274        public Enumeration<NamingSystemIdentifierType> fromType(Base code) throws FHIRException {
275          if (code == null)
276            return null;
277          if (code.isEmpty())
278            return new Enumeration<NamingSystemIdentifierType>(this);
279          String codeString = ((PrimitiveType) code).asStringValue();
280          if (codeString == null || "".equals(codeString))
281            return null;
282        if ("oid".equals(codeString))
283          return new Enumeration<NamingSystemIdentifierType>(this, NamingSystemIdentifierType.OID);
284        if ("uuid".equals(codeString))
285          return new Enumeration<NamingSystemIdentifierType>(this, NamingSystemIdentifierType.UUID);
286        if ("uri".equals(codeString))
287          return new Enumeration<NamingSystemIdentifierType>(this, NamingSystemIdentifierType.URI);
288        if ("other".equals(codeString))
289          return new Enumeration<NamingSystemIdentifierType>(this, NamingSystemIdentifierType.OTHER);
290        throw new FHIRException("Unknown NamingSystemIdentifierType code '"+codeString+"'");
291        }
292    public String toCode(NamingSystemIdentifierType code) {
293      if (code == NamingSystemIdentifierType.OID)
294        return "oid";
295      if (code == NamingSystemIdentifierType.UUID)
296        return "uuid";
297      if (code == NamingSystemIdentifierType.URI)
298        return "uri";
299      if (code == NamingSystemIdentifierType.OTHER)
300        return "other";
301      return "?";
302      }
303    public String toSystem(NamingSystemIdentifierType code) {
304      return code.getSystem();
305      }
306    }
307
308    @Block()
309    public static class NamingSystemUniqueIdComponent extends BackboneElement implements IBaseBackboneElement {
310        /**
311         * Identifies the unique identifier scheme used for this particular identifier.
312         */
313        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
314        @Description(shortDefinition="oid | uuid | uri | other", formalDefinition="Identifies the unique identifier scheme used for this particular identifier." )
315        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/namingsystem-identifier-type")
316        protected Enumeration<NamingSystemIdentifierType> type;
317
318        /**
319         * The string that should be sent over the wire to identify the code system or identifier system.
320         */
321        @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
322        @Description(shortDefinition="The unique identifier", formalDefinition="The string that should be sent over the wire to identify the code system or identifier system." )
323        protected StringType value;
324
325        /**
326         * Indicates whether this identifier is the "preferred" identifier of this type.
327         */
328        @Child(name = "preferred", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
329        @Description(shortDefinition="Is this the id that should be used for this type", formalDefinition="Indicates whether this identifier is the \"preferred\" identifier of this type." )
330        protected BooleanType preferred;
331
332        /**
333         * Notes about the past or intended usage of this identifier.
334         */
335        @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
336        @Description(shortDefinition="Notes about identifier usage", formalDefinition="Notes about the past or intended usage of this identifier." )
337        protected StringType comment;
338
339        /**
340         * Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic.
341         */
342        @Child(name = "period", type = {Period.class}, order=5, min=0, max=1, modifier=false, summary=false)
343        @Description(shortDefinition="When is identifier valid?", formalDefinition="Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic." )
344        protected Period period;
345
346        private static final long serialVersionUID = -1458889328L;
347
348    /**
349     * Constructor
350     */
351      public NamingSystemUniqueIdComponent() {
352        super();
353      }
354
355    /**
356     * Constructor
357     */
358      public NamingSystemUniqueIdComponent(Enumeration<NamingSystemIdentifierType> type, StringType value) {
359        super();
360        this.type = type;
361        this.value = value;
362      }
363
364        /**
365         * @return {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
366         */
367        public Enumeration<NamingSystemIdentifierType> getTypeElement() { 
368          if (this.type == null)
369            if (Configuration.errorOnAutoCreate())
370              throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.type");
371            else if (Configuration.doAutoCreate())
372              this.type = new Enumeration<NamingSystemIdentifierType>(new NamingSystemIdentifierTypeEnumFactory()); // bb
373          return this.type;
374        }
375
376        public boolean hasTypeElement() { 
377          return this.type != null && !this.type.isEmpty();
378        }
379
380        public boolean hasType() { 
381          return this.type != null && !this.type.isEmpty();
382        }
383
384        /**
385         * @param value {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
386         */
387        public NamingSystemUniqueIdComponent setTypeElement(Enumeration<NamingSystemIdentifierType> value) { 
388          this.type = value;
389          return this;
390        }
391
392        /**
393         * @return Identifies the unique identifier scheme used for this particular identifier.
394         */
395        public NamingSystemIdentifierType getType() { 
396          return this.type == null ? null : this.type.getValue();
397        }
398
399        /**
400         * @param value Identifies the unique identifier scheme used for this particular identifier.
401         */
402        public NamingSystemUniqueIdComponent setType(NamingSystemIdentifierType value) { 
403            if (this.type == null)
404              this.type = new Enumeration<NamingSystemIdentifierType>(new NamingSystemIdentifierTypeEnumFactory());
405            this.type.setValue(value);
406          return this;
407        }
408
409        /**
410         * @return {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
411         */
412        public StringType getValueElement() { 
413          if (this.value == null)
414            if (Configuration.errorOnAutoCreate())
415              throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.value");
416            else if (Configuration.doAutoCreate())
417              this.value = new StringType(); // bb
418          return this.value;
419        }
420
421        public boolean hasValueElement() { 
422          return this.value != null && !this.value.isEmpty();
423        }
424
425        public boolean hasValue() { 
426          return this.value != null && !this.value.isEmpty();
427        }
428
429        /**
430         * @param value {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
431         */
432        public NamingSystemUniqueIdComponent setValueElement(StringType value) { 
433          this.value = value;
434          return this;
435        }
436
437        /**
438         * @return The string that should be sent over the wire to identify the code system or identifier system.
439         */
440        public String getValue() { 
441          return this.value == null ? null : this.value.getValue();
442        }
443
444        /**
445         * @param value The string that should be sent over the wire to identify the code system or identifier system.
446         */
447        public NamingSystemUniqueIdComponent setValue(String value) { 
448            if (this.value == null)
449              this.value = new StringType();
450            this.value.setValue(value);
451          return this;
452        }
453
454        /**
455         * @return {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value
456         */
457        public BooleanType getPreferredElement() { 
458          if (this.preferred == null)
459            if (Configuration.errorOnAutoCreate())
460              throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.preferred");
461            else if (Configuration.doAutoCreate())
462              this.preferred = new BooleanType(); // bb
463          return this.preferred;
464        }
465
466        public boolean hasPreferredElement() { 
467          return this.preferred != null && !this.preferred.isEmpty();
468        }
469
470        public boolean hasPreferred() { 
471          return this.preferred != null && !this.preferred.isEmpty();
472        }
473
474        /**
475         * @param value {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value
476         */
477        public NamingSystemUniqueIdComponent setPreferredElement(BooleanType value) { 
478          this.preferred = value;
479          return this;
480        }
481
482        /**
483         * @return Indicates whether this identifier is the "preferred" identifier of this type.
484         */
485        public boolean getPreferred() { 
486          return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue();
487        }
488
489        /**
490         * @param value Indicates whether this identifier is the "preferred" identifier of this type.
491         */
492        public NamingSystemUniqueIdComponent setPreferred(boolean value) { 
493            if (this.preferred == null)
494              this.preferred = new BooleanType();
495            this.preferred.setValue(value);
496          return this;
497        }
498
499        /**
500         * @return {@link #comment} (Notes about the past or intended usage of this identifier.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
501         */
502        public StringType getCommentElement() { 
503          if (this.comment == null)
504            if (Configuration.errorOnAutoCreate())
505              throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.comment");
506            else if (Configuration.doAutoCreate())
507              this.comment = new StringType(); // bb
508          return this.comment;
509        }
510
511        public boolean hasCommentElement() { 
512          return this.comment != null && !this.comment.isEmpty();
513        }
514
515        public boolean hasComment() { 
516          return this.comment != null && !this.comment.isEmpty();
517        }
518
519        /**
520         * @param value {@link #comment} (Notes about the past or intended usage of this identifier.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
521         */
522        public NamingSystemUniqueIdComponent setCommentElement(StringType value) { 
523          this.comment = value;
524          return this;
525        }
526
527        /**
528         * @return Notes about the past or intended usage of this identifier.
529         */
530        public String getComment() { 
531          return this.comment == null ? null : this.comment.getValue();
532        }
533
534        /**
535         * @param value Notes about the past or intended usage of this identifier.
536         */
537        public NamingSystemUniqueIdComponent setComment(String value) { 
538          if (Utilities.noString(value))
539            this.comment = null;
540          else {
541            if (this.comment == null)
542              this.comment = new StringType();
543            this.comment.setValue(value);
544          }
545          return this;
546        }
547
548        /**
549         * @return {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic.)
550         */
551        public Period getPeriod() { 
552          if (this.period == null)
553            if (Configuration.errorOnAutoCreate())
554              throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.period");
555            else if (Configuration.doAutoCreate())
556              this.period = new Period(); // cc
557          return this.period;
558        }
559
560        public boolean hasPeriod() { 
561          return this.period != null && !this.period.isEmpty();
562        }
563
564        /**
565         * @param value {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic.)
566         */
567        public NamingSystemUniqueIdComponent setPeriod(Period value)  { 
568          this.period = value;
569          return this;
570        }
571
572        protected void listChildren(List<Property> children) {
573          super.listChildren(children);
574          children.add(new Property("type", "code", "Identifies the unique identifier scheme used for this particular identifier.", 0, 1, type));
575          children.add(new Property("value", "string", "The string that should be sent over the wire to identify the code system or identifier system.", 0, 1, value));
576          children.add(new Property("preferred", "boolean", "Indicates whether this identifier is the \"preferred\" identifier of this type.", 0, 1, preferred));
577          children.add(new Property("comment", "string", "Notes about the past or intended usage of this identifier.", 0, 1, comment));
578          children.add(new Property("period", "Period", "Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic.", 0, 1, period));
579        }
580
581        @Override
582        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
583          switch (_hash) {
584          case 3575610: /*type*/  return new Property("type", "code", "Identifies the unique identifier scheme used for this particular identifier.", 0, 1, type);
585          case 111972721: /*value*/  return new Property("value", "string", "The string that should be sent over the wire to identify the code system or identifier system.", 0, 1, value);
586          case -1294005119: /*preferred*/  return new Property("preferred", "boolean", "Indicates whether this identifier is the \"preferred\" identifier of this type.", 0, 1, preferred);
587          case 950398559: /*comment*/  return new Property("comment", "string", "Notes about the past or intended usage of this identifier.", 0, 1, comment);
588          case -991726143: /*period*/  return new Property("period", "Period", "Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic.", 0, 1, period);
589          default: return super.getNamedProperty(_hash, _name, _checkValid);
590          }
591
592        }
593
594      @Override
595      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
596        switch (hash) {
597        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<NamingSystemIdentifierType>
598        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
599        case -1294005119: /*preferred*/ return this.preferred == null ? new Base[0] : new Base[] {this.preferred}; // BooleanType
600        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
601        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
602        default: return super.getProperty(hash, name, checkValid);
603        }
604
605      }
606
607      @Override
608      public Base setProperty(int hash, String name, Base value) throws FHIRException {
609        switch (hash) {
610        case 3575610: // type
611          value = new NamingSystemIdentifierTypeEnumFactory().fromType(castToCode(value));
612          this.type = (Enumeration) value; // Enumeration<NamingSystemIdentifierType>
613          return value;
614        case 111972721: // value
615          this.value = castToString(value); // StringType
616          return value;
617        case -1294005119: // preferred
618          this.preferred = castToBoolean(value); // BooleanType
619          return value;
620        case 950398559: // comment
621          this.comment = castToString(value); // StringType
622          return value;
623        case -991726143: // period
624          this.period = castToPeriod(value); // Period
625          return value;
626        default: return super.setProperty(hash, name, value);
627        }
628
629      }
630
631      @Override
632      public Base setProperty(String name, Base value) throws FHIRException {
633        if (name.equals("type")) {
634          value = new NamingSystemIdentifierTypeEnumFactory().fromType(castToCode(value));
635          this.type = (Enumeration) value; // Enumeration<NamingSystemIdentifierType>
636        } else if (name.equals("value")) {
637          this.value = castToString(value); // StringType
638        } else if (name.equals("preferred")) {
639          this.preferred = castToBoolean(value); // BooleanType
640        } else if (name.equals("comment")) {
641          this.comment = castToString(value); // StringType
642        } else if (name.equals("period")) {
643          this.period = castToPeriod(value); // Period
644        } else
645          return super.setProperty(name, value);
646        return value;
647      }
648
649      @Override
650      public Base makeProperty(int hash, String name) throws FHIRException {
651        switch (hash) {
652        case 3575610:  return getTypeElement();
653        case 111972721:  return getValueElement();
654        case -1294005119:  return getPreferredElement();
655        case 950398559:  return getCommentElement();
656        case -991726143:  return getPeriod(); 
657        default: return super.makeProperty(hash, name);
658        }
659
660      }
661
662      @Override
663      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
664        switch (hash) {
665        case 3575610: /*type*/ return new String[] {"code"};
666        case 111972721: /*value*/ return new String[] {"string"};
667        case -1294005119: /*preferred*/ return new String[] {"boolean"};
668        case 950398559: /*comment*/ return new String[] {"string"};
669        case -991726143: /*period*/ return new String[] {"Period"};
670        default: return super.getTypesForProperty(hash, name);
671        }
672
673      }
674
675      @Override
676      public Base addChild(String name) throws FHIRException {
677        if (name.equals("type")) {
678          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.type");
679        }
680        else if (name.equals("value")) {
681          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.value");
682        }
683        else if (name.equals("preferred")) {
684          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.preferred");
685        }
686        else if (name.equals("comment")) {
687          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.comment");
688        }
689        else if (name.equals("period")) {
690          this.period = new Period();
691          return this.period;
692        }
693        else
694          return super.addChild(name);
695      }
696
697      public NamingSystemUniqueIdComponent copy() {
698        NamingSystemUniqueIdComponent dst = new NamingSystemUniqueIdComponent();
699        copyValues(dst);
700        dst.type = type == null ? null : type.copy();
701        dst.value = value == null ? null : value.copy();
702        dst.preferred = preferred == null ? null : preferred.copy();
703        dst.comment = comment == null ? null : comment.copy();
704        dst.period = period == null ? null : period.copy();
705        return dst;
706      }
707
708      @Override
709      public boolean equalsDeep(Base other_) {
710        if (!super.equalsDeep(other_))
711          return false;
712        if (!(other_ instanceof NamingSystemUniqueIdComponent))
713          return false;
714        NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other_;
715        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(preferred, o.preferred, true)
716           && compareDeep(comment, o.comment, true) && compareDeep(period, o.period, true);
717      }
718
719      @Override
720      public boolean equalsShallow(Base other_) {
721        if (!super.equalsShallow(other_))
722          return false;
723        if (!(other_ instanceof NamingSystemUniqueIdComponent))
724          return false;
725        NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other_;
726        return compareValues(type, o.type, true) && compareValues(value, o.value, true) && compareValues(preferred, o.preferred, true)
727           && compareValues(comment, o.comment, true);
728      }
729
730      public boolean isEmpty() {
731        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value, preferred, comment
732          , period);
733      }
734
735  public String fhirType() {
736    return "NamingSystem.uniqueId";
737
738  }
739
740  }
741
742    /**
743     * Indicates the purpose for the naming system - what kinds of things does it make unique?
744     */
745    @Child(name = "kind", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=false)
746    @Description(shortDefinition="codesystem | identifier | root", formalDefinition="Indicates the purpose for the naming system - what kinds of things does it make unique?" )
747    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/namingsystem-type")
748    protected Enumeration<NamingSystemType> kind;
749
750    /**
751     * The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.
752     */
753    @Child(name = "responsible", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
754    @Description(shortDefinition="Who maintains system namespace?", formalDefinition="The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision." )
755    protected StringType responsible;
756
757    /**
758     * Categorizes a naming system for easier search by grouping related naming systems.
759     */
760    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
761    @Description(shortDefinition="e.g. driver,  provider,  patient, bank etc.", formalDefinition="Categorizes a naming system for easier search by grouping related naming systems." )
762    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/identifier-type")
763    protected CodeableConcept type;
764
765    /**
766     * Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.
767     */
768    @Child(name = "usage", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
769    @Description(shortDefinition="How/where is it used", formalDefinition="Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc." )
770    protected StringType usage;
771
772    /**
773     * Indicates how the system may be identified when referenced in electronic exchange.
774     */
775    @Child(name = "uniqueId", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
776    @Description(shortDefinition="Unique identifiers used for system", formalDefinition="Indicates how the system may be identified when referenced in electronic exchange." )
777    protected List<NamingSystemUniqueIdComponent> uniqueId;
778
779    /**
780     * For naming systems that are retired, indicates the naming system that should be used in their place (if any).
781     */
782    @Child(name = "replacedBy", type = {NamingSystem.class}, order=5, min=0, max=1, modifier=false, summary=false)
783    @Description(shortDefinition="Use this instead", formalDefinition="For naming systems that are retired, indicates the naming system that should be used in their place (if any)." )
784    protected Reference replacedBy;
785
786    /**
787     * The actual object that is the target of the reference (For naming systems that are retired, indicates the naming system that should be used in their place (if any).)
788     */
789    protected NamingSystem replacedByTarget;
790
791    private static final long serialVersionUID = -743416513L;
792
793  /**
794   * Constructor
795   */
796    public NamingSystem() {
797      super();
798    }
799
800  /**
801   * Constructor
802   */
803    public NamingSystem(StringType name, Enumeration<PublicationStatus> status, Enumeration<NamingSystemType> kind, DateTimeType date) {
804      super();
805      this.name = name;
806      this.status = status;
807      this.kind = kind;
808      this.date = date;
809    }
810
811    /**
812     * @return {@link #name} (A natural language name identifying the naming 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
813     */
814    public StringType getNameElement() { 
815      if (this.name == null)
816        if (Configuration.errorOnAutoCreate())
817          throw new Error("Attempt to auto-create NamingSystem.name");
818        else if (Configuration.doAutoCreate())
819          this.name = new StringType(); // bb
820      return this.name;
821    }
822
823    public boolean hasNameElement() { 
824      return this.name != null && !this.name.isEmpty();
825    }
826
827    public boolean hasName() { 
828      return this.name != null && !this.name.isEmpty();
829    }
830
831    /**
832     * @param value {@link #name} (A natural language name identifying the naming 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
833     */
834    public NamingSystem setNameElement(StringType value) { 
835      this.name = value;
836      return this;
837    }
838
839    /**
840     * @return A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation.
841     */
842    public String getName() { 
843      return this.name == null ? null : this.name.getValue();
844    }
845
846    /**
847     * @param value A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation.
848     */
849    public NamingSystem setName(String value) { 
850        if (this.name == null)
851          this.name = new StringType();
852        this.name.setValue(value);
853      return this;
854    }
855
856    /**
857     * @return {@link #status} (The status of this naming system. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
858     */
859    public Enumeration<PublicationStatus> getStatusElement() { 
860      if (this.status == null)
861        if (Configuration.errorOnAutoCreate())
862          throw new Error("Attempt to auto-create NamingSystem.status");
863        else if (Configuration.doAutoCreate())
864          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
865      return this.status;
866    }
867
868    public boolean hasStatusElement() { 
869      return this.status != null && !this.status.isEmpty();
870    }
871
872    public boolean hasStatus() { 
873      return this.status != null && !this.status.isEmpty();
874    }
875
876    /**
877     * @param value {@link #status} (The status of this naming system. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
878     */
879    public NamingSystem setStatusElement(Enumeration<PublicationStatus> value) { 
880      this.status = value;
881      return this;
882    }
883
884    /**
885     * @return The status of this naming system. Enables tracking the life-cycle of the content.
886     */
887    public PublicationStatus getStatus() { 
888      return this.status == null ? null : this.status.getValue();
889    }
890
891    /**
892     * @param value The status of this naming system. Enables tracking the life-cycle of the content.
893     */
894    public NamingSystem setStatus(PublicationStatus value) { 
895        if (this.status == null)
896          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
897        this.status.setValue(value);
898      return this;
899    }
900
901    /**
902     * @return {@link #kind} (Indicates the purpose for the naming system - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
903     */
904    public Enumeration<NamingSystemType> getKindElement() { 
905      if (this.kind == null)
906        if (Configuration.errorOnAutoCreate())
907          throw new Error("Attempt to auto-create NamingSystem.kind");
908        else if (Configuration.doAutoCreate())
909          this.kind = new Enumeration<NamingSystemType>(new NamingSystemTypeEnumFactory()); // bb
910      return this.kind;
911    }
912
913    public boolean hasKindElement() { 
914      return this.kind != null && !this.kind.isEmpty();
915    }
916
917    public boolean hasKind() { 
918      return this.kind != null && !this.kind.isEmpty();
919    }
920
921    /**
922     * @param value {@link #kind} (Indicates the purpose for the naming system - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
923     */
924    public NamingSystem setKindElement(Enumeration<NamingSystemType> value) { 
925      this.kind = value;
926      return this;
927    }
928
929    /**
930     * @return Indicates the purpose for the naming system - what kinds of things does it make unique?
931     */
932    public NamingSystemType getKind() { 
933      return this.kind == null ? null : this.kind.getValue();
934    }
935
936    /**
937     * @param value Indicates the purpose for the naming system - what kinds of things does it make unique?
938     */
939    public NamingSystem setKind(NamingSystemType value) { 
940        if (this.kind == null)
941          this.kind = new Enumeration<NamingSystemType>(new NamingSystemTypeEnumFactory());
942        this.kind.setValue(value);
943      return this;
944    }
945
946    /**
947     * @return {@link #date} (The date  (and optionally time) when the naming system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
948     */
949    public DateTimeType getDateElement() { 
950      if (this.date == null)
951        if (Configuration.errorOnAutoCreate())
952          throw new Error("Attempt to auto-create NamingSystem.date");
953        else if (Configuration.doAutoCreate())
954          this.date = new DateTimeType(); // bb
955      return this.date;
956    }
957
958    public boolean hasDateElement() { 
959      return this.date != null && !this.date.isEmpty();
960    }
961
962    public boolean hasDate() { 
963      return this.date != null && !this.date.isEmpty();
964    }
965
966    /**
967     * @param value {@link #date} (The date  (and optionally time) when the naming system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
968     */
969    public NamingSystem setDateElement(DateTimeType value) { 
970      this.date = value;
971      return this;
972    }
973
974    /**
975     * @return The date  (and optionally time) when the naming system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.
976     */
977    public Date getDate() { 
978      return this.date == null ? null : this.date.getValue();
979    }
980
981    /**
982     * @param value The date  (and optionally time) when the naming system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.
983     */
984    public NamingSystem setDate(Date value) { 
985        if (this.date == null)
986          this.date = new DateTimeType();
987        this.date.setValue(value);
988      return this;
989    }
990
991    /**
992     * @return {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
993     */
994    public StringType getPublisherElement() { 
995      if (this.publisher == null)
996        if (Configuration.errorOnAutoCreate())
997          throw new Error("Attempt to auto-create NamingSystem.publisher");
998        else if (Configuration.doAutoCreate())
999          this.publisher = new StringType(); // bb
1000      return this.publisher;
1001    }
1002
1003    public boolean hasPublisherElement() { 
1004      return this.publisher != null && !this.publisher.isEmpty();
1005    }
1006
1007    public boolean hasPublisher() { 
1008      return this.publisher != null && !this.publisher.isEmpty();
1009    }
1010
1011    /**
1012     * @param value {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
1013     */
1014    public NamingSystem setPublisherElement(StringType value) { 
1015      this.publisher = value;
1016      return this;
1017    }
1018
1019    /**
1020     * @return The name of the individual or organization that published the naming system.
1021     */
1022    public String getPublisher() { 
1023      return this.publisher == null ? null : this.publisher.getValue();
1024    }
1025
1026    /**
1027     * @param value The name of the individual or organization that published the naming system.
1028     */
1029    public NamingSystem setPublisher(String value) { 
1030      if (Utilities.noString(value))
1031        this.publisher = null;
1032      else {
1033        if (this.publisher == null)
1034          this.publisher = new StringType();
1035        this.publisher.setValue(value);
1036      }
1037      return this;
1038    }
1039
1040    /**
1041     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
1042     */
1043    public List<ContactDetail> getContact() { 
1044      if (this.contact == null)
1045        this.contact = new ArrayList<ContactDetail>();
1046      return this.contact;
1047    }
1048
1049    /**
1050     * @return Returns a reference to <code>this</code> for easy method chaining
1051     */
1052    public NamingSystem setContact(List<ContactDetail> theContact) { 
1053      this.contact = theContact;
1054      return this;
1055    }
1056
1057    public boolean hasContact() { 
1058      if (this.contact == null)
1059        return false;
1060      for (ContactDetail item : this.contact)
1061        if (!item.isEmpty())
1062          return true;
1063      return false;
1064    }
1065
1066    public ContactDetail addContact() { //3
1067      ContactDetail t = new ContactDetail();
1068      if (this.contact == null)
1069        this.contact = new ArrayList<ContactDetail>();
1070      this.contact.add(t);
1071      return t;
1072    }
1073
1074    public NamingSystem addContact(ContactDetail t) { //3
1075      if (t == null)
1076        return this;
1077      if (this.contact == null)
1078        this.contact = new ArrayList<ContactDetail>();
1079      this.contact.add(t);
1080      return this;
1081    }
1082
1083    /**
1084     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
1085     */
1086    public ContactDetail getContactFirstRep() { 
1087      if (getContact().isEmpty()) {
1088        addContact();
1089      }
1090      return getContact().get(0);
1091    }
1092
1093    /**
1094     * @return {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value
1095     */
1096    public StringType getResponsibleElement() { 
1097      if (this.responsible == null)
1098        if (Configuration.errorOnAutoCreate())
1099          throw new Error("Attempt to auto-create NamingSystem.responsible");
1100        else if (Configuration.doAutoCreate())
1101          this.responsible = new StringType(); // bb
1102      return this.responsible;
1103    }
1104
1105    public boolean hasResponsibleElement() { 
1106      return this.responsible != null && !this.responsible.isEmpty();
1107    }
1108
1109    public boolean hasResponsible() { 
1110      return this.responsible != null && !this.responsible.isEmpty();
1111    }
1112
1113    /**
1114     * @param value {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value
1115     */
1116    public NamingSystem setResponsibleElement(StringType value) { 
1117      this.responsible = value;
1118      return this;
1119    }
1120
1121    /**
1122     * @return The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.
1123     */
1124    public String getResponsible() { 
1125      return this.responsible == null ? null : this.responsible.getValue();
1126    }
1127
1128    /**
1129     * @param value The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.
1130     */
1131    public NamingSystem setResponsible(String value) { 
1132      if (Utilities.noString(value))
1133        this.responsible = null;
1134      else {
1135        if (this.responsible == null)
1136          this.responsible = new StringType();
1137        this.responsible.setValue(value);
1138      }
1139      return this;
1140    }
1141
1142    /**
1143     * @return {@link #type} (Categorizes a naming system for easier search by grouping related naming systems.)
1144     */
1145    public CodeableConcept getType() { 
1146      if (this.type == null)
1147        if (Configuration.errorOnAutoCreate())
1148          throw new Error("Attempt to auto-create NamingSystem.type");
1149        else if (Configuration.doAutoCreate())
1150          this.type = new CodeableConcept(); // cc
1151      return this.type;
1152    }
1153
1154    public boolean hasType() { 
1155      return this.type != null && !this.type.isEmpty();
1156    }
1157
1158    /**
1159     * @param value {@link #type} (Categorizes a naming system for easier search by grouping related naming systems.)
1160     */
1161    public NamingSystem setType(CodeableConcept value)  { 
1162      this.type = value;
1163      return this;
1164    }
1165
1166    /**
1167     * @return {@link #description} (A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1168     */
1169    public MarkdownType getDescriptionElement() { 
1170      if (this.description == null)
1171        if (Configuration.errorOnAutoCreate())
1172          throw new Error("Attempt to auto-create NamingSystem.description");
1173        else if (Configuration.doAutoCreate())
1174          this.description = new MarkdownType(); // bb
1175      return this.description;
1176    }
1177
1178    public boolean hasDescriptionElement() { 
1179      return this.description != null && !this.description.isEmpty();
1180    }
1181
1182    public boolean hasDescription() { 
1183      return this.description != null && !this.description.isEmpty();
1184    }
1185
1186    /**
1187     * @param value {@link #description} (A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1188     */
1189    public NamingSystem setDescriptionElement(MarkdownType value) { 
1190      this.description = value;
1191      return this;
1192    }
1193
1194    /**
1195     * @return A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.
1196     */
1197    public String getDescription() { 
1198      return this.description == null ? null : this.description.getValue();
1199    }
1200
1201    /**
1202     * @param value A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.
1203     */
1204    public NamingSystem setDescription(String value) { 
1205      if (value == null)
1206        this.description = null;
1207      else {
1208        if (this.description == null)
1209          this.description = new MarkdownType();
1210        this.description.setValue(value);
1211      }
1212      return this;
1213    }
1214
1215    /**
1216     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate naming system instances.)
1217     */
1218    public List<UsageContext> getUseContext() { 
1219      if (this.useContext == null)
1220        this.useContext = new ArrayList<UsageContext>();
1221      return this.useContext;
1222    }
1223
1224    /**
1225     * @return Returns a reference to <code>this</code> for easy method chaining
1226     */
1227    public NamingSystem setUseContext(List<UsageContext> theUseContext) { 
1228      this.useContext = theUseContext;
1229      return this;
1230    }
1231
1232    public boolean hasUseContext() { 
1233      if (this.useContext == null)
1234        return false;
1235      for (UsageContext item : this.useContext)
1236        if (!item.isEmpty())
1237          return true;
1238      return false;
1239    }
1240
1241    public UsageContext addUseContext() { //3
1242      UsageContext t = new UsageContext();
1243      if (this.useContext == null)
1244        this.useContext = new ArrayList<UsageContext>();
1245      this.useContext.add(t);
1246      return t;
1247    }
1248
1249    public NamingSystem addUseContext(UsageContext t) { //3
1250      if (t == null)
1251        return this;
1252      if (this.useContext == null)
1253        this.useContext = new ArrayList<UsageContext>();
1254      this.useContext.add(t);
1255      return this;
1256    }
1257
1258    /**
1259     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
1260     */
1261    public UsageContext getUseContextFirstRep() { 
1262      if (getUseContext().isEmpty()) {
1263        addUseContext();
1264      }
1265      return getUseContext().get(0);
1266    }
1267
1268    /**
1269     * @return {@link #jurisdiction} (A legal or geographic region in which the naming system is intended to be used.)
1270     */
1271    public List<CodeableConcept> getJurisdiction() { 
1272      if (this.jurisdiction == null)
1273        this.jurisdiction = new ArrayList<CodeableConcept>();
1274      return this.jurisdiction;
1275    }
1276
1277    /**
1278     * @return Returns a reference to <code>this</code> for easy method chaining
1279     */
1280    public NamingSystem setJurisdiction(List<CodeableConcept> theJurisdiction) { 
1281      this.jurisdiction = theJurisdiction;
1282      return this;
1283    }
1284
1285    public boolean hasJurisdiction() { 
1286      if (this.jurisdiction == null)
1287        return false;
1288      for (CodeableConcept item : this.jurisdiction)
1289        if (!item.isEmpty())
1290          return true;
1291      return false;
1292    }
1293
1294    public CodeableConcept addJurisdiction() { //3
1295      CodeableConcept t = new CodeableConcept();
1296      if (this.jurisdiction == null)
1297        this.jurisdiction = new ArrayList<CodeableConcept>();
1298      this.jurisdiction.add(t);
1299      return t;
1300    }
1301
1302    public NamingSystem addJurisdiction(CodeableConcept t) { //3
1303      if (t == null)
1304        return this;
1305      if (this.jurisdiction == null)
1306        this.jurisdiction = new ArrayList<CodeableConcept>();
1307      this.jurisdiction.add(t);
1308      return this;
1309    }
1310
1311    /**
1312     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
1313     */
1314    public CodeableConcept getJurisdictionFirstRep() { 
1315      if (getJurisdiction().isEmpty()) {
1316        addJurisdiction();
1317      }
1318      return getJurisdiction().get(0);
1319    }
1320
1321    /**
1322     * @return {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value
1323     */
1324    public StringType getUsageElement() { 
1325      if (this.usage == null)
1326        if (Configuration.errorOnAutoCreate())
1327          throw new Error("Attempt to auto-create NamingSystem.usage");
1328        else if (Configuration.doAutoCreate())
1329          this.usage = new StringType(); // bb
1330      return this.usage;
1331    }
1332
1333    public boolean hasUsageElement() { 
1334      return this.usage != null && !this.usage.isEmpty();
1335    }
1336
1337    public boolean hasUsage() { 
1338      return this.usage != null && !this.usage.isEmpty();
1339    }
1340
1341    /**
1342     * @param value {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value
1343     */
1344    public NamingSystem setUsageElement(StringType value) { 
1345      this.usage = value;
1346      return this;
1347    }
1348
1349    /**
1350     * @return Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.
1351     */
1352    public String getUsage() { 
1353      return this.usage == null ? null : this.usage.getValue();
1354    }
1355
1356    /**
1357     * @param value Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.
1358     */
1359    public NamingSystem setUsage(String value) { 
1360      if (Utilities.noString(value))
1361        this.usage = null;
1362      else {
1363        if (this.usage == null)
1364          this.usage = new StringType();
1365        this.usage.setValue(value);
1366      }
1367      return this;
1368    }
1369
1370    /**
1371     * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.)
1372     */
1373    public List<NamingSystemUniqueIdComponent> getUniqueId() { 
1374      if (this.uniqueId == null)
1375        this.uniqueId = new ArrayList<NamingSystemUniqueIdComponent>();
1376      return this.uniqueId;
1377    }
1378
1379    /**
1380     * @return Returns a reference to <code>this</code> for easy method chaining
1381     */
1382    public NamingSystem setUniqueId(List<NamingSystemUniqueIdComponent> theUniqueId) { 
1383      this.uniqueId = theUniqueId;
1384      return this;
1385    }
1386
1387    public boolean hasUniqueId() { 
1388      if (this.uniqueId == null)
1389        return false;
1390      for (NamingSystemUniqueIdComponent item : this.uniqueId)
1391        if (!item.isEmpty())
1392          return true;
1393      return false;
1394    }
1395
1396    public NamingSystemUniqueIdComponent addUniqueId() { //3
1397      NamingSystemUniqueIdComponent t = new NamingSystemUniqueIdComponent();
1398      if (this.uniqueId == null)
1399        this.uniqueId = new ArrayList<NamingSystemUniqueIdComponent>();
1400      this.uniqueId.add(t);
1401      return t;
1402    }
1403
1404    public NamingSystem addUniqueId(NamingSystemUniqueIdComponent t) { //3
1405      if (t == null)
1406        return this;
1407      if (this.uniqueId == null)
1408        this.uniqueId = new ArrayList<NamingSystemUniqueIdComponent>();
1409      this.uniqueId.add(t);
1410      return this;
1411    }
1412
1413    /**
1414     * @return The first repetition of repeating field {@link #uniqueId}, creating it if it does not already exist
1415     */
1416    public NamingSystemUniqueIdComponent getUniqueIdFirstRep() { 
1417      if (getUniqueId().isEmpty()) {
1418        addUniqueId();
1419      }
1420      return getUniqueId().get(0);
1421    }
1422
1423    /**
1424     * @return {@link #replacedBy} (For naming systems that are retired, indicates the naming system that should be used in their place (if any).)
1425     */
1426    public Reference getReplacedBy() { 
1427      if (this.replacedBy == null)
1428        if (Configuration.errorOnAutoCreate())
1429          throw new Error("Attempt to auto-create NamingSystem.replacedBy");
1430        else if (Configuration.doAutoCreate())
1431          this.replacedBy = new Reference(); // cc
1432      return this.replacedBy;
1433    }
1434
1435    public boolean hasReplacedBy() { 
1436      return this.replacedBy != null && !this.replacedBy.isEmpty();
1437    }
1438
1439    /**
1440     * @param value {@link #replacedBy} (For naming systems that are retired, indicates the naming system that should be used in their place (if any).)
1441     */
1442    public NamingSystem setReplacedBy(Reference value)  { 
1443      this.replacedBy = value;
1444      return this;
1445    }
1446
1447    /**
1448     * @return {@link #replacedBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (For naming systems that are retired, indicates the naming system that should be used in their place (if any).)
1449     */
1450    public NamingSystem getReplacedByTarget() { 
1451      if (this.replacedByTarget == null)
1452        if (Configuration.errorOnAutoCreate())
1453          throw new Error("Attempt to auto-create NamingSystem.replacedBy");
1454        else if (Configuration.doAutoCreate())
1455          this.replacedByTarget = new NamingSystem(); // aa
1456      return this.replacedByTarget;
1457    }
1458
1459    /**
1460     * @param value {@link #replacedBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (For naming systems that are retired, indicates the naming system that should be used in their place (if any).)
1461     */
1462    public NamingSystem setReplacedByTarget(NamingSystem value) { 
1463      this.replacedByTarget = value;
1464      return this;
1465    }
1466
1467      protected void listChildren(List<Property> children) {
1468        super.listChildren(children);
1469        children.add(new Property("name", "string", "A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
1470        children.add(new Property("status", "code", "The status of this naming system. Enables tracking the life-cycle of the content.", 0, 1, status));
1471        children.add(new Property("kind", "code", "Indicates the purpose for the naming system - what kinds of things does it make unique?", 0, 1, kind));
1472        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the naming system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.", 0, 1, date));
1473        children.add(new Property("publisher", "string", "The name of the individual or organization that published the naming system.", 0, 1, publisher));
1474        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));
1475        children.add(new Property("responsible", "string", "The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.", 0, 1, responsible));
1476        children.add(new Property("type", "CodeableConcept", "Categorizes a naming system for easier search by grouping related naming systems.", 0, 1, type));
1477        children.add(new Property("description", "markdown", "A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.", 0, 1, description));
1478        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate naming system instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
1479        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the naming system is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
1480        children.add(new Property("usage", "string", "Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.", 0, 1, usage));
1481        children.add(new Property("uniqueId", "", "Indicates how the system may be identified when referenced in electronic exchange.", 0, java.lang.Integer.MAX_VALUE, uniqueId));
1482        children.add(new Property("replacedBy", "Reference(NamingSystem)", "For naming systems that are retired, indicates the naming system that should be used in their place (if any).", 0, 1, replacedBy));
1483      }
1484
1485      @Override
1486      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1487        switch (_hash) {
1488        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
1489        case -892481550: /*status*/  return new Property("status", "code", "The status of this naming system. Enables tracking the life-cycle of the content.", 0, 1, status);
1490        case 3292052: /*kind*/  return new Property("kind", "code", "Indicates the purpose for the naming system - what kinds of things does it make unique?", 0, 1, kind);
1491        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the naming system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.", 0, 1, date);
1492        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the individual or organization that published the naming system.", 0, 1, publisher);
1493        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);
1494        case 1847674614: /*responsible*/  return new Property("responsible", "string", "The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.", 0, 1, responsible);
1495        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Categorizes a naming system for easier search by grouping related naming systems.", 0, 1, type);
1496        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.", 0, 1, description);
1497        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 terms may be used to assist with indexing and searching for appropriate naming system instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
1498        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the naming system is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
1499        case 111574433: /*usage*/  return new Property("usage", "string", "Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.", 0, 1, usage);
1500        case -294460212: /*uniqueId*/  return new Property("uniqueId", "", "Indicates how the system may be identified when referenced in electronic exchange.", 0, java.lang.Integer.MAX_VALUE, uniqueId);
1501        case -1233035097: /*replacedBy*/  return new Property("replacedBy", "Reference(NamingSystem)", "For naming systems that are retired, indicates the naming system that should be used in their place (if any).", 0, 1, replacedBy);
1502        default: return super.getNamedProperty(_hash, _name, _checkValid);
1503        }
1504
1505      }
1506
1507      @Override
1508      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1509        switch (hash) {
1510        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1511        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
1512        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<NamingSystemType>
1513        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1514        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
1515        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
1516        case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // StringType
1517        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1518        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
1519        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
1520        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
1521        case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType
1522        case -294460212: /*uniqueId*/ return this.uniqueId == null ? new Base[0] : this.uniqueId.toArray(new Base[this.uniqueId.size()]); // NamingSystemUniqueIdComponent
1523        case -1233035097: /*replacedBy*/ return this.replacedBy == null ? new Base[0] : new Base[] {this.replacedBy}; // Reference
1524        default: return super.getProperty(hash, name, checkValid);
1525        }
1526
1527      }
1528
1529      @Override
1530      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1531        switch (hash) {
1532        case 3373707: // name
1533          this.name = castToString(value); // StringType
1534          return value;
1535        case -892481550: // status
1536          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
1537          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
1538          return value;
1539        case 3292052: // kind
1540          value = new NamingSystemTypeEnumFactory().fromType(castToCode(value));
1541          this.kind = (Enumeration) value; // Enumeration<NamingSystemType>
1542          return value;
1543        case 3076014: // date
1544          this.date = castToDateTime(value); // DateTimeType
1545          return value;
1546        case 1447404028: // publisher
1547          this.publisher = castToString(value); // StringType
1548          return value;
1549        case 951526432: // contact
1550          this.getContact().add(castToContactDetail(value)); // ContactDetail
1551          return value;
1552        case 1847674614: // responsible
1553          this.responsible = castToString(value); // StringType
1554          return value;
1555        case 3575610: // type
1556          this.type = castToCodeableConcept(value); // CodeableConcept
1557          return value;
1558        case -1724546052: // description
1559          this.description = castToMarkdown(value); // MarkdownType
1560          return value;
1561        case -669707736: // useContext
1562          this.getUseContext().add(castToUsageContext(value)); // UsageContext
1563          return value;
1564        case -507075711: // jurisdiction
1565          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
1566          return value;
1567        case 111574433: // usage
1568          this.usage = castToString(value); // StringType
1569          return value;
1570        case -294460212: // uniqueId
1571          this.getUniqueId().add((NamingSystemUniqueIdComponent) value); // NamingSystemUniqueIdComponent
1572          return value;
1573        case -1233035097: // replacedBy
1574          this.replacedBy = castToReference(value); // Reference
1575          return value;
1576        default: return super.setProperty(hash, name, value);
1577        }
1578
1579      }
1580
1581      @Override
1582      public Base setProperty(String name, Base value) throws FHIRException {
1583        if (name.equals("name")) {
1584          this.name = castToString(value); // StringType
1585        } else if (name.equals("status")) {
1586          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
1587          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
1588        } else if (name.equals("kind")) {
1589          value = new NamingSystemTypeEnumFactory().fromType(castToCode(value));
1590          this.kind = (Enumeration) value; // Enumeration<NamingSystemType>
1591        } else if (name.equals("date")) {
1592          this.date = castToDateTime(value); // DateTimeType
1593        } else if (name.equals("publisher")) {
1594          this.publisher = castToString(value); // StringType
1595        } else if (name.equals("contact")) {
1596          this.getContact().add(castToContactDetail(value));
1597        } else if (name.equals("responsible")) {
1598          this.responsible = castToString(value); // StringType
1599        } else if (name.equals("type")) {
1600          this.type = castToCodeableConcept(value); // CodeableConcept
1601        } else if (name.equals("description")) {
1602          this.description = castToMarkdown(value); // MarkdownType
1603        } else if (name.equals("useContext")) {
1604          this.getUseContext().add(castToUsageContext(value));
1605        } else if (name.equals("jurisdiction")) {
1606          this.getJurisdiction().add(castToCodeableConcept(value));
1607        } else if (name.equals("usage")) {
1608          this.usage = castToString(value); // StringType
1609        } else if (name.equals("uniqueId")) {
1610          this.getUniqueId().add((NamingSystemUniqueIdComponent) value);
1611        } else if (name.equals("replacedBy")) {
1612          this.replacedBy = castToReference(value); // Reference
1613        } else
1614          return super.setProperty(name, value);
1615        return value;
1616      }
1617
1618      @Override
1619      public Base makeProperty(int hash, String name) throws FHIRException {
1620        switch (hash) {
1621        case 3373707:  return getNameElement();
1622        case -892481550:  return getStatusElement();
1623        case 3292052:  return getKindElement();
1624        case 3076014:  return getDateElement();
1625        case 1447404028:  return getPublisherElement();
1626        case 951526432:  return addContact(); 
1627        case 1847674614:  return getResponsibleElement();
1628        case 3575610:  return getType(); 
1629        case -1724546052:  return getDescriptionElement();
1630        case -669707736:  return addUseContext(); 
1631        case -507075711:  return addJurisdiction(); 
1632        case 111574433:  return getUsageElement();
1633        case -294460212:  return addUniqueId(); 
1634        case -1233035097:  return getReplacedBy(); 
1635        default: return super.makeProperty(hash, name);
1636        }
1637
1638      }
1639
1640      @Override
1641      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1642        switch (hash) {
1643        case 3373707: /*name*/ return new String[] {"string"};
1644        case -892481550: /*status*/ return new String[] {"code"};
1645        case 3292052: /*kind*/ return new String[] {"code"};
1646        case 3076014: /*date*/ return new String[] {"dateTime"};
1647        case 1447404028: /*publisher*/ return new String[] {"string"};
1648        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
1649        case 1847674614: /*responsible*/ return new String[] {"string"};
1650        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1651        case -1724546052: /*description*/ return new String[] {"markdown"};
1652        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
1653        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
1654        case 111574433: /*usage*/ return new String[] {"string"};
1655        case -294460212: /*uniqueId*/ return new String[] {};
1656        case -1233035097: /*replacedBy*/ return new String[] {"Reference"};
1657        default: return super.getTypesForProperty(hash, name);
1658        }
1659
1660      }
1661
1662      @Override
1663      public Base addChild(String name) throws FHIRException {
1664        if (name.equals("name")) {
1665          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.name");
1666        }
1667        else if (name.equals("status")) {
1668          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.status");
1669        }
1670        else if (name.equals("kind")) {
1671          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.kind");
1672        }
1673        else if (name.equals("date")) {
1674          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.date");
1675        }
1676        else if (name.equals("publisher")) {
1677          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.publisher");
1678        }
1679        else if (name.equals("contact")) {
1680          return addContact();
1681        }
1682        else if (name.equals("responsible")) {
1683          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.responsible");
1684        }
1685        else if (name.equals("type")) {
1686          this.type = new CodeableConcept();
1687          return this.type;
1688        }
1689        else if (name.equals("description")) {
1690          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.description");
1691        }
1692        else if (name.equals("useContext")) {
1693          return addUseContext();
1694        }
1695        else if (name.equals("jurisdiction")) {
1696          return addJurisdiction();
1697        }
1698        else if (name.equals("usage")) {
1699          throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.usage");
1700        }
1701        else if (name.equals("uniqueId")) {
1702          return addUniqueId();
1703        }
1704        else if (name.equals("replacedBy")) {
1705          this.replacedBy = new Reference();
1706          return this.replacedBy;
1707        }
1708        else
1709          return super.addChild(name);
1710      }
1711
1712  public String fhirType() {
1713    return "NamingSystem";
1714
1715  }
1716
1717      public NamingSystem copy() {
1718        NamingSystem dst = new NamingSystem();
1719        copyValues(dst);
1720        dst.name = name == null ? null : name.copy();
1721        dst.status = status == null ? null : status.copy();
1722        dst.kind = kind == null ? null : kind.copy();
1723        dst.date = date == null ? null : date.copy();
1724        dst.publisher = publisher == null ? null : publisher.copy();
1725        if (contact != null) {
1726          dst.contact = new ArrayList<ContactDetail>();
1727          for (ContactDetail i : contact)
1728            dst.contact.add(i.copy());
1729        };
1730        dst.responsible = responsible == null ? null : responsible.copy();
1731        dst.type = type == null ? null : type.copy();
1732        dst.description = description == null ? null : description.copy();
1733        if (useContext != null) {
1734          dst.useContext = new ArrayList<UsageContext>();
1735          for (UsageContext i : useContext)
1736            dst.useContext.add(i.copy());
1737        };
1738        if (jurisdiction != null) {
1739          dst.jurisdiction = new ArrayList<CodeableConcept>();
1740          for (CodeableConcept i : jurisdiction)
1741            dst.jurisdiction.add(i.copy());
1742        };
1743        dst.usage = usage == null ? null : usage.copy();
1744        if (uniqueId != null) {
1745          dst.uniqueId = new ArrayList<NamingSystemUniqueIdComponent>();
1746          for (NamingSystemUniqueIdComponent i : uniqueId)
1747            dst.uniqueId.add(i.copy());
1748        };
1749        dst.replacedBy = replacedBy == null ? null : replacedBy.copy();
1750        return dst;
1751      }
1752
1753      protected NamingSystem typedCopy() {
1754        return copy();
1755      }
1756
1757      @Override
1758      public boolean equalsDeep(Base other_) {
1759        if (!super.equalsDeep(other_))
1760          return false;
1761        if (!(other_ instanceof NamingSystem))
1762          return false;
1763        NamingSystem o = (NamingSystem) other_;
1764        return compareDeep(kind, o.kind, true) && compareDeep(responsible, o.responsible, true) && compareDeep(type, o.type, true)
1765           && compareDeep(usage, o.usage, true) && compareDeep(uniqueId, o.uniqueId, true) && compareDeep(replacedBy, o.replacedBy, true)
1766          ;
1767      }
1768
1769      @Override
1770      public boolean equalsShallow(Base other_) {
1771        if (!super.equalsShallow(other_))
1772          return false;
1773        if (!(other_ instanceof NamingSystem))
1774          return false;
1775        NamingSystem o = (NamingSystem) other_;
1776        return compareValues(kind, o.kind, true) && compareValues(responsible, o.responsible, true) && compareValues(usage, o.usage, true)
1777          ;
1778      }
1779
1780      public boolean isEmpty() {
1781        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(kind, responsible, type
1782          , usage, uniqueId, replacedBy);
1783      }
1784
1785  @Override
1786  public ResourceType getResourceType() {
1787    return ResourceType.NamingSystem;
1788   }
1789
1790 /**
1791   * Search parameter: <b>date</b>
1792   * <p>
1793   * Description: <b>The naming system publication date</b><br>
1794   * Type: <b>date</b><br>
1795   * Path: <b>NamingSystem.date</b><br>
1796   * </p>
1797   */
1798  @SearchParamDefinition(name="date", path="NamingSystem.date", description="The naming system publication date", type="date" )
1799  public static final String SP_DATE = "date";
1800 /**
1801   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1802   * <p>
1803   * Description: <b>The naming system publication date</b><br>
1804   * Type: <b>date</b><br>
1805   * Path: <b>NamingSystem.date</b><br>
1806   * </p>
1807   */
1808  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1809
1810 /**
1811   * Search parameter: <b>period</b>
1812   * <p>
1813   * Description: <b>When is identifier valid?</b><br>
1814   * Type: <b>date</b><br>
1815   * Path: <b>NamingSystem.uniqueId.period</b><br>
1816   * </p>
1817   */
1818  @SearchParamDefinition(name="period", path="NamingSystem.uniqueId.period", description="When is identifier valid?", type="date" )
1819  public static final String SP_PERIOD = "period";
1820 /**
1821   * <b>Fluent Client</b> search parameter constant for <b>period</b>
1822   * <p>
1823   * Description: <b>When is identifier valid?</b><br>
1824   * Type: <b>date</b><br>
1825   * Path: <b>NamingSystem.uniqueId.period</b><br>
1826   * </p>
1827   */
1828  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
1829
1830 /**
1831   * Search parameter: <b>kind</b>
1832   * <p>
1833   * Description: <b>codesystem | identifier | root</b><br>
1834   * Type: <b>token</b><br>
1835   * Path: <b>NamingSystem.kind</b><br>
1836   * </p>
1837   */
1838  @SearchParamDefinition(name="kind", path="NamingSystem.kind", description="codesystem | identifier | root", type="token" )
1839  public static final String SP_KIND = "kind";
1840 /**
1841   * <b>Fluent Client</b> search parameter constant for <b>kind</b>
1842   * <p>
1843   * Description: <b>codesystem | identifier | root</b><br>
1844   * Type: <b>token</b><br>
1845   * Path: <b>NamingSystem.kind</b><br>
1846   * </p>
1847   */
1848  public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND);
1849
1850 /**
1851   * Search parameter: <b>jurisdiction</b>
1852   * <p>
1853   * Description: <b>Intended jurisdiction for the naming system</b><br>
1854   * Type: <b>token</b><br>
1855   * Path: <b>NamingSystem.jurisdiction</b><br>
1856   * </p>
1857   */
1858  @SearchParamDefinition(name="jurisdiction", path="NamingSystem.jurisdiction", description="Intended jurisdiction for the naming system", type="token" )
1859  public static final String SP_JURISDICTION = "jurisdiction";
1860 /**
1861   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
1862   * <p>
1863   * Description: <b>Intended jurisdiction for the naming system</b><br>
1864   * Type: <b>token</b><br>
1865   * Path: <b>NamingSystem.jurisdiction</b><br>
1866   * </p>
1867   */
1868  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
1869
1870 /**
1871   * Search parameter: <b>description</b>
1872   * <p>
1873   * Description: <b>The description of the naming system</b><br>
1874   * Type: <b>string</b><br>
1875   * Path: <b>NamingSystem.description</b><br>
1876   * </p>
1877   */
1878  @SearchParamDefinition(name="description", path="NamingSystem.description", description="The description of the naming system", type="string" )
1879  public static final String SP_DESCRIPTION = "description";
1880 /**
1881   * <b>Fluent Client</b> search parameter constant for <b>description</b>
1882   * <p>
1883   * Description: <b>The description of the naming system</b><br>
1884   * Type: <b>string</b><br>
1885   * Path: <b>NamingSystem.description</b><br>
1886   * </p>
1887   */
1888  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
1889
1890 /**
1891   * Search parameter: <b>type</b>
1892   * <p>
1893   * Description: <b>e.g. driver,  provider,  patient, bank etc.</b><br>
1894   * Type: <b>token</b><br>
1895   * Path: <b>NamingSystem.type</b><br>
1896   * </p>
1897   */
1898  @SearchParamDefinition(name="type", path="NamingSystem.type", description="e.g. driver,  provider,  patient, bank etc.", type="token" )
1899  public static final String SP_TYPE = "type";
1900 /**
1901   * <b>Fluent Client</b> search parameter constant for <b>type</b>
1902   * <p>
1903   * Description: <b>e.g. driver,  provider,  patient, bank etc.</b><br>
1904   * Type: <b>token</b><br>
1905   * Path: <b>NamingSystem.type</b><br>
1906   * </p>
1907   */
1908  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
1909
1910 /**
1911   * Search parameter: <b>id-type</b>
1912   * <p>
1913   * Description: <b>oid | uuid | uri | other</b><br>
1914   * Type: <b>token</b><br>
1915   * Path: <b>NamingSystem.uniqueId.type</b><br>
1916   * </p>
1917   */
1918  @SearchParamDefinition(name="id-type", path="NamingSystem.uniqueId.type", description="oid | uuid | uri | other", type="token" )
1919  public static final String SP_ID_TYPE = "id-type";
1920 /**
1921   * <b>Fluent Client</b> search parameter constant for <b>id-type</b>
1922   * <p>
1923   * Description: <b>oid | uuid | uri | other</b><br>
1924   * Type: <b>token</b><br>
1925   * Path: <b>NamingSystem.uniqueId.type</b><br>
1926   * </p>
1927   */
1928  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ID_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ID_TYPE);
1929
1930 /**
1931   * Search parameter: <b>responsible</b>
1932   * <p>
1933   * Description: <b>Who maintains system namespace?</b><br>
1934   * Type: <b>string</b><br>
1935   * Path: <b>NamingSystem.responsible</b><br>
1936   * </p>
1937   */
1938  @SearchParamDefinition(name="responsible", path="NamingSystem.responsible", description="Who maintains system namespace?", type="string" )
1939  public static final String SP_RESPONSIBLE = "responsible";
1940 /**
1941   * <b>Fluent Client</b> search parameter constant for <b>responsible</b>
1942   * <p>
1943   * Description: <b>Who maintains system namespace?</b><br>
1944   * Type: <b>string</b><br>
1945   * Path: <b>NamingSystem.responsible</b><br>
1946   * </p>
1947   */
1948  public static final ca.uhn.fhir.rest.gclient.StringClientParam RESPONSIBLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_RESPONSIBLE);
1949
1950 /**
1951   * Search parameter: <b>contact</b>
1952   * <p>
1953   * Description: <b>Name of an individual to contact</b><br>
1954   * Type: <b>string</b><br>
1955   * Path: <b>NamingSystem.contact.name</b><br>
1956   * </p>
1957   */
1958  @SearchParamDefinition(name="contact", path="NamingSystem.contact.name", description="Name of an individual to contact", type="string" )
1959  public static final String SP_CONTACT = "contact";
1960 /**
1961   * <b>Fluent Client</b> search parameter constant for <b>contact</b>
1962   * <p>
1963   * Description: <b>Name of an individual to contact</b><br>
1964   * Type: <b>string</b><br>
1965   * Path: <b>NamingSystem.contact.name</b><br>
1966   * </p>
1967   */
1968  public static final ca.uhn.fhir.rest.gclient.StringClientParam CONTACT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_CONTACT);
1969
1970 /**
1971   * Search parameter: <b>name</b>
1972   * <p>
1973   * Description: <b>Computationally friendly name of the naming system</b><br>
1974   * Type: <b>string</b><br>
1975   * Path: <b>NamingSystem.name</b><br>
1976   * </p>
1977   */
1978  @SearchParamDefinition(name="name", path="NamingSystem.name", description="Computationally friendly name of the naming system", type="string" )
1979  public static final String SP_NAME = "name";
1980 /**
1981   * <b>Fluent Client</b> search parameter constant for <b>name</b>
1982   * <p>
1983   * Description: <b>Computationally friendly name of the naming system</b><br>
1984   * Type: <b>string</b><br>
1985   * Path: <b>NamingSystem.name</b><br>
1986   * </p>
1987   */
1988  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
1989
1990 /**
1991   * Search parameter: <b>publisher</b>
1992   * <p>
1993   * Description: <b>Name of the publisher of the naming system</b><br>
1994   * Type: <b>string</b><br>
1995   * Path: <b>NamingSystem.publisher</b><br>
1996   * </p>
1997   */
1998  @SearchParamDefinition(name="publisher", path="NamingSystem.publisher", description="Name of the publisher of the naming system", type="string" )
1999  public static final String SP_PUBLISHER = "publisher";
2000 /**
2001   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
2002   * <p>
2003   * Description: <b>Name of the publisher of the naming system</b><br>
2004   * Type: <b>string</b><br>
2005   * Path: <b>NamingSystem.publisher</b><br>
2006   * </p>
2007   */
2008  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
2009
2010 /**
2011   * Search parameter: <b>telecom</b>
2012   * <p>
2013   * Description: <b>Contact details for individual or organization</b><br>
2014   * Type: <b>token</b><br>
2015   * Path: <b>NamingSystem.contact.telecom</b><br>
2016   * </p>
2017   */
2018  @SearchParamDefinition(name="telecom", path="NamingSystem.contact.telecom", description="Contact details for individual or organization", type="token" )
2019  public static final String SP_TELECOM = "telecom";
2020 /**
2021   * <b>Fluent Client</b> search parameter constant for <b>telecom</b>
2022   * <p>
2023   * Description: <b>Contact details for individual or organization</b><br>
2024   * Type: <b>token</b><br>
2025   * Path: <b>NamingSystem.contact.telecom</b><br>
2026   * </p>
2027   */
2028  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM);
2029
2030 /**
2031   * Search parameter: <b>value</b>
2032   * <p>
2033   * Description: <b>The unique identifier</b><br>
2034   * Type: <b>string</b><br>
2035   * Path: <b>NamingSystem.uniqueId.value</b><br>
2036   * </p>
2037   */
2038  @SearchParamDefinition(name="value", path="NamingSystem.uniqueId.value", description="The unique identifier", type="string" )
2039  public static final String SP_VALUE = "value";
2040 /**
2041   * <b>Fluent Client</b> search parameter constant for <b>value</b>
2042   * <p>
2043   * Description: <b>The unique identifier</b><br>
2044   * Type: <b>string</b><br>
2045   * Path: <b>NamingSystem.uniqueId.value</b><br>
2046   * </p>
2047   */
2048  public static final ca.uhn.fhir.rest.gclient.StringClientParam VALUE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VALUE);
2049
2050 /**
2051   * Search parameter: <b>replaced-by</b>
2052   * <p>
2053   * Description: <b>Use this instead</b><br>
2054   * Type: <b>reference</b><br>
2055   * Path: <b>NamingSystem.replacedBy</b><br>
2056   * </p>
2057   */
2058  @SearchParamDefinition(name="replaced-by", path="NamingSystem.replacedBy", description="Use this instead", type="reference", target={NamingSystem.class } )
2059  public static final String SP_REPLACED_BY = "replaced-by";
2060 /**
2061   * <b>Fluent Client</b> search parameter constant for <b>replaced-by</b>
2062   * <p>
2063   * Description: <b>Use this instead</b><br>
2064   * Type: <b>reference</b><br>
2065   * Path: <b>NamingSystem.replacedBy</b><br>
2066   * </p>
2067   */
2068  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPLACED_BY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPLACED_BY);
2069
2070/**
2071   * Constant for fluent queries to be used to add include statements. Specifies
2072   * the path value of "<b>NamingSystem:replaced-by</b>".
2073   */
2074  public static final ca.uhn.fhir.model.api.Include INCLUDE_REPLACED_BY = new ca.uhn.fhir.model.api.Include("NamingSystem:replaced-by").toLocked();
2075
2076 /**
2077   * Search parameter: <b>status</b>
2078   * <p>
2079   * Description: <b>The current status of the naming system</b><br>
2080   * Type: <b>token</b><br>
2081   * Path: <b>NamingSystem.status</b><br>
2082   * </p>
2083   */
2084  @SearchParamDefinition(name="status", path="NamingSystem.status", description="The current status of the naming system", type="token" )
2085  public static final String SP_STATUS = "status";
2086 /**
2087   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2088   * <p>
2089   * Description: <b>The current status of the naming system</b><br>
2090   * Type: <b>token</b><br>
2091   * Path: <b>NamingSystem.status</b><br>
2092   * </p>
2093   */
2094  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2095
2096
2097}
2098