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 Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1 033import java.util.ArrayList; 034import java.util.Date; 035import java.util.List; 036 037import org.hl7.fhir.exceptions.FHIRException; 038import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 039 040import ca.uhn.fhir.model.api.annotation.Block; 041import ca.uhn.fhir.model.api.annotation.Child; 042import ca.uhn.fhir.model.api.annotation.Description; 043import ca.uhn.fhir.model.api.annotation.ResourceDef; 044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 045 046/** 047 * Provenance of a resource is a record that describes entities and processes 048 * involved in producing and delivering or otherwise influencing that resource. 049 * Provenance provides a critical foundation for assessing authenticity, 050 * enabling trust, and allowing reproducibility. Provenance assertions are a 051 * form of contextual metadata and can themselves become important records with 052 * their own provenance. Provenance statement indicates clinical significance in 053 * terms of confidence in authenticity, reliability, and trustworthiness, 054 * integrity, and stage in lifecycle (e.g. Document Completion - has the 055 * artifact been legally authenticated), all of which may impact security, 056 * privacy, and trust policies. 057 */ 058@ResourceDef(name = "Provenance", profile = "http://hl7.org/fhir/StructureDefinition/Provenance") 059public class Provenance extends DomainResource { 060 061 public enum ProvenanceEntityRole { 062 /** 063 * A transformation of an entity into another, an update of an entity resulting 064 * in a new one, or the construction of a new entity based on a pre-existing 065 * entity. 066 */ 067 DERIVATION, 068 /** 069 * A derivation for which the resulting entity is a revised version of some 070 * original. 071 */ 072 REVISION, 073 /** 074 * The repeat of (some or all of) an entity, such as text or image, by someone 075 * who might or might not be its original author. 076 */ 077 QUOTATION, 078 /** 079 * A primary source for a topic refers to something produced by some agent with 080 * direct experience and knowledge about the topic, at the time of the topic's 081 * study, without benefit from hindsight. 082 */ 083 SOURCE, 084 /** 085 * A derivation for which the entity is removed from accessibility usually 086 * through the use of the Delete operation. 087 */ 088 REMOVAL, 089 /** 090 * added to help the parsers with the generic types 091 */ 092 NULL; 093 094 public static ProvenanceEntityRole fromCode(String codeString) throws FHIRException { 095 if (codeString == null || "".equals(codeString)) 096 return null; 097 if ("derivation".equals(codeString)) 098 return DERIVATION; 099 if ("revision".equals(codeString)) 100 return REVISION; 101 if ("quotation".equals(codeString)) 102 return QUOTATION; 103 if ("source".equals(codeString)) 104 return SOURCE; 105 if ("removal".equals(codeString)) 106 return REMOVAL; 107 if (Configuration.isAcceptInvalidEnums()) 108 return null; 109 else 110 throw new FHIRException("Unknown ProvenanceEntityRole code '" + codeString + "'"); 111 } 112 113 public String toCode() { 114 switch (this) { 115 case DERIVATION: 116 return "derivation"; 117 case REVISION: 118 return "revision"; 119 case QUOTATION: 120 return "quotation"; 121 case SOURCE: 122 return "source"; 123 case REMOVAL: 124 return "removal"; 125 case NULL: 126 return null; 127 default: 128 return "?"; 129 } 130 } 131 132 public String getSystem() { 133 switch (this) { 134 case DERIVATION: 135 return "http://hl7.org/fhir/provenance-entity-role"; 136 case REVISION: 137 return "http://hl7.org/fhir/provenance-entity-role"; 138 case QUOTATION: 139 return "http://hl7.org/fhir/provenance-entity-role"; 140 case SOURCE: 141 return "http://hl7.org/fhir/provenance-entity-role"; 142 case REMOVAL: 143 return "http://hl7.org/fhir/provenance-entity-role"; 144 case NULL: 145 return null; 146 default: 147 return "?"; 148 } 149 } 150 151 public String getDefinition() { 152 switch (this) { 153 case DERIVATION: 154 return "A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a pre-existing entity."; 155 case REVISION: 156 return "A derivation for which the resulting entity is a revised version of some original."; 157 case QUOTATION: 158 return "The repeat of (some or all of) an entity, such as text or image, by someone who might or might not be its original author."; 159 case SOURCE: 160 return "A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight."; 161 case REMOVAL: 162 return "A derivation for which the entity is removed from accessibility usually through the use of the Delete operation."; 163 case NULL: 164 return null; 165 default: 166 return "?"; 167 } 168 } 169 170 public String getDisplay() { 171 switch (this) { 172 case DERIVATION: 173 return "Derivation"; 174 case REVISION: 175 return "Revision"; 176 case QUOTATION: 177 return "Quotation"; 178 case SOURCE: 179 return "Source"; 180 case REMOVAL: 181 return "Removal"; 182 case NULL: 183 return null; 184 default: 185 return "?"; 186 } 187 } 188 } 189 190 public static class ProvenanceEntityRoleEnumFactory implements EnumFactory<ProvenanceEntityRole> { 191 public ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { 192 if (codeString == null || "".equals(codeString)) 193 if (codeString == null || "".equals(codeString)) 194 return null; 195 if ("derivation".equals(codeString)) 196 return ProvenanceEntityRole.DERIVATION; 197 if ("revision".equals(codeString)) 198 return ProvenanceEntityRole.REVISION; 199 if ("quotation".equals(codeString)) 200 return ProvenanceEntityRole.QUOTATION; 201 if ("source".equals(codeString)) 202 return ProvenanceEntityRole.SOURCE; 203 if ("removal".equals(codeString)) 204 return ProvenanceEntityRole.REMOVAL; 205 throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '" + codeString + "'"); 206 } 207 208 public Enumeration<ProvenanceEntityRole> fromType(PrimitiveType<?> code) throws FHIRException { 209 if (code == null) 210 return null; 211 if (code.isEmpty()) 212 return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.NULL, code); 213 String codeString = code.asStringValue(); 214 if (codeString == null || "".equals(codeString)) 215 return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.NULL, code); 216 if ("derivation".equals(codeString)) 217 return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.DERIVATION, code); 218 if ("revision".equals(codeString)) 219 return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.REVISION, code); 220 if ("quotation".equals(codeString)) 221 return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.QUOTATION, code); 222 if ("source".equals(codeString)) 223 return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.SOURCE, code); 224 if ("removal".equals(codeString)) 225 return new Enumeration<ProvenanceEntityRole>(this, ProvenanceEntityRole.REMOVAL, code); 226 throw new FHIRException("Unknown ProvenanceEntityRole code '" + codeString + "'"); 227 } 228 229 public String toCode(ProvenanceEntityRole code) { 230 if (code == ProvenanceEntityRole.DERIVATION) 231 return "derivation"; 232 if (code == ProvenanceEntityRole.REVISION) 233 return "revision"; 234 if (code == ProvenanceEntityRole.QUOTATION) 235 return "quotation"; 236 if (code == ProvenanceEntityRole.SOURCE) 237 return "source"; 238 if (code == ProvenanceEntityRole.REMOVAL) 239 return "removal"; 240 return "?"; 241 } 242 243 public String toSystem(ProvenanceEntityRole code) { 244 return code.getSystem(); 245 } 246 } 247 248 @Block() 249 public static class ProvenanceAgentComponent extends BackboneElement implements IBaseBackboneElement { 250 /** 251 * The participation the agent had with respect to the activity. 252 */ 253 @Child(name = "type", type = { 254 CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = true) 255 @Description(shortDefinition = "How the agent participated", formalDefinition = "The participation the agent had with respect to the activity.") 256 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/provenance-agent-type") 257 protected CodeableConcept type; 258 259 /** 260 * The function of the agent with respect to the activity. The security role 261 * enabling the agent with respect to the activity. 262 */ 263 @Child(name = "role", type = { 264 CodeableConcept.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 265 @Description(shortDefinition = "What the agents role was", formalDefinition = "The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.") 266 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/security-role-type") 267 protected List<CodeableConcept> role; 268 269 /** 270 * The individual, device or organization that participated in the event. 271 */ 272 @Child(name = "who", type = { Practitioner.class, PractitionerRole.class, RelatedPerson.class, Patient.class, 273 Device.class, Organization.class }, order = 3, min = 1, max = 1, modifier = false, summary = true) 274 @Description(shortDefinition = "Who participated", formalDefinition = "The individual, device or organization that participated in the event.") 275 protected Reference who; 276 277 /** 278 * The actual object that is the target of the reference (The individual, device 279 * or organization that participated in the event.) 280 */ 281 protected Resource whoTarget; 282 283 /** 284 * The individual, device, or organization for whom the change was made. 285 */ 286 @Child(name = "onBehalfOf", type = { Practitioner.class, PractitionerRole.class, RelatedPerson.class, Patient.class, 287 Device.class, Organization.class }, order = 4, min = 0, max = 1, modifier = false, summary = false) 288 @Description(shortDefinition = "Who the agent is representing", formalDefinition = "The individual, device, or organization for whom the change was made.") 289 protected Reference onBehalfOf; 290 291 /** 292 * The actual object that is the target of the reference (The individual, 293 * device, or organization for whom the change was made.) 294 */ 295 protected Resource onBehalfOfTarget; 296 297 private static final long serialVersionUID = -1363252586L; 298 299 /** 300 * Constructor 301 */ 302 public ProvenanceAgentComponent() { 303 super(); 304 } 305 306 /** 307 * Constructor 308 */ 309 public ProvenanceAgentComponent(Reference who) { 310 super(); 311 this.who = who; 312 } 313 314 /** 315 * @return {@link #type} (The participation the agent had with respect to the 316 * activity.) 317 */ 318 public CodeableConcept getType() { 319 if (this.type == null) 320 if (Configuration.errorOnAutoCreate()) 321 throw new Error("Attempt to auto-create ProvenanceAgentComponent.type"); 322 else if (Configuration.doAutoCreate()) 323 this.type = new CodeableConcept(); // cc 324 return this.type; 325 } 326 327 public boolean hasType() { 328 return this.type != null && !this.type.isEmpty(); 329 } 330 331 /** 332 * @param value {@link #type} (The participation the agent had with respect to 333 * the activity.) 334 */ 335 public ProvenanceAgentComponent setType(CodeableConcept value) { 336 this.type = value; 337 return this; 338 } 339 340 /** 341 * @return {@link #role} (The function of the agent with respect to the 342 * activity. The security role enabling the agent with respect to the 343 * activity.) 344 */ 345 public List<CodeableConcept> getRole() { 346 if (this.role == null) 347 this.role = new ArrayList<CodeableConcept>(); 348 return this.role; 349 } 350 351 /** 352 * @return Returns a reference to <code>this</code> for easy method chaining 353 */ 354 public ProvenanceAgentComponent setRole(List<CodeableConcept> theRole) { 355 this.role = theRole; 356 return this; 357 } 358 359 public boolean hasRole() { 360 if (this.role == null) 361 return false; 362 for (CodeableConcept item : this.role) 363 if (!item.isEmpty()) 364 return true; 365 return false; 366 } 367 368 public CodeableConcept addRole() { // 3 369 CodeableConcept t = new CodeableConcept(); 370 if (this.role == null) 371 this.role = new ArrayList<CodeableConcept>(); 372 this.role.add(t); 373 return t; 374 } 375 376 public ProvenanceAgentComponent addRole(CodeableConcept t) { // 3 377 if (t == null) 378 return this; 379 if (this.role == null) 380 this.role = new ArrayList<CodeableConcept>(); 381 this.role.add(t); 382 return this; 383 } 384 385 /** 386 * @return The first repetition of repeating field {@link #role}, creating it if 387 * it does not already exist 388 */ 389 public CodeableConcept getRoleFirstRep() { 390 if (getRole().isEmpty()) { 391 addRole(); 392 } 393 return getRole().get(0); 394 } 395 396 /** 397 * @return {@link #who} (The individual, device or organization that 398 * participated in the event.) 399 */ 400 public Reference getWho() { 401 if (this.who == null) 402 if (Configuration.errorOnAutoCreate()) 403 throw new Error("Attempt to auto-create ProvenanceAgentComponent.who"); 404 else if (Configuration.doAutoCreate()) 405 this.who = new Reference(); // cc 406 return this.who; 407 } 408 409 public boolean hasWho() { 410 return this.who != null && !this.who.isEmpty(); 411 } 412 413 /** 414 * @param value {@link #who} (The individual, device or organization that 415 * participated in the event.) 416 */ 417 public ProvenanceAgentComponent setWho(Reference value) { 418 this.who = value; 419 return this; 420 } 421 422 /** 423 * @return {@link #who} The actual object that is the target of the reference. 424 * The reference library doesn't populate this, but you can use it to 425 * hold the resource if you resolve it. (The individual, device or 426 * organization that participated in the event.) 427 */ 428 public Resource getWhoTarget() { 429 return this.whoTarget; 430 } 431 432 /** 433 * @param value {@link #who} The actual object that is the target of the 434 * reference. The reference library doesn't use these, but you can 435 * use it to hold the resource if you resolve it. (The individual, 436 * device or organization that participated in the event.) 437 */ 438 public ProvenanceAgentComponent setWhoTarget(Resource value) { 439 this.whoTarget = value; 440 return this; 441 } 442 443 /** 444 * @return {@link #onBehalfOf} (The individual, device, or organization for whom 445 * the change was made.) 446 */ 447 public Reference getOnBehalfOf() { 448 if (this.onBehalfOf == null) 449 if (Configuration.errorOnAutoCreate()) 450 throw new Error("Attempt to auto-create ProvenanceAgentComponent.onBehalfOf"); 451 else if (Configuration.doAutoCreate()) 452 this.onBehalfOf = new Reference(); // cc 453 return this.onBehalfOf; 454 } 455 456 public boolean hasOnBehalfOf() { 457 return this.onBehalfOf != null && !this.onBehalfOf.isEmpty(); 458 } 459 460 /** 461 * @param value {@link #onBehalfOf} (The individual, device, or organization for 462 * whom the change was made.) 463 */ 464 public ProvenanceAgentComponent setOnBehalfOf(Reference value) { 465 this.onBehalfOf = value; 466 return this; 467 } 468 469 /** 470 * @return {@link #onBehalfOf} The actual object that is the target of the 471 * reference. The reference library doesn't populate this, but you can 472 * use it to hold the resource if you resolve it. (The individual, 473 * device, or organization for whom the change was made.) 474 */ 475 public Resource getOnBehalfOfTarget() { 476 return this.onBehalfOfTarget; 477 } 478 479 /** 480 * @param value {@link #onBehalfOf} The actual object that is the target of the 481 * reference. The reference library doesn't use these, but you can 482 * use it to hold the resource if you resolve it. (The individual, 483 * device, or organization for whom the change was made.) 484 */ 485 public ProvenanceAgentComponent setOnBehalfOfTarget(Resource value) { 486 this.onBehalfOfTarget = value; 487 return this; 488 } 489 490 protected void listChildren(List<Property> children) { 491 super.listChildren(children); 492 children.add(new Property("type", "CodeableConcept", 493 "The participation the agent had with respect to the activity.", 0, 1, type)); 494 children.add(new Property("role", "CodeableConcept", 495 "The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.", 496 0, java.lang.Integer.MAX_VALUE, role)); 497 children 498 .add(new Property("who", "Reference(Practitioner|PractitionerRole|RelatedPerson|Patient|Device|Organization)", 499 "The individual, device or organization that participated in the event.", 0, 1, who)); 500 children.add(new Property("onBehalfOf", 501 "Reference(Practitioner|PractitionerRole|RelatedPerson|Patient|Device|Organization)", 502 "The individual, device, or organization for whom the change was made.", 0, 1, onBehalfOf)); 503 } 504 505 @Override 506 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 507 switch (_hash) { 508 case 3575610: 509 /* type */ return new Property("type", "CodeableConcept", 510 "The participation the agent had with respect to the activity.", 0, 1, type); 511 case 3506294: 512 /* role */ return new Property("role", "CodeableConcept", 513 "The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.", 514 0, java.lang.Integer.MAX_VALUE, role); 515 case 117694: 516 /* who */ return new Property("who", 517 "Reference(Practitioner|PractitionerRole|RelatedPerson|Patient|Device|Organization)", 518 "The individual, device or organization that participated in the event.", 0, 1, who); 519 case -14402964: 520 /* onBehalfOf */ return new Property("onBehalfOf", 521 "Reference(Practitioner|PractitionerRole|RelatedPerson|Patient|Device|Organization)", 522 "The individual, device, or organization for whom the change was made.", 0, 1, onBehalfOf); 523 default: 524 return super.getNamedProperty(_hash, _name, _checkValid); 525 } 526 527 } 528 529 @Override 530 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 531 switch (hash) { 532 case 3575610: 533 /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // CodeableConcept 534 case 3506294: 535 /* role */ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept 536 case 117694: 537 /* who */ return this.who == null ? new Base[0] : new Base[] { this.who }; // Reference 538 case -14402964: 539 /* onBehalfOf */ return this.onBehalfOf == null ? new Base[0] : new Base[] { this.onBehalfOf }; // Reference 540 default: 541 return super.getProperty(hash, name, checkValid); 542 } 543 544 } 545 546 @Override 547 public Base setProperty(int hash, String name, Base value) throws FHIRException { 548 switch (hash) { 549 case 3575610: // type 550 this.type = castToCodeableConcept(value); // CodeableConcept 551 return value; 552 case 3506294: // role 553 this.getRole().add(castToCodeableConcept(value)); // CodeableConcept 554 return value; 555 case 117694: // who 556 this.who = castToReference(value); // Reference 557 return value; 558 case -14402964: // onBehalfOf 559 this.onBehalfOf = castToReference(value); // Reference 560 return value; 561 default: 562 return super.setProperty(hash, name, value); 563 } 564 565 } 566 567 @Override 568 public Base setProperty(String name, Base value) throws FHIRException { 569 if (name.equals("type")) { 570 this.type = castToCodeableConcept(value); // CodeableConcept 571 } else if (name.equals("role")) { 572 this.getRole().add(castToCodeableConcept(value)); 573 } else if (name.equals("who")) { 574 this.who = castToReference(value); // Reference 575 } else if (name.equals("onBehalfOf")) { 576 this.onBehalfOf = castToReference(value); // Reference 577 } else 578 return super.setProperty(name, value); 579 return value; 580 } 581 582 @Override 583 public Base makeProperty(int hash, String name) throws FHIRException { 584 switch (hash) { 585 case 3575610: 586 return getType(); 587 case 3506294: 588 return addRole(); 589 case 117694: 590 return getWho(); 591 case -14402964: 592 return getOnBehalfOf(); 593 default: 594 return super.makeProperty(hash, name); 595 } 596 597 } 598 599 @Override 600 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 601 switch (hash) { 602 case 3575610: 603 /* type */ return new String[] { "CodeableConcept" }; 604 case 3506294: 605 /* role */ return new String[] { "CodeableConcept" }; 606 case 117694: 607 /* who */ return new String[] { "Reference" }; 608 case -14402964: 609 /* onBehalfOf */ return new String[] { "Reference" }; 610 default: 611 return super.getTypesForProperty(hash, name); 612 } 613 614 } 615 616 @Override 617 public Base addChild(String name) throws FHIRException { 618 if (name.equals("type")) { 619 this.type = new CodeableConcept(); 620 return this.type; 621 } else if (name.equals("role")) { 622 return addRole(); 623 } else if (name.equals("who")) { 624 this.who = new Reference(); 625 return this.who; 626 } else if (name.equals("onBehalfOf")) { 627 this.onBehalfOf = new Reference(); 628 return this.onBehalfOf; 629 } else 630 return super.addChild(name); 631 } 632 633 public ProvenanceAgentComponent copy() { 634 ProvenanceAgentComponent dst = new ProvenanceAgentComponent(); 635 copyValues(dst); 636 return dst; 637 } 638 639 public void copyValues(ProvenanceAgentComponent dst) { 640 super.copyValues(dst); 641 dst.type = type == null ? null : type.copy(); 642 if (role != null) { 643 dst.role = new ArrayList<CodeableConcept>(); 644 for (CodeableConcept i : role) 645 dst.role.add(i.copy()); 646 } 647 ; 648 dst.who = who == null ? null : who.copy(); 649 dst.onBehalfOf = onBehalfOf == null ? null : onBehalfOf.copy(); 650 } 651 652 @Override 653 public boolean equalsDeep(Base other_) { 654 if (!super.equalsDeep(other_)) 655 return false; 656 if (!(other_ instanceof ProvenanceAgentComponent)) 657 return false; 658 ProvenanceAgentComponent o = (ProvenanceAgentComponent) other_; 659 return compareDeep(type, o.type, true) && compareDeep(role, o.role, true) && compareDeep(who, o.who, true) 660 && compareDeep(onBehalfOf, o.onBehalfOf, true); 661 } 662 663 @Override 664 public boolean equalsShallow(Base other_) { 665 if (!super.equalsShallow(other_)) 666 return false; 667 if (!(other_ instanceof ProvenanceAgentComponent)) 668 return false; 669 ProvenanceAgentComponent o = (ProvenanceAgentComponent) other_; 670 return true; 671 } 672 673 public boolean isEmpty() { 674 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, role, who, onBehalfOf); 675 } 676 677 public String fhirType() { 678 return "Provenance.agent"; 679 680 } 681 682 } 683 684 @Block() 685 public static class ProvenanceEntityComponent extends BackboneElement implements IBaseBackboneElement { 686 /** 687 * How the entity was used during the activity. 688 */ 689 @Child(name = "role", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true) 690 @Description(shortDefinition = "derivation | revision | quotation | source | removal", formalDefinition = "How the entity was used during the activity.") 691 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/provenance-entity-role") 692 protected Enumeration<ProvenanceEntityRole> role; 693 694 /** 695 * Identity of the Entity used. May be a logical or physical uri and maybe 696 * absolute or relative. 697 */ 698 @Child(name = "what", type = { Reference.class }, order = 2, min = 1, max = 1, modifier = false, summary = true) 699 @Description(shortDefinition = "Identity of entity", formalDefinition = "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.") 700 protected Reference what; 701 702 /** 703 * The actual object that is the target of the reference (Identity of the Entity 704 * used. May be a logical or physical uri and maybe absolute or relative.) 705 */ 706 protected Resource whatTarget; 707 708 /** 709 * The entity is attributed to an agent to express the agent's responsibility 710 * for that entity, possibly along with other agents. This description can be 711 * understood as shorthand for saying that the agent was responsible for the 712 * activity which generated the entity. 713 */ 714 @Child(name = "agent", type = { 715 ProvenanceAgentComponent.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 716 @Description(shortDefinition = "Entity is attributed to this agent", formalDefinition = "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.") 717 protected List<ProvenanceAgentComponent> agent; 718 719 private static final long serialVersionUID = 144967401L; 720 721 /** 722 * Constructor 723 */ 724 public ProvenanceEntityComponent() { 725 super(); 726 } 727 728 /** 729 * Constructor 730 */ 731 public ProvenanceEntityComponent(Enumeration<ProvenanceEntityRole> role, Reference what) { 732 super(); 733 this.role = role; 734 this.what = what; 735 } 736 737 /** 738 * @return {@link #role} (How the entity was used during the activity.). This is 739 * the underlying object with id, value and extensions. The accessor 740 * "getRole" gives direct access to the value 741 */ 742 public Enumeration<ProvenanceEntityRole> getRoleElement() { 743 if (this.role == null) 744 if (Configuration.errorOnAutoCreate()) 745 throw new Error("Attempt to auto-create ProvenanceEntityComponent.role"); 746 else if (Configuration.doAutoCreate()) 747 this.role = new Enumeration<ProvenanceEntityRole>(new ProvenanceEntityRoleEnumFactory()); // bb 748 return this.role; 749 } 750 751 public boolean hasRoleElement() { 752 return this.role != null && !this.role.isEmpty(); 753 } 754 755 public boolean hasRole() { 756 return this.role != null && !this.role.isEmpty(); 757 } 758 759 /** 760 * @param value {@link #role} (How the entity was used during the activity.). 761 * This is the underlying object with id, value and extensions. The 762 * accessor "getRole" gives direct access to the value 763 */ 764 public ProvenanceEntityComponent setRoleElement(Enumeration<ProvenanceEntityRole> value) { 765 this.role = value; 766 return this; 767 } 768 769 /** 770 * @return How the entity was used during the activity. 771 */ 772 public ProvenanceEntityRole getRole() { 773 return this.role == null ? null : this.role.getValue(); 774 } 775 776 /** 777 * @param value How the entity was used during the activity. 778 */ 779 public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { 780 if (this.role == null) 781 this.role = new Enumeration<ProvenanceEntityRole>(new ProvenanceEntityRoleEnumFactory()); 782 this.role.setValue(value); 783 return this; 784 } 785 786 /** 787 * @return {@link #what} (Identity of the Entity used. May be a logical or 788 * physical uri and maybe absolute or relative.) 789 */ 790 public Reference getWhat() { 791 if (this.what == null) 792 if (Configuration.errorOnAutoCreate()) 793 throw new Error("Attempt to auto-create ProvenanceEntityComponent.what"); 794 else if (Configuration.doAutoCreate()) 795 this.what = new Reference(); // cc 796 return this.what; 797 } 798 799 public boolean hasWhat() { 800 return this.what != null && !this.what.isEmpty(); 801 } 802 803 /** 804 * @param value {@link #what} (Identity of the Entity used. May be a logical or 805 * physical uri and maybe absolute or relative.) 806 */ 807 public ProvenanceEntityComponent setWhat(Reference value) { 808 this.what = value; 809 return this; 810 } 811 812 /** 813 * @return {@link #what} The actual object that is the target of the reference. 814 * The reference library doesn't populate this, but you can use it to 815 * hold the resource if you resolve it. (Identity of the Entity used. 816 * May be a logical or physical uri and maybe absolute or relative.) 817 */ 818 public Resource getWhatTarget() { 819 return this.whatTarget; 820 } 821 822 /** 823 * @param value {@link #what} The actual object that is the target of the 824 * reference. The reference library doesn't use these, but you can 825 * use it to hold the resource if you resolve it. (Identity of the 826 * Entity used. May be a logical or physical uri and maybe absolute 827 * or relative.) 828 */ 829 public ProvenanceEntityComponent setWhatTarget(Resource value) { 830 this.whatTarget = value; 831 return this; 832 } 833 834 /** 835 * @return {@link #agent} (The entity is attributed to an agent to express the 836 * agent's responsibility for that entity, possibly along with other 837 * agents. This description can be understood as shorthand for saying 838 * that the agent was responsible for the activity which generated the 839 * entity.) 840 */ 841 public List<ProvenanceAgentComponent> getAgent() { 842 if (this.agent == null) 843 this.agent = new ArrayList<ProvenanceAgentComponent>(); 844 return this.agent; 845 } 846 847 /** 848 * @return Returns a reference to <code>this</code> for easy method chaining 849 */ 850 public ProvenanceEntityComponent setAgent(List<ProvenanceAgentComponent> theAgent) { 851 this.agent = theAgent; 852 return this; 853 } 854 855 public boolean hasAgent() { 856 if (this.agent == null) 857 return false; 858 for (ProvenanceAgentComponent item : this.agent) 859 if (!item.isEmpty()) 860 return true; 861 return false; 862 } 863 864 public ProvenanceAgentComponent addAgent() { // 3 865 ProvenanceAgentComponent t = new ProvenanceAgentComponent(); 866 if (this.agent == null) 867 this.agent = new ArrayList<ProvenanceAgentComponent>(); 868 this.agent.add(t); 869 return t; 870 } 871 872 public ProvenanceEntityComponent addAgent(ProvenanceAgentComponent t) { // 3 873 if (t == null) 874 return this; 875 if (this.agent == null) 876 this.agent = new ArrayList<ProvenanceAgentComponent>(); 877 this.agent.add(t); 878 return this; 879 } 880 881 /** 882 * @return The first repetition of repeating field {@link #agent}, creating it 883 * if it does not already exist 884 */ 885 public ProvenanceAgentComponent getAgentFirstRep() { 886 if (getAgent().isEmpty()) { 887 addAgent(); 888 } 889 return getAgent().get(0); 890 } 891 892 protected void listChildren(List<Property> children) { 893 super.listChildren(children); 894 children.add(new Property("role", "code", "How the entity was used during the activity.", 0, 1, role)); 895 children.add(new Property("what", "Reference(Any)", 896 "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, 1, 897 what)); 898 children.add(new Property("agent", "@Provenance.agent", 899 "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 900 0, java.lang.Integer.MAX_VALUE, agent)); 901 } 902 903 @Override 904 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 905 switch (_hash) { 906 case 3506294: 907 /* role */ return new Property("role", "code", "How the entity was used during the activity.", 0, 1, role); 908 case 3648196: 909 /* what */ return new Property("what", "Reference(Any)", 910 "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, 1, 911 what); 912 case 92750597: 913 /* agent */ return new Property("agent", "@Provenance.agent", 914 "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 915 0, java.lang.Integer.MAX_VALUE, agent); 916 default: 917 return super.getNamedProperty(_hash, _name, _checkValid); 918 } 919 920 } 921 922 @Override 923 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 924 switch (hash) { 925 case 3506294: 926 /* role */ return this.role == null ? new Base[0] : new Base[] { this.role }; // Enumeration<ProvenanceEntityRole> 927 case 3648196: 928 /* what */ return this.what == null ? new Base[0] : new Base[] { this.what }; // Reference 929 case 92750597: 930 /* agent */ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // ProvenanceAgentComponent 931 default: 932 return super.getProperty(hash, name, checkValid); 933 } 934 935 } 936 937 @Override 938 public Base setProperty(int hash, String name, Base value) throws FHIRException { 939 switch (hash) { 940 case 3506294: // role 941 value = new ProvenanceEntityRoleEnumFactory().fromType(castToCode(value)); 942 this.role = (Enumeration) value; // Enumeration<ProvenanceEntityRole> 943 return value; 944 case 3648196: // what 945 this.what = castToReference(value); // Reference 946 return value; 947 case 92750597: // agent 948 this.getAgent().add((ProvenanceAgentComponent) value); // ProvenanceAgentComponent 949 return value; 950 default: 951 return super.setProperty(hash, name, value); 952 } 953 954 } 955 956 @Override 957 public Base setProperty(String name, Base value) throws FHIRException { 958 if (name.equals("role")) { 959 value = new ProvenanceEntityRoleEnumFactory().fromType(castToCode(value)); 960 this.role = (Enumeration) value; // Enumeration<ProvenanceEntityRole> 961 } else if (name.equals("what")) { 962 this.what = castToReference(value); // Reference 963 } else if (name.equals("agent")) { 964 this.getAgent().add((ProvenanceAgentComponent) value); 965 } else 966 return super.setProperty(name, value); 967 return value; 968 } 969 970 @Override 971 public Base makeProperty(int hash, String name) throws FHIRException { 972 switch (hash) { 973 case 3506294: 974 return getRoleElement(); 975 case 3648196: 976 return getWhat(); 977 case 92750597: 978 return addAgent(); 979 default: 980 return super.makeProperty(hash, name); 981 } 982 983 } 984 985 @Override 986 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 987 switch (hash) { 988 case 3506294: 989 /* role */ return new String[] { "code" }; 990 case 3648196: 991 /* what */ return new String[] { "Reference" }; 992 case 92750597: 993 /* agent */ return new String[] { "@Provenance.agent" }; 994 default: 995 return super.getTypesForProperty(hash, name); 996 } 997 998 } 999 1000 @Override 1001 public Base addChild(String name) throws FHIRException { 1002 if (name.equals("role")) { 1003 throw new FHIRException("Cannot call addChild on a singleton property Provenance.role"); 1004 } else if (name.equals("what")) { 1005 this.what = new Reference(); 1006 return this.what; 1007 } else if (name.equals("agent")) { 1008 return addAgent(); 1009 } else 1010 return super.addChild(name); 1011 } 1012 1013 public ProvenanceEntityComponent copy() { 1014 ProvenanceEntityComponent dst = new ProvenanceEntityComponent(); 1015 copyValues(dst); 1016 return dst; 1017 } 1018 1019 public void copyValues(ProvenanceEntityComponent dst) { 1020 super.copyValues(dst); 1021 dst.role = role == null ? null : role.copy(); 1022 dst.what = what == null ? null : what.copy(); 1023 if (agent != null) { 1024 dst.agent = new ArrayList<ProvenanceAgentComponent>(); 1025 for (ProvenanceAgentComponent i : agent) 1026 dst.agent.add(i.copy()); 1027 } 1028 ; 1029 } 1030 1031 @Override 1032 public boolean equalsDeep(Base other_) { 1033 if (!super.equalsDeep(other_)) 1034 return false; 1035 if (!(other_ instanceof ProvenanceEntityComponent)) 1036 return false; 1037 ProvenanceEntityComponent o = (ProvenanceEntityComponent) other_; 1038 return compareDeep(role, o.role, true) && compareDeep(what, o.what, true) && compareDeep(agent, o.agent, true); 1039 } 1040 1041 @Override 1042 public boolean equalsShallow(Base other_) { 1043 if (!super.equalsShallow(other_)) 1044 return false; 1045 if (!(other_ instanceof ProvenanceEntityComponent)) 1046 return false; 1047 ProvenanceEntityComponent o = (ProvenanceEntityComponent) other_; 1048 return compareValues(role, o.role, true); 1049 } 1050 1051 public boolean isEmpty() { 1052 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, what, agent); 1053 } 1054 1055 public String fhirType() { 1056 return "Provenance.entity"; 1057 1058 } 1059 1060 } 1061 1062 /** 1063 * The Reference(s) that were generated or updated by the activity described in 1064 * this resource. A provenance can point to more than one target if multiple 1065 * resources were created/updated by the same activity. 1066 */ 1067 @Child(name = "target", type = { 1068 Reference.class }, order = 0, min = 1, max = Child.MAX_UNLIMITED, modifier = false, summary = true) 1069 @Description(shortDefinition = "Target Reference(s) (usually version specific)", formalDefinition = "The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.") 1070 protected List<Reference> target; 1071 /** 1072 * The actual objects that are the target of the reference (The Reference(s) 1073 * that were generated or updated by the activity described in this resource. A 1074 * provenance can point to more than one target if multiple resources were 1075 * created/updated by the same activity.) 1076 */ 1077 protected List<Resource> targetTarget; 1078 1079 /** 1080 * The period during which the activity occurred. 1081 */ 1082 @Child(name = "occurred", type = { Period.class, 1083 DateTimeType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false) 1084 @Description(shortDefinition = "When the activity occurred", formalDefinition = "The period during which the activity occurred.") 1085 protected Type occurred; 1086 1087 /** 1088 * The instant of time at which the activity was recorded. 1089 */ 1090 @Child(name = "recorded", type = { InstantType.class }, order = 2, min = 1, max = 1, modifier = false, summary = true) 1091 @Description(shortDefinition = "When the activity was recorded / updated", formalDefinition = "The instant of time at which the activity was recorded.") 1092 protected InstantType recorded; 1093 1094 /** 1095 * Policy or plan the activity was defined by. Typically, a single activity may 1096 * have multiple applicable policy documents, such as patient consent, guarantor 1097 * funding, etc. 1098 */ 1099 @Child(name = "policy", type = { 1100 UriType.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 1101 @Description(shortDefinition = "Policy or plan the activity was defined by", formalDefinition = "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.") 1102 protected List<UriType> policy; 1103 1104 /** 1105 * Where the activity occurred, if relevant. 1106 */ 1107 @Child(name = "location", type = { Location.class }, order = 4, min = 0, max = 1, modifier = false, summary = false) 1108 @Description(shortDefinition = "Where the activity occurred, if relevant", formalDefinition = "Where the activity occurred, if relevant.") 1109 protected Reference location; 1110 1111 /** 1112 * The actual object that is the target of the reference (Where the activity 1113 * occurred, if relevant.) 1114 */ 1115 protected Location locationTarget; 1116 1117 /** 1118 * The reason that the activity was taking place. 1119 */ 1120 @Child(name = "reason", type = { 1121 CodeableConcept.class }, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 1122 @Description(shortDefinition = "Reason the activity is occurring", formalDefinition = "The reason that the activity was taking place.") 1123 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://terminology.hl7.org/ValueSet/v3-PurposeOfUse") 1124 protected List<CodeableConcept> reason; 1125 1126 /** 1127 * An activity is something that occurs over a period of time and acts upon or 1128 * with entities; it may include consuming, processing, transforming, modifying, 1129 * relocating, using, or generating entities. 1130 */ 1131 @Child(name = "activity", type = { 1132 CodeableConcept.class }, order = 6, min = 0, max = 1, modifier = false, summary = false) 1133 @Description(shortDefinition = "Activity that occurred", formalDefinition = "An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.") 1134 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/provenance-activity-type") 1135 protected CodeableConcept activity; 1136 1137 /** 1138 * An actor taking a role in an activity for which it can be assigned some 1139 * degree of responsibility for the activity taking place. 1140 */ 1141 @Child(name = "agent", type = {}, order = 7, min = 1, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 1142 @Description(shortDefinition = "Actor involved", formalDefinition = "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.") 1143 protected List<ProvenanceAgentComponent> agent; 1144 1145 /** 1146 * An entity used in this activity. 1147 */ 1148 @Child(name = "entity", type = {}, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 1149 @Description(shortDefinition = "An entity used in this activity", formalDefinition = "An entity used in this activity.") 1150 protected List<ProvenanceEntityComponent> entity; 1151 1152 /** 1153 * A digital signature on the target Reference(s). The signer should match a 1154 * Provenance.agent. The purpose of the signature is indicated. 1155 */ 1156 @Child(name = "signature", type = { 1157 Signature.class }, order = 9, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 1158 @Description(shortDefinition = "Signature on target", formalDefinition = "A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.") 1159 protected List<Signature> signature; 1160 1161 private static final long serialVersionUID = -1991881518L; 1162 1163 /** 1164 * Constructor 1165 */ 1166 public Provenance() { 1167 super(); 1168 } 1169 1170 /** 1171 * Constructor 1172 */ 1173 public Provenance(InstantType recorded) { 1174 super(); 1175 this.recorded = recorded; 1176 } 1177 1178 /** 1179 * @return {@link #target} (The Reference(s) that were generated or updated by 1180 * the activity described in this resource. A provenance can point to 1181 * more than one target if multiple resources were created/updated by 1182 * the same activity.) 1183 */ 1184 public List<Reference> getTarget() { 1185 if (this.target == null) 1186 this.target = new ArrayList<Reference>(); 1187 return this.target; 1188 } 1189 1190 /** 1191 * @return Returns a reference to <code>this</code> for easy method chaining 1192 */ 1193 public Provenance setTarget(List<Reference> theTarget) { 1194 this.target = theTarget; 1195 return this; 1196 } 1197 1198 public boolean hasTarget() { 1199 if (this.target == null) 1200 return false; 1201 for (Reference item : this.target) 1202 if (!item.isEmpty()) 1203 return true; 1204 return false; 1205 } 1206 1207 public Reference addTarget() { // 3 1208 Reference t = new Reference(); 1209 if (this.target == null) 1210 this.target = new ArrayList<Reference>(); 1211 this.target.add(t); 1212 return t; 1213 } 1214 1215 public Provenance addTarget(Reference t) { // 3 1216 if (t == null) 1217 return this; 1218 if (this.target == null) 1219 this.target = new ArrayList<Reference>(); 1220 this.target.add(t); 1221 return this; 1222 } 1223 1224 /** 1225 * @return The first repetition of repeating field {@link #target}, creating it 1226 * if it does not already exist 1227 */ 1228 public Reference getTargetFirstRep() { 1229 if (getTarget().isEmpty()) { 1230 addTarget(); 1231 } 1232 return getTarget().get(0); 1233 } 1234 1235 /** 1236 * @deprecated Use Reference#setResource(IBaseResource) instead 1237 */ 1238 @Deprecated 1239 public List<Resource> getTargetTarget() { 1240 if (this.targetTarget == null) 1241 this.targetTarget = new ArrayList<Resource>(); 1242 return this.targetTarget; 1243 } 1244 1245 /** 1246 * @return {@link #occurred} (The period during which the activity occurred.) 1247 */ 1248 public Type getOccurred() { 1249 return this.occurred; 1250 } 1251 1252 /** 1253 * @return {@link #occurred} (The period during which the activity occurred.) 1254 */ 1255 public Period getOccurredPeriod() throws FHIRException { 1256 if (this.occurred == null) 1257 this.occurred = new Period(); 1258 if (!(this.occurred instanceof Period)) 1259 throw new FHIRException("Type mismatch: the type Period was expected, but " + this.occurred.getClass().getName() 1260 + " was encountered"); 1261 return (Period) this.occurred; 1262 } 1263 1264 public boolean hasOccurredPeriod() { 1265 return this != null && this.occurred instanceof Period; 1266 } 1267 1268 /** 1269 * @return {@link #occurred} (The period during which the activity occurred.) 1270 */ 1271 public DateTimeType getOccurredDateTimeType() throws FHIRException { 1272 if (this.occurred == null) 1273 this.occurred = new DateTimeType(); 1274 if (!(this.occurred instanceof DateTimeType)) 1275 throw new FHIRException("Type mismatch: the type DateTimeType was expected, but " 1276 + this.occurred.getClass().getName() + " was encountered"); 1277 return (DateTimeType) this.occurred; 1278 } 1279 1280 public boolean hasOccurredDateTimeType() { 1281 return this != null && this.occurred instanceof DateTimeType; 1282 } 1283 1284 public boolean hasOccurred() { 1285 return this.occurred != null && !this.occurred.isEmpty(); 1286 } 1287 1288 /** 1289 * @param value {@link #occurred} (The period during which the activity 1290 * occurred.) 1291 */ 1292 public Provenance setOccurred(Type value) { 1293 if (value != null && !(value instanceof Period || value instanceof DateTimeType)) 1294 throw new Error("Not the right type for Provenance.occurred[x]: " + value.fhirType()); 1295 this.occurred = value; 1296 return this; 1297 } 1298 1299 /** 1300 * @return {@link #recorded} (The instant of time at which the activity was 1301 * recorded.). This is the underlying object with id, value and 1302 * extensions. The accessor "getRecorded" gives direct access to the 1303 * value 1304 */ 1305 public InstantType getRecordedElement() { 1306 if (this.recorded == null) 1307 if (Configuration.errorOnAutoCreate()) 1308 throw new Error("Attempt to auto-create Provenance.recorded"); 1309 else if (Configuration.doAutoCreate()) 1310 this.recorded = new InstantType(); // bb 1311 return this.recorded; 1312 } 1313 1314 public boolean hasRecordedElement() { 1315 return this.recorded != null && !this.recorded.isEmpty(); 1316 } 1317 1318 public boolean hasRecorded() { 1319 return this.recorded != null && !this.recorded.isEmpty(); 1320 } 1321 1322 /** 1323 * @param value {@link #recorded} (The instant of time at which the activity was 1324 * recorded.). This is the underlying object with id, value and 1325 * extensions. The accessor "getRecorded" gives direct access to 1326 * the value 1327 */ 1328 public Provenance setRecordedElement(InstantType value) { 1329 this.recorded = value; 1330 return this; 1331 } 1332 1333 /** 1334 * @return The instant of time at which the activity was recorded. 1335 */ 1336 public Date getRecorded() { 1337 return this.recorded == null ? null : this.recorded.getValue(); 1338 } 1339 1340 /** 1341 * @param value The instant of time at which the activity was recorded. 1342 */ 1343 public Provenance setRecorded(Date value) { 1344 if (this.recorded == null) 1345 this.recorded = new InstantType(); 1346 this.recorded.setValue(value); 1347 return this; 1348 } 1349 1350 /** 1351 * @return {@link #policy} (Policy or plan the activity was defined by. 1352 * Typically, a single activity may have multiple applicable policy 1353 * documents, such as patient consent, guarantor funding, etc.) 1354 */ 1355 public List<UriType> getPolicy() { 1356 if (this.policy == null) 1357 this.policy = new ArrayList<UriType>(); 1358 return this.policy; 1359 } 1360 1361 /** 1362 * @return Returns a reference to <code>this</code> for easy method chaining 1363 */ 1364 public Provenance setPolicy(List<UriType> thePolicy) { 1365 this.policy = thePolicy; 1366 return this; 1367 } 1368 1369 public boolean hasPolicy() { 1370 if (this.policy == null) 1371 return false; 1372 for (UriType item : this.policy) 1373 if (!item.isEmpty()) 1374 return true; 1375 return false; 1376 } 1377 1378 /** 1379 * @return {@link #policy} (Policy or plan the activity was defined by. 1380 * Typically, a single activity may have multiple applicable policy 1381 * documents, such as patient consent, guarantor funding, etc.) 1382 */ 1383 public UriType addPolicyElement() {// 2 1384 UriType t = new UriType(); 1385 if (this.policy == null) 1386 this.policy = new ArrayList<UriType>(); 1387 this.policy.add(t); 1388 return t; 1389 } 1390 1391 /** 1392 * @param value {@link #policy} (Policy or plan the activity was defined by. 1393 * Typically, a single activity may have multiple applicable policy 1394 * documents, such as patient consent, guarantor funding, etc.) 1395 */ 1396 public Provenance addPolicy(String value) { // 1 1397 UriType t = new UriType(); 1398 t.setValue(value); 1399 if (this.policy == null) 1400 this.policy = new ArrayList<UriType>(); 1401 this.policy.add(t); 1402 return this; 1403 } 1404 1405 /** 1406 * @param value {@link #policy} (Policy or plan the activity was defined by. 1407 * Typically, a single activity may have multiple applicable policy 1408 * documents, such as patient consent, guarantor funding, etc.) 1409 */ 1410 public boolean hasPolicy(String value) { 1411 if (this.policy == null) 1412 return false; 1413 for (UriType v : this.policy) 1414 if (v.getValue().equals(value)) // uri 1415 return true; 1416 return false; 1417 } 1418 1419 /** 1420 * @return {@link #location} (Where the activity occurred, if relevant.) 1421 */ 1422 public Reference getLocation() { 1423 if (this.location == null) 1424 if (Configuration.errorOnAutoCreate()) 1425 throw new Error("Attempt to auto-create Provenance.location"); 1426 else if (Configuration.doAutoCreate()) 1427 this.location = new Reference(); // cc 1428 return this.location; 1429 } 1430 1431 public boolean hasLocation() { 1432 return this.location != null && !this.location.isEmpty(); 1433 } 1434 1435 /** 1436 * @param value {@link #location} (Where the activity occurred, if relevant.) 1437 */ 1438 public Provenance setLocation(Reference value) { 1439 this.location = value; 1440 return this; 1441 } 1442 1443 /** 1444 * @return {@link #location} The actual object that is the target of the 1445 * reference. The reference library doesn't populate this, but you can 1446 * use it to hold the resource if you resolve it. (Where the activity 1447 * occurred, if relevant.) 1448 */ 1449 public Location getLocationTarget() { 1450 if (this.locationTarget == null) 1451 if (Configuration.errorOnAutoCreate()) 1452 throw new Error("Attempt to auto-create Provenance.location"); 1453 else if (Configuration.doAutoCreate()) 1454 this.locationTarget = new Location(); // aa 1455 return this.locationTarget; 1456 } 1457 1458 /** 1459 * @param value {@link #location} The actual object that is the target of the 1460 * reference. The reference library doesn't use these, but you can 1461 * use it to hold the resource if you resolve it. (Where the 1462 * activity occurred, if relevant.) 1463 */ 1464 public Provenance setLocationTarget(Location value) { 1465 this.locationTarget = value; 1466 return this; 1467 } 1468 1469 /** 1470 * @return {@link #reason} (The reason that the activity was taking place.) 1471 */ 1472 public List<CodeableConcept> getReason() { 1473 if (this.reason == null) 1474 this.reason = new ArrayList<CodeableConcept>(); 1475 return this.reason; 1476 } 1477 1478 /** 1479 * @return Returns a reference to <code>this</code> for easy method chaining 1480 */ 1481 public Provenance setReason(List<CodeableConcept> theReason) { 1482 this.reason = theReason; 1483 return this; 1484 } 1485 1486 public boolean hasReason() { 1487 if (this.reason == null) 1488 return false; 1489 for (CodeableConcept item : this.reason) 1490 if (!item.isEmpty()) 1491 return true; 1492 return false; 1493 } 1494 1495 public CodeableConcept addReason() { // 3 1496 CodeableConcept t = new CodeableConcept(); 1497 if (this.reason == null) 1498 this.reason = new ArrayList<CodeableConcept>(); 1499 this.reason.add(t); 1500 return t; 1501 } 1502 1503 public Provenance addReason(CodeableConcept t) { // 3 1504 if (t == null) 1505 return this; 1506 if (this.reason == null) 1507 this.reason = new ArrayList<CodeableConcept>(); 1508 this.reason.add(t); 1509 return this; 1510 } 1511 1512 /** 1513 * @return The first repetition of repeating field {@link #reason}, creating it 1514 * if it does not already exist 1515 */ 1516 public CodeableConcept getReasonFirstRep() { 1517 if (getReason().isEmpty()) { 1518 addReason(); 1519 } 1520 return getReason().get(0); 1521 } 1522 1523 /** 1524 * @return {@link #activity} (An activity is something that occurs over a period 1525 * of time and acts upon or with entities; it may include consuming, 1526 * processing, transforming, modifying, relocating, using, or generating 1527 * entities.) 1528 */ 1529 public CodeableConcept getActivity() { 1530 if (this.activity == null) 1531 if (Configuration.errorOnAutoCreate()) 1532 throw new Error("Attempt to auto-create Provenance.activity"); 1533 else if (Configuration.doAutoCreate()) 1534 this.activity = new CodeableConcept(); // cc 1535 return this.activity; 1536 } 1537 1538 public boolean hasActivity() { 1539 return this.activity != null && !this.activity.isEmpty(); 1540 } 1541 1542 /** 1543 * @param value {@link #activity} (An activity is something that occurs over a 1544 * period of time and acts upon or with entities; it may include 1545 * consuming, processing, transforming, modifying, relocating, 1546 * using, or generating entities.) 1547 */ 1548 public Provenance setActivity(CodeableConcept value) { 1549 this.activity = value; 1550 return this; 1551 } 1552 1553 /** 1554 * @return {@link #agent} (An actor taking a role in an activity for which it 1555 * can be assigned some degree of responsibility for the activity taking 1556 * place.) 1557 */ 1558 public List<ProvenanceAgentComponent> getAgent() { 1559 if (this.agent == null) 1560 this.agent = new ArrayList<ProvenanceAgentComponent>(); 1561 return this.agent; 1562 } 1563 1564 /** 1565 * @return Returns a reference to <code>this</code> for easy method chaining 1566 */ 1567 public Provenance setAgent(List<ProvenanceAgentComponent> theAgent) { 1568 this.agent = theAgent; 1569 return this; 1570 } 1571 1572 public boolean hasAgent() { 1573 if (this.agent == null) 1574 return false; 1575 for (ProvenanceAgentComponent item : this.agent) 1576 if (!item.isEmpty()) 1577 return true; 1578 return false; 1579 } 1580 1581 public ProvenanceAgentComponent addAgent() { // 3 1582 ProvenanceAgentComponent t = new ProvenanceAgentComponent(); 1583 if (this.agent == null) 1584 this.agent = new ArrayList<ProvenanceAgentComponent>(); 1585 this.agent.add(t); 1586 return t; 1587 } 1588 1589 public Provenance addAgent(ProvenanceAgentComponent t) { // 3 1590 if (t == null) 1591 return this; 1592 if (this.agent == null) 1593 this.agent = new ArrayList<ProvenanceAgentComponent>(); 1594 this.agent.add(t); 1595 return this; 1596 } 1597 1598 /** 1599 * @return The first repetition of repeating field {@link #agent}, creating it 1600 * if it does not already exist 1601 */ 1602 public ProvenanceAgentComponent getAgentFirstRep() { 1603 if (getAgent().isEmpty()) { 1604 addAgent(); 1605 } 1606 return getAgent().get(0); 1607 } 1608 1609 /** 1610 * @return {@link #entity} (An entity used in this activity.) 1611 */ 1612 public List<ProvenanceEntityComponent> getEntity() { 1613 if (this.entity == null) 1614 this.entity = new ArrayList<ProvenanceEntityComponent>(); 1615 return this.entity; 1616 } 1617 1618 /** 1619 * @return Returns a reference to <code>this</code> for easy method chaining 1620 */ 1621 public Provenance setEntity(List<ProvenanceEntityComponent> theEntity) { 1622 this.entity = theEntity; 1623 return this; 1624 } 1625 1626 public boolean hasEntity() { 1627 if (this.entity == null) 1628 return false; 1629 for (ProvenanceEntityComponent item : this.entity) 1630 if (!item.isEmpty()) 1631 return true; 1632 return false; 1633 } 1634 1635 public ProvenanceEntityComponent addEntity() { // 3 1636 ProvenanceEntityComponent t = new ProvenanceEntityComponent(); 1637 if (this.entity == null) 1638 this.entity = new ArrayList<ProvenanceEntityComponent>(); 1639 this.entity.add(t); 1640 return t; 1641 } 1642 1643 public Provenance addEntity(ProvenanceEntityComponent t) { // 3 1644 if (t == null) 1645 return this; 1646 if (this.entity == null) 1647 this.entity = new ArrayList<ProvenanceEntityComponent>(); 1648 this.entity.add(t); 1649 return this; 1650 } 1651 1652 /** 1653 * @return The first repetition of repeating field {@link #entity}, creating it 1654 * if it does not already exist 1655 */ 1656 public ProvenanceEntityComponent getEntityFirstRep() { 1657 if (getEntity().isEmpty()) { 1658 addEntity(); 1659 } 1660 return getEntity().get(0); 1661 } 1662 1663 /** 1664 * @return {@link #signature} (A digital signature on the target Reference(s). 1665 * The signer should match a Provenance.agent. The purpose of the 1666 * signature is indicated.) 1667 */ 1668 public List<Signature> getSignature() { 1669 if (this.signature == null) 1670 this.signature = new ArrayList<Signature>(); 1671 return this.signature; 1672 } 1673 1674 /** 1675 * @return Returns a reference to <code>this</code> for easy method chaining 1676 */ 1677 public Provenance setSignature(List<Signature> theSignature) { 1678 this.signature = theSignature; 1679 return this; 1680 } 1681 1682 public boolean hasSignature() { 1683 if (this.signature == null) 1684 return false; 1685 for (Signature item : this.signature) 1686 if (!item.isEmpty()) 1687 return true; 1688 return false; 1689 } 1690 1691 public Signature addSignature() { // 3 1692 Signature t = new Signature(); 1693 if (this.signature == null) 1694 this.signature = new ArrayList<Signature>(); 1695 this.signature.add(t); 1696 return t; 1697 } 1698 1699 public Provenance addSignature(Signature t) { // 3 1700 if (t == null) 1701 return this; 1702 if (this.signature == null) 1703 this.signature = new ArrayList<Signature>(); 1704 this.signature.add(t); 1705 return this; 1706 } 1707 1708 /** 1709 * @return The first repetition of repeating field {@link #signature}, creating 1710 * it if it does not already exist 1711 */ 1712 public Signature getSignatureFirstRep() { 1713 if (getSignature().isEmpty()) { 1714 addSignature(); 1715 } 1716 return getSignature().get(0); 1717 } 1718 1719 protected void listChildren(List<Property> children) { 1720 super.listChildren(children); 1721 children.add(new Property("target", "Reference(Any)", 1722 "The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.", 1723 0, java.lang.Integer.MAX_VALUE, target)); 1724 children.add(new Property("occurred[x]", "Period|dateTime", "The period during which the activity occurred.", 0, 1, 1725 occurred)); 1726 children.add( 1727 new Property("recorded", "instant", "The instant of time at which the activity was recorded.", 0, 1, recorded)); 1728 children.add(new Property("policy", "uri", 1729 "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.", 1730 0, java.lang.Integer.MAX_VALUE, policy)); 1731 children.add( 1732 new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 0, 1, location)); 1733 children.add(new Property("reason", "CodeableConcept", "The reason that the activity was taking place.", 0, 1734 java.lang.Integer.MAX_VALUE, reason)); 1735 children.add(new Property("activity", "CodeableConcept", 1736 "An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.", 1737 0, 1, activity)); 1738 children.add(new Property("agent", "", 1739 "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 1740 0, java.lang.Integer.MAX_VALUE, agent)); 1741 children 1742 .add(new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, entity)); 1743 children.add(new Property("signature", "Signature", 1744 "A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.", 1745 0, java.lang.Integer.MAX_VALUE, signature)); 1746 } 1747 1748 @Override 1749 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1750 switch (_hash) { 1751 case -880905839: 1752 /* target */ return new Property("target", "Reference(Any)", 1753 "The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.", 1754 0, java.lang.Integer.MAX_VALUE, target); 1755 case 784181563: 1756 /* occurred[x] */ return new Property("occurred[x]", "Period|dateTime", 1757 "The period during which the activity occurred.", 0, 1, occurred); 1758 case 792816933: 1759 /* occurred */ return new Property("occurred[x]", "Period|dateTime", 1760 "The period during which the activity occurred.", 0, 1, occurred); 1761 case 894082886: 1762 /* occurredPeriod */ return new Property("occurred[x]", "Period|dateTime", 1763 "The period during which the activity occurred.", 0, 1, occurred); 1764 case 1579027424: 1765 /* occurredDateTime */ return new Property("occurred[x]", "Period|dateTime", 1766 "The period during which the activity occurred.", 0, 1, occurred); 1767 case -799233872: 1768 /* recorded */ return new Property("recorded", "instant", 1769 "The instant of time at which the activity was recorded.", 0, 1, recorded); 1770 case -982670030: 1771 /* policy */ return new Property("policy", "uri", 1772 "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.", 1773 0, java.lang.Integer.MAX_VALUE, policy); 1774 case 1901043637: 1775 /* location */ return new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 1776 0, 1, location); 1777 case -934964668: 1778 /* reason */ return new Property("reason", "CodeableConcept", "The reason that the activity was taking place.", 0, 1779 java.lang.Integer.MAX_VALUE, reason); 1780 case -1655966961: 1781 /* activity */ return new Property("activity", "CodeableConcept", 1782 "An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.", 1783 0, 1, activity); 1784 case 92750597: 1785 /* agent */ return new Property("agent", "", 1786 "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 1787 0, java.lang.Integer.MAX_VALUE, agent); 1788 case -1298275357: 1789 /* entity */ return new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, 1790 entity); 1791 case 1073584312: 1792 /* signature */ return new Property("signature", "Signature", 1793 "A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.", 1794 0, java.lang.Integer.MAX_VALUE, signature); 1795 default: 1796 return super.getNamedProperty(_hash, _name, _checkValid); 1797 } 1798 1799 } 1800 1801 @Override 1802 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1803 switch (hash) { 1804 case -880905839: 1805 /* target */ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // Reference 1806 case 792816933: 1807 /* occurred */ return this.occurred == null ? new Base[0] : new Base[] { this.occurred }; // Type 1808 case -799233872: 1809 /* recorded */ return this.recorded == null ? new Base[0] : new Base[] { this.recorded }; // InstantType 1810 case -982670030: 1811 /* policy */ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // UriType 1812 case 1901043637: 1813 /* location */ return this.location == null ? new Base[0] : new Base[] { this.location }; // Reference 1814 case -934964668: 1815 /* reason */ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept 1816 case -1655966961: 1817 /* activity */ return this.activity == null ? new Base[0] : new Base[] { this.activity }; // CodeableConcept 1818 case 92750597: 1819 /* agent */ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // ProvenanceAgentComponent 1820 case -1298275357: 1821 /* entity */ return this.entity == null ? new Base[0] : this.entity.toArray(new Base[this.entity.size()]); // ProvenanceEntityComponent 1822 case 1073584312: 1823 /* signature */ return this.signature == null ? new Base[0] 1824 : this.signature.toArray(new Base[this.signature.size()]); // Signature 1825 default: 1826 return super.getProperty(hash, name, checkValid); 1827 } 1828 1829 } 1830 1831 @Override 1832 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1833 switch (hash) { 1834 case -880905839: // target 1835 this.getTarget().add(castToReference(value)); // Reference 1836 return value; 1837 case 792816933: // occurred 1838 this.occurred = castToType(value); // Type 1839 return value; 1840 case -799233872: // recorded 1841 this.recorded = castToInstant(value); // InstantType 1842 return value; 1843 case -982670030: // policy 1844 this.getPolicy().add(castToUri(value)); // UriType 1845 return value; 1846 case 1901043637: // location 1847 this.location = castToReference(value); // Reference 1848 return value; 1849 case -934964668: // reason 1850 this.getReason().add(castToCodeableConcept(value)); // CodeableConcept 1851 return value; 1852 case -1655966961: // activity 1853 this.activity = castToCodeableConcept(value); // CodeableConcept 1854 return value; 1855 case 92750597: // agent 1856 this.getAgent().add((ProvenanceAgentComponent) value); // ProvenanceAgentComponent 1857 return value; 1858 case -1298275357: // entity 1859 this.getEntity().add((ProvenanceEntityComponent) value); // ProvenanceEntityComponent 1860 return value; 1861 case 1073584312: // signature 1862 this.getSignature().add(castToSignature(value)); // Signature 1863 return value; 1864 default: 1865 return super.setProperty(hash, name, value); 1866 } 1867 1868 } 1869 1870 @Override 1871 public Base setProperty(String name, Base value) throws FHIRException { 1872 if (name.equals("target")) { 1873 this.getTarget().add(castToReference(value)); 1874 } else if (name.equals("occurred[x]")) { 1875 this.occurred = castToType(value); // Type 1876 } else if (name.equals("recorded")) { 1877 this.recorded = castToInstant(value); // InstantType 1878 } else if (name.equals("policy")) { 1879 this.getPolicy().add(castToUri(value)); 1880 } else if (name.equals("location")) { 1881 this.location = castToReference(value); // Reference 1882 } else if (name.equals("reason")) { 1883 this.getReason().add(castToCodeableConcept(value)); 1884 } else if (name.equals("activity")) { 1885 this.activity = castToCodeableConcept(value); // CodeableConcept 1886 } else if (name.equals("agent")) { 1887 this.getAgent().add((ProvenanceAgentComponent) value); 1888 } else if (name.equals("entity")) { 1889 this.getEntity().add((ProvenanceEntityComponent) value); 1890 } else if (name.equals("signature")) { 1891 this.getSignature().add(castToSignature(value)); 1892 } else 1893 return super.setProperty(name, value); 1894 return value; 1895 } 1896 1897 @Override 1898 public Base makeProperty(int hash, String name) throws FHIRException { 1899 switch (hash) { 1900 case -880905839: 1901 return addTarget(); 1902 case 784181563: 1903 return getOccurred(); 1904 case 792816933: 1905 return getOccurred(); 1906 case -799233872: 1907 return getRecordedElement(); 1908 case -982670030: 1909 return addPolicyElement(); 1910 case 1901043637: 1911 return getLocation(); 1912 case -934964668: 1913 return addReason(); 1914 case -1655966961: 1915 return getActivity(); 1916 case 92750597: 1917 return addAgent(); 1918 case -1298275357: 1919 return addEntity(); 1920 case 1073584312: 1921 return addSignature(); 1922 default: 1923 return super.makeProperty(hash, name); 1924 } 1925 1926 } 1927 1928 @Override 1929 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1930 switch (hash) { 1931 case -880905839: 1932 /* target */ return new String[] { "Reference" }; 1933 case 792816933: 1934 /* occurred */ return new String[] { "Period", "dateTime" }; 1935 case -799233872: 1936 /* recorded */ return new String[] { "instant" }; 1937 case -982670030: 1938 /* policy */ return new String[] { "uri" }; 1939 case 1901043637: 1940 /* location */ return new String[] { "Reference" }; 1941 case -934964668: 1942 /* reason */ return new String[] { "CodeableConcept" }; 1943 case -1655966961: 1944 /* activity */ return new String[] { "CodeableConcept" }; 1945 case 92750597: 1946 /* agent */ return new String[] {}; 1947 case -1298275357: 1948 /* entity */ return new String[] {}; 1949 case 1073584312: 1950 /* signature */ return new String[] { "Signature" }; 1951 default: 1952 return super.getTypesForProperty(hash, name); 1953 } 1954 1955 } 1956 1957 @Override 1958 public Base addChild(String name) throws FHIRException { 1959 if (name.equals("target")) { 1960 return addTarget(); 1961 } else if (name.equals("occurredPeriod")) { 1962 this.occurred = new Period(); 1963 return this.occurred; 1964 } else if (name.equals("occurredDateTime")) { 1965 this.occurred = new DateTimeType(); 1966 return this.occurred; 1967 } else if (name.equals("recorded")) { 1968 throw new FHIRException("Cannot call addChild on a singleton property Provenance.recorded"); 1969 } else if (name.equals("policy")) { 1970 throw new FHIRException("Cannot call addChild on a singleton property Provenance.policy"); 1971 } else if (name.equals("location")) { 1972 this.location = new Reference(); 1973 return this.location; 1974 } else if (name.equals("reason")) { 1975 return addReason(); 1976 } else if (name.equals("activity")) { 1977 this.activity = new CodeableConcept(); 1978 return this.activity; 1979 } else if (name.equals("agent")) { 1980 return addAgent(); 1981 } else if (name.equals("entity")) { 1982 return addEntity(); 1983 } else if (name.equals("signature")) { 1984 return addSignature(); 1985 } else 1986 return super.addChild(name); 1987 } 1988 1989 public String fhirType() { 1990 return "Provenance"; 1991 1992 } 1993 1994 public Provenance copy() { 1995 Provenance dst = new Provenance(); 1996 copyValues(dst); 1997 return dst; 1998 } 1999 2000 public void copyValues(Provenance dst) { 2001 super.copyValues(dst); 2002 if (target != null) { 2003 dst.target = new ArrayList<Reference>(); 2004 for (Reference i : target) 2005 dst.target.add(i.copy()); 2006 } 2007 ; 2008 dst.occurred = occurred == null ? null : occurred.copy(); 2009 dst.recorded = recorded == null ? null : recorded.copy(); 2010 if (policy != null) { 2011 dst.policy = new ArrayList<UriType>(); 2012 for (UriType i : policy) 2013 dst.policy.add(i.copy()); 2014 } 2015 ; 2016 dst.location = location == null ? null : location.copy(); 2017 if (reason != null) { 2018 dst.reason = new ArrayList<CodeableConcept>(); 2019 for (CodeableConcept i : reason) 2020 dst.reason.add(i.copy()); 2021 } 2022 ; 2023 dst.activity = activity == null ? null : activity.copy(); 2024 if (agent != null) { 2025 dst.agent = new ArrayList<ProvenanceAgentComponent>(); 2026 for (ProvenanceAgentComponent i : agent) 2027 dst.agent.add(i.copy()); 2028 } 2029 ; 2030 if (entity != null) { 2031 dst.entity = new ArrayList<ProvenanceEntityComponent>(); 2032 for (ProvenanceEntityComponent i : entity) 2033 dst.entity.add(i.copy()); 2034 } 2035 ; 2036 if (signature != null) { 2037 dst.signature = new ArrayList<Signature>(); 2038 for (Signature i : signature) 2039 dst.signature.add(i.copy()); 2040 } 2041 ; 2042 } 2043 2044 protected Provenance typedCopy() { 2045 return copy(); 2046 } 2047 2048 @Override 2049 public boolean equalsDeep(Base other_) { 2050 if (!super.equalsDeep(other_)) 2051 return false; 2052 if (!(other_ instanceof Provenance)) 2053 return false; 2054 Provenance o = (Provenance) other_; 2055 return compareDeep(target, o.target, true) && compareDeep(occurred, o.occurred, true) 2056 && compareDeep(recorded, o.recorded, true) && compareDeep(policy, o.policy, true) 2057 && compareDeep(location, o.location, true) && compareDeep(reason, o.reason, true) 2058 && compareDeep(activity, o.activity, true) && compareDeep(agent, o.agent, true) 2059 && compareDeep(entity, o.entity, true) && compareDeep(signature, o.signature, true); 2060 } 2061 2062 @Override 2063 public boolean equalsShallow(Base other_) { 2064 if (!super.equalsShallow(other_)) 2065 return false; 2066 if (!(other_ instanceof Provenance)) 2067 return false; 2068 Provenance o = (Provenance) other_; 2069 return compareValues(recorded, o.recorded, true) && compareValues(policy, o.policy, true); 2070 } 2071 2072 public boolean isEmpty() { 2073 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(target, occurred, recorded, policy, location, reason, 2074 activity, agent, entity, signature); 2075 } 2076 2077 @Override 2078 public ResourceType getResourceType() { 2079 return ResourceType.Provenance; 2080 } 2081 2082 /** 2083 * Search parameter: <b>agent-type</b> 2084 * <p> 2085 * Description: <b>How the agent participated</b><br> 2086 * Type: <b>token</b><br> 2087 * Path: <b>Provenance.agent.type</b><br> 2088 * </p> 2089 */ 2090 @SearchParamDefinition(name = "agent-type", path = "Provenance.agent.type", description = "How the agent participated", type = "token") 2091 public static final String SP_AGENT_TYPE = "agent-type"; 2092 /** 2093 * <b>Fluent Client</b> search parameter constant for <b>agent-type</b> 2094 * <p> 2095 * Description: <b>How the agent participated</b><br> 2096 * Type: <b>token</b><br> 2097 * Path: <b>Provenance.agent.type</b><br> 2098 * </p> 2099 */ 2100 public static final ca.uhn.fhir.rest.gclient.TokenClientParam AGENT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam( 2101 SP_AGENT_TYPE); 2102 2103 /** 2104 * Search parameter: <b>agent</b> 2105 * <p> 2106 * Description: <b>Who participated</b><br> 2107 * Type: <b>reference</b><br> 2108 * Path: <b>Provenance.agent.who</b><br> 2109 * </p> 2110 */ 2111 @SearchParamDefinition(name = "agent", path = "Provenance.agent.who", description = "Who participated", type = "reference", providesMembershipIn = { 2112 @ca.uhn.fhir.model.api.annotation.Compartment(name = "Device"), 2113 @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner"), 2114 @ca.uhn.fhir.model.api.annotation.Compartment(name = "RelatedPerson") }, target = { Device.class, 2115 Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class }) 2116 public static final String SP_AGENT = "agent"; 2117 /** 2118 * <b>Fluent Client</b> search parameter constant for <b>agent</b> 2119 * <p> 2120 * Description: <b>Who participated</b><br> 2121 * Type: <b>reference</b><br> 2122 * Path: <b>Provenance.agent.who</b><br> 2123 * </p> 2124 */ 2125 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam( 2126 SP_AGENT); 2127 2128 /** 2129 * Constant for fluent queries to be used to add include statements. Specifies 2130 * the path value of "<b>Provenance:agent</b>". 2131 */ 2132 public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include( 2133 "Provenance:agent").toLocked(); 2134 2135 /** 2136 * Search parameter: <b>signature-type</b> 2137 * <p> 2138 * Description: <b>Indication of the reason the entity signed the 2139 * object(s)</b><br> 2140 * Type: <b>token</b><br> 2141 * Path: <b>Provenance.signature.type</b><br> 2142 * </p> 2143 */ 2144 @SearchParamDefinition(name = "signature-type", path = "Provenance.signature.type", description = "Indication of the reason the entity signed the object(s)", type = "token") 2145 public static final String SP_SIGNATURE_TYPE = "signature-type"; 2146 /** 2147 * <b>Fluent Client</b> search parameter constant for <b>signature-type</b> 2148 * <p> 2149 * Description: <b>Indication of the reason the entity signed the 2150 * object(s)</b><br> 2151 * Type: <b>token</b><br> 2152 * Path: <b>Provenance.signature.type</b><br> 2153 * </p> 2154 */ 2155 public static final ca.uhn.fhir.rest.gclient.TokenClientParam SIGNATURE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam( 2156 SP_SIGNATURE_TYPE); 2157 2158 /** 2159 * Search parameter: <b>patient</b> 2160 * <p> 2161 * Description: <b>Target Reference(s) (usually version specific)</b><br> 2162 * Type: <b>reference</b><br> 2163 * Path: <b>Provenance.target</b><br> 2164 * </p> 2165 */ 2166 @SearchParamDefinition(name = "patient", path = "Provenance.target.where(resolve() is Patient)", description = "Target Reference(s) (usually version specific)", type = "reference", providesMembershipIn = { 2167 @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient") }, target = { Patient.class }) 2168 public static final String SP_PATIENT = "patient"; 2169 /** 2170 * <b>Fluent Client</b> search parameter constant for <b>patient</b> 2171 * <p> 2172 * Description: <b>Target Reference(s) (usually version specific)</b><br> 2173 * Type: <b>reference</b><br> 2174 * Path: <b>Provenance.target</b><br> 2175 * </p> 2176 */ 2177 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam( 2178 SP_PATIENT); 2179 2180 /** 2181 * Constant for fluent queries to be used to add include statements. Specifies 2182 * the path value of "<b>Provenance:patient</b>". 2183 */ 2184 public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include( 2185 "Provenance:patient").toLocked(); 2186 2187 /** 2188 * Search parameter: <b>location</b> 2189 * <p> 2190 * Description: <b>Where the activity occurred, if relevant</b><br> 2191 * Type: <b>reference</b><br> 2192 * Path: <b>Provenance.location</b><br> 2193 * </p> 2194 */ 2195 @SearchParamDefinition(name = "location", path = "Provenance.location", description = "Where the activity occurred, if relevant", type = "reference", target = { 2196 Location.class }) 2197 public static final String SP_LOCATION = "location"; 2198 /** 2199 * <b>Fluent Client</b> search parameter constant for <b>location</b> 2200 * <p> 2201 * Description: <b>Where the activity occurred, if relevant</b><br> 2202 * Type: <b>reference</b><br> 2203 * Path: <b>Provenance.location</b><br> 2204 * </p> 2205 */ 2206 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam( 2207 SP_LOCATION); 2208 2209 /** 2210 * Constant for fluent queries to be used to add include statements. Specifies 2211 * the path value of "<b>Provenance:location</b>". 2212 */ 2213 public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include( 2214 "Provenance:location").toLocked(); 2215 2216 /** 2217 * Search parameter: <b>recorded</b> 2218 * <p> 2219 * Description: <b>When the activity was recorded / updated</b><br> 2220 * Type: <b>date</b><br> 2221 * Path: <b>Provenance.recorded</b><br> 2222 * </p> 2223 */ 2224 @SearchParamDefinition(name = "recorded", path = "Provenance.recorded", description = "When the activity was recorded / updated", type = "date") 2225 public static final String SP_RECORDED = "recorded"; 2226 /** 2227 * <b>Fluent Client</b> search parameter constant for <b>recorded</b> 2228 * <p> 2229 * Description: <b>When the activity was recorded / updated</b><br> 2230 * Type: <b>date</b><br> 2231 * Path: <b>Provenance.recorded</b><br> 2232 * </p> 2233 */ 2234 public static final ca.uhn.fhir.rest.gclient.DateClientParam RECORDED = new ca.uhn.fhir.rest.gclient.DateClientParam( 2235 SP_RECORDED); 2236 2237 /** 2238 * Search parameter: <b>agent-role</b> 2239 * <p> 2240 * Description: <b>What the agents role was</b><br> 2241 * Type: <b>token</b><br> 2242 * Path: <b>Provenance.agent.role</b><br> 2243 * </p> 2244 */ 2245 @SearchParamDefinition(name = "agent-role", path = "Provenance.agent.role", description = "What the agents role was", type = "token") 2246 public static final String SP_AGENT_ROLE = "agent-role"; 2247 /** 2248 * <b>Fluent Client</b> search parameter constant for <b>agent-role</b> 2249 * <p> 2250 * Description: <b>What the agents role was</b><br> 2251 * Type: <b>token</b><br> 2252 * Path: <b>Provenance.agent.role</b><br> 2253 * </p> 2254 */ 2255 public static final ca.uhn.fhir.rest.gclient.TokenClientParam AGENT_ROLE = new ca.uhn.fhir.rest.gclient.TokenClientParam( 2256 SP_AGENT_ROLE); 2257 2258 /** 2259 * Search parameter: <b>when</b> 2260 * <p> 2261 * Description: <b>When the activity occurred</b><br> 2262 * Type: <b>date</b><br> 2263 * Path: <b>Provenance.occurredDateTime</b><br> 2264 * </p> 2265 */ 2266 @SearchParamDefinition(name = "when", path = "(Provenance.occurred as dateTime)", description = "When the activity occurred", type = "date") 2267 public static final String SP_WHEN = "when"; 2268 /** 2269 * <b>Fluent Client</b> search parameter constant for <b>when</b> 2270 * <p> 2271 * Description: <b>When the activity occurred</b><br> 2272 * Type: <b>date</b><br> 2273 * Path: <b>Provenance.occurredDateTime</b><br> 2274 * </p> 2275 */ 2276 public static final ca.uhn.fhir.rest.gclient.DateClientParam WHEN = new ca.uhn.fhir.rest.gclient.DateClientParam( 2277 SP_WHEN); 2278 2279 /** 2280 * Search parameter: <b>entity</b> 2281 * <p> 2282 * Description: <b>Identity of entity</b><br> 2283 * Type: <b>reference</b><br> 2284 * Path: <b>Provenance.entity.what</b><br> 2285 * </p> 2286 */ 2287 @SearchParamDefinition(name = "entity", path = "Provenance.entity.what", description = "Identity of entity", type = "reference") 2288 public static final String SP_ENTITY = "entity"; 2289 /** 2290 * <b>Fluent Client</b> search parameter constant for <b>entity</b> 2291 * <p> 2292 * Description: <b>Identity of entity</b><br> 2293 * Type: <b>reference</b><br> 2294 * Path: <b>Provenance.entity.what</b><br> 2295 * </p> 2296 */ 2297 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam( 2298 SP_ENTITY); 2299 2300 /** 2301 * Constant for fluent queries to be used to add include statements. Specifies 2302 * the path value of "<b>Provenance:entity</b>". 2303 */ 2304 public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTITY = new ca.uhn.fhir.model.api.Include( 2305 "Provenance:entity").toLocked(); 2306 2307 /** 2308 * Search parameter: <b>target</b> 2309 * <p> 2310 * Description: <b>Target Reference(s) (usually version specific)</b><br> 2311 * Type: <b>reference</b><br> 2312 * Path: <b>Provenance.target</b><br> 2313 * </p> 2314 */ 2315 @SearchParamDefinition(name = "target", path = "Provenance.target", description = "Target Reference(s) (usually version specific)", type = "reference") 2316 public static final String SP_TARGET = "target"; 2317 /** 2318 * <b>Fluent Client</b> search parameter constant for <b>target</b> 2319 * <p> 2320 * Description: <b>Target Reference(s) (usually version specific)</b><br> 2321 * Type: <b>reference</b><br> 2322 * Path: <b>Provenance.target</b><br> 2323 * </p> 2324 */ 2325 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam( 2326 SP_TARGET); 2327 2328 /** 2329 * Constant for fluent queries to be used to add include statements. Specifies 2330 * the path value of "<b>Provenance:target</b>". 2331 */ 2332 public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include( 2333 "Provenance:target").toLocked(); 2334 2335}