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