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