
001package org.hl7.fhir.r5.openehr; 002 003 004/* 005 Copyright (c) 2011+, HL7, Inc. 006 All rights reserved. 007 008 Redistribution and use in source and binary forms, with or without modification, \ 009 are permitted provided that the following conditions are met: 010 011 * Redistributions of source code must retain the above copyright notice, this \ 012 list of conditions and the following disclaimer. 013 * Redistributions in binary form must reproduce the above copyright notice, \ 014 this list of conditions and the following disclaimer in the documentation \ 015 and/or other materials provided with the distribution. 016 * Neither the name of HL7 nor the names of its contributors may be used to 017 endorse or promote products derived from this software without specific 018 prior written permission. 019 020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \ 021 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \ 022 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \ 023 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \ 024 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \ 025 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \ 026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \ 027 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \ 028 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \ 029 POSSIBILITY OF SUCH DAMAGE. 030 */ 031 032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0 033 034import java.util.ArrayList; 035import java.util.Date; 036import java.util.List; 037import org.hl7.fhir.utilities.Utilities; 038import org.hl7.fhir.r5.openehr.Enumerations.*; 039import org.hl7.fhir.exceptions.FHIRException; 040import org.hl7.fhir.r5.model.*; 041import org.hl7.fhir.instance.model.api.ICompositeType; 042import ca.uhn.fhir.model.api.annotation.Child; 043import ca.uhn.fhir.model.api.annotation.ChildOrder; 044import ca.uhn.fhir.model.api.annotation.DatatypeDef; 045import ca.uhn.fhir.model.api.annotation.Description; 046import ca.uhn.fhir.model.api.annotation.Block; 047 048/** 049 * Language-specific detail of resource description. When a resource is translated for use in another language environment, each RESOURCE_DESCRIPTION_ITEM needs to be copied and translated into the new language. 050 */ 051@DatatypeDef(name="RESOURCE_DESCRIPTION_ITEM") 052public class RESOURCE_DESCRIPTION_ITEM extends LogicalBase implements ICompositeType { 053 054 /** 055 * The localised language in which the items in this description item are written. Coded from openEHR code set languages. 056 */ 057 @Child(name = "language", type = {CODE_PHRASE.class}, order=0, min=1, max=1, modifier=false, summary=false) 058 @Description(shortDefinition="The localised language in which the items in this description item are written", formalDefinition="The localised language in which the items in this description item are written. Coded from openEHR code set languages." ) 059 protected CODE_PHRASE language; 060 061 /** 062 * Purpose of the resource. 063 */ 064 @Child(name = "purpose", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) 065 @Description(shortDefinition="Purpose of the resource", formalDefinition="Purpose of the resource." ) 066 protected StringType purpose; 067 068 /** 069 * Keywords which characterise this resource, used e.g. for indexing and searching. 070 */ 071 @Child(name = "keywords", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 072 @Description(shortDefinition="Keywords which characterise this resource, used e.g. for indexing and searching", formalDefinition="Keywords which characterise this resource, used e.g. for indexing and searching." ) 073 protected List<StringType> keywordsList; 074 075 /** 076 * Description of the uses of the resource, i.e. contexts in which it could be used. 077 */ 078 @Child(name = "use", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) 079 @Description(shortDefinition="Description of the uses of the resource, i.e. contexts in which it could be used", formalDefinition="Description of the uses of the resource, i.e. contexts in which it could be used." ) 080 protected StringType use; 081 082 /** 083 * Description of any misuses of the resource, i.e. contexts in which it should not be used. 084 */ 085 @Child(name = "misuse", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) 086 @Description(shortDefinition="Description of any misuses of the resource, i.e. contexts in which it should not be used", formalDefinition="Description of any misuses of the resource, i.e. contexts in which it should not be used." ) 087 protected StringType misuse; 088 089 /** 090 * Optional copyright statement for the resource as a knowledge resource. 091 */ 092 @Child(name = "copyright", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) 093 @Description(shortDefinition="Optional copyright statement for the resource as a knowledge resource", formalDefinition="Optional copyright statement for the resource as a knowledge resource." ) 094 protected StringType copyright; 095 096 /** 097 * URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning. 098 */ 099 @Child(name = "original_resource_uri", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 100 @Description(shortDefinition="URIs of original clinical document(s) or description of which resource is a formalisation", formalDefinition="URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning." ) 101 protected List<StringType> original_resource_uriList; 102 103 /** 104 * Additional language-senstive resource metadata, as a list of name/value pairs. 105 */ 106 @Child(name = "other_details", type = {StringType.class}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 107 @Description(shortDefinition="Additional language-senstive resource metadata, as a list of name/value pairs", formalDefinition="Additional language-senstive resource metadata, as a list of name/value pairs." ) 108 protected List<StringType> other_detailsList; 109 110 private static final long serialVersionUID = -1123991092L; 111 112 /** 113 * Constructor 114 */ 115 public RESOURCE_DESCRIPTION_ITEM() { 116 super(); 117 } 118 119 /** 120 * Constructor 121 */ 122 public RESOURCE_DESCRIPTION_ITEM(CODE_PHRASE language, String purpose, String other_details) { 123 super(); 124 this.setLanguage(language); 125 this.setPurpose(purpose); 126 this.addOther_details(other_details); 127 } 128 129 /** 130 * @return {@link #language} (The localised language in which the items in this description item are written. Coded from openEHR code set languages.) 131 */ 132 public CODE_PHRASE getLanguage() { 133 if (this.language == null) 134 if (Configuration.errorOnAutoCreate()) 135 throw new Error("Attempt to auto-create RESOURCE_DESCRIPTION_ITEM.language"); 136 else if (Configuration.doAutoCreate()) 137 this.language = new CODE_PHRASE(); // cc 138 return this.language; 139 } 140 141 public boolean hasLanguage() { 142 return this.language != null && !this.language.isEmpty(); 143 } 144 145 /** 146 * @param value {@link #language} (The localised language in which the items in this description item are written. Coded from openEHR code set languages.) 147 */ 148 public RESOURCE_DESCRIPTION_ITEM setLanguage(CODE_PHRASE value) { 149 this.language = value; 150 return this; 151 } 152 153 /** 154 * @return {@link #purpose} (Purpose of the resource.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value 155 */ 156 public StringType getPurposeElement() { 157 if (this.purpose == null) 158 if (Configuration.errorOnAutoCreate()) 159 throw new Error("Attempt to auto-create RESOURCE_DESCRIPTION_ITEM.purpose"); 160 else if (Configuration.doAutoCreate()) 161 this.purpose = new StringType(); // bb 162 return this.purpose; 163 } 164 165 public boolean hasPurposeElement() { 166 return this.purpose != null && !this.purpose.isEmpty(); 167 } 168 169 public boolean hasPurpose() { 170 return this.purpose != null && !this.purpose.isEmpty(); 171 } 172 173 /** 174 * @param value {@link #purpose} (Purpose of the resource.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value 175 */ 176 public RESOURCE_DESCRIPTION_ITEM setPurposeElement(StringType value) { 177 this.purpose = value; 178 return this; 179 } 180 181 /** 182 * @return Purpose of the resource. 183 */ 184 public String getPurpose() { 185 return this.purpose == null ? null : this.purpose.getValue(); 186 } 187 188 /** 189 * @param value Purpose of the resource. 190 */ 191 public RESOURCE_DESCRIPTION_ITEM setPurpose(String value) { 192 if (this.purpose == null) 193 this.purpose = new StringType(); 194 this.purpose.setValue(value); 195 return this; 196 } 197 198 /** 199 * @return {@link #keywords} (Keywords which characterise this resource, used e.g. for indexing and searching.) 200 */ 201 public List<StringType> getKeywordsList() { 202 if (this.keywordsList == null) 203 this.keywordsList = new ArrayList<StringType>(); 204 return this.keywordsList; 205 } 206 207 /** 208 * @return Returns a reference to <code>this</code> for easy method chaining 209 */ 210 public RESOURCE_DESCRIPTION_ITEM setKeywordsList(List<StringType> theKeywords) { 211 this.keywordsList = theKeywords; 212 return this; 213 } 214 215 public boolean hasKeywords() { 216 if (this.keywordsList == null) 217 return false; 218 for (StringType item : this.keywordsList) 219 if (!item.isEmpty()) 220 return true; 221 return false; 222 } 223 224 /** 225 * @return {@link #keywords} (Keywords which characterise this resource, used e.g. for indexing and searching.) 226 */ 227 public StringType addKeywordsElement() {//2 228 StringType t = new StringType(); 229 if (this.keywordsList == null) 230 this.keywordsList = new ArrayList<StringType>(); 231 this.keywordsList.add(t); 232 return t; 233 } 234 235 /** 236 * @param value {@link #keywords} (Keywords which characterise this resource, used e.g. for indexing and searching.) 237 */ 238 public RESOURCE_DESCRIPTION_ITEM addKeywords(String value) { //1 239 StringType t = new StringType(); 240 t.setValue(value); 241 if (this.keywordsList == null) 242 this.keywordsList = new ArrayList<StringType>(); 243 this.keywordsList.add(t); 244 return this; 245 } 246 247 /** 248 * @param value {@link #keywords} (Keywords which characterise this resource, used e.g. for indexing and searching.) 249 */ 250 public boolean hasKeywords(String value) { 251 if (this.keywordsList == null) 252 return false; 253 for (StringType v : this.keywordsList) 254 if (v.getValue().equals(value)) // string 255 return true; 256 return false; 257 } 258 259 /** 260 * @return {@link #use} (Description of the uses of the resource, i.e. contexts in which it could be used.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value 261 */ 262 public StringType getUseElement() { 263 if (this.use == null) 264 if (Configuration.errorOnAutoCreate()) 265 throw new Error("Attempt to auto-create RESOURCE_DESCRIPTION_ITEM.use"); 266 else if (Configuration.doAutoCreate()) 267 this.use = new StringType(); // bb 268 return this.use; 269 } 270 271 public boolean hasUseElement() { 272 return this.use != null && !this.use.isEmpty(); 273 } 274 275 public boolean hasUse() { 276 return this.use != null && !this.use.isEmpty(); 277 } 278 279 /** 280 * @param value {@link #use} (Description of the uses of the resource, i.e. contexts in which it could be used.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value 281 */ 282 public RESOURCE_DESCRIPTION_ITEM setUseElement(StringType value) { 283 this.use = value; 284 return this; 285 } 286 287 /** 288 * @return Description of the uses of the resource, i.e. contexts in which it could be used. 289 */ 290 public String getUse() { 291 return this.use == null ? null : this.use.getValue(); 292 } 293 294 /** 295 * @param value Description of the uses of the resource, i.e. contexts in which it could be used. 296 */ 297 public RESOURCE_DESCRIPTION_ITEM setUse(String value) { 298 if (Utilities.noString(value)) 299 this.use = null; 300 else { 301 if (this.use == null) 302 this.use = new StringType(); 303 this.use.setValue(value); 304 } 305 return this; 306 } 307 308 /** 309 * @return {@link #misuse} (Description of any misuses of the resource, i.e. contexts in which it should not be used.). This is the underlying object with id, value and extensions. The accessor "getMisuse" gives direct access to the value 310 */ 311 public StringType getMisuseElement() { 312 if (this.misuse == null) 313 if (Configuration.errorOnAutoCreate()) 314 throw new Error("Attempt to auto-create RESOURCE_DESCRIPTION_ITEM.misuse"); 315 else if (Configuration.doAutoCreate()) 316 this.misuse = new StringType(); // bb 317 return this.misuse; 318 } 319 320 public boolean hasMisuseElement() { 321 return this.misuse != null && !this.misuse.isEmpty(); 322 } 323 324 public boolean hasMisuse() { 325 return this.misuse != null && !this.misuse.isEmpty(); 326 } 327 328 /** 329 * @param value {@link #misuse} (Description of any misuses of the resource, i.e. contexts in which it should not be used.). This is the underlying object with id, value and extensions. The accessor "getMisuse" gives direct access to the value 330 */ 331 public RESOURCE_DESCRIPTION_ITEM setMisuseElement(StringType value) { 332 this.misuse = value; 333 return this; 334 } 335 336 /** 337 * @return Description of any misuses of the resource, i.e. contexts in which it should not be used. 338 */ 339 public String getMisuse() { 340 return this.misuse == null ? null : this.misuse.getValue(); 341 } 342 343 /** 344 * @param value Description of any misuses of the resource, i.e. contexts in which it should not be used. 345 */ 346 public RESOURCE_DESCRIPTION_ITEM setMisuse(String value) { 347 if (Utilities.noString(value)) 348 this.misuse = null; 349 else { 350 if (this.misuse == null) 351 this.misuse = new StringType(); 352 this.misuse.setValue(value); 353 } 354 return this; 355 } 356 357 /** 358 * @return {@link #copyright} (Optional copyright statement for the resource as a knowledge resource.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value 359 */ 360 public StringType getCopyrightElement() { 361 if (this.copyright == null) 362 if (Configuration.errorOnAutoCreate()) 363 throw new Error("Attempt to auto-create RESOURCE_DESCRIPTION_ITEM.copyright"); 364 else if (Configuration.doAutoCreate()) 365 this.copyright = new StringType(); // bb 366 return this.copyright; 367 } 368 369 public boolean hasCopyrightElement() { 370 return this.copyright != null && !this.copyright.isEmpty(); 371 } 372 373 public boolean hasCopyright() { 374 return this.copyright != null && !this.copyright.isEmpty(); 375 } 376 377 /** 378 * @param value {@link #copyright} (Optional copyright statement for the resource as a knowledge resource.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value 379 */ 380 public RESOURCE_DESCRIPTION_ITEM setCopyrightElement(StringType value) { 381 this.copyright = value; 382 return this; 383 } 384 385 /** 386 * @return Optional copyright statement for the resource as a knowledge resource. 387 */ 388 public String getCopyright() { 389 return this.copyright == null ? null : this.copyright.getValue(); 390 } 391 392 /** 393 * @param value Optional copyright statement for the resource as a knowledge resource. 394 */ 395 public RESOURCE_DESCRIPTION_ITEM setCopyright(String value) { 396 if (Utilities.noString(value)) 397 this.copyright = null; 398 else { 399 if (this.copyright == null) 400 this.copyright = new StringType(); 401 this.copyright.setValue(value); 402 } 403 return this; 404 } 405 406 /** 407 * @return {@link #original_resource_uri} (URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning.) 408 */ 409 public List<StringType> getOriginal_resource_uriList() { 410 if (this.original_resource_uriList == null) 411 this.original_resource_uriList = new ArrayList<StringType>(); 412 return this.original_resource_uriList; 413 } 414 415 /** 416 * @return Returns a reference to <code>this</code> for easy method chaining 417 */ 418 public RESOURCE_DESCRIPTION_ITEM setOriginal_resource_uriList(List<StringType> theOriginal_resource_uri) { 419 this.original_resource_uriList = theOriginal_resource_uri; 420 return this; 421 } 422 423 public boolean hasOriginal_resource_uri() { 424 if (this.original_resource_uriList == null) 425 return false; 426 for (StringType item : this.original_resource_uriList) 427 if (!item.isEmpty()) 428 return true; 429 return false; 430 } 431 432 /** 433 * @return {@link #original_resource_uri} (URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning.) 434 */ 435 public StringType addOriginal_resource_uriElement() {//2 436 StringType t = new StringType(); 437 if (this.original_resource_uriList == null) 438 this.original_resource_uriList = new ArrayList<StringType>(); 439 this.original_resource_uriList.add(t); 440 return t; 441 } 442 443 /** 444 * @param value {@link #original_resource_uri} (URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning.) 445 */ 446 public RESOURCE_DESCRIPTION_ITEM addOriginal_resource_uri(String value) { //1 447 StringType t = new StringType(); 448 t.setValue(value); 449 if (this.original_resource_uriList == null) 450 this.original_resource_uriList = new ArrayList<StringType>(); 451 this.original_resource_uriList.add(t); 452 return this; 453 } 454 455 /** 456 * @param value {@link #original_resource_uri} (URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning.) 457 */ 458 public boolean hasOriginal_resource_uri(String value) { 459 if (this.original_resource_uriList == null) 460 return false; 461 for (StringType v : this.original_resource_uriList) 462 if (v.getValue().equals(value)) // string 463 return true; 464 return false; 465 } 466 467 /** 468 * @return {@link #other_details} (Additional language-senstive resource metadata, as a list of name/value pairs.) 469 */ 470 public List<StringType> getOther_detailsList() { 471 if (this.other_detailsList == null) 472 this.other_detailsList = new ArrayList<StringType>(); 473 return this.other_detailsList; 474 } 475 476 /** 477 * @return Returns a reference to <code>this</code> for easy method chaining 478 */ 479 public RESOURCE_DESCRIPTION_ITEM setOther_detailsList(List<StringType> theOther_details) { 480 this.other_detailsList = theOther_details; 481 return this; 482 } 483 484 public boolean hasOther_details() { 485 if (this.other_detailsList == null) 486 return false; 487 for (StringType item : this.other_detailsList) 488 if (!item.isEmpty()) 489 return true; 490 return false; 491 } 492 493 /** 494 * @return {@link #other_details} (Additional language-senstive resource metadata, as a list of name/value pairs.) 495 */ 496 public StringType addOther_detailsElement() {//2 497 StringType t = new StringType(); 498 if (this.other_detailsList == null) 499 this.other_detailsList = new ArrayList<StringType>(); 500 this.other_detailsList.add(t); 501 return t; 502 } 503 504 /** 505 * @param value {@link #other_details} (Additional language-senstive resource metadata, as a list of name/value pairs.) 506 */ 507 public RESOURCE_DESCRIPTION_ITEM addOther_details(String value) { //1 508 StringType t = new StringType(); 509 t.setValue(value); 510 if (this.other_detailsList == null) 511 this.other_detailsList = new ArrayList<StringType>(); 512 this.other_detailsList.add(t); 513 return this; 514 } 515 516 /** 517 * @param value {@link #other_details} (Additional language-senstive resource metadata, as a list of name/value pairs.) 518 */ 519 public boolean hasOther_details(String value) { 520 if (this.other_detailsList == null) 521 return false; 522 for (StringType v : this.other_detailsList) 523 if (v.getValue().equals(value)) // string 524 return true; 525 return false; 526 } 527 528 protected void listChildren(List<Property> children) { 529 super.listChildren(children); 530 children.add(new Property("language", "http://openehr.org/fhir/StructureDefinition/CODE-PHRASE", "The localised language in which the items in this description item are written. Coded from openEHR code set languages.", 0, 1, language)); 531 children.add(new Property("purpose", "string", "Purpose of the resource.", 0, 1, purpose)); 532 children.add(new Property("keywords", "string", "Keywords which characterise this resource, used e.g. for indexing and searching.", 0, java.lang.Integer.MAX_VALUE, keywordsList)); 533 children.add(new Property("use", "string", "Description of the uses of the resource, i.e. contexts in which it could be used.", 0, 1, use)); 534 children.add(new Property("misuse", "string", "Description of any misuses of the resource, i.e. contexts in which it should not be used.", 0, 1, misuse)); 535 children.add(new Property("copyright", "string", "Optional copyright statement for the resource as a knowledge resource.", 0, 1, copyright)); 536 children.add(new Property("original_resource_uri", "string", "URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning.", 0, java.lang.Integer.MAX_VALUE, original_resource_uriList)); 537 children.add(new Property("other_details", "string", "Additional language-senstive resource metadata, as a list of name/value pairs.", 0, java.lang.Integer.MAX_VALUE, other_detailsList)); 538 } 539 540 @Override 541 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 542 switch (_hash) { 543 case -1613589672: /*language*/ return new Property("language", "http://openehr.org/fhir/StructureDefinition/CODE-PHRASE", "The localised language in which the items in this description item are written. Coded from openEHR code set languages.", 0, 1, language); 544 case -220463842: /*purpose*/ return new Property("purpose", "string", "Purpose of the resource.", 0, 1, purpose); 545 case 523149226: /*keywords*/ return new Property("keywords", "string", "Keywords which characterise this resource, used e.g. for indexing and searching.", 0, java.lang.Integer.MAX_VALUE, keywordsList); 546 case 116103: /*use*/ return new Property("use", "string", "Description of the uses of the resource, i.e. contexts in which it could be used.", 0, 1, use); 547 case -1073878064: /*misuse*/ return new Property("misuse", "string", "Description of any misuses of the resource, i.e. contexts in which it should not be used.", 0, 1, misuse); 548 case 1522889671: /*copyright*/ return new Property("copyright", "string", "Optional copyright statement for the resource as a knowledge resource.", 0, 1, copyright); 549 case -775873175: /*original_resource_uri*/ return new Property("original_resource_uri", "string", "URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning.", 0, java.lang.Integer.MAX_VALUE, original_resource_uriList); 550 case -1257043949: /*other_details*/ return new Property("other_details", "string", "Additional language-senstive resource metadata, as a list of name/value pairs.", 0, java.lang.Integer.MAX_VALUE, other_detailsList); 551 default: return super.getNamedProperty(_hash, _name, _checkValid); 552 } 553 554 } 555 556 @Override 557 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 558 switch (hash) { 559 case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CODE_PHRASE 560 case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // StringType 561 case 523149226: /*keywords*/ return this.keywordsList == null ? new Base[0] : this.keywordsList.toArray(new Base[this.keywordsList.size()]); // StringType 562 case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // StringType 563 case -1073878064: /*misuse*/ return this.misuse == null ? new Base[0] : new Base[] {this.misuse}; // StringType 564 case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType 565 case -775873175: /*original_resource_uri*/ return this.original_resource_uriList == null ? new Base[0] : this.original_resource_uriList.toArray(new Base[this.original_resource_uriList.size()]); // StringType 566 case -1257043949: /*other_details*/ return this.other_detailsList == null ? new Base[0] : this.other_detailsList.toArray(new Base[this.other_detailsList.size()]); // StringType 567 default: return super.getProperty(hash, name, checkValid); 568 } 569 570 } 571 572 @Override 573 public Base setProperty(int hash, String name, Base value) throws FHIRException { 574 switch (hash) { 575 case -1613589672: // language 576 this.language = (CODE_PHRASE) value; // CODE_PHRASE 577 return value; 578 case -220463842: // purpose 579 this.purpose = TypeConvertor.castToString(value); // StringType 580 return value; 581 case 523149226: // keywords 582 this.getKeywordsList().add(TypeConvertor.castToString(value)); // StringType 583 return value; 584 case 116103: // use 585 this.use = TypeConvertor.castToString(value); // StringType 586 return value; 587 case -1073878064: // misuse 588 this.misuse = TypeConvertor.castToString(value); // StringType 589 return value; 590 case 1522889671: // copyright 591 this.copyright = TypeConvertor.castToString(value); // StringType 592 return value; 593 case -775873175: // original_resource_uri 594 this.getOriginal_resource_uriList().add(TypeConvertor.castToString(value)); // StringType 595 return value; 596 case -1257043949: // other_details 597 this.getOther_detailsList().add(TypeConvertor.castToString(value)); // StringType 598 return value; 599 default: return super.setProperty(hash, name, value); 600 } 601 602 } 603 604 @Override 605 public Base setProperty(String name, Base value) throws FHIRException { 606 if (name.equals("language")) { 607 this.language = (CODE_PHRASE) value; // CODE_PHRASE 608 } else if (name.equals("purpose")) { 609 this.purpose = TypeConvertor.castToString(value); // StringType 610 } else if (name.equals("keywords")) { 611 this.getKeywordsList().add(TypeConvertor.castToString(value)); // StringType 612 } else if (name.equals("use")) { 613 this.use = TypeConvertor.castToString(value); // StringType 614 } else if (name.equals("misuse")) { 615 this.misuse = TypeConvertor.castToString(value); // StringType 616 } else if (name.equals("copyright")) { 617 this.copyright = TypeConvertor.castToString(value); // StringType 618 } else if (name.equals("original_resource_uri")) { 619 this.getOriginal_resource_uriList().add(TypeConvertor.castToString(value)); // StringType 620 } else if (name.equals("other_details")) { 621 this.getOther_detailsList().add(TypeConvertor.castToString(value)); // StringType 622 } else 623 return super.setProperty(name, value); 624 return value; 625 } 626 627 @Override 628 public Base makeProperty(int hash, String name) throws FHIRException { 629 switch (hash) { 630 case -1613589672: return getLanguage(); 631 case -220463842: return getPurposeElement(); 632 case 523149226: return addKeywordsElement(); 633 case 116103: return getUseElement(); 634 case -1073878064: return getMisuseElement(); 635 case 1522889671: return getCopyrightElement(); 636 case -775873175: return addOriginal_resource_uriElement(); 637 case -1257043949: return addOther_detailsElement(); 638 default: return super.makeProperty(hash, name); 639 } 640 641 } 642 643 @Override 644 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 645 switch (hash) { 646 case -1613589672: /*language*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/CODE-PHRASE"}; 647 case -220463842: /*purpose*/ return new String[] {"string"}; 648 case 523149226: /*keywords*/ return new String[] {"string"}; 649 case 116103: /*use*/ return new String[] {"string"}; 650 case -1073878064: /*misuse*/ return new String[] {"string"}; 651 case 1522889671: /*copyright*/ return new String[] {"string"}; 652 case -775873175: /*original_resource_uri*/ return new String[] {"string"}; 653 case -1257043949: /*other_details*/ return new String[] {"string"}; 654 default: return super.getTypesForProperty(hash, name); 655 } 656 657 } 658 659 @Override 660 public Base addChild(String name) throws FHIRException { 661 if (name.equals("language")) { 662 this.language = new CODE_PHRASE(); 663 return this.language; 664 } 665 else if (name.equals("purpose")) { 666 throw new FHIRException("Cannot call addChild on a singleton property RESOURCE_DESCRIPTION_ITEM.purpose"); 667 } 668 else if (name.equals("keywords")) { 669 throw new FHIRException("Cannot call addChild on a singleton property RESOURCE_DESCRIPTION_ITEM.keywords"); 670 } 671 else if (name.equals("use")) { 672 throw new FHIRException("Cannot call addChild on a singleton property RESOURCE_DESCRIPTION_ITEM.use"); 673 } 674 else if (name.equals("misuse")) { 675 throw new FHIRException("Cannot call addChild on a singleton property RESOURCE_DESCRIPTION_ITEM.misuse"); 676 } 677 else if (name.equals("copyright")) { 678 throw new FHIRException("Cannot call addChild on a singleton property RESOURCE_DESCRIPTION_ITEM.copyright"); 679 } 680 else if (name.equals("original_resource_uri")) { 681 throw new FHIRException("Cannot call addChild on a singleton property RESOURCE_DESCRIPTION_ITEM.original_resource_uri"); 682 } 683 else if (name.equals("other_details")) { 684 throw new FHIRException("Cannot call addChild on a singleton property RESOURCE_DESCRIPTION_ITEM.other_details"); 685 } 686 else 687 return super.addChild(name); 688 } 689 690 public String fhirType() { 691 return "RESOURCE_DESCRIPTION_ITEM"; 692 693 } 694 695 public RESOURCE_DESCRIPTION_ITEM copy() { 696 RESOURCE_DESCRIPTION_ITEM dst = new RESOURCE_DESCRIPTION_ITEM(); 697 copyValues(dst); 698 return dst; 699 } 700 701 public void copyValues(RESOURCE_DESCRIPTION_ITEM dst) { 702 super.copyValues(dst); 703 dst.language = language == null ? null : language.copy(); 704 dst.purpose = purpose == null ? null : purpose.copy(); 705 if (keywordsList != null) { 706 dst.keywordsList = new ArrayList<StringType>(); 707 for (StringType i : keywordsList) 708 dst.keywordsList.add(i.copy()); 709 }; 710 dst.use = use == null ? null : use.copy(); 711 dst.misuse = misuse == null ? null : misuse.copy(); 712 dst.copyright = copyright == null ? null : copyright.copy(); 713 if (original_resource_uriList != null) { 714 dst.original_resource_uriList = new ArrayList<StringType>(); 715 for (StringType i : original_resource_uriList) 716 dst.original_resource_uriList.add(i.copy()); 717 }; 718 if (other_detailsList != null) { 719 dst.other_detailsList = new ArrayList<StringType>(); 720 for (StringType i : other_detailsList) 721 dst.other_detailsList.add(i.copy()); 722 }; 723 } 724 725 protected RESOURCE_DESCRIPTION_ITEM typedCopy() { 726 return copy(); 727 } 728 729 @Override 730 public boolean equalsDeep(Base other_) { 731 if (!super.equalsDeep(other_)) 732 return false; 733 if (!(other_ instanceof RESOURCE_DESCRIPTION_ITEM)) 734 return false; 735 RESOURCE_DESCRIPTION_ITEM o = (RESOURCE_DESCRIPTION_ITEM) other_; 736 return compareDeep(language, o.language, true) && compareDeep(purpose, o.purpose, true) && compareDeep(keywordsList, o.keywordsList, true) 737 && compareDeep(use, o.use, true) && compareDeep(misuse, o.misuse, true) && compareDeep(copyright, o.copyright, true) 738 && compareDeep(original_resource_uriList, o.original_resource_uriList, true) && compareDeep(other_detailsList, o.other_detailsList, true) 739 ; 740 } 741 742 @Override 743 public boolean equalsShallow(Base other_) { 744 if (!super.equalsShallow(other_)) 745 return false; 746 if (!(other_ instanceof RESOURCE_DESCRIPTION_ITEM)) 747 return false; 748 RESOURCE_DESCRIPTION_ITEM o = (RESOURCE_DESCRIPTION_ITEM) other_; 749 return compareValues(purpose, o.purpose, true) && compareValues(keywordsList, o.keywordsList, true) 750 && compareValues(use, o.use, true) && compareValues(misuse, o.misuse, true) && compareValues(copyright, o.copyright, true) 751 && compareValues(original_resource_uriList, o.original_resource_uriList, true) && compareValues(other_detailsList, o.other_detailsList, true) 752 ; 753 } 754 755 public boolean isEmpty() { 756 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(language, purpose, keywordsList 757 , use, misuse, copyright, original_resource_uriList, other_detailsList); 758 } 759 760 761} 762