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