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.ResourceDef; 039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 040import ca.uhn.fhir.model.api.annotation.Child; 041import ca.uhn.fhir.model.api.annotation.ChildOrder; 042import ca.uhn.fhir.model.api.annotation.Description; 043import ca.uhn.fhir.model.api.annotation.Block; 044import org.hl7.fhir.instance.model.api.*; 045import org.hl7.fhir.exceptions.FHIRException; 046/** 047 * Common Ancestor declaration for conformance and knowledge artifact resources. 048 */ 049public abstract class MetadataResource extends DomainResource { 050 051 /** 052 * An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers. 053 */ 054 @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) 055 @Description(shortDefinition="Canonical identifier for this metadata resource, represented as a URI (globally unique)", formalDefinition="An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers." ) 056 protected UriType url; 057 058 /** 059 * The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. 060 */ 061 @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) 062 @Description(shortDefinition="Business version of the metadata resource", formalDefinition="The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence." ) 063 protected StringType version; 064 065 /** 066 * A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation. 067 */ 068 @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) 069 @Description(shortDefinition="Name for this metadata resource (computer friendly)", formalDefinition="A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation." ) 070 protected StringType name; 071 072 /** 073 * A short, descriptive, user-friendly title for the metadata resource. 074 */ 075 @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) 076 @Description(shortDefinition="Name for this metadata resource (human friendly)", formalDefinition="A short, descriptive, user-friendly title for the metadata resource." ) 077 protected StringType title; 078 079 /** 080 * The status of this metadata resource. Enables tracking the life-cycle of the content. 081 */ 082 @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) 083 @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The status of this metadata resource. Enables tracking the life-cycle of the content." ) 084 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status") 085 protected Enumeration<PublicationStatus> status; 086 087 /** 088 * A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. 089 */ 090 @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) 091 @Description(shortDefinition="For testing purposes, not real usage", formalDefinition="A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage." ) 092 protected BooleanType experimental; 093 094 /** 095 * The date (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes. 096 */ 097 @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) 098 @Description(shortDefinition="Date last changed", formalDefinition="The date (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes." ) 099 protected DateTimeType date; 100 101 /** 102 * The name of the organization or individual that published the metadata resource. 103 */ 104 @Child(name = "publisher", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) 105 @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the organization or individual that published the metadata resource." ) 106 protected StringType publisher; 107 108 /** 109 * Contact details to assist a user in finding and communicating with the publisher. 110 */ 111 @Child(name = "contact", type = {ContactDetail.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 112 @Description(shortDefinition="Contact details for the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) 113 protected List<ContactDetail> contact; 114 115 /** 116 * A free text natural language description of the metadata resource from a consumer's perspective. 117 */ 118 @Child(name = "description", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=false) 119 @Description(shortDefinition="Natural language description of the metadata resource", formalDefinition="A free text natural language description of the metadata resource from a consumer's perspective." ) 120 protected MarkdownType description; 121 122 /** 123 * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate metadata resource instances. 124 */ 125 @Child(name = "useContext", type = {UsageContext.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 126 @Description(shortDefinition="The context that the content is intended to support", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate metadata resource instances." ) 127 protected List<UsageContext> useContext; 128 129 /** 130 * A legal or geographic region in which the metadata resource is intended to be used. 131 */ 132 @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 133 @Description(shortDefinition="Intended jurisdiction for metadata resource (if applicable)", formalDefinition="A legal or geographic region in which the metadata resource is intended to be used." ) 134 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction") 135 protected List<CodeableConcept> jurisdiction; 136 137 private static final long serialVersionUID = 1952104592L; 138 139 /** 140 * Constructor 141 */ 142 public MetadataResource() { 143 super(); 144 } 145 146 /** 147 * Constructor 148 */ 149 public MetadataResource(Enumeration<PublicationStatus> status) { 150 super(); 151 this.status = status; 152 } 153 154 /** 155 * @return {@link #url} (An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 156 */ 157 public UriType getUrlElement() { 158 if (this.url == null) 159 if (Configuration.errorOnAutoCreate()) 160 throw new Error("Attempt to auto-create MetadataResource.url"); 161 else if (Configuration.doAutoCreate()) 162 this.url = new UriType(); // bb 163 return this.url; 164 } 165 166 public boolean hasUrlElement() { 167 return this.url != null && !this.url.isEmpty(); 168 } 169 170 public boolean hasUrl() { 171 return this.url != null && !this.url.isEmpty(); 172 } 173 174 /** 175 * @param value {@link #url} (An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 176 */ 177 public MetadataResource setUrlElement(UriType value) { 178 this.url = value; 179 return this; 180 } 181 182 /** 183 * @return An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers. 184 */ 185 public String getUrl() { 186 return this.url == null ? null : this.url.getValue(); 187 } 188 189 /** 190 * @param value An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers. 191 */ 192 public MetadataResource setUrl(String value) { 193 if (Utilities.noString(value)) 194 this.url = null; 195 else { 196 if (this.url == null) 197 this.url = new UriType(); 198 this.url.setValue(value); 199 } 200 return this; 201 } 202 203 /** 204 * @return {@link #version} (The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value 205 */ 206 public StringType getVersionElement() { 207 if (this.version == null) 208 if (Configuration.errorOnAutoCreate()) 209 throw new Error("Attempt to auto-create MetadataResource.version"); 210 else if (Configuration.doAutoCreate()) 211 this.version = new StringType(); // bb 212 return this.version; 213 } 214 215 public boolean hasVersionElement() { 216 return this.version != null && !this.version.isEmpty(); 217 } 218 219 public boolean hasVersion() { 220 return this.version != null && !this.version.isEmpty(); 221 } 222 223 /** 224 * @param value {@link #version} (The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value 225 */ 226 public MetadataResource setVersionElement(StringType value) { 227 this.version = value; 228 return this; 229 } 230 231 /** 232 * @return The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. 233 */ 234 public String getVersion() { 235 return this.version == null ? null : this.version.getValue(); 236 } 237 238 /** 239 * @param value The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. 240 */ 241 public MetadataResource setVersion(String value) { 242 if (Utilities.noString(value)) 243 this.version = null; 244 else { 245 if (this.version == null) 246 this.version = new StringType(); 247 this.version.setValue(value); 248 } 249 return this; 250 } 251 252 /** 253 * @return {@link #name} (A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 254 */ 255 public StringType getNameElement() { 256 if (this.name == null) 257 if (Configuration.errorOnAutoCreate()) 258 throw new Error("Attempt to auto-create MetadataResource.name"); 259 else if (Configuration.doAutoCreate()) 260 this.name = new StringType(); // bb 261 return this.name; 262 } 263 264 public boolean hasNameElement() { 265 return this.name != null && !this.name.isEmpty(); 266 } 267 268 public boolean hasName() { 269 return this.name != null && !this.name.isEmpty(); 270 } 271 272 /** 273 * @param value {@link #name} (A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 274 */ 275 public MetadataResource setNameElement(StringType value) { 276 this.name = value; 277 return this; 278 } 279 280 /** 281 * @return A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation. 282 */ 283 public String getName() { 284 return this.name == null ? null : this.name.getValue(); 285 } 286 287 /** 288 * @param value A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation. 289 */ 290 public MetadataResource setName(String value) { 291 if (Utilities.noString(value)) 292 this.name = null; 293 else { 294 if (this.name == null) 295 this.name = new StringType(); 296 this.name.setValue(value); 297 } 298 return this; 299 } 300 301 /** 302 * @return {@link #title} (A short, descriptive, user-friendly title for the metadata resource.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value 303 */ 304 public StringType getTitleElement() { 305 if (this.title == null) 306 if (Configuration.errorOnAutoCreate()) 307 throw new Error("Attempt to auto-create MetadataResource.title"); 308 else if (Configuration.doAutoCreate()) 309 this.title = new StringType(); // bb 310 return this.title; 311 } 312 313 public boolean hasTitleElement() { 314 return this.title != null && !this.title.isEmpty(); 315 } 316 317 public boolean hasTitle() { 318 return this.title != null && !this.title.isEmpty(); 319 } 320 321 /** 322 * @param value {@link #title} (A short, descriptive, user-friendly title for the metadata resource.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value 323 */ 324 public MetadataResource setTitleElement(StringType value) { 325 this.title = value; 326 return this; 327 } 328 329 /** 330 * @return A short, descriptive, user-friendly title for the metadata resource. 331 */ 332 public String getTitle() { 333 return this.title == null ? null : this.title.getValue(); 334 } 335 336 /** 337 * @param value A short, descriptive, user-friendly title for the metadata resource. 338 */ 339 public MetadataResource setTitle(String value) { 340 if (Utilities.noString(value)) 341 this.title = null; 342 else { 343 if (this.title == null) 344 this.title = new StringType(); 345 this.title.setValue(value); 346 } 347 return this; 348 } 349 350 /** 351 * @return {@link #status} (The status of this metadata resource. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 352 */ 353 public Enumeration<PublicationStatus> getStatusElement() { 354 if (this.status == null) 355 if (Configuration.errorOnAutoCreate()) 356 throw new Error("Attempt to auto-create MetadataResource.status"); 357 else if (Configuration.doAutoCreate()) 358 this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb 359 return this.status; 360 } 361 362 public boolean hasStatusElement() { 363 return this.status != null && !this.status.isEmpty(); 364 } 365 366 public boolean hasStatus() { 367 return this.status != null && !this.status.isEmpty(); 368 } 369 370 /** 371 * @param value {@link #status} (The status of this metadata resource. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 372 */ 373 public MetadataResource setStatusElement(Enumeration<PublicationStatus> value) { 374 this.status = value; 375 return this; 376 } 377 378 /** 379 * @return The status of this metadata resource. Enables tracking the life-cycle of the content. 380 */ 381 public PublicationStatus getStatus() { 382 return this.status == null ? null : this.status.getValue(); 383 } 384 385 /** 386 * @param value The status of this metadata resource. Enables tracking the life-cycle of the content. 387 */ 388 public MetadataResource setStatus(PublicationStatus value) { 389 if (this.status == null) 390 this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); 391 this.status.setValue(value); 392 return this; 393 } 394 395 /** 396 * @return {@link #experimental} (A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value 397 */ 398 public BooleanType getExperimentalElement() { 399 if (this.experimental == null) 400 if (Configuration.errorOnAutoCreate()) 401 throw new Error("Attempt to auto-create MetadataResource.experimental"); 402 else if (Configuration.doAutoCreate()) 403 this.experimental = new BooleanType(); // bb 404 return this.experimental; 405 } 406 407 public boolean hasExperimentalElement() { 408 return this.experimental != null && !this.experimental.isEmpty(); 409 } 410 411 public boolean hasExperimental() { 412 return this.experimental != null && !this.experimental.isEmpty(); 413 } 414 415 /** 416 * @param value {@link #experimental} (A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value 417 */ 418 public MetadataResource setExperimentalElement(BooleanType value) { 419 this.experimental = value; 420 return this; 421 } 422 423 /** 424 * @return A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. 425 */ 426 public boolean getExperimental() { 427 return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); 428 } 429 430 /** 431 * @param value A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. 432 */ 433 public MetadataResource setExperimental(boolean value) { 434 if (this.experimental == null) 435 this.experimental = new BooleanType(); 436 this.experimental.setValue(value); 437 return this; 438 } 439 440 /** 441 * @return {@link #date} (The date (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value 442 */ 443 public DateTimeType getDateElement() { 444 if (this.date == null) 445 if (Configuration.errorOnAutoCreate()) 446 throw new Error("Attempt to auto-create MetadataResource.date"); 447 else if (Configuration.doAutoCreate()) 448 this.date = new DateTimeType(); // bb 449 return this.date; 450 } 451 452 public boolean hasDateElement() { 453 return this.date != null && !this.date.isEmpty(); 454 } 455 456 public boolean hasDate() { 457 return this.date != null && !this.date.isEmpty(); 458 } 459 460 /** 461 * @param value {@link #date} (The date (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value 462 */ 463 public MetadataResource setDateElement(DateTimeType value) { 464 this.date = value; 465 return this; 466 } 467 468 /** 469 * @return The date (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes. 470 */ 471 public Date getDate() { 472 return this.date == null ? null : this.date.getValue(); 473 } 474 475 /** 476 * @param value The date (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes. 477 */ 478 public MetadataResource setDate(Date value) { 479 if (value == null) 480 this.date = null; 481 else { 482 if (this.date == null) 483 this.date = new DateTimeType(); 484 this.date.setValue(value); 485 } 486 return this; 487 } 488 489 /** 490 * @return {@link #publisher} (The name of the organization or individual that published the metadata resource.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value 491 */ 492 public StringType getPublisherElement() { 493 if (this.publisher == null) 494 if (Configuration.errorOnAutoCreate()) 495 throw new Error("Attempt to auto-create MetadataResource.publisher"); 496 else if (Configuration.doAutoCreate()) 497 this.publisher = new StringType(); // bb 498 return this.publisher; 499 } 500 501 public boolean hasPublisherElement() { 502 return this.publisher != null && !this.publisher.isEmpty(); 503 } 504 505 public boolean hasPublisher() { 506 return this.publisher != null && !this.publisher.isEmpty(); 507 } 508 509 /** 510 * @param value {@link #publisher} (The name of the organization or individual that published the metadata resource.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value 511 */ 512 public MetadataResource setPublisherElement(StringType value) { 513 this.publisher = value; 514 return this; 515 } 516 517 /** 518 * @return The name of the organization or individual that published the metadata resource. 519 */ 520 public String getPublisher() { 521 return this.publisher == null ? null : this.publisher.getValue(); 522 } 523 524 /** 525 * @param value The name of the organization or individual that published the metadata resource. 526 */ 527 public MetadataResource setPublisher(String value) { 528 if (Utilities.noString(value)) 529 this.publisher = null; 530 else { 531 if (this.publisher == null) 532 this.publisher = new StringType(); 533 this.publisher.setValue(value); 534 } 535 return this; 536 } 537 538 /** 539 * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.) 540 */ 541 public List<ContactDetail> getContact() { 542 if (this.contact == null) 543 this.contact = new ArrayList<ContactDetail>(); 544 return this.contact; 545 } 546 547 /** 548 * @return Returns a reference to <code>this</code> for easy method chaining 549 */ 550 public MetadataResource setContact(List<ContactDetail> theContact) { 551 this.contact = theContact; 552 return this; 553 } 554 555 public boolean hasContact() { 556 if (this.contact == null) 557 return false; 558 for (ContactDetail item : this.contact) 559 if (!item.isEmpty()) 560 return true; 561 return false; 562 } 563 564 public ContactDetail addContact() { //3 565 ContactDetail t = new ContactDetail(); 566 if (this.contact == null) 567 this.contact = new ArrayList<ContactDetail>(); 568 this.contact.add(t); 569 return t; 570 } 571 572 public MetadataResource addContact(ContactDetail t) { //3 573 if (t == null) 574 return this; 575 if (this.contact == null) 576 this.contact = new ArrayList<ContactDetail>(); 577 this.contact.add(t); 578 return this; 579 } 580 581 /** 582 * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist 583 */ 584 public ContactDetail getContactFirstRep() { 585 if (getContact().isEmpty()) { 586 addContact(); 587 } 588 return getContact().get(0); 589 } 590 591 /** 592 * @return {@link #description} (A free text natural language description of the metadata resource from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 593 */ 594 public MarkdownType getDescriptionElement() { 595 if (this.description == null) 596 if (Configuration.errorOnAutoCreate()) 597 throw new Error("Attempt to auto-create MetadataResource.description"); 598 else if (Configuration.doAutoCreate()) 599 this.description = new MarkdownType(); // bb 600 return this.description; 601 } 602 603 public boolean hasDescriptionElement() { 604 return this.description != null && !this.description.isEmpty(); 605 } 606 607 public boolean hasDescription() { 608 return this.description != null && !this.description.isEmpty(); 609 } 610 611 /** 612 * @param value {@link #description} (A free text natural language description of the metadata resource from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 613 */ 614 public MetadataResource setDescriptionElement(MarkdownType value) { 615 this.description = value; 616 return this; 617 } 618 619 /** 620 * @return A free text natural language description of the metadata resource from a consumer's perspective. 621 */ 622 public String getDescription() { 623 return this.description == null ? null : this.description.getValue(); 624 } 625 626 /** 627 * @param value A free text natural language description of the metadata resource from a consumer's perspective. 628 */ 629 public MetadataResource setDescription(String value) { 630 if (value == null) 631 this.description = null; 632 else { 633 if (this.description == null) 634 this.description = new MarkdownType(); 635 this.description.setValue(value); 636 } 637 return this; 638 } 639 640 /** 641 * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate metadata resource instances.) 642 */ 643 public List<UsageContext> getUseContext() { 644 if (this.useContext == null) 645 this.useContext = new ArrayList<UsageContext>(); 646 return this.useContext; 647 } 648 649 /** 650 * @return Returns a reference to <code>this</code> for easy method chaining 651 */ 652 public MetadataResource setUseContext(List<UsageContext> theUseContext) { 653 this.useContext = theUseContext; 654 return this; 655 } 656 657 public boolean hasUseContext() { 658 if (this.useContext == null) 659 return false; 660 for (UsageContext item : this.useContext) 661 if (!item.isEmpty()) 662 return true; 663 return false; 664 } 665 666 public UsageContext addUseContext() { //3 667 UsageContext t = new UsageContext(); 668 if (this.useContext == null) 669 this.useContext = new ArrayList<UsageContext>(); 670 this.useContext.add(t); 671 return t; 672 } 673 674 public MetadataResource addUseContext(UsageContext t) { //3 675 if (t == null) 676 return this; 677 if (this.useContext == null) 678 this.useContext = new ArrayList<UsageContext>(); 679 this.useContext.add(t); 680 return this; 681 } 682 683 /** 684 * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist 685 */ 686 public UsageContext getUseContextFirstRep() { 687 if (getUseContext().isEmpty()) { 688 addUseContext(); 689 } 690 return getUseContext().get(0); 691 } 692 693 /** 694 * @return {@link #jurisdiction} (A legal or geographic region in which the metadata resource is intended to be used.) 695 */ 696 public List<CodeableConcept> getJurisdiction() { 697 if (this.jurisdiction == null) 698 this.jurisdiction = new ArrayList<CodeableConcept>(); 699 return this.jurisdiction; 700 } 701 702 /** 703 * @return Returns a reference to <code>this</code> for easy method chaining 704 */ 705 public MetadataResource setJurisdiction(List<CodeableConcept> theJurisdiction) { 706 this.jurisdiction = theJurisdiction; 707 return this; 708 } 709 710 public boolean hasJurisdiction() { 711 if (this.jurisdiction == null) 712 return false; 713 for (CodeableConcept item : this.jurisdiction) 714 if (!item.isEmpty()) 715 return true; 716 return false; 717 } 718 719 public CodeableConcept addJurisdiction() { //3 720 CodeableConcept t = new CodeableConcept(); 721 if (this.jurisdiction == null) 722 this.jurisdiction = new ArrayList<CodeableConcept>(); 723 this.jurisdiction.add(t); 724 return t; 725 } 726 727 public MetadataResource addJurisdiction(CodeableConcept t) { //3 728 if (t == null) 729 return this; 730 if (this.jurisdiction == null) 731 this.jurisdiction = new ArrayList<CodeableConcept>(); 732 this.jurisdiction.add(t); 733 return this; 734 } 735 736 /** 737 * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist 738 */ 739 public CodeableConcept getJurisdictionFirstRep() { 740 if (getJurisdiction().isEmpty()) { 741 addJurisdiction(); 742 } 743 return getJurisdiction().get(0); 744 } 745 746 protected void listChildren(List<Property> children) { 747 // todo: add a flag to decide whether to do this... super.listChildren(children); 748 } 749 750 @Override 751 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 752 switch (hash) { 753 case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType 754 case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType 755 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 756 case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType 757 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus> 758 case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType 759 case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType 760 case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType 761 case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail 762 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType 763 case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext 764 case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept 765 default: return super.getProperty(hash, name, checkValid); 766 } 767 768 } 769 770 @Override 771 public Base setProperty(int hash, String name, Base value) throws FHIRException { 772 switch (hash) { 773 case 116079: // url 774 this.url = castToUri(value); // UriType 775 return value; 776 case 351608024: // version 777 this.version = castToString(value); // StringType 778 return value; 779 case 3373707: // name 780 this.name = castToString(value); // StringType 781 return value; 782 case 110371416: // title 783 this.title = castToString(value); // StringType 784 return value; 785 case -892481550: // status 786 value = new PublicationStatusEnumFactory().fromType(castToCode(value)); 787 this.status = (Enumeration) value; // Enumeration<PublicationStatus> 788 return value; 789 case -404562712: // experimental 790 this.experimental = castToBoolean(value); // BooleanType 791 return value; 792 case 3076014: // date 793 this.date = castToDateTime(value); // DateTimeType 794 return value; 795 case 1447404028: // publisher 796 this.publisher = castToString(value); // StringType 797 return value; 798 case 951526432: // contact 799 this.getContact().add(castToContactDetail(value)); // ContactDetail 800 return value; 801 case -1724546052: // description 802 this.description = castToMarkdown(value); // MarkdownType 803 return value; 804 case -669707736: // useContext 805 this.getUseContext().add(castToUsageContext(value)); // UsageContext 806 return value; 807 case -507075711: // jurisdiction 808 this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept 809 return value; 810 default: return super.setProperty(hash, name, value); 811 } 812 813 } 814 815 @Override 816 public Base setProperty(String name, Base value) throws FHIRException { 817 if (name.equals("url")) { 818 this.url = castToUri(value); // UriType 819 } else if (name.equals("version")) { 820 this.version = castToString(value); // StringType 821 } else if (name.equals("name")) { 822 this.name = castToString(value); // StringType 823 } else if (name.equals("title")) { 824 this.title = castToString(value); // StringType 825 } else if (name.equals("status")) { 826 value = new PublicationStatusEnumFactory().fromType(castToCode(value)); 827 this.status = (Enumeration) value; // Enumeration<PublicationStatus> 828 } else if (name.equals("experimental")) { 829 this.experimental = castToBoolean(value); // BooleanType 830 } else if (name.equals("date")) { 831 this.date = castToDateTime(value); // DateTimeType 832 } else if (name.equals("publisher")) { 833 this.publisher = castToString(value); // StringType 834 } else if (name.equals("contact")) { 835 this.getContact().add(castToContactDetail(value)); 836 } else if (name.equals("description")) { 837 this.description = castToMarkdown(value); // MarkdownType 838 } else if (name.equals("useContext")) { 839 this.getUseContext().add(castToUsageContext(value)); 840 } else if (name.equals("jurisdiction")) { 841 this.getJurisdiction().add(castToCodeableConcept(value)); 842 } else 843 return super.setProperty(name, value); 844 return value; 845 } 846 847 @Override 848 public Base makeProperty(int hash, String name) throws FHIRException { 849 switch (hash) { 850 case 116079: return getUrlElement(); 851 case 351608024: return getVersionElement(); 852 case 3373707: return getNameElement(); 853 case 110371416: return getTitleElement(); 854 case -892481550: return getStatusElement(); 855 case -404562712: return getExperimentalElement(); 856 case 3076014: return getDateElement(); 857 case 1447404028: return getPublisherElement(); 858 case 951526432: return addContact(); 859 case -1724546052: return getDescriptionElement(); 860 case -669707736: return addUseContext(); 861 case -507075711: return addJurisdiction(); 862 default: return super.makeProperty(hash, name); 863 } 864 865 } 866 867 @Override 868 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 869 switch (hash) { 870 case 116079: /*url*/ return new String[] {"uri"}; 871 case 351608024: /*version*/ return new String[] {"string"}; 872 case 3373707: /*name*/ return new String[] {"string"}; 873 case 110371416: /*title*/ return new String[] {"string"}; 874 case -892481550: /*status*/ return new String[] {"code"}; 875 case -404562712: /*experimental*/ return new String[] {"boolean"}; 876 case 3076014: /*date*/ return new String[] {"dateTime"}; 877 case 1447404028: /*publisher*/ return new String[] {"string"}; 878 case 951526432: /*contact*/ return new String[] {"ContactDetail"}; 879 case -1724546052: /*description*/ return new String[] {"markdown"}; 880 case -669707736: /*useContext*/ return new String[] {"UsageContext"}; 881 case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"}; 882 default: return super.getTypesForProperty(hash, name); 883 } 884 885 } 886 887 @Override 888 public Base addChild(String name) throws FHIRException { 889 if (name.equals("url")) { 890 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.url"); 891 } 892 else if (name.equals("version")) { 893 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.version"); 894 } 895 else if (name.equals("name")) { 896 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.name"); 897 } 898 else if (name.equals("title")) { 899 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.title"); 900 } 901 else if (name.equals("status")) { 902 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.status"); 903 } 904 else if (name.equals("experimental")) { 905 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.experimental"); 906 } 907 else if (name.equals("date")) { 908 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.date"); 909 } 910 else if (name.equals("publisher")) { 911 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.publisher"); 912 } 913 else if (name.equals("contact")) { 914 return addContact(); 915 } 916 else if (name.equals("description")) { 917 throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.description"); 918 } 919 else if (name.equals("useContext")) { 920 return addUseContext(); 921 } 922 else if (name.equals("jurisdiction")) { 923 return addJurisdiction(); 924 } 925 else 926 return super.addChild(name); 927 } 928 929 public String fhirType() { 930 return "MetadataResource"; 931 932 } 933 934 public abstract MetadataResource copy(); 935 936 public void copyValues(MetadataResource dst) { 937 super.copyValues(dst); 938 dst.url = url == null ? null : url.copy(); 939 dst.version = version == null ? null : version.copy(); 940 dst.name = name == null ? null : name.copy(); 941 dst.title = title == null ? null : title.copy(); 942 dst.status = status == null ? null : status.copy(); 943 dst.experimental = experimental == null ? null : experimental.copy(); 944 dst.date = date == null ? null : date.copy(); 945 dst.publisher = publisher == null ? null : publisher.copy(); 946 if (contact != null) { 947 dst.contact = new ArrayList<ContactDetail>(); 948 for (ContactDetail i : contact) 949 dst.contact.add(i.copy()); 950 }; 951 dst.description = description == null ? null : description.copy(); 952 if (useContext != null) { 953 dst.useContext = new ArrayList<UsageContext>(); 954 for (UsageContext i : useContext) 955 dst.useContext.add(i.copy()); 956 }; 957 if (jurisdiction != null) { 958 dst.jurisdiction = new ArrayList<CodeableConcept>(); 959 for (CodeableConcept i : jurisdiction) 960 dst.jurisdiction.add(i.copy()); 961 }; 962 } 963 964 @Override 965 public boolean equalsDeep(Base other_) { 966 if (!super.equalsDeep(other_)) 967 return false; 968 if (!(other_ instanceof MetadataResource)) 969 return false; 970 MetadataResource o = (MetadataResource) other_; 971 return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) 972 && compareDeep(title, o.title, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) 973 && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) 974 && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) 975 && compareDeep(jurisdiction, o.jurisdiction, true); 976 } 977 978 @Override 979 public boolean equalsShallow(Base other_) { 980 if (!super.equalsShallow(other_)) 981 return false; 982 if (!(other_ instanceof MetadataResource)) 983 return false; 984 MetadataResource o = (MetadataResource) other_; 985 return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) 986 && compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) 987 && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) 988 ; 989 } 990 991 public boolean isEmpty() { 992 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, version, name, title 993 , status, experimental, date, publisher, contact, description, useContext, jurisdiction 994 ); 995 } 996 997// added from java-adornments.txt: 998 @Override 999 public String toString() { 1000 return fhirType()+"["+getUrl()+"]"; 1001 } 1002 1003 public String present() { 1004 if (hasTitle()) 1005 return getTitle(); 1006 if (hasName()) 1007 return getName(); 1008 return toString(); 1009 } 1010 1011// end addition 1012 1013} 1014