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 ca.uhn.fhir.model.api.annotation.Child; 038import ca.uhn.fhir.model.api.annotation.ChildOrder; 039import ca.uhn.fhir.model.api.annotation.Description; 040import ca.uhn.fhir.model.api.annotation.DatatypeDef; 041import ca.uhn.fhir.model.api.annotation.Block; 042import org.hl7.fhir.instance.model.api.*; 043import org.hl7.fhir.exceptions.FHIRException; 044/** 045 * Related artifacts such as additional documentation, justification, or bibliographic references. 046 */ 047@DatatypeDef(name="RelatedArtifact") 048public class RelatedArtifact extends Type implements ICompositeType { 049 050 public enum RelatedArtifactType { 051 /** 052 * Additional documentation for the knowledge resource. This would include additional instructions on usage as well as additional information on clinical context or appropriateness. 053 */ 054 DOCUMENTATION, 055 /** 056 * A summary of the justification for the knowledge resource including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the knowledge resource available to the consumer of interventions or results produced by the knowledge resource. 057 */ 058 JUSTIFICATION, 059 /** 060 * Bibliographic citation for papers, references, or other relevant material for the knowledge resource. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this knowledge resource. 061 */ 062 CITATION, 063 /** 064 * The previous version of the knowledge resource. 065 */ 066 PREDECESSOR, 067 /** 068 * The next version of the knowledge resource. 069 */ 070 SUCCESSOR, 071 /** 072 * The knowledge resource is derived from the related artifact. This is intended to capture the relationship in which a particular knowledge resource is based on the content of another artifact, but is modified to capture either a different set of overall requirements, or a more specific set of requirements such as those involved in a particular institution or clinical setting. 073 */ 074 DERIVEDFROM, 075 /** 076 * The knowledge resource depends on the given related artifact. 077 */ 078 DEPENDSON, 079 /** 080 * The knowledge resource is composed of the given related artifact. 081 */ 082 COMPOSEDOF, 083 /** 084 * added to help the parsers with the generic types 085 */ 086 NULL; 087 public static RelatedArtifactType fromCode(String codeString) throws FHIRException { 088 if (codeString == null || "".equals(codeString)) 089 return null; 090 if ("documentation".equals(codeString)) 091 return DOCUMENTATION; 092 if ("justification".equals(codeString)) 093 return JUSTIFICATION; 094 if ("citation".equals(codeString)) 095 return CITATION; 096 if ("predecessor".equals(codeString)) 097 return PREDECESSOR; 098 if ("successor".equals(codeString)) 099 return SUCCESSOR; 100 if ("derived-from".equals(codeString)) 101 return DERIVEDFROM; 102 if ("depends-on".equals(codeString)) 103 return DEPENDSON; 104 if ("composed-of".equals(codeString)) 105 return COMPOSEDOF; 106 if (Configuration.isAcceptInvalidEnums()) 107 return null; 108 else 109 throw new FHIRException("Unknown RelatedArtifactType code '"+codeString+"'"); 110 } 111 public String toCode() { 112 switch (this) { 113 case DOCUMENTATION: return "documentation"; 114 case JUSTIFICATION: return "justification"; 115 case CITATION: return "citation"; 116 case PREDECESSOR: return "predecessor"; 117 case SUCCESSOR: return "successor"; 118 case DERIVEDFROM: return "derived-from"; 119 case DEPENDSON: return "depends-on"; 120 case COMPOSEDOF: return "composed-of"; 121 default: return "?"; 122 } 123 } 124 public String getSystem() { 125 switch (this) { 126 case DOCUMENTATION: return "http://hl7.org/fhir/related-artifact-type"; 127 case JUSTIFICATION: return "http://hl7.org/fhir/related-artifact-type"; 128 case CITATION: return "http://hl7.org/fhir/related-artifact-type"; 129 case PREDECESSOR: return "http://hl7.org/fhir/related-artifact-type"; 130 case SUCCESSOR: return "http://hl7.org/fhir/related-artifact-type"; 131 case DERIVEDFROM: return "http://hl7.org/fhir/related-artifact-type"; 132 case DEPENDSON: return "http://hl7.org/fhir/related-artifact-type"; 133 case COMPOSEDOF: return "http://hl7.org/fhir/related-artifact-type"; 134 default: return "?"; 135 } 136 } 137 public String getDefinition() { 138 switch (this) { 139 case DOCUMENTATION: return "Additional documentation for the knowledge resource. This would include additional instructions on usage as well as additional information on clinical context or appropriateness."; 140 case JUSTIFICATION: return "A summary of the justification for the knowledge resource including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the knowledge resource available to the consumer of interventions or results produced by the knowledge resource."; 141 case CITATION: return "Bibliographic citation for papers, references, or other relevant material for the knowledge resource. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this knowledge resource."; 142 case PREDECESSOR: return "The previous version of the knowledge resource."; 143 case SUCCESSOR: return "The next version of the knowledge resource."; 144 case DERIVEDFROM: return "The knowledge resource is derived from the related artifact. This is intended to capture the relationship in which a particular knowledge resource is based on the content of another artifact, but is modified to capture either a different set of overall requirements, or a more specific set of requirements such as those involved in a particular institution or clinical setting."; 145 case DEPENDSON: return "The knowledge resource depends on the given related artifact."; 146 case COMPOSEDOF: return "The knowledge resource is composed of the given related artifact."; 147 default: return "?"; 148 } 149 } 150 public String getDisplay() { 151 switch (this) { 152 case DOCUMENTATION: return "Documentation"; 153 case JUSTIFICATION: return "Justification"; 154 case CITATION: return "Citation"; 155 case PREDECESSOR: return "Predecessor"; 156 case SUCCESSOR: return "Successor"; 157 case DERIVEDFROM: return "Derived From"; 158 case DEPENDSON: return "Depends On"; 159 case COMPOSEDOF: return "Composed Of"; 160 default: return "?"; 161 } 162 } 163 } 164 165 public static class RelatedArtifactTypeEnumFactory implements EnumFactory<RelatedArtifactType> { 166 public RelatedArtifactType fromCode(String codeString) throws IllegalArgumentException { 167 if (codeString == null || "".equals(codeString)) 168 if (codeString == null || "".equals(codeString)) 169 return null; 170 if ("documentation".equals(codeString)) 171 return RelatedArtifactType.DOCUMENTATION; 172 if ("justification".equals(codeString)) 173 return RelatedArtifactType.JUSTIFICATION; 174 if ("citation".equals(codeString)) 175 return RelatedArtifactType.CITATION; 176 if ("predecessor".equals(codeString)) 177 return RelatedArtifactType.PREDECESSOR; 178 if ("successor".equals(codeString)) 179 return RelatedArtifactType.SUCCESSOR; 180 if ("derived-from".equals(codeString)) 181 return RelatedArtifactType.DERIVEDFROM; 182 if ("depends-on".equals(codeString)) 183 return RelatedArtifactType.DEPENDSON; 184 if ("composed-of".equals(codeString)) 185 return RelatedArtifactType.COMPOSEDOF; 186 throw new IllegalArgumentException("Unknown RelatedArtifactType code '"+codeString+"'"); 187 } 188 public Enumeration<RelatedArtifactType> fromType(Base code) throws FHIRException { 189 if (code == null) 190 return null; 191 if (code.isEmpty()) 192 return new Enumeration<RelatedArtifactType>(this); 193 String codeString = ((PrimitiveType) code).asStringValue(); 194 if (codeString == null || "".equals(codeString)) 195 return null; 196 if ("documentation".equals(codeString)) 197 return new Enumeration<RelatedArtifactType>(this, RelatedArtifactType.DOCUMENTATION); 198 if ("justification".equals(codeString)) 199 return new Enumeration<RelatedArtifactType>(this, RelatedArtifactType.JUSTIFICATION); 200 if ("citation".equals(codeString)) 201 return new Enumeration<RelatedArtifactType>(this, RelatedArtifactType.CITATION); 202 if ("predecessor".equals(codeString)) 203 return new Enumeration<RelatedArtifactType>(this, RelatedArtifactType.PREDECESSOR); 204 if ("successor".equals(codeString)) 205 return new Enumeration<RelatedArtifactType>(this, RelatedArtifactType.SUCCESSOR); 206 if ("derived-from".equals(codeString)) 207 return new Enumeration<RelatedArtifactType>(this, RelatedArtifactType.DERIVEDFROM); 208 if ("depends-on".equals(codeString)) 209 return new Enumeration<RelatedArtifactType>(this, RelatedArtifactType.DEPENDSON); 210 if ("composed-of".equals(codeString)) 211 return new Enumeration<RelatedArtifactType>(this, RelatedArtifactType.COMPOSEDOF); 212 throw new FHIRException("Unknown RelatedArtifactType code '"+codeString+"'"); 213 } 214 public String toCode(RelatedArtifactType code) { 215 if (code == RelatedArtifactType.DOCUMENTATION) 216 return "documentation"; 217 if (code == RelatedArtifactType.JUSTIFICATION) 218 return "justification"; 219 if (code == RelatedArtifactType.CITATION) 220 return "citation"; 221 if (code == RelatedArtifactType.PREDECESSOR) 222 return "predecessor"; 223 if (code == RelatedArtifactType.SUCCESSOR) 224 return "successor"; 225 if (code == RelatedArtifactType.DERIVEDFROM) 226 return "derived-from"; 227 if (code == RelatedArtifactType.DEPENDSON) 228 return "depends-on"; 229 if (code == RelatedArtifactType.COMPOSEDOF) 230 return "composed-of"; 231 return "?"; 232 } 233 public String toSystem(RelatedArtifactType code) { 234 return code.getSystem(); 235 } 236 } 237 238 /** 239 * The type of relationship to the related artifact. 240 */ 241 @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) 242 @Description(shortDefinition="documentation | justification | citation | predecessor | successor | derived-from | depends-on | composed-of", formalDefinition="The type of relationship to the related artifact." ) 243 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/related-artifact-type") 244 protected Enumeration<RelatedArtifactType> type; 245 246 /** 247 * A brief description of the document or knowledge resource being referenced, suitable for display to a consumer. 248 */ 249 @Child(name = "display", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) 250 @Description(shortDefinition="Brief description of the related artifact", formalDefinition="A brief description of the document or knowledge resource being referenced, suitable for display to a consumer." ) 251 protected StringType display; 252 253 /** 254 * A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format. 255 */ 256 @Child(name = "citation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) 257 @Description(shortDefinition="Bibliographic citation for the artifact", formalDefinition="A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format." ) 258 protected StringType citation; 259 260 /** 261 * A url for the artifact that can be followed to access the actual content. 262 */ 263 @Child(name = "url", type = {UrlType.class}, order=3, min=0, max=1, modifier=false, summary=true) 264 @Description(shortDefinition="Where the artifact can be accessed", formalDefinition="A url for the artifact that can be followed to access the actual content." ) 265 protected UrlType url; 266 267 /** 268 * The document being referenced, represented as an attachment. This is exclusive with the resource element. 269 */ 270 @Child(name = "document", type = {Attachment.class}, order=4, min=0, max=1, modifier=false, summary=true) 271 @Description(shortDefinition="What document is being referenced", formalDefinition="The document being referenced, represented as an attachment. This is exclusive with the resource element." ) 272 protected Attachment document; 273 274 /** 275 * The related resource, such as a library, value set, profile, or other knowledge resource. 276 */ 277 @Child(name = "resource", type = {CanonicalType.class}, order=5, min=0, max=1, modifier=false, summary=true) 278 @Description(shortDefinition="What resource is being referenced", formalDefinition="The related resource, such as a library, value set, profile, or other knowledge resource." ) 279 protected CanonicalType resource; 280 281 private static final long serialVersionUID = 365945959L; 282 283 /** 284 * Constructor 285 */ 286 public RelatedArtifact() { 287 super(); 288 } 289 290 /** 291 * Constructor 292 */ 293 public RelatedArtifact(Enumeration<RelatedArtifactType> type) { 294 super(); 295 this.type = type; 296 } 297 298 /** 299 * @return {@link #type} (The type of relationship to the related artifact.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 300 */ 301 public Enumeration<RelatedArtifactType> getTypeElement() { 302 if (this.type == null) 303 if (Configuration.errorOnAutoCreate()) 304 throw new Error("Attempt to auto-create RelatedArtifact.type"); 305 else if (Configuration.doAutoCreate()) 306 this.type = new Enumeration<RelatedArtifactType>(new RelatedArtifactTypeEnumFactory()); // bb 307 return this.type; 308 } 309 310 public boolean hasTypeElement() { 311 return this.type != null && !this.type.isEmpty(); 312 } 313 314 public boolean hasType() { 315 return this.type != null && !this.type.isEmpty(); 316 } 317 318 /** 319 * @param value {@link #type} (The type of relationship to the related artifact.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 320 */ 321 public RelatedArtifact setTypeElement(Enumeration<RelatedArtifactType> value) { 322 this.type = value; 323 return this; 324 } 325 326 /** 327 * @return The type of relationship to the related artifact. 328 */ 329 public RelatedArtifactType getType() { 330 return this.type == null ? null : this.type.getValue(); 331 } 332 333 /** 334 * @param value The type of relationship to the related artifact. 335 */ 336 public RelatedArtifact setType(RelatedArtifactType value) { 337 if (this.type == null) 338 this.type = new Enumeration<RelatedArtifactType>(new RelatedArtifactTypeEnumFactory()); 339 this.type.setValue(value); 340 return this; 341 } 342 343 /** 344 * @return {@link #display} (A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value 345 */ 346 public StringType getDisplayElement() { 347 if (this.display == null) 348 if (Configuration.errorOnAutoCreate()) 349 throw new Error("Attempt to auto-create RelatedArtifact.display"); 350 else if (Configuration.doAutoCreate()) 351 this.display = new StringType(); // bb 352 return this.display; 353 } 354 355 public boolean hasDisplayElement() { 356 return this.display != null && !this.display.isEmpty(); 357 } 358 359 public boolean hasDisplay() { 360 return this.display != null && !this.display.isEmpty(); 361 } 362 363 /** 364 * @param value {@link #display} (A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value 365 */ 366 public RelatedArtifact setDisplayElement(StringType value) { 367 this.display = value; 368 return this; 369 } 370 371 /** 372 * @return A brief description of the document or knowledge resource being referenced, suitable for display to a consumer. 373 */ 374 public String getDisplay() { 375 return this.display == null ? null : this.display.getValue(); 376 } 377 378 /** 379 * @param value A brief description of the document or knowledge resource being referenced, suitable for display to a consumer. 380 */ 381 public RelatedArtifact setDisplay(String value) { 382 if (Utilities.noString(value)) 383 this.display = null; 384 else { 385 if (this.display == null) 386 this.display = new StringType(); 387 this.display.setValue(value); 388 } 389 return this; 390 } 391 392 /** 393 * @return {@link #citation} (A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.). This is the underlying object with id, value and extensions. The accessor "getCitation" gives direct access to the value 394 */ 395 public StringType getCitationElement() { 396 if (this.citation == null) 397 if (Configuration.errorOnAutoCreate()) 398 throw new Error("Attempt to auto-create RelatedArtifact.citation"); 399 else if (Configuration.doAutoCreate()) 400 this.citation = new StringType(); // bb 401 return this.citation; 402 } 403 404 public boolean hasCitationElement() { 405 return this.citation != null && !this.citation.isEmpty(); 406 } 407 408 public boolean hasCitation() { 409 return this.citation != null && !this.citation.isEmpty(); 410 } 411 412 /** 413 * @param value {@link #citation} (A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.). This is the underlying object with id, value and extensions. The accessor "getCitation" gives direct access to the value 414 */ 415 public RelatedArtifact setCitationElement(StringType value) { 416 this.citation = value; 417 return this; 418 } 419 420 /** 421 * @return A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format. 422 */ 423 public String getCitation() { 424 return this.citation == null ? null : this.citation.getValue(); 425 } 426 427 /** 428 * @param value A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format. 429 */ 430 public RelatedArtifact setCitation(String value) { 431 if (Utilities.noString(value)) 432 this.citation = null; 433 else { 434 if (this.citation == null) 435 this.citation = new StringType(); 436 this.citation.setValue(value); 437 } 438 return this; 439 } 440 441 /** 442 * @return {@link #url} (A url for the artifact that can be followed to access the actual content.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 443 */ 444 public UrlType getUrlElement() { 445 if (this.url == null) 446 if (Configuration.errorOnAutoCreate()) 447 throw new Error("Attempt to auto-create RelatedArtifact.url"); 448 else if (Configuration.doAutoCreate()) 449 this.url = new UrlType(); // bb 450 return this.url; 451 } 452 453 public boolean hasUrlElement() { 454 return this.url != null && !this.url.isEmpty(); 455 } 456 457 public boolean hasUrl() { 458 return this.url != null && !this.url.isEmpty(); 459 } 460 461 /** 462 * @param value {@link #url} (A url for the artifact that can be followed to access the actual content.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 463 */ 464 public RelatedArtifact setUrlElement(UrlType value) { 465 this.url = value; 466 return this; 467 } 468 469 /** 470 * @return A url for the artifact that can be followed to access the actual content. 471 */ 472 public String getUrl() { 473 return this.url == null ? null : this.url.getValue(); 474 } 475 476 /** 477 * @param value A url for the artifact that can be followed to access the actual content. 478 */ 479 public RelatedArtifact setUrl(String value) { 480 if (Utilities.noString(value)) 481 this.url = null; 482 else { 483 if (this.url == null) 484 this.url = new UrlType(); 485 this.url.setValue(value); 486 } 487 return this; 488 } 489 490 /** 491 * @return {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.) 492 */ 493 public Attachment getDocument() { 494 if (this.document == null) 495 if (Configuration.errorOnAutoCreate()) 496 throw new Error("Attempt to auto-create RelatedArtifact.document"); 497 else if (Configuration.doAutoCreate()) 498 this.document = new Attachment(); // cc 499 return this.document; 500 } 501 502 public boolean hasDocument() { 503 return this.document != null && !this.document.isEmpty(); 504 } 505 506 /** 507 * @param value {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.) 508 */ 509 public RelatedArtifact setDocument(Attachment value) { 510 this.document = value; 511 return this; 512 } 513 514 /** 515 * @return {@link #resource} (The related resource, such as a library, value set, profile, or other knowledge resource.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value 516 */ 517 public CanonicalType getResourceElement() { 518 if (this.resource == null) 519 if (Configuration.errorOnAutoCreate()) 520 throw new Error("Attempt to auto-create RelatedArtifact.resource"); 521 else if (Configuration.doAutoCreate()) 522 this.resource = new CanonicalType(); // bb 523 return this.resource; 524 } 525 526 public boolean hasResourceElement() { 527 return this.resource != null && !this.resource.isEmpty(); 528 } 529 530 public boolean hasResource() { 531 return this.resource != null && !this.resource.isEmpty(); 532 } 533 534 /** 535 * @param value {@link #resource} (The related resource, such as a library, value set, profile, or other knowledge resource.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value 536 */ 537 public RelatedArtifact setResourceElement(CanonicalType value) { 538 this.resource = value; 539 return this; 540 } 541 542 /** 543 * @return The related resource, such as a library, value set, profile, or other knowledge resource. 544 */ 545 public String getResource() { 546 return this.resource == null ? null : this.resource.getValue(); 547 } 548 549 /** 550 * @param value The related resource, such as a library, value set, profile, or other knowledge resource. 551 */ 552 public RelatedArtifact setResource(String value) { 553 if (Utilities.noString(value)) 554 this.resource = null; 555 else { 556 if (this.resource == null) 557 this.resource = new CanonicalType(); 558 this.resource.setValue(value); 559 } 560 return this; 561 } 562 563 protected void listChildren(List<Property> children) { 564 super.listChildren(children); 565 children.add(new Property("type", "code", "The type of relationship to the related artifact.", 0, 1, type)); 566 children.add(new Property("display", "string", "A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.", 0, 1, display)); 567 children.add(new Property("citation", "string", "A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.", 0, 1, citation)); 568 children.add(new Property("url", "url", "A url for the artifact that can be followed to access the actual content.", 0, 1, url)); 569 children.add(new Property("document", "Attachment", "The document being referenced, represented as an attachment. This is exclusive with the resource element.", 0, 1, document)); 570 children.add(new Property("resource", "canonical(Any)", "The related resource, such as a library, value set, profile, or other knowledge resource.", 0, 1, resource)); 571 } 572 573 @Override 574 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 575 switch (_hash) { 576 case 3575610: /*type*/ return new Property("type", "code", "The type of relationship to the related artifact.", 0, 1, type); 577 case 1671764162: /*display*/ return new Property("display", "string", "A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.", 0, 1, display); 578 case -1442706713: /*citation*/ return new Property("citation", "string", "A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.", 0, 1, citation); 579 case 116079: /*url*/ return new Property("url", "url", "A url for the artifact that can be followed to access the actual content.", 0, 1, url); 580 case 861720859: /*document*/ return new Property("document", "Attachment", "The document being referenced, represented as an attachment. This is exclusive with the resource element.", 0, 1, document); 581 case -341064690: /*resource*/ return new Property("resource", "canonical(Any)", "The related resource, such as a library, value set, profile, or other knowledge resource.", 0, 1, resource); 582 default: return super.getNamedProperty(_hash, _name, _checkValid); 583 } 584 585 } 586 587 @Override 588 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 589 switch (hash) { 590 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<RelatedArtifactType> 591 case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType 592 case -1442706713: /*citation*/ return this.citation == null ? new Base[0] : new Base[] {this.citation}; // StringType 593 case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UrlType 594 case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Attachment 595 case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CanonicalType 596 default: return super.getProperty(hash, name, checkValid); 597 } 598 599 } 600 601 @Override 602 public Base setProperty(int hash, String name, Base value) throws FHIRException { 603 switch (hash) { 604 case 3575610: // type 605 value = new RelatedArtifactTypeEnumFactory().fromType(castToCode(value)); 606 this.type = (Enumeration) value; // Enumeration<RelatedArtifactType> 607 return value; 608 case 1671764162: // display 609 this.display = castToString(value); // StringType 610 return value; 611 case -1442706713: // citation 612 this.citation = castToString(value); // StringType 613 return value; 614 case 116079: // url 615 this.url = castToUrl(value); // UrlType 616 return value; 617 case 861720859: // document 618 this.document = castToAttachment(value); // Attachment 619 return value; 620 case -341064690: // resource 621 this.resource = castToCanonical(value); // CanonicalType 622 return value; 623 default: return super.setProperty(hash, name, value); 624 } 625 626 } 627 628 @Override 629 public Base setProperty(String name, Base value) throws FHIRException { 630 if (name.equals("type")) { 631 value = new RelatedArtifactTypeEnumFactory().fromType(castToCode(value)); 632 this.type = (Enumeration) value; // Enumeration<RelatedArtifactType> 633 } else if (name.equals("display")) { 634 this.display = castToString(value); // StringType 635 } else if (name.equals("citation")) { 636 this.citation = castToString(value); // StringType 637 } else if (name.equals("url")) { 638 this.url = castToUrl(value); // UrlType 639 } else if (name.equals("document")) { 640 this.document = castToAttachment(value); // Attachment 641 } else if (name.equals("resource")) { 642 this.resource = castToCanonical(value); // CanonicalType 643 } else 644 return super.setProperty(name, value); 645 return value; 646 } 647 648 @Override 649 public Base makeProperty(int hash, String name) throws FHIRException { 650 switch (hash) { 651 case 3575610: return getTypeElement(); 652 case 1671764162: return getDisplayElement(); 653 case -1442706713: return getCitationElement(); 654 case 116079: return getUrlElement(); 655 case 861720859: return getDocument(); 656 case -341064690: return getResourceElement(); 657 default: return super.makeProperty(hash, name); 658 } 659 660 } 661 662 @Override 663 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 664 switch (hash) { 665 case 3575610: /*type*/ return new String[] {"code"}; 666 case 1671764162: /*display*/ return new String[] {"string"}; 667 case -1442706713: /*citation*/ return new String[] {"string"}; 668 case 116079: /*url*/ return new String[] {"url"}; 669 case 861720859: /*document*/ return new String[] {"Attachment"}; 670 case -341064690: /*resource*/ return new String[] {"canonical"}; 671 default: return super.getTypesForProperty(hash, name); 672 } 673 674 } 675 676 @Override 677 public Base addChild(String name) throws FHIRException { 678 if (name.equals("type")) { 679 throw new FHIRException("Cannot call addChild on a primitive type RelatedArtifact.type"); 680 } 681 else if (name.equals("display")) { 682 throw new FHIRException("Cannot call addChild on a primitive type RelatedArtifact.display"); 683 } 684 else if (name.equals("citation")) { 685 throw new FHIRException("Cannot call addChild on a primitive type RelatedArtifact.citation"); 686 } 687 else if (name.equals("url")) { 688 throw new FHIRException("Cannot call addChild on a primitive type RelatedArtifact.url"); 689 } 690 else if (name.equals("document")) { 691 this.document = new Attachment(); 692 return this.document; 693 } 694 else if (name.equals("resource")) { 695 throw new FHIRException("Cannot call addChild on a primitive type RelatedArtifact.resource"); 696 } 697 else 698 return super.addChild(name); 699 } 700 701 public String fhirType() { 702 return "RelatedArtifact"; 703 704 } 705 706 public RelatedArtifact copy() { 707 RelatedArtifact dst = new RelatedArtifact(); 708 copyValues(dst); 709 dst.type = type == null ? null : type.copy(); 710 dst.display = display == null ? null : display.copy(); 711 dst.citation = citation == null ? null : citation.copy(); 712 dst.url = url == null ? null : url.copy(); 713 dst.document = document == null ? null : document.copy(); 714 dst.resource = resource == null ? null : resource.copy(); 715 return dst; 716 } 717 718 protected RelatedArtifact typedCopy() { 719 return copy(); 720 } 721 722 @Override 723 public boolean equalsDeep(Base other_) { 724 if (!super.equalsDeep(other_)) 725 return false; 726 if (!(other_ instanceof RelatedArtifact)) 727 return false; 728 RelatedArtifact o = (RelatedArtifact) other_; 729 return compareDeep(type, o.type, true) && compareDeep(display, o.display, true) && compareDeep(citation, o.citation, true) 730 && compareDeep(url, o.url, true) && compareDeep(document, o.document, true) && compareDeep(resource, o.resource, true) 731 ; 732 } 733 734 @Override 735 public boolean equalsShallow(Base other_) { 736 if (!super.equalsShallow(other_)) 737 return false; 738 if (!(other_ instanceof RelatedArtifact)) 739 return false; 740 RelatedArtifact o = (RelatedArtifact) other_; 741 return compareValues(type, o.type, true) && compareValues(display, o.display, true) && compareValues(citation, o.citation, true) 742 && compareValues(url, o.url, true); 743 } 744 745 public boolean isEmpty() { 746 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, display, citation 747 , url, document, resource); 748 } 749 750 751} 752