001package org.hl7.fhir.r4.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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.r4.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;
045/**
046 * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
047 */
048@DatatypeDef(name="Meta")
049public class Meta extends Type implements IBaseMetaType {
050
051    /**
052     * The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.
053     */
054    @Child(name = "versionId", type = {IdType.class}, order=0, min=0, max=1, modifier=false, summary=true)
055    @Description(shortDefinition="Version specific identifier", formalDefinition="The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted." )
056    protected IdType versionId;
057
058    /**
059     * When the resource last changed - e.g. when the version changed.
060     */
061    @Child(name = "lastUpdated", type = {InstantType.class}, order=1, min=0, max=1, modifier=false, summary=true)
062    @Description(shortDefinition="When the resource version last changed", formalDefinition="When the resource last changed - e.g. when the version changed." )
063    protected InstantType lastUpdated;
064
065    /**
066     * A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.
067     */
068    @Child(name = "source", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
069    @Description(shortDefinition="Identifies where the resource comes from", formalDefinition="A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc." )
070    protected UriType source;
071
072    /**
073     * A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].
074     */
075    @Child(name = "profile", type = {CanonicalType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
076    @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]." )
077    protected List<CanonicalType> profile;
078
079    /**
080     * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.
081     */
082    @Child(name = "security", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
083    @Description(shortDefinition="Security Labels applied to this resource", formalDefinition="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure." )
084    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-labels")
085    protected List<Coding> security;
086
087    /**
088     * Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.
089     */
090    @Child(name = "tag", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
091    @Description(shortDefinition="Tags applied to this resource", formalDefinition="Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource." )
092    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/common-tags")
093    protected List<Coding> tag;
094
095    private static final long serialVersionUID = -1386695622L;
096
097  /**
098   * Constructor
099   */
100    public Meta() {
101      super();
102    }
103
104    /**
105     * @return {@link #versionId} (The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value
106     */
107    public IdType getVersionIdElement() { 
108      if (this.versionId == null)
109        if (Configuration.errorOnAutoCreate())
110          throw new Error("Attempt to auto-create Meta.versionId");
111        else if (Configuration.doAutoCreate())
112          this.versionId = new IdType(); // bb
113      return this.versionId;
114    }
115
116    public boolean hasVersionIdElement() { 
117      return this.versionId != null && !this.versionId.isEmpty();
118    }
119
120    public boolean hasVersionId() { 
121      return this.versionId != null && !this.versionId.isEmpty();
122    }
123
124    /**
125     * @param value {@link #versionId} (The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value
126     */
127    public Meta setVersionIdElement(IdType value) { 
128      this.versionId = value;
129      return this;
130    }
131
132    /**
133     * @return The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.
134     */
135    public String getVersionId() { 
136      return this.versionId == null ? null : this.versionId.getValue();
137    }
138
139    /**
140     * @param value The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.
141     */
142    public Meta setVersionId(String value) { 
143      if (Utilities.noString(value))
144        this.versionId = null;
145      else {
146        if (this.versionId == null)
147          this.versionId = new IdType();
148        this.versionId.setValue(value);
149      }
150      return this;
151    }
152
153    /**
154     * @return {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value
155     */
156    public InstantType getLastUpdatedElement() { 
157      if (this.lastUpdated == null)
158        if (Configuration.errorOnAutoCreate())
159          throw new Error("Attempt to auto-create Meta.lastUpdated");
160        else if (Configuration.doAutoCreate())
161          this.lastUpdated = new InstantType(); // bb
162      return this.lastUpdated;
163    }
164
165    public boolean hasLastUpdatedElement() { 
166      return this.lastUpdated != null && !this.lastUpdated.isEmpty();
167    }
168
169    public boolean hasLastUpdated() { 
170      return this.lastUpdated != null && !this.lastUpdated.isEmpty();
171    }
172
173    /**
174     * @param value {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value
175     */
176    public Meta setLastUpdatedElement(InstantType value) { 
177      this.lastUpdated = value;
178      return this;
179    }
180
181    /**
182     * @return When the resource last changed - e.g. when the version changed.
183     */
184    public Date getLastUpdated() { 
185      return this.lastUpdated == null ? null : this.lastUpdated.getValue();
186    }
187
188    /**
189     * @param value When the resource last changed - e.g. when the version changed.
190     */
191    public Meta setLastUpdated(Date value) { 
192      if (value == null)
193        this.lastUpdated = null;
194      else {
195        if (this.lastUpdated == null)
196          this.lastUpdated = new InstantType();
197        this.lastUpdated.setValue(value);
198      }
199      return this;
200    }
201
202    /**
203     * @return {@link #source} (A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value
204     */
205    public UriType getSourceElement() { 
206      if (this.source == null)
207        if (Configuration.errorOnAutoCreate())
208          throw new Error("Attempt to auto-create Meta.source");
209        else if (Configuration.doAutoCreate())
210          this.source = new UriType(); // bb
211      return this.source;
212    }
213
214    public boolean hasSourceElement() { 
215      return this.source != null && !this.source.isEmpty();
216    }
217
218    public boolean hasSource() { 
219      return this.source != null && !this.source.isEmpty();
220    }
221
222    /**
223     * @param value {@link #source} (A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value
224     */
225    public Meta setSourceElement(UriType value) { 
226      this.source = value;
227      return this;
228    }
229
230    /**
231     * @return A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.
232     */
233    public String getSource() { 
234      return this.source == null ? null : this.source.getValue();
235    }
236
237    /**
238     * @param value A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.
239     */
240    public Meta setSource(String value) { 
241      if (Utilities.noString(value))
242        this.source = null;
243      else {
244        if (this.source == null)
245          this.source = new UriType();
246        this.source.setValue(value);
247      }
248      return this;
249    }
250
251    /**
252     * @return {@link #profile} (A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].)
253     */
254    public List<CanonicalType> getProfile() { 
255      if (this.profile == null)
256        this.profile = new ArrayList<CanonicalType>();
257      return this.profile;
258    }
259
260    /**
261     * @return Returns a reference to <code>this</code> for easy method chaining
262     */
263    public Meta setProfile(List<CanonicalType> theProfile) { 
264      this.profile = theProfile;
265      return this;
266    }
267
268    public boolean hasProfile() { 
269      if (this.profile == null)
270        return false;
271      for (CanonicalType item : this.profile)
272        if (!item.isEmpty())
273          return true;
274      return false;
275    }
276
277    /**
278     * @return {@link #profile} (A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].)
279     */
280    public CanonicalType addProfileElement() {//2 
281      CanonicalType t = new CanonicalType();
282      if (this.profile == null)
283        this.profile = new ArrayList<CanonicalType>();
284      this.profile.add(t);
285      return t;
286    }
287
288    /**
289     * @param value {@link #profile} (A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].)
290     */
291    public Meta addProfile(String value) { //1
292      CanonicalType t = new CanonicalType();
293      t.setValue(value);
294      if (this.profile == null)
295        this.profile = new ArrayList<CanonicalType>();
296      this.profile.add(t);
297      return this;
298    }
299
300    /**
301     * @param value {@link #profile} (A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].)
302     */
303    public boolean hasProfile(String value) { 
304      if (this.profile == null)
305        return false;
306      for (CanonicalType v : this.profile)
307        if (v.getValue().equals(value)) // canonical(StructureDefinition)
308          return true;
309      return false;
310    }
311
312    /**
313     * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.)
314     */
315    public List<Coding> getSecurity() { 
316      if (this.security == null)
317        this.security = new ArrayList<Coding>();
318      return this.security;
319    }
320
321    /**
322     * @return Returns a reference to <code>this</code> for easy method chaining
323     */
324    public Meta setSecurity(List<Coding> theSecurity) { 
325      this.security = theSecurity;
326      return this;
327    }
328
329    public boolean hasSecurity() { 
330      if (this.security == null)
331        return false;
332      for (Coding item : this.security)
333        if (!item.isEmpty())
334          return true;
335      return false;
336    }
337
338    public Coding addSecurity() { //3
339      Coding t = new Coding();
340      if (this.security == null)
341        this.security = new ArrayList<Coding>();
342      this.security.add(t);
343      return t;
344    }
345
346    public Meta addSecurity(Coding t) { //3
347      if (t == null)
348        return this;
349      if (this.security == null)
350        this.security = new ArrayList<Coding>();
351      this.security.add(t);
352      return this;
353    }
354
355    /**
356     * @return The first repetition of repeating field {@link #security}, creating it if it does not already exist
357     */
358    public Coding getSecurityFirstRep() { 
359      if (getSecurity().isEmpty()) {
360        addSecurity();
361      }
362      return getSecurity().get(0);
363    }
364
365    /**
366     * @return {@link #tag} (Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.)
367     */
368    public List<Coding> getTag() { 
369      if (this.tag == null)
370        this.tag = new ArrayList<Coding>();
371      return this.tag;
372    }
373
374    /**
375     * @return Returns a reference to <code>this</code> for easy method chaining
376     */
377    public Meta setTag(List<Coding> theTag) { 
378      this.tag = theTag;
379      return this;
380    }
381
382    public boolean hasTag() { 
383      if (this.tag == null)
384        return false;
385      for (Coding item : this.tag)
386        if (!item.isEmpty())
387          return true;
388      return false;
389    }
390
391    public Coding addTag() { //3
392      Coding t = new Coding();
393      if (this.tag == null)
394        this.tag = new ArrayList<Coding>();
395      this.tag.add(t);
396      return t;
397    }
398
399    public Meta addTag(Coding t) { //3
400      if (t == null)
401        return this;
402      if (this.tag == null)
403        this.tag = new ArrayList<Coding>();
404      this.tag.add(t);
405      return this;
406    }
407
408    /**
409     * @return The first repetition of repeating field {@link #tag}, creating it if it does not already exist
410     */
411    public Coding getTagFirstRep() { 
412      if (getTag().isEmpty()) {
413        addTag();
414      }
415      return getTag().get(0);
416    }
417
418    /**
419     * Convenience method which adds a tag
420     * 
421     * @param theSystem The code system
422     * @param theCode The code
423     * @param theDisplay The display name
424     * @return Returns a reference to <code>this</code> for easy chaining
425     */
426    public Meta addTag(String theSystem, String theCode, String theDisplay) {
427     addTag().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay);
428     return this;
429    }
430    /**
431     * Convenience method which adds a security tag
432     * 
433     * @param theSystem The code system
434     * @param theCode The code
435     * @param theDisplay The display name
436     * @return Returns a reference to <code>this</code> for easy chaining
437     */
438    public Meta addSecurity(String theSystem, String theCode, String theDisplay) {
439     addSecurity().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay);
440     return this;
441    }
442   /**
443   * Returns the first tag (if any) that has the given system and code, or returns
444   * <code>null</code> if none
445   */
446  public Coding getTag(String theSystem, String theCode) {
447    for (Coding next : getTag()) {
448      if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
449        return next;
450      }
451    }
452    return null;
453  }
454
455  /**
456   * Returns the first security label (if any) that has the given system and code, or returns
457   * <code>null</code> if none
458   */
459  public Coding getSecurity(String theSystem, String theCode) {
460    for (Coding next : getTag()) {
461      if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) {
462        return next;
463      }
464    }
465    return null;
466  }
467      protected void listChildren(List<Property> children) {
468        super.listChildren(children);
469        children.add(new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.", 0, 1, versionId));
470        children.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, 1, lastUpdated));
471        children.add(new Property("source", "uri", "A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.", 0, 1, source));
472        children.add(new Property("profile", "canonical(StructureDefinition)", "A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].", 0, java.lang.Integer.MAX_VALUE, profile));
473        children.add(new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security));
474        children.add(new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag));
475      }
476
477      @Override
478      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
479        switch (_hash) {
480        case -1407102957: /*versionId*/  return new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.", 0, 1, versionId);
481        case 1649733957: /*lastUpdated*/  return new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, 1, lastUpdated);
482        case -896505829: /*source*/  return new Property("source", "uri", "A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.", 0, 1, source);
483        case -309425751: /*profile*/  return new Property("profile", "canonical(StructureDefinition)", "A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].", 0, java.lang.Integer.MAX_VALUE, profile);
484        case 949122880: /*security*/  return new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security);
485        case 114586: /*tag*/  return new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag);
486        default: return super.getNamedProperty(_hash, _name, _checkValid);
487        }
488
489      }
490
491      @Override
492      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
493        switch (hash) {
494        case -1407102957: /*versionId*/ return this.versionId == null ? new Base[0] : new Base[] {this.versionId}; // IdType
495        case 1649733957: /*lastUpdated*/ return this.lastUpdated == null ? new Base[0] : new Base[] {this.lastUpdated}; // InstantType
496        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // UriType
497        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // CanonicalType
498        case 949122880: /*security*/ return this.security == null ? new Base[0] : this.security.toArray(new Base[this.security.size()]); // Coding
499        case 114586: /*tag*/ return this.tag == null ? new Base[0] : this.tag.toArray(new Base[this.tag.size()]); // Coding
500        default: return super.getProperty(hash, name, checkValid);
501        }
502
503      }
504
505      @Override
506      public Base setProperty(int hash, String name, Base value) throws FHIRException {
507        switch (hash) {
508        case -1407102957: // versionId
509          this.versionId = castToId(value); // IdType
510          return value;
511        case 1649733957: // lastUpdated
512          this.lastUpdated = castToInstant(value); // InstantType
513          return value;
514        case -896505829: // source
515          this.source = castToUri(value); // UriType
516          return value;
517        case -309425751: // profile
518          this.getProfile().add(castToCanonical(value)); // CanonicalType
519          return value;
520        case 949122880: // security
521          this.getSecurity().add(castToCoding(value)); // Coding
522          return value;
523        case 114586: // tag
524          this.getTag().add(castToCoding(value)); // Coding
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("versionId")) {
534          this.versionId = castToId(value); // IdType
535        } else if (name.equals("lastUpdated")) {
536          this.lastUpdated = castToInstant(value); // InstantType
537        } else if (name.equals("source")) {
538          this.source = castToUri(value); // UriType
539        } else if (name.equals("profile")) {
540          this.getProfile().add(castToCanonical(value));
541        } else if (name.equals("security")) {
542          this.getSecurity().add(castToCoding(value));
543        } else if (name.equals("tag")) {
544          this.getTag().add(castToCoding(value));
545        } else
546          return super.setProperty(name, value);
547        return value;
548      }
549
550      @Override
551      public Base makeProperty(int hash, String name) throws FHIRException {
552        switch (hash) {
553        case -1407102957:  return getVersionIdElement();
554        case 1649733957:  return getLastUpdatedElement();
555        case -896505829:  return getSourceElement();
556        case -309425751:  return addProfileElement();
557        case 949122880:  return addSecurity(); 
558        case 114586:  return addTag(); 
559        default: return super.makeProperty(hash, name);
560        }
561
562      }
563
564      @Override
565      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
566        switch (hash) {
567        case -1407102957: /*versionId*/ return new String[] {"id"};
568        case 1649733957: /*lastUpdated*/ return new String[] {"instant"};
569        case -896505829: /*source*/ return new String[] {"uri"};
570        case -309425751: /*profile*/ return new String[] {"canonical"};
571        case 949122880: /*security*/ return new String[] {"Coding"};
572        case 114586: /*tag*/ return new String[] {"Coding"};
573        default: return super.getTypesForProperty(hash, name);
574        }
575
576      }
577
578      @Override
579      public Base addChild(String name) throws FHIRException {
580        if (name.equals("versionId")) {
581          throw new FHIRException("Cannot call addChild on a primitive type Meta.versionId");
582        }
583        else if (name.equals("lastUpdated")) {
584          throw new FHIRException("Cannot call addChild on a primitive type Meta.lastUpdated");
585        }
586        else if (name.equals("source")) {
587          throw new FHIRException("Cannot call addChild on a primitive type Meta.source");
588        }
589        else if (name.equals("profile")) {
590          throw new FHIRException("Cannot call addChild on a primitive type Meta.profile");
591        }
592        else if (name.equals("security")) {
593          return addSecurity();
594        }
595        else if (name.equals("tag")) {
596          return addTag();
597        }
598        else
599          return super.addChild(name);
600      }
601
602  public String fhirType() {
603    return "Meta";
604
605  }
606
607      public Meta copy() {
608        Meta dst = new Meta();
609        copyValues(dst);
610        dst.versionId = versionId == null ? null : versionId.copy();
611        dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy();
612        dst.source = source == null ? null : source.copy();
613        if (profile != null) {
614          dst.profile = new ArrayList<CanonicalType>();
615          for (CanonicalType i : profile)
616            dst.profile.add(i.copy());
617        };
618        if (security != null) {
619          dst.security = new ArrayList<Coding>();
620          for (Coding i : security)
621            dst.security.add(i.copy());
622        };
623        if (tag != null) {
624          dst.tag = new ArrayList<Coding>();
625          for (Coding i : tag)
626            dst.tag.add(i.copy());
627        };
628        return dst;
629      }
630
631      protected Meta typedCopy() {
632        return copy();
633      }
634
635      @Override
636      public boolean equalsDeep(Base other_) {
637        if (!super.equalsDeep(other_))
638          return false;
639        if (!(other_ instanceof Meta))
640          return false;
641        Meta o = (Meta) other_;
642        return compareDeep(versionId, o.versionId, true) && compareDeep(lastUpdated, o.lastUpdated, true)
643           && compareDeep(source, o.source, true) && compareDeep(profile, o.profile, true) && compareDeep(security, o.security, true)
644           && compareDeep(tag, o.tag, true);
645      }
646
647      @Override
648      public boolean equalsShallow(Base other_) {
649        if (!super.equalsShallow(other_))
650          return false;
651        if (!(other_ instanceof Meta))
652          return false;
653        Meta o = (Meta) other_;
654        return compareValues(versionId, o.versionId, true) && compareValues(lastUpdated, o.lastUpdated, true)
655           && compareValues(source, o.source, true);
656      }
657
658      public boolean isEmpty() {
659        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(versionId, lastUpdated, source
660          , profile, security, tag);
661      }
662
663
664}
665