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