001package org.hl7.fhir.r5.model;
002
003
004/*
005 * #%L
006 * org.hl7.fhir.r5
007 * %%
008 * Copyright (C) 2014 - 2019 Health Level 7
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the \"License\");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 * 
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 * 
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an \"AS IS\" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * #L%
022 */
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, \
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this \
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, \
034     this list of conditions and the following disclaimer in the documentation \
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
049  POSSIBILITY OF SUCH DAMAGE.
050  */
051
052// Generated on Tue, Dec 31, 2019 12:12+1100 for FHIR vcurrent
053
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057import org.hl7.fhir.utilities.Utilities;
058import org.hl7.fhir.r5.model.Enumerations.*;
059import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
060import org.hl7.fhir.exceptions.FHIRException;
061import org.hl7.fhir.instance.model.api.ICompositeType;
062import ca.uhn.fhir.model.api.annotation.Child;
063import ca.uhn.fhir.model.api.annotation.ChildOrder;
064import ca.uhn.fhir.model.api.annotation.DatatypeDef;
065import ca.uhn.fhir.model.api.annotation.Description;
066import ca.uhn.fhir.model.api.annotation.Block;
067
068import org.hl7.fhir.instance.model.api.IBaseMetaType;
069/**
070 * Base StructureDefinition for Meta Type: 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.
071 */
072@DatatypeDef(name="Meta")
073public class Meta extends DataType implements IBaseMetaType {
074
075    /**
076     * 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.
077     */
078    @Child(name = "versionId", type = {IdType.class}, order=0, min=0, max=1, modifier=false, summary=true)
079    @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." )
080    protected IdType versionId;
081
082    /**
083     * When the resource last changed - e.g. when the version changed.
084     */
085    @Child(name = "lastUpdated", type = {InstantType.class}, order=1, min=0, max=1, modifier=false, summary=true)
086    @Description(shortDefinition="When the resource version last changed", formalDefinition="When the resource last changed - e.g. when the version changed." )
087    protected InstantType lastUpdated;
088
089    /**
090     * A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) 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.
091     */
092    @Child(name = "source", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
093    @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](provenance.html#) 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." )
094    protected UriType source;
095
096    /**
097     * A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).
098     */
099    @Child(name = "profile", type = {CanonicalType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
100    @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url)." )
101    protected List<CanonicalType> profile;
102
103    /**
104     * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.
105     */
106    @Child(name = "security", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
107    @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." )
108    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-labels")
109    protected List<Coding> security;
110
111    /**
112     * 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.
113     */
114    @Child(name = "tag", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
115    @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." )
116    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/common-tags")
117    protected List<Coding> tag;
118
119    private static final long serialVersionUID = -1386695622L;
120
121  /**
122   * Constructor
123   */
124    public Meta() {
125      super();
126    }
127
128    /**
129     * @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
130     */
131    public IdType getVersionIdElement() { 
132      if (this.versionId == null)
133        if (Configuration.errorOnAutoCreate())
134          throw new Error("Attempt to auto-create Meta.versionId");
135        else if (Configuration.doAutoCreate())
136          this.versionId = new IdType(); // bb
137      return this.versionId;
138    }
139
140    public boolean hasVersionIdElement() { 
141      return this.versionId != null && !this.versionId.isEmpty();
142    }
143
144    public boolean hasVersionId() { 
145      return this.versionId != null && !this.versionId.isEmpty();
146    }
147
148    /**
149     * @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
150     */
151    public Meta setVersionIdElement(IdType value) { 
152      this.versionId = value;
153      return this;
154    }
155
156    /**
157     * @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.
158     */
159    public String getVersionId() { 
160      return this.versionId == null ? null : this.versionId.getValue();
161    }
162
163    /**
164     * @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.
165     */
166    public Meta setVersionId(String value) { 
167      if (Utilities.noString(value))
168        this.versionId = null;
169      else {
170        if (this.versionId == null)
171          this.versionId = new IdType();
172        this.versionId.setValue(value);
173      }
174      return this;
175    }
176
177    /**
178     * @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
179     */
180    public InstantType getLastUpdatedElement() { 
181      if (this.lastUpdated == null)
182        if (Configuration.errorOnAutoCreate())
183          throw new Error("Attempt to auto-create Meta.lastUpdated");
184        else if (Configuration.doAutoCreate())
185          this.lastUpdated = new InstantType(); // bb
186      return this.lastUpdated;
187    }
188
189    public boolean hasLastUpdatedElement() { 
190      return this.lastUpdated != null && !this.lastUpdated.isEmpty();
191    }
192
193    public boolean hasLastUpdated() { 
194      return this.lastUpdated != null && !this.lastUpdated.isEmpty();
195    }
196
197    /**
198     * @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
199     */
200    public Meta setLastUpdatedElement(InstantType value) { 
201      this.lastUpdated = value;
202      return this;
203    }
204
205    /**
206     * @return When the resource last changed - e.g. when the version changed.
207     */
208    public Date getLastUpdated() { 
209      return this.lastUpdated == null ? null : this.lastUpdated.getValue();
210    }
211
212    /**
213     * @param value When the resource last changed - e.g. when the version changed.
214     */
215    public Meta setLastUpdated(Date value) { 
216      if (value == null)
217        this.lastUpdated = null;
218      else {
219        if (this.lastUpdated == null)
220          this.lastUpdated = new InstantType();
221        this.lastUpdated.setValue(value);
222      }
223      return this;
224    }
225
226    /**
227     * @return {@link #source} (A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) 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
228     */
229    public UriType getSourceElement() { 
230      if (this.source == null)
231        if (Configuration.errorOnAutoCreate())
232          throw new Error("Attempt to auto-create Meta.source");
233        else if (Configuration.doAutoCreate())
234          this.source = new UriType(); // bb
235      return this.source;
236    }
237
238    public boolean hasSourceElement() { 
239      return this.source != null && !this.source.isEmpty();
240    }
241
242    public boolean hasSource() { 
243      return this.source != null && !this.source.isEmpty();
244    }
245
246    /**
247     * @param value {@link #source} (A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) 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
248     */
249    public Meta setSourceElement(UriType value) { 
250      this.source = value;
251      return this;
252    }
253
254    /**
255     * @return A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) 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.
256     */
257    public String getSource() { 
258      return this.source == null ? null : this.source.getValue();
259    }
260
261    /**
262     * @param value A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) 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.
263     */
264    public Meta setSource(String value) { 
265      if (Utilities.noString(value))
266        this.source = null;
267      else {
268        if (this.source == null)
269          this.source = new UriType();
270        this.source.setValue(value);
271      }
272      return this;
273    }
274
275    /**
276     * @return {@link #profile} (A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).)
277     */
278    public List<CanonicalType> getProfile() { 
279      if (this.profile == null)
280        this.profile = new ArrayList<CanonicalType>();
281      return this.profile;
282    }
283
284    /**
285     * @return Returns a reference to <code>this</code> for easy method chaining
286     */
287    public Meta setProfile(List<CanonicalType> theProfile) { 
288      this.profile = theProfile;
289      return this;
290    }
291
292    public boolean hasProfile() { 
293      if (this.profile == null)
294        return false;
295      for (CanonicalType item : this.profile)
296        if (!item.isEmpty())
297          return true;
298      return false;
299    }
300
301    /**
302     * @return {@link #profile} (A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).)
303     */
304    public CanonicalType addProfileElement() {//2 
305      CanonicalType t = new CanonicalType();
306      if (this.profile == null)
307        this.profile = new ArrayList<CanonicalType>();
308      this.profile.add(t);
309      return t;
310    }
311
312    /**
313     * @param value {@link #profile} (A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).)
314     */
315    public Meta addProfile(String value) { //1
316      CanonicalType t = new CanonicalType();
317      t.setValue(value);
318      if (this.profile == null)
319        this.profile = new ArrayList<CanonicalType>();
320      this.profile.add(t);
321      return this;
322    }
323
324    /**
325     * @param value {@link #profile} (A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).)
326     */
327    public boolean hasProfile(String value) { 
328      if (this.profile == null)
329        return false;
330      for (CanonicalType v : this.profile)
331        if (v.getValue().equals(value)) // canonical
332          return true;
333      return false;
334    }
335
336    /**
337     * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.)
338     */
339    public List<Coding> getSecurity() { 
340      if (this.security == null)
341        this.security = new ArrayList<Coding>();
342      return this.security;
343    }
344
345    /**
346     * @return Returns a reference to <code>this</code> for easy method chaining
347     */
348    public Meta setSecurity(List<Coding> theSecurity) { 
349      this.security = theSecurity;
350      return this;
351    }
352
353    public boolean hasSecurity() { 
354      if (this.security == null)
355        return false;
356      for (Coding item : this.security)
357        if (!item.isEmpty())
358          return true;
359      return false;
360    }
361
362    public Coding addSecurity() { //3
363      Coding t = new Coding();
364      if (this.security == null)
365        this.security = new ArrayList<Coding>();
366      this.security.add(t);
367      return t;
368    }
369
370    public Meta addSecurity(Coding t) { //3
371      if (t == null)
372        return this;
373      if (this.security == null)
374        this.security = new ArrayList<Coding>();
375      this.security.add(t);
376      return this;
377    }
378
379    /**
380     * @return The first repetition of repeating field {@link #security}, creating it if it does not already exist {3}
381     */
382    public Coding getSecurityFirstRep() { 
383      if (getSecurity().isEmpty()) {
384        addSecurity();
385      }
386      return getSecurity().get(0);
387    }
388
389    /**
390     * @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.)
391     */
392    public List<Coding> getTag() { 
393      if (this.tag == null)
394        this.tag = new ArrayList<Coding>();
395      return this.tag;
396    }
397
398    /**
399     * @return Returns a reference to <code>this</code> for easy method chaining
400     */
401    public Meta setTag(List<Coding> theTag) { 
402      this.tag = theTag;
403      return this;
404    }
405
406    public boolean hasTag() { 
407      if (this.tag == null)
408        return false;
409      for (Coding item : this.tag)
410        if (!item.isEmpty())
411          return true;
412      return false;
413    }
414
415    public Coding addTag() { //3
416      Coding t = new Coding();
417      if (this.tag == null)
418        this.tag = new ArrayList<Coding>();
419      this.tag.add(t);
420      return t;
421    }
422
423    public Meta addTag(Coding t) { //3
424      if (t == null)
425        return this;
426      if (this.tag == null)
427        this.tag = new ArrayList<Coding>();
428      this.tag.add(t);
429      return this;
430    }
431
432    /**
433     * @return The first repetition of repeating field {@link #tag}, creating it if it does not already exist {3}
434     */
435    public Coding getTagFirstRep() { 
436      if (getTag().isEmpty()) {
437        addTag();
438      }
439      return getTag().get(0);
440    }
441
442      protected void listChildren(List<Property> children) {
443        super.listChildren(children);
444        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));
445        children.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, 1, lastUpdated));
446        children.add(new Property("source", "uri", "A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) 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));
447        children.add(new Property("profile", "canonical(StructureDefinition)", "A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).", 0, java.lang.Integer.MAX_VALUE, profile));
448        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));
449        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));
450      }
451
452      @Override
453      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
454        switch (_hash) {
455        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);
456        case 1649733957: /*lastUpdated*/  return new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, 1, lastUpdated);
457        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](provenance.html#) 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);
458        case -309425751: /*profile*/  return new Property("profile", "canonical(StructureDefinition)", "A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).", 0, java.lang.Integer.MAX_VALUE, profile);
459        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);
460        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);
461        default: return super.getNamedProperty(_hash, _name, _checkValid);
462        }
463
464      }
465
466      @Override
467      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
468        switch (hash) {
469        case -1407102957: /*versionId*/ return this.versionId == null ? new Base[0] : new Base[] {this.versionId}; // IdType
470        case 1649733957: /*lastUpdated*/ return this.lastUpdated == null ? new Base[0] : new Base[] {this.lastUpdated}; // InstantType
471        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // UriType
472        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // CanonicalType
473        case 949122880: /*security*/ return this.security == null ? new Base[0] : this.security.toArray(new Base[this.security.size()]); // Coding
474        case 114586: /*tag*/ return this.tag == null ? new Base[0] : this.tag.toArray(new Base[this.tag.size()]); // Coding
475        default: return super.getProperty(hash, name, checkValid);
476        }
477
478      }
479
480      @Override
481      public Base setProperty(int hash, String name, Base value) throws FHIRException {
482        switch (hash) {
483        case -1407102957: // versionId
484          this.versionId = TypeConvertor.castToId(value); // IdType
485          return value;
486        case 1649733957: // lastUpdated
487          this.lastUpdated = TypeConvertor.castToInstant(value); // InstantType
488          return value;
489        case -896505829: // source
490          this.source = TypeConvertor.castToUri(value); // UriType
491          return value;
492        case -309425751: // profile
493          this.getProfile().add(TypeConvertor.castToCanonical(value)); // CanonicalType
494          return value;
495        case 949122880: // security
496          this.getSecurity().add(TypeConvertor.castToCoding(value)); // Coding
497          return value;
498        case 114586: // tag
499          this.getTag().add(TypeConvertor.castToCoding(value)); // Coding
500          return value;
501        default: return super.setProperty(hash, name, value);
502        }
503
504      }
505
506      @Override
507      public Base setProperty(String name, Base value) throws FHIRException {
508        if (name.equals("versionId")) {
509          this.versionId = TypeConvertor.castToId(value); // IdType
510        } else if (name.equals("lastUpdated")) {
511          this.lastUpdated = TypeConvertor.castToInstant(value); // InstantType
512        } else if (name.equals("source")) {
513          this.source = TypeConvertor.castToUri(value); // UriType
514        } else if (name.equals("profile")) {
515          this.getProfile().add(TypeConvertor.castToCanonical(value));
516        } else if (name.equals("security")) {
517          this.getSecurity().add(TypeConvertor.castToCoding(value));
518        } else if (name.equals("tag")) {
519          this.getTag().add(TypeConvertor.castToCoding(value));
520        } else
521          return super.setProperty(name, value);
522        return value;
523      }
524
525      @Override
526      public Base makeProperty(int hash, String name) throws FHIRException {
527        switch (hash) {
528        case -1407102957:  return getVersionIdElement();
529        case 1649733957:  return getLastUpdatedElement();
530        case -896505829:  return getSourceElement();
531        case -309425751:  return addProfileElement();
532        case 949122880:  return addSecurity(); 
533        case 114586:  return addTag(); 
534        default: return super.makeProperty(hash, name);
535        }
536
537      }
538
539      @Override
540      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
541        switch (hash) {
542        case -1407102957: /*versionId*/ return new String[] {"id"};
543        case 1649733957: /*lastUpdated*/ return new String[] {"instant"};
544        case -896505829: /*source*/ return new String[] {"uri"};
545        case -309425751: /*profile*/ return new String[] {"canonical"};
546        case 949122880: /*security*/ return new String[] {"Coding"};
547        case 114586: /*tag*/ return new String[] {"Coding"};
548        default: return super.getTypesForProperty(hash, name);
549        }
550
551      }
552
553      @Override
554      public Base addChild(String name) throws FHIRException {
555        if (name.equals("versionId")) {
556          throw new FHIRException("Cannot call addChild on a primitive type Meta.versionId");
557        }
558        else if (name.equals("lastUpdated")) {
559          throw new FHIRException("Cannot call addChild on a primitive type Meta.lastUpdated");
560        }
561        else if (name.equals("source")) {
562          throw new FHIRException("Cannot call addChild on a primitive type Meta.source");
563        }
564        else if (name.equals("profile")) {
565          throw new FHIRException("Cannot call addChild on a primitive type Meta.profile");
566        }
567        else if (name.equals("security")) {
568          return addSecurity();
569        }
570        else if (name.equals("tag")) {
571          return addTag();
572        }
573        else
574          return super.addChild(name);
575      }
576
577  public String fhirType() {
578    return "Meta";
579
580  }
581
582      public Meta copy() {
583        Meta dst = new Meta();
584        copyValues(dst);
585        return dst;
586      }
587
588      public void copyValues(Meta dst) {
589        super.copyValues(dst);
590        dst.versionId = versionId == null ? null : versionId.copy();
591        dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy();
592        dst.source = source == null ? null : source.copy();
593        if (profile != null) {
594          dst.profile = new ArrayList<CanonicalType>();
595          for (CanonicalType i : profile)
596            dst.profile.add(i.copy());
597        };
598        if (security != null) {
599          dst.security = new ArrayList<Coding>();
600          for (Coding i : security)
601            dst.security.add(i.copy());
602        };
603        if (tag != null) {
604          dst.tag = new ArrayList<Coding>();
605          for (Coding i : tag)
606            dst.tag.add(i.copy());
607        };
608      }
609
610      protected Meta typedCopy() {
611        return copy();
612      }
613
614      @Override
615      public boolean equalsDeep(Base other_) {
616        if (!super.equalsDeep(other_))
617          return false;
618        if (!(other_ instanceof Meta))
619          return false;
620        Meta o = (Meta) other_;
621        return compareDeep(versionId, o.versionId, true) && compareDeep(lastUpdated, o.lastUpdated, true)
622           && compareDeep(source, o.source, true) && compareDeep(profile, o.profile, true) && compareDeep(security, o.security, true)
623           && compareDeep(tag, o.tag, true);
624      }
625
626      @Override
627      public boolean equalsShallow(Base other_) {
628        if (!super.equalsShallow(other_))
629          return false;
630        if (!(other_ instanceof Meta))
631          return false;
632        Meta o = (Meta) other_;
633        return compareValues(versionId, o.versionId, true) && compareValues(lastUpdated, o.lastUpdated, true)
634           && compareValues(source, o.source, true) && compareValues(profile, o.profile, true);
635      }
636
637      public boolean isEmpty() {
638        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(versionId, lastUpdated, source
639          , profile, security, tag);
640      }
641
642// Manual code (from Configuration.txt)t:
643    /** 
644     * Convenience method which adds a tag 
645     *  
646     * @param theSystem The code system 
647     * @param theCode The code 
648     * @param theDisplay The display name 
649     * @return Returns a reference to <code>this</code> for easy chaining 
650     */ 
651    public Meta addTag(String theSystem, String theCode, String theDisplay) { 
652     addTag().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay); 
653     return this; 
654    } 
655
656   /**
657   * Returns the first tag (if any) that has the given system and code, or returns 
658   * <code>null</code> if none 
659   */
660  public Coding getTag(String theSystem, String theCode) { 
661    for (Coding next : getTag()) {
662      if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) { 
663        return next; 
664      } 
665    }
666    return null; 
667  } 
668
669  /**
670   * Returns the first security label (if any) that has the given system and code, or returns 
671   * <code>null</code> if none 
672   */
673  public Coding getSecurity(String theSystem, String theCode) { 
674    for (Coding next : getTag()) {
675      if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) { 
676        return next; 
677      } 
678    }
679    return null; 
680  }
681
682// end addition
683
684}
685