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