001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.ChildOrder;
044import ca.uhn.fhir.model.api.annotation.DatatypeDef;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047
048/**
049 * Base StructureDefinition for Identifier Type: An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.
050 */
051@DatatypeDef(name="Identifier")
052public class Identifier extends DataType implements ICompositeType {
053
054    public enum IdentifierUse {
055        /**
056         * The identifier recommended for display and use in real-world interactions.
057         */
058        USUAL, 
059        /**
060         * The identifier considered to be most trusted for the identification of this item. Sometimes also known as \"primary\" and \"main\". The determination of \"official\" is subjective and implementation guides often provide additional guidelines for use.
061         */
062        OFFICIAL, 
063        /**
064         * A temporary identifier.
065         */
066        TEMP, 
067        /**
068         * An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context.
069         */
070        SECONDARY, 
071        /**
072         * The identifier id no longer considered valid, but may be relevant for search purposes.  E.g. Changes to identifier schemes, account merges, etc.
073         */
074        OLD, 
075        /**
076         * added to help the parsers with the generic types
077         */
078        NULL;
079        public static IdentifierUse fromCode(String codeString) throws FHIRException {
080            if (codeString == null || "".equals(codeString))
081                return null;
082        if ("usual".equals(codeString))
083          return USUAL;
084        if ("official".equals(codeString))
085          return OFFICIAL;
086        if ("temp".equals(codeString))
087          return TEMP;
088        if ("secondary".equals(codeString))
089          return SECONDARY;
090        if ("old".equals(codeString))
091          return OLD;
092        if (Configuration.isAcceptInvalidEnums())
093          return null;
094        else
095          throw new FHIRException("Unknown IdentifierUse code '"+codeString+"'");
096        }
097        public String toCode() {
098          switch (this) {
099            case USUAL: return "usual";
100            case OFFICIAL: return "official";
101            case TEMP: return "temp";
102            case SECONDARY: return "secondary";
103            case OLD: return "old";
104            default: return "?";
105          }
106        }
107        public String getSystem() {
108          switch (this) {
109            case USUAL: return "http://hl7.org/fhir/identifier-use";
110            case OFFICIAL: return "http://hl7.org/fhir/identifier-use";
111            case TEMP: return "http://hl7.org/fhir/identifier-use";
112            case SECONDARY: return "http://hl7.org/fhir/identifier-use";
113            case OLD: return "http://hl7.org/fhir/identifier-use";
114            default: return "?";
115          }
116        }
117        public String getDefinition() {
118          switch (this) {
119            case USUAL: return "The identifier recommended for display and use in real-world interactions.";
120            case OFFICIAL: return "The identifier considered to be most trusted for the identification of this item. Sometimes also known as \"primary\" and \"main\". The determination of \"official\" is subjective and implementation guides often provide additional guidelines for use.";
121            case TEMP: return "A temporary identifier.";
122            case SECONDARY: return "An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context.";
123            case OLD: return "The identifier id no longer considered valid, but may be relevant for search purposes.  E.g. Changes to identifier schemes, account merges, etc.";
124            default: return "?";
125          }
126        }
127        public String getDisplay() {
128          switch (this) {
129            case USUAL: return "Usual";
130            case OFFICIAL: return "Official";
131            case TEMP: return "Temp";
132            case SECONDARY: return "Secondary";
133            case OLD: return "Old";
134            default: return "?";
135          }
136        }
137    }
138
139  public static class IdentifierUseEnumFactory implements EnumFactory<IdentifierUse> {
140    public IdentifierUse fromCode(String codeString) throws IllegalArgumentException {
141      if (codeString == null || "".equals(codeString))
142            if (codeString == null || "".equals(codeString))
143                return null;
144        if ("usual".equals(codeString))
145          return IdentifierUse.USUAL;
146        if ("official".equals(codeString))
147          return IdentifierUse.OFFICIAL;
148        if ("temp".equals(codeString))
149          return IdentifierUse.TEMP;
150        if ("secondary".equals(codeString))
151          return IdentifierUse.SECONDARY;
152        if ("old".equals(codeString))
153          return IdentifierUse.OLD;
154        throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'");
155        }
156        public Enumeration<IdentifierUse> fromType(Base code) throws FHIRException {
157          if (code == null)
158            return null;
159          if (code.isEmpty())
160            return new Enumeration<IdentifierUse>(this);
161          String codeString = ((PrimitiveType) code).asStringValue();
162          if (codeString == null || "".equals(codeString))
163            return null;
164        if ("usual".equals(codeString))
165          return new Enumeration<IdentifierUse>(this, IdentifierUse.USUAL);
166        if ("official".equals(codeString))
167          return new Enumeration<IdentifierUse>(this, IdentifierUse.OFFICIAL);
168        if ("temp".equals(codeString))
169          return new Enumeration<IdentifierUse>(this, IdentifierUse.TEMP);
170        if ("secondary".equals(codeString))
171          return new Enumeration<IdentifierUse>(this, IdentifierUse.SECONDARY);
172        if ("old".equals(codeString))
173          return new Enumeration<IdentifierUse>(this, IdentifierUse.OLD);
174        throw new FHIRException("Unknown IdentifierUse code '"+codeString+"'");
175        }
176    public String toCode(IdentifierUse code) {
177      if (code == IdentifierUse.USUAL)
178        return "usual";
179      if (code == IdentifierUse.OFFICIAL)
180        return "official";
181      if (code == IdentifierUse.TEMP)
182        return "temp";
183      if (code == IdentifierUse.SECONDARY)
184        return "secondary";
185      if (code == IdentifierUse.OLD)
186        return "old";
187      return "?";
188      }
189    public String toSystem(IdentifierUse code) {
190      return code.getSystem();
191      }
192    }
193
194    /**
195     * The purpose of this identifier.
196     */
197    @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1, modifier=true, summary=true)
198    @Description(shortDefinition="usual | official | temp | secondary | old (If known)", formalDefinition="The purpose of this identifier." )
199    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/identifier-use")
200    protected Enumeration<IdentifierUse> use;
201
202    /**
203     * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.
204     */
205    @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
206    @Description(shortDefinition="Description of identifier", formalDefinition="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." )
207    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/identifier-type")
208    protected CodeableConcept type;
209
210    /**
211     * Establishes the namespace for the value - that is, a URL that describes a set values that are unique.
212     */
213    @Child(name = "system", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
214    @Description(shortDefinition="The namespace for the identifier value", formalDefinition="Establishes the namespace for the value - that is, a URL that describes a set values that are unique." )
215    protected UriType system;
216
217    /**
218     * The portion of the identifier typically relevant to the user and which is unique within the context of the system.
219     */
220    @Child(name = "value", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
221    @Description(shortDefinition="The value that is unique", formalDefinition="The portion of the identifier typically relevant to the user and which is unique within the context of the system." )
222    protected StringType value;
223
224    /**
225     * Time period during which identifier is/was valid for use.
226     */
227    @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true)
228    @Description(shortDefinition="Time period when id is/was valid for use", formalDefinition="Time period during which identifier is/was valid for use." )
229    protected Period period;
230
231    /**
232     * Organization that issued/manages the identifier.
233     */
234    @Child(name = "assigner", type = {Organization.class}, order=5, min=0, max=1, modifier=false, summary=true)
235    @Description(shortDefinition="Organization that issued id (may be just text)", formalDefinition="Organization that issued/manages the identifier." )
236    protected Reference assigner;
237
238    private static final long serialVersionUID = 2098433371L;
239
240  /**
241   * Constructor
242   */
243    public Identifier() {
244      super();
245    }
246
247    /**
248     * @return {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
249     */
250    public Enumeration<IdentifierUse> getUseElement() { 
251      if (this.use == null)
252        if (Configuration.errorOnAutoCreate())
253          throw new Error("Attempt to auto-create Identifier.use");
254        else if (Configuration.doAutoCreate())
255          this.use = new Enumeration<IdentifierUse>(new IdentifierUseEnumFactory()); // bb
256      return this.use;
257    }
258
259    public boolean hasUseElement() { 
260      return this.use != null && !this.use.isEmpty();
261    }
262
263    public boolean hasUse() { 
264      return this.use != null && !this.use.isEmpty();
265    }
266
267    /**
268     * @param value {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
269     */
270    public Identifier setUseElement(Enumeration<IdentifierUse> value) { 
271      this.use = value;
272      return this;
273    }
274
275    /**
276     * @return The purpose of this identifier.
277     */
278    public IdentifierUse getUse() { 
279      return this.use == null ? null : this.use.getValue();
280    }
281
282    /**
283     * @param value The purpose of this identifier.
284     */
285    public Identifier setUse(IdentifierUse value) { 
286      if (value == null)
287        this.use = null;
288      else {
289        if (this.use == null)
290          this.use = new Enumeration<IdentifierUse>(new IdentifierUseEnumFactory());
291        this.use.setValue(value);
292      }
293      return this;
294    }
295
296    /**
297     * @return {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.)
298     */
299    public CodeableConcept getType() { 
300      if (this.type == null)
301        if (Configuration.errorOnAutoCreate())
302          throw new Error("Attempt to auto-create Identifier.type");
303        else if (Configuration.doAutoCreate())
304          this.type = new CodeableConcept(); // cc
305      return this.type;
306    }
307
308    public boolean hasType() { 
309      return this.type != null && !this.type.isEmpty();
310    }
311
312    /**
313     * @param value {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.)
314     */
315    public Identifier setType(CodeableConcept value) { 
316      this.type = value;
317      return this;
318    }
319
320    /**
321     * @return {@link #system} (Establishes the namespace for the value - that is, a URL that describes a set values that are unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
322     */
323    public UriType getSystemElement() { 
324      if (this.system == null)
325        if (Configuration.errorOnAutoCreate())
326          throw new Error("Attempt to auto-create Identifier.system");
327        else if (Configuration.doAutoCreate())
328          this.system = new UriType(); // bb
329      return this.system;
330    }
331
332    public boolean hasSystemElement() { 
333      return this.system != null && !this.system.isEmpty();
334    }
335
336    public boolean hasSystem() { 
337      return this.system != null && !this.system.isEmpty();
338    }
339
340    /**
341     * @param value {@link #system} (Establishes the namespace for the value - that is, a URL that describes a set values that are unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
342     */
343    public Identifier setSystemElement(UriType value) { 
344      this.system = value;
345      return this;
346    }
347
348    /**
349     * @return Establishes the namespace for the value - that is, a URL that describes a set values that are unique.
350     */
351    public String getSystem() { 
352      return this.system == null ? null : this.system.getValue();
353    }
354
355    /**
356     * @param value Establishes the namespace for the value - that is, a URL that describes a set values that are unique.
357     */
358    public Identifier setSystem(String value) { 
359      if (Utilities.noString(value))
360        this.system = null;
361      else {
362        if (this.system == null)
363          this.system = new UriType();
364        this.system.setValue(value);
365      }
366      return this;
367    }
368
369    /**
370     * @return {@link #value} (The portion of the identifier typically relevant to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
371     */
372    public StringType getValueElement() { 
373      if (this.value == null)
374        if (Configuration.errorOnAutoCreate())
375          throw new Error("Attempt to auto-create Identifier.value");
376        else if (Configuration.doAutoCreate())
377          this.value = new StringType(); // bb
378      return this.value;
379    }
380
381    public boolean hasValueElement() { 
382      return this.value != null && !this.value.isEmpty();
383    }
384
385    public boolean hasValue() { 
386      return this.value != null && !this.value.isEmpty();
387    }
388
389    /**
390     * @param value {@link #value} (The portion of the identifier typically relevant to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
391     */
392    public Identifier setValueElement(StringType value) { 
393      this.value = value;
394      return this;
395    }
396
397    /**
398     * @return The portion of the identifier typically relevant to the user and which is unique within the context of the system.
399     */
400    public String getValue() { 
401      return this.value == null ? null : this.value.getValue();
402    }
403
404    /**
405     * @param value The portion of the identifier typically relevant to the user and which is unique within the context of the system.
406     */
407    public Identifier setValue(String value) { 
408      if (Utilities.noString(value))
409        this.value = null;
410      else {
411        if (this.value == null)
412          this.value = new StringType();
413        this.value.setValue(value);
414      }
415      return this;
416    }
417
418    /**
419     * @return {@link #period} (Time period during which identifier is/was valid for use.)
420     */
421    public Period getPeriod() { 
422      if (this.period == null)
423        if (Configuration.errorOnAutoCreate())
424          throw new Error("Attempt to auto-create Identifier.period");
425        else if (Configuration.doAutoCreate())
426          this.period = new Period(); // cc
427      return this.period;
428    }
429
430    public boolean hasPeriod() { 
431      return this.period != null && !this.period.isEmpty();
432    }
433
434    /**
435     * @param value {@link #period} (Time period during which identifier is/was valid for use.)
436     */
437    public Identifier setPeriod(Period value) { 
438      this.period = value;
439      return this;
440    }
441
442    /**
443     * @return {@link #assigner} (Organization that issued/manages the identifier.)
444     */
445    public Reference getAssigner() { 
446      if (this.assigner == null)
447        if (Configuration.errorOnAutoCreate())
448          throw new Error("Attempt to auto-create Identifier.assigner");
449        else if (Configuration.doAutoCreate())
450          this.assigner = new Reference(); // cc
451      return this.assigner;
452    }
453
454    public boolean hasAssigner() { 
455      return this.assigner != null && !this.assigner.isEmpty();
456    }
457
458    /**
459     * @param value {@link #assigner} (Organization that issued/manages the identifier.)
460     */
461    public Identifier setAssigner(Reference value) { 
462      this.assigner = value;
463      return this;
464    }
465
466      protected void listChildren(List<Property> children) {
467        super.listChildren(children);
468        children.add(new Property("use", "code", "The purpose of this identifier.", 0, 1, use));
469        children.add(new Property("type", "CodeableConcept", "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.", 0, 1, type));
470        children.add(new Property("system", "uri", "Establishes the namespace for the value - that is, a URL that describes a set values that are unique.", 0, 1, system));
471        children.add(new Property("value", "string", "The portion of the identifier typically relevant to the user and which is unique within the context of the system.", 0, 1, value));
472        children.add(new Property("period", "Period", "Time period during which identifier is/was valid for use.", 0, 1, period));
473        children.add(new Property("assigner", "Reference(Organization)", "Organization that issued/manages the identifier.", 0, 1, assigner));
474      }
475
476      @Override
477      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
478        switch (_hash) {
479        case 116103: /*use*/  return new Property("use", "code", "The purpose of this identifier.", 0, 1, use);
480        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.", 0, 1, type);
481        case -887328209: /*system*/  return new Property("system", "uri", "Establishes the namespace for the value - that is, a URL that describes a set values that are unique.", 0, 1, system);
482        case 111972721: /*value*/  return new Property("value", "string", "The portion of the identifier typically relevant to the user and which is unique within the context of the system.", 0, 1, value);
483        case -991726143: /*period*/  return new Property("period", "Period", "Time period during which identifier is/was valid for use.", 0, 1, period);
484        case -369881636: /*assigner*/  return new Property("assigner", "Reference(Organization)", "Organization that issued/manages the identifier.", 0, 1, assigner);
485        default: return super.getNamedProperty(_hash, _name, _checkValid);
486        }
487
488      }
489
490      @Override
491      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
492        switch (hash) {
493        case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration<IdentifierUse>
494        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
495        case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType
496        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
497        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
498        case -369881636: /*assigner*/ return this.assigner == null ? new Base[0] : new Base[] {this.assigner}; // Reference
499        default: return super.getProperty(hash, name, checkValid);
500        }
501
502      }
503
504      @Override
505      public Base setProperty(int hash, String name, Base value) throws FHIRException {
506        switch (hash) {
507        case 116103: // use
508          value = new IdentifierUseEnumFactory().fromType(TypeConvertor.castToCode(value));
509          this.use = (Enumeration) value; // Enumeration<IdentifierUse>
510          return value;
511        case 3575610: // type
512          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
513          return value;
514        case -887328209: // system
515          this.system = TypeConvertor.castToUri(value); // UriType
516          return value;
517        case 111972721: // value
518          this.value = TypeConvertor.castToString(value); // StringType
519          return value;
520        case -991726143: // period
521          this.period = TypeConvertor.castToPeriod(value); // Period
522          return value;
523        case -369881636: // assigner
524          this.assigner = TypeConvertor.castToReference(value); // Reference
525          return value;
526        default: return super.setProperty(hash, name, value);
527        }
528
529      }
530
531      @Override
532      public Base setProperty(String name, Base value) throws FHIRException {
533        if (name.equals("use")) {
534          value = new IdentifierUseEnumFactory().fromType(TypeConvertor.castToCode(value));
535          this.use = (Enumeration) value; // Enumeration<IdentifierUse>
536        } else if (name.equals("type")) {
537          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
538        } else if (name.equals("system")) {
539          this.system = TypeConvertor.castToUri(value); // UriType
540        } else if (name.equals("value")) {
541          this.value = TypeConvertor.castToString(value); // StringType
542        } else if (name.equals("period")) {
543          this.period = TypeConvertor.castToPeriod(value); // Period
544        } else if (name.equals("assigner")) {
545          this.assigner = TypeConvertor.castToReference(value); // Reference
546        } else
547          return super.setProperty(name, value);
548        return value;
549      }
550
551      @Override
552      public Base makeProperty(int hash, String name) throws FHIRException {
553        switch (hash) {
554        case 116103:  return getUseElement();
555        case 3575610:  return getType();
556        case -887328209:  return getSystemElement();
557        case 111972721:  return getValueElement();
558        case -991726143:  return getPeriod();
559        case -369881636:  return getAssigner();
560        default: return super.makeProperty(hash, name);
561        }
562
563      }
564
565      @Override
566      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
567        switch (hash) {
568        case 116103: /*use*/ return new String[] {"code"};
569        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
570        case -887328209: /*system*/ return new String[] {"uri"};
571        case 111972721: /*value*/ return new String[] {"string"};
572        case -991726143: /*period*/ return new String[] {"Period"};
573        case -369881636: /*assigner*/ return new String[] {"Reference"};
574        default: return super.getTypesForProperty(hash, name);
575        }
576
577      }
578
579      @Override
580      public Base addChild(String name) throws FHIRException {
581        if (name.equals("use")) {
582          throw new FHIRException("Cannot call addChild on a primitive type Identifier.use");
583        }
584        else if (name.equals("type")) {
585          this.type = new CodeableConcept();
586          return this.type;
587        }
588        else if (name.equals("system")) {
589          throw new FHIRException("Cannot call addChild on a primitive type Identifier.system");
590        }
591        else if (name.equals("value")) {
592          throw new FHIRException("Cannot call addChild on a primitive type Identifier.value");
593        }
594        else if (name.equals("period")) {
595          this.period = new Period();
596          return this.period;
597        }
598        else if (name.equals("assigner")) {
599          this.assigner = new Reference();
600          return this.assigner;
601        }
602        else
603          return super.addChild(name);
604      }
605
606  public String fhirType() {
607    return "Identifier";
608
609  }
610
611      public Identifier copy() {
612        Identifier dst = new Identifier();
613        copyValues(dst);
614        return dst;
615      }
616
617      public void copyValues(Identifier dst) {
618        super.copyValues(dst);
619        dst.use = use == null ? null : use.copy();
620        dst.type = type == null ? null : type.copy();
621        dst.system = system == null ? null : system.copy();
622        dst.value = value == null ? null : value.copy();
623        dst.period = period == null ? null : period.copy();
624        dst.assigner = assigner == null ? null : assigner.copy();
625      }
626
627      protected Identifier typedCopy() {
628        return copy();
629      }
630
631      @Override
632      public boolean equalsDeep(Base other_) {
633        if (!super.equalsDeep(other_))
634          return false;
635        if (!(other_ instanceof Identifier))
636          return false;
637        Identifier o = (Identifier) other_;
638        return compareDeep(use, o.use, true) && compareDeep(type, o.type, true) && compareDeep(system, o.system, true)
639           && compareDeep(value, o.value, true) && compareDeep(period, o.period, true) && compareDeep(assigner, o.assigner, true)
640          ;
641      }
642
643      @Override
644      public boolean equalsShallow(Base other_) {
645        if (!super.equalsShallow(other_))
646          return false;
647        if (!(other_ instanceof Identifier))
648          return false;
649        Identifier o = (Identifier) other_;
650        return compareValues(use, o.use, true) && compareValues(system, o.system, true) && compareValues(value, o.value, true)
651          ;
652      }
653
654      public boolean isEmpty() {
655        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(use, type, system, value
656          , period, assigner);
657      }
658
659
660}
661