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