001package org.hl7.fhir.r4.model; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0 033 034import java.util.*; 035 036import org.hl7.fhir.utilities.Utilities; 037import org.hl7.fhir.r4.model.Enumerations.*; 038import ca.uhn.fhir.model.api.annotation.Child; 039import ca.uhn.fhir.model.api.annotation.ChildOrder; 040import ca.uhn.fhir.model.api.annotation.Description; 041import ca.uhn.fhir.model.api.annotation.DatatypeDef; 042import ca.uhn.fhir.model.api.annotation.Block; 043import org.hl7.fhir.instance.model.api.*; 044import org.hl7.fhir.exceptions.FHIRException; 045/** 046 * For referring to data content defined in other formats. 047 */ 048@DatatypeDef(name="Attachment") 049public class Attachment extends Type implements ICompositeType { 050 051 /** 052 * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. 053 */ 054 @Child(name = "contentType", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) 055 @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) 056 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/mimetypes") 057 protected CodeType contentType; 058 059 /** 060 * The human language of the content. The value can be any valid value according to BCP 47. 061 */ 062 @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) 063 @Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." ) 064 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages") 065 protected CodeType language; 066 067 /** 068 * The actual data of the attachment - a sequence of bytes, base64 encoded. 069 */ 070 @Child(name = "data", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false) 071 @Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes, base64 encoded." ) 072 protected Base64BinaryType data; 073 074 /** 075 * A location where the data can be accessed. 076 */ 077 @Child(name = "url", type = {UrlType.class}, order=3, min=0, max=1, modifier=false, summary=true) 078 @Description(shortDefinition="Uri where the data can be found", formalDefinition="A location where the data can be accessed." ) 079 protected UrlType url; 080 081 /** 082 * The number of bytes of data that make up this attachment (before base64 encoding, if that is done). 083 */ 084 @Child(name = "size", type = {UnsignedIntType.class}, order=4, min=0, max=1, modifier=false, summary=true) 085 @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment (before base64 encoding, if that is done)." ) 086 protected UnsignedIntType size; 087 088 /** 089 * The calculated hash of the data using SHA-1. Represented using base64. 090 */ 091 @Child(name = "hash", type = {Base64BinaryType.class}, order=5, min=0, max=1, modifier=false, summary=true) 092 @Description(shortDefinition="Hash of the data (sha-1, base64ed)", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." ) 093 protected Base64BinaryType hash; 094 095 /** 096 * A label or set of text to display in place of the data. 097 */ 098 @Child(name = "title", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) 099 @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) 100 protected StringType title; 101 102 /** 103 * The date that the attachment was first created. 104 */ 105 @Child(name = "creation", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) 106 @Description(shortDefinition="Date attachment was first created", formalDefinition="The date that the attachment was first created." ) 107 protected DateTimeType creation; 108 109 private static final long serialVersionUID = -564352571L; 110 111 /** 112 * Constructor 113 */ 114 public Attachment() { 115 super(); 116 } 117 118 /** 119 * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value 120 */ 121 public CodeType getContentTypeElement() { 122 if (this.contentType == null) 123 if (Configuration.errorOnAutoCreate()) 124 throw new Error("Attempt to auto-create Attachment.contentType"); 125 else if (Configuration.doAutoCreate()) 126 this.contentType = new CodeType(); // bb 127 return this.contentType; 128 } 129 130 public boolean hasContentTypeElement() { 131 return this.contentType != null && !this.contentType.isEmpty(); 132 } 133 134 public boolean hasContentType() { 135 return this.contentType != null && !this.contentType.isEmpty(); 136 } 137 138 /** 139 * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value 140 */ 141 public Attachment setContentTypeElement(CodeType value) { 142 this.contentType = value; 143 return this; 144 } 145 146 /** 147 * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. 148 */ 149 public String getContentType() { 150 return this.contentType == null ? null : this.contentType.getValue(); 151 } 152 153 /** 154 * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. 155 */ 156 public Attachment setContentType(String value) { 157 if (Utilities.noString(value)) 158 this.contentType = null; 159 else { 160 if (this.contentType == null) 161 this.contentType = new CodeType(); 162 this.contentType.setValue(value); 163 } 164 return this; 165 } 166 167 /** 168 * @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value 169 */ 170 public CodeType getLanguageElement() { 171 if (this.language == null) 172 if (Configuration.errorOnAutoCreate()) 173 throw new Error("Attempt to auto-create Attachment.language"); 174 else if (Configuration.doAutoCreate()) 175 this.language = new CodeType(); // bb 176 return this.language; 177 } 178 179 public boolean hasLanguageElement() { 180 return this.language != null && !this.language.isEmpty(); 181 } 182 183 public boolean hasLanguage() { 184 return this.language != null && !this.language.isEmpty(); 185 } 186 187 /** 188 * @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value 189 */ 190 public Attachment setLanguageElement(CodeType value) { 191 this.language = value; 192 return this; 193 } 194 195 /** 196 * @return The human language of the content. The value can be any valid value according to BCP 47. 197 */ 198 public String getLanguage() { 199 return this.language == null ? null : this.language.getValue(); 200 } 201 202 /** 203 * @param value The human language of the content. The value can be any valid value according to BCP 47. 204 */ 205 public Attachment setLanguage(String value) { 206 if (Utilities.noString(value)) 207 this.language = null; 208 else { 209 if (this.language == null) 210 this.language = new CodeType(); 211 this.language.setValue(value); 212 } 213 return this; 214 } 215 216 /** 217 * @return {@link #data} (The actual data of the attachment - a sequence of bytes, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value 218 */ 219 public Base64BinaryType getDataElement() { 220 if (this.data == null) 221 if (Configuration.errorOnAutoCreate()) 222 throw new Error("Attempt to auto-create Attachment.data"); 223 else if (Configuration.doAutoCreate()) 224 this.data = new Base64BinaryType(); // bb 225 return this.data; 226 } 227 228 public boolean hasDataElement() { 229 return this.data != null && !this.data.isEmpty(); 230 } 231 232 public boolean hasData() { 233 return this.data != null && !this.data.isEmpty(); 234 } 235 236 /** 237 * @param value {@link #data} (The actual data of the attachment - a sequence of bytes, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value 238 */ 239 public Attachment setDataElement(Base64BinaryType value) { 240 this.data = value; 241 return this; 242 } 243 244 /** 245 * @return The actual data of the attachment - a sequence of bytes, base64 encoded. 246 */ 247 public byte[] getData() { 248 return this.data == null ? null : this.data.getValue(); 249 } 250 251 /** 252 * @param value The actual data of the attachment - a sequence of bytes, base64 encoded. 253 */ 254 public Attachment setData(byte[] value) { 255 if (value == null) 256 this.data = null; 257 else { 258 if (this.data == null) 259 this.data = new Base64BinaryType(); 260 this.data.setValue(value); 261 } 262 return this; 263 } 264 265 /** 266 * @return {@link #url} (A location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 267 */ 268 public UrlType getUrlElement() { 269 if (this.url == null) 270 if (Configuration.errorOnAutoCreate()) 271 throw new Error("Attempt to auto-create Attachment.url"); 272 else if (Configuration.doAutoCreate()) 273 this.url = new UrlType(); // bb 274 return this.url; 275 } 276 277 public boolean hasUrlElement() { 278 return this.url != null && !this.url.isEmpty(); 279 } 280 281 public boolean hasUrl() { 282 return this.url != null && !this.url.isEmpty(); 283 } 284 285 /** 286 * @param value {@link #url} (A location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 287 */ 288 public Attachment setUrlElement(UrlType value) { 289 this.url = value; 290 return this; 291 } 292 293 /** 294 * @return A location where the data can be accessed. 295 */ 296 public String getUrl() { 297 return this.url == null ? null : this.url.getValue(); 298 } 299 300 /** 301 * @param value A location where the data can be accessed. 302 */ 303 public Attachment setUrl(String value) { 304 if (Utilities.noString(value)) 305 this.url = null; 306 else { 307 if (this.url == null) 308 this.url = new UrlType(); 309 this.url.setValue(value); 310 } 311 return this; 312 } 313 314 /** 315 * @return {@link #size} (The number of bytes of data that make up this attachment (before base64 encoding, if that is done).). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value 316 */ 317 public UnsignedIntType getSizeElement() { 318 if (this.size == null) 319 if (Configuration.errorOnAutoCreate()) 320 throw new Error("Attempt to auto-create Attachment.size"); 321 else if (Configuration.doAutoCreate()) 322 this.size = new UnsignedIntType(); // bb 323 return this.size; 324 } 325 326 public boolean hasSizeElement() { 327 return this.size != null && !this.size.isEmpty(); 328 } 329 330 public boolean hasSize() { 331 return this.size != null && !this.size.isEmpty(); 332 } 333 334 /** 335 * @param value {@link #size} (The number of bytes of data that make up this attachment (before base64 encoding, if that is done).). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value 336 */ 337 public Attachment setSizeElement(UnsignedIntType value) { 338 this.size = value; 339 return this; 340 } 341 342 /** 343 * @return The number of bytes of data that make up this attachment (before base64 encoding, if that is done). 344 */ 345 public int getSize() { 346 return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); 347 } 348 349 /** 350 * @param value The number of bytes of data that make up this attachment (before base64 encoding, if that is done). 351 */ 352 public Attachment setSize(int value) { 353 if (this.size == null) 354 this.size = new UnsignedIntType(); 355 this.size.setValue(value); 356 return this; 357 } 358 359 /** 360 * @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value 361 */ 362 public Base64BinaryType getHashElement() { 363 if (this.hash == null) 364 if (Configuration.errorOnAutoCreate()) 365 throw new Error("Attempt to auto-create Attachment.hash"); 366 else if (Configuration.doAutoCreate()) 367 this.hash = new Base64BinaryType(); // bb 368 return this.hash; 369 } 370 371 public boolean hasHashElement() { 372 return this.hash != null && !this.hash.isEmpty(); 373 } 374 375 public boolean hasHash() { 376 return this.hash != null && !this.hash.isEmpty(); 377 } 378 379 /** 380 * @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value 381 */ 382 public Attachment setHashElement(Base64BinaryType value) { 383 this.hash = value; 384 return this; 385 } 386 387 /** 388 * @return The calculated hash of the data using SHA-1. Represented using base64. 389 */ 390 public byte[] getHash() { 391 return this.hash == null ? null : this.hash.getValue(); 392 } 393 394 /** 395 * @param value The calculated hash of the data using SHA-1. Represented using base64. 396 */ 397 public Attachment setHash(byte[] value) { 398 if (value == null) 399 this.hash = null; 400 else { 401 if (this.hash == null) 402 this.hash = new Base64BinaryType(); 403 this.hash.setValue(value); 404 } 405 return this; 406 } 407 408 /** 409 * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value 410 */ 411 public StringType getTitleElement() { 412 if (this.title == null) 413 if (Configuration.errorOnAutoCreate()) 414 throw new Error("Attempt to auto-create Attachment.title"); 415 else if (Configuration.doAutoCreate()) 416 this.title = new StringType(); // bb 417 return this.title; 418 } 419 420 public boolean hasTitleElement() { 421 return this.title != null && !this.title.isEmpty(); 422 } 423 424 public boolean hasTitle() { 425 return this.title != null && !this.title.isEmpty(); 426 } 427 428 /** 429 * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value 430 */ 431 public Attachment setTitleElement(StringType value) { 432 this.title = value; 433 return this; 434 } 435 436 /** 437 * @return A label or set of text to display in place of the data. 438 */ 439 public String getTitle() { 440 return this.title == null ? null : this.title.getValue(); 441 } 442 443 /** 444 * @param value A label or set of text to display in place of the data. 445 */ 446 public Attachment setTitle(String value) { 447 if (Utilities.noString(value)) 448 this.title = null; 449 else { 450 if (this.title == null) 451 this.title = new StringType(); 452 this.title.setValue(value); 453 } 454 return this; 455 } 456 457 /** 458 * @return {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value 459 */ 460 public DateTimeType getCreationElement() { 461 if (this.creation == null) 462 if (Configuration.errorOnAutoCreate()) 463 throw new Error("Attempt to auto-create Attachment.creation"); 464 else if (Configuration.doAutoCreate()) 465 this.creation = new DateTimeType(); // bb 466 return this.creation; 467 } 468 469 public boolean hasCreationElement() { 470 return this.creation != null && !this.creation.isEmpty(); 471 } 472 473 public boolean hasCreation() { 474 return this.creation != null && !this.creation.isEmpty(); 475 } 476 477 /** 478 * @param value {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value 479 */ 480 public Attachment setCreationElement(DateTimeType value) { 481 this.creation = value; 482 return this; 483 } 484 485 /** 486 * @return The date that the attachment was first created. 487 */ 488 public Date getCreation() { 489 return this.creation == null ? null : this.creation.getValue(); 490 } 491 492 /** 493 * @param value The date that the attachment was first created. 494 */ 495 public Attachment setCreation(Date value) { 496 if (value == null) 497 this.creation = null; 498 else { 499 if (this.creation == null) 500 this.creation = new DateTimeType(); 501 this.creation.setValue(value); 502 } 503 return this; 504 } 505 506 protected void listChildren(List<Property> children) { 507 super.listChildren(children); 508 children.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, 1, contentType)); 509 children.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, 1, language)); 510 children.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes, base64 encoded.", 0, 1, data)); 511 children.add(new Property("url", "url", "A location where the data can be accessed.", 0, 1, url)); 512 children.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment (before base64 encoding, if that is done).", 0, 1, size)); 513 children.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, 1, hash)); 514 children.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, 1, title)); 515 children.add(new Property("creation", "dateTime", "The date that the attachment was first created.", 0, 1, creation)); 516 } 517 518 @Override 519 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 520 switch (_hash) { 521 case -389131437: /*contentType*/ return new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, 1, contentType); 522 case -1613589672: /*language*/ return new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, 1, language); 523 case 3076010: /*data*/ return new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes, base64 encoded.", 0, 1, data); 524 case 116079: /*url*/ return new Property("url", "url", "A location where the data can be accessed.", 0, 1, url); 525 case 3530753: /*size*/ return new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment (before base64 encoding, if that is done).", 0, 1, size); 526 case 3195150: /*hash*/ return new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, 1, hash); 527 case 110371416: /*title*/ return new Property("title", "string", "A label or set of text to display in place of the data.", 0, 1, title); 528 case 1820421855: /*creation*/ return new Property("creation", "dateTime", "The date that the attachment was first created.", 0, 1, creation); 529 default: return super.getNamedProperty(_hash, _name, _checkValid); 530 } 531 532 } 533 534 @Override 535 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 536 switch (hash) { 537 case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType 538 case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType 539 case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // Base64BinaryType 540 case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UrlType 541 case 3530753: /*size*/ return this.size == null ? new Base[0] : new Base[] {this.size}; // UnsignedIntType 542 case 3195150: /*hash*/ return this.hash == null ? new Base[0] : new Base[] {this.hash}; // Base64BinaryType 543 case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType 544 case 1820421855: /*creation*/ return this.creation == null ? new Base[0] : new Base[] {this.creation}; // DateTimeType 545 default: return super.getProperty(hash, name, checkValid); 546 } 547 548 } 549 550 @Override 551 public Base setProperty(int hash, String name, Base value) throws FHIRException { 552 switch (hash) { 553 case -389131437: // contentType 554 this.contentType = castToCode(value); // CodeType 555 return value; 556 case -1613589672: // language 557 this.language = castToCode(value); // CodeType 558 return value; 559 case 3076010: // data 560 this.data = castToBase64Binary(value); // Base64BinaryType 561 return value; 562 case 116079: // url 563 this.url = castToUrl(value); // UrlType 564 return value; 565 case 3530753: // size 566 this.size = castToUnsignedInt(value); // UnsignedIntType 567 return value; 568 case 3195150: // hash 569 this.hash = castToBase64Binary(value); // Base64BinaryType 570 return value; 571 case 110371416: // title 572 this.title = castToString(value); // StringType 573 return value; 574 case 1820421855: // creation 575 this.creation = castToDateTime(value); // DateTimeType 576 return value; 577 default: return super.setProperty(hash, name, value); 578 } 579 580 } 581 582 @Override 583 public Base setProperty(String name, Base value) throws FHIRException { 584 if (name.equals("contentType")) { 585 this.contentType = castToCode(value); // CodeType 586 } else if (name.equals("language")) { 587 this.language = castToCode(value); // CodeType 588 } else if (name.equals("data")) { 589 this.data = castToBase64Binary(value); // Base64BinaryType 590 } else if (name.equals("url")) { 591 this.url = castToUrl(value); // UrlType 592 } else if (name.equals("size")) { 593 this.size = castToUnsignedInt(value); // UnsignedIntType 594 } else if (name.equals("hash")) { 595 this.hash = castToBase64Binary(value); // Base64BinaryType 596 } else if (name.equals("title")) { 597 this.title = castToString(value); // StringType 598 } else if (name.equals("creation")) { 599 this.creation = castToDateTime(value); // DateTimeType 600 } else 601 return super.setProperty(name, value); 602 return value; 603 } 604 605 @Override 606 public Base makeProperty(int hash, String name) throws FHIRException { 607 switch (hash) { 608 case -389131437: return getContentTypeElement(); 609 case -1613589672: return getLanguageElement(); 610 case 3076010: return getDataElement(); 611 case 116079: return getUrlElement(); 612 case 3530753: return getSizeElement(); 613 case 3195150: return getHashElement(); 614 case 110371416: return getTitleElement(); 615 case 1820421855: return getCreationElement(); 616 default: return super.makeProperty(hash, name); 617 } 618 619 } 620 621 @Override 622 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 623 switch (hash) { 624 case -389131437: /*contentType*/ return new String[] {"code"}; 625 case -1613589672: /*language*/ return new String[] {"code"}; 626 case 3076010: /*data*/ return new String[] {"base64Binary"}; 627 case 116079: /*url*/ return new String[] {"url"}; 628 case 3530753: /*size*/ return new String[] {"unsignedInt"}; 629 case 3195150: /*hash*/ return new String[] {"base64Binary"}; 630 case 110371416: /*title*/ return new String[] {"string"}; 631 case 1820421855: /*creation*/ return new String[] {"dateTime"}; 632 default: return super.getTypesForProperty(hash, name); 633 } 634 635 } 636 637 @Override 638 public Base addChild(String name) throws FHIRException { 639 if (name.equals("contentType")) { 640 throw new FHIRException("Cannot call addChild on a primitive type Attachment.contentType"); 641 } 642 else if (name.equals("language")) { 643 throw new FHIRException("Cannot call addChild on a primitive type Attachment.language"); 644 } 645 else if (name.equals("data")) { 646 throw new FHIRException("Cannot call addChild on a primitive type Attachment.data"); 647 } 648 else if (name.equals("url")) { 649 throw new FHIRException("Cannot call addChild on a primitive type Attachment.url"); 650 } 651 else if (name.equals("size")) { 652 throw new FHIRException("Cannot call addChild on a primitive type Attachment.size"); 653 } 654 else if (name.equals("hash")) { 655 throw new FHIRException("Cannot call addChild on a primitive type Attachment.hash"); 656 } 657 else if (name.equals("title")) { 658 throw new FHIRException("Cannot call addChild on a primitive type Attachment.title"); 659 } 660 else if (name.equals("creation")) { 661 throw new FHIRException("Cannot call addChild on a primitive type Attachment.creation"); 662 } 663 else 664 return super.addChild(name); 665 } 666 667 public String fhirType() { 668 return "Attachment"; 669 670 } 671 672 public Attachment copy() { 673 Attachment dst = new Attachment(); 674 copyValues(dst); 675 dst.contentType = contentType == null ? null : contentType.copy(); 676 dst.language = language == null ? null : language.copy(); 677 dst.data = data == null ? null : data.copy(); 678 dst.url = url == null ? null : url.copy(); 679 dst.size = size == null ? null : size.copy(); 680 dst.hash = hash == null ? null : hash.copy(); 681 dst.title = title == null ? null : title.copy(); 682 dst.creation = creation == null ? null : creation.copy(); 683 return dst; 684 } 685 686 protected Attachment typedCopy() { 687 return copy(); 688 } 689 690 @Override 691 public boolean equalsDeep(Base other_) { 692 if (!super.equalsDeep(other_)) 693 return false; 694 if (!(other_ instanceof Attachment)) 695 return false; 696 Attachment o = (Attachment) other_; 697 return compareDeep(contentType, o.contentType, true) && compareDeep(language, o.language, true) 698 && compareDeep(data, o.data, true) && compareDeep(url, o.url, true) && compareDeep(size, o.size, true) 699 && compareDeep(hash, o.hash, true) && compareDeep(title, o.title, true) && compareDeep(creation, o.creation, true) 700 ; 701 } 702 703 @Override 704 public boolean equalsShallow(Base other_) { 705 if (!super.equalsShallow(other_)) 706 return false; 707 if (!(other_ instanceof Attachment)) 708 return false; 709 Attachment o = (Attachment) other_; 710 return compareValues(contentType, o.contentType, true) && compareValues(language, o.language, true) 711 && compareValues(data, o.data, true) && compareValues(url, o.url, true) && compareValues(size, o.size, true) 712 && compareValues(hash, o.hash, true) && compareValues(title, o.title, true) && compareValues(creation, o.creation, true) 713 ; 714 } 715 716 public boolean isEmpty() { 717 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(contentType, language, data 718 , url, size, hash, title, creation); 719 } 720 721 722} 723