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