001package org.hl7.fhir.dstu2.model; 002 003 004 005 006import java.math.BigDecimal; 007 008/* 009 Copyright (c) 2011+, HL7, Inc. 010 All rights reserved. 011 012 Redistribution and use in source and binary forms, with or without modification, 013 are permitted provided that the following conditions are met: 014 015 * Redistributions of source code must retain the above copyright notice, this 016 list of conditions and the following disclaimer. 017 * Redistributions in binary form must reproduce the above copyright notice, 018 this list of conditions and the following disclaimer in the documentation 019 and/or other materials provided with the distribution. 020 * Neither the name of HL7 nor the names of its contributors may be used to 021 endorse or promote products derived from this software without specific 022 prior written permission. 023 024 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 025 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 026 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 027 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 028 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 029 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 030 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 031 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 032 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 033 POSSIBILITY OF SUCH DAMAGE. 034 035*/ 036 037// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2 038import java.util.ArrayList; 039import java.util.Date; 040import java.util.List; 041 042import ca.uhn.fhir.model.api.annotation.Block; 043import ca.uhn.fhir.model.api.annotation.Child; 044import ca.uhn.fhir.model.api.annotation.Description; 045import ca.uhn.fhir.model.api.annotation.ResourceDef; 046import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 047import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 048import org.hl7.fhir.instance.model.api.IBaseBundle; 049import org.hl7.fhir.exceptions.FHIRException; 050import org.hl7.fhir.utilities.Utilities; 051/** 052 * A container for a collection of resources. 053 */ 054@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle") 055public class Bundle extends Resource implements IBaseBundle { 056 057 public enum BundleType { 058 /** 059 * The bundle is a document. The first resource is a Composition. 060 */ 061 DOCUMENT, 062 /** 063 * The bundle is a message. The first resource is a MessageHeader. 064 */ 065 MESSAGE, 066 /** 067 * The bundle is a transaction - intended to be processed by a server as an atomic commit. 068 */ 069 TRANSACTION, 070 /** 071 * The bundle is a transaction response. Because the response is a transaction response, the transactionhas succeeded, and all responses are error free. 072 */ 073 TRANSACTIONRESPONSE, 074 /** 075 * The bundle is a transaction - intended to be processed by a server as a group of actions. 076 */ 077 BATCH, 078 /** 079 * The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success. 080 */ 081 BATCHRESPONSE, 082 /** 083 * The bundle is a list of resources from a history interaction on a server. 084 */ 085 HISTORY, 086 /** 087 * The bundle is a list of resources returned as a result of a search/query interaction, operation, or message. 088 */ 089 SEARCHSET, 090 /** 091 * The bundle is a set of resources collected into a single document for ease of distribution. 092 */ 093 COLLECTION, 094 /** 095 * added to help the parsers 096 */ 097 NULL; 098 public static BundleType fromCode(String codeString) throws FHIRException { 099 if (codeString == null || "".equals(codeString)) 100 return null; 101 if ("document".equals(codeString)) 102 return DOCUMENT; 103 if ("message".equals(codeString)) 104 return MESSAGE; 105 if ("transaction".equals(codeString)) 106 return TRANSACTION; 107 if ("transaction-response".equals(codeString)) 108 return TRANSACTIONRESPONSE; 109 if ("batch".equals(codeString)) 110 return BATCH; 111 if ("batch-response".equals(codeString)) 112 return BATCHRESPONSE; 113 if ("history".equals(codeString)) 114 return HISTORY; 115 if ("searchset".equals(codeString)) 116 return SEARCHSET; 117 if ("collection".equals(codeString)) 118 return COLLECTION; 119 throw new FHIRException("Unknown BundleType code '"+codeString+"'"); 120 } 121 public String toCode() { 122 switch (this) { 123 case DOCUMENT: return "document"; 124 case MESSAGE: return "message"; 125 case TRANSACTION: return "transaction"; 126 case TRANSACTIONRESPONSE: return "transaction-response"; 127 case BATCH: return "batch"; 128 case BATCHRESPONSE: return "batch-response"; 129 case HISTORY: return "history"; 130 case SEARCHSET: return "searchset"; 131 case COLLECTION: return "collection"; 132 case NULL: return null; 133 default: return "?"; 134 } 135 } 136 public String getSystem() { 137 switch (this) { 138 case DOCUMENT: return "http://hl7.org/fhir/bundle-type"; 139 case MESSAGE: return "http://hl7.org/fhir/bundle-type"; 140 case TRANSACTION: return "http://hl7.org/fhir/bundle-type"; 141 case TRANSACTIONRESPONSE: return "http://hl7.org/fhir/bundle-type"; 142 case BATCH: return "http://hl7.org/fhir/bundle-type"; 143 case BATCHRESPONSE: return "http://hl7.org/fhir/bundle-type"; 144 case HISTORY: return "http://hl7.org/fhir/bundle-type"; 145 case SEARCHSET: return "http://hl7.org/fhir/bundle-type"; 146 case COLLECTION: return "http://hl7.org/fhir/bundle-type"; 147 case NULL: return null; 148 default: return "?"; 149 } 150 } 151 public String getDefinition() { 152 switch (this) { 153 case DOCUMENT: return "The bundle is a document. The first resource is a Composition."; 154 case MESSAGE: return "The bundle is a message. The first resource is a MessageHeader."; 155 case TRANSACTION: return "The bundle is a transaction - intended to be processed by a server as an atomic commit."; 156 case TRANSACTIONRESPONSE: return "The bundle is a transaction response. Because the response is a transaction response, the transactionhas succeeded, and all responses are error free."; 157 case BATCH: return "The bundle is a transaction - intended to be processed by a server as a group of actions."; 158 case BATCHRESPONSE: return "The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success."; 159 case HISTORY: return "The bundle is a list of resources from a history interaction on a server."; 160 case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; 161 case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; 162 case NULL: return null; 163 default: return "?"; 164 } 165 } 166 public String getDisplay() { 167 switch (this) { 168 case DOCUMENT: return "Document"; 169 case MESSAGE: return "Message"; 170 case TRANSACTION: return "Transaction"; 171 case TRANSACTIONRESPONSE: return "Transaction Response"; 172 case BATCH: return "Batch"; 173 case BATCHRESPONSE: return "Batch Response"; 174 case HISTORY: return "History List"; 175 case SEARCHSET: return "Search Results"; 176 case COLLECTION: return "Collection"; 177 case NULL: return null; 178 default: return "?"; 179 } 180 } 181 } 182 183 public static class BundleTypeEnumFactory implements EnumFactory<BundleType> { 184 public BundleType fromCode(String codeString) throws IllegalArgumentException { 185 if (codeString == null || "".equals(codeString)) 186 if (codeString == null || "".equals(codeString)) 187 return null; 188 if ("document".equals(codeString)) 189 return BundleType.DOCUMENT; 190 if ("message".equals(codeString)) 191 return BundleType.MESSAGE; 192 if ("transaction".equals(codeString)) 193 return BundleType.TRANSACTION; 194 if ("transaction-response".equals(codeString)) 195 return BundleType.TRANSACTIONRESPONSE; 196 if ("batch".equals(codeString)) 197 return BundleType.BATCH; 198 if ("batch-response".equals(codeString)) 199 return BundleType.BATCHRESPONSE; 200 if ("history".equals(codeString)) 201 return BundleType.HISTORY; 202 if ("searchset".equals(codeString)) 203 return BundleType.SEARCHSET; 204 if ("collection".equals(codeString)) 205 return BundleType.COLLECTION; 206 throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); 207 } 208 public Enumeration<BundleType> fromType(Base code) throws FHIRException { 209 if (code == null || code.isEmpty()) 210 return null; 211 String codeString = ((PrimitiveType) code).asStringValue(); 212 if (codeString == null || "".equals(codeString)) 213 return null; 214 if ("document".equals(codeString)) 215 return new Enumeration<BundleType>(this, BundleType.DOCUMENT); 216 if ("message".equals(codeString)) 217 return new Enumeration<BundleType>(this, BundleType.MESSAGE); 218 if ("transaction".equals(codeString)) 219 return new Enumeration<BundleType>(this, BundleType.TRANSACTION); 220 if ("transaction-response".equals(codeString)) 221 return new Enumeration<BundleType>(this, BundleType.TRANSACTIONRESPONSE); 222 if ("batch".equals(codeString)) 223 return new Enumeration<BundleType>(this, BundleType.BATCH); 224 if ("batch-response".equals(codeString)) 225 return new Enumeration<BundleType>(this, BundleType.BATCHRESPONSE); 226 if ("history".equals(codeString)) 227 return new Enumeration<BundleType>(this, BundleType.HISTORY); 228 if ("searchset".equals(codeString)) 229 return new Enumeration<BundleType>(this, BundleType.SEARCHSET); 230 if ("collection".equals(codeString)) 231 return new Enumeration<BundleType>(this, BundleType.COLLECTION); 232 throw new FHIRException("Unknown BundleType code '"+codeString+"'"); 233 } 234 public String toCode(BundleType code) { 235 if (code == BundleType.DOCUMENT) 236 return "document"; 237 if (code == BundleType.MESSAGE) 238 return "message"; 239 if (code == BundleType.TRANSACTION) 240 return "transaction"; 241 if (code == BundleType.TRANSACTIONRESPONSE) 242 return "transaction-response"; 243 if (code == BundleType.BATCH) 244 return "batch"; 245 if (code == BundleType.BATCHRESPONSE) 246 return "batch-response"; 247 if (code == BundleType.HISTORY) 248 return "history"; 249 if (code == BundleType.SEARCHSET) 250 return "searchset"; 251 if (code == BundleType.COLLECTION) 252 return "collection"; 253 return "?"; 254 } 255 } 256 257 public enum SearchEntryMode { 258 /** 259 * This resource matched the search specification. 260 */ 261 MATCH, 262 /** 263 * This resource is returned because it is referred to from another resource in the search set. 264 */ 265 INCLUDE, 266 /** 267 * An OperationOutcome that provides additional information about the processing of a search. 268 */ 269 OUTCOME, 270 /** 271 * added to help the parsers 272 */ 273 NULL; 274 public static SearchEntryMode fromCode(String codeString) throws FHIRException { 275 if (codeString == null || "".equals(codeString)) 276 return null; 277 if ("match".equals(codeString)) 278 return MATCH; 279 if ("include".equals(codeString)) 280 return INCLUDE; 281 if ("outcome".equals(codeString)) 282 return OUTCOME; 283 throw new FHIRException("Unknown SearchEntryMode code '"+codeString+"'"); 284 } 285 public String toCode() { 286 switch (this) { 287 case MATCH: return "match"; 288 case INCLUDE: return "include"; 289 case OUTCOME: return "outcome"; 290 case NULL: return null; 291 default: return "?"; 292 } 293 } 294 public String getSystem() { 295 switch (this) { 296 case MATCH: return "http://hl7.org/fhir/search-entry-mode"; 297 case INCLUDE: return "http://hl7.org/fhir/search-entry-mode"; 298 case OUTCOME: return "http://hl7.org/fhir/search-entry-mode"; 299 case NULL: return null; 300 default: return "?"; 301 } 302 } 303 public String getDefinition() { 304 switch (this) { 305 case MATCH: return "This resource matched the search specification."; 306 case INCLUDE: return "This resource is returned because it is referred to from another resource in the search set."; 307 case OUTCOME: return "An OperationOutcome that provides additional information about the processing of a search."; 308 case NULL: return null; 309 default: return "?"; 310 } 311 } 312 public String getDisplay() { 313 switch (this) { 314 case MATCH: return "Match"; 315 case INCLUDE: return "Include"; 316 case OUTCOME: return "Outcome"; 317 case NULL: return null; 318 default: return "?"; 319 } 320 } 321 } 322 323 public static class SearchEntryModeEnumFactory implements EnumFactory<SearchEntryMode> { 324 public SearchEntryMode fromCode(String codeString) throws IllegalArgumentException { 325 if (codeString == null || "".equals(codeString)) 326 if (codeString == null || "".equals(codeString)) 327 return null; 328 if ("match".equals(codeString)) 329 return SearchEntryMode.MATCH; 330 if ("include".equals(codeString)) 331 return SearchEntryMode.INCLUDE; 332 if ("outcome".equals(codeString)) 333 return SearchEntryMode.OUTCOME; 334 throw new IllegalArgumentException("Unknown SearchEntryMode code '"+codeString+"'"); 335 } 336 public Enumeration<SearchEntryMode> fromType(Base code) throws FHIRException { 337 if (code == null || code.isEmpty()) 338 return null; 339 String codeString = ((PrimitiveType) code).asStringValue(); 340 if (codeString == null || "".equals(codeString)) 341 return null; 342 if ("match".equals(codeString)) 343 return new Enumeration<SearchEntryMode>(this, SearchEntryMode.MATCH); 344 if ("include".equals(codeString)) 345 return new Enumeration<SearchEntryMode>(this, SearchEntryMode.INCLUDE); 346 if ("outcome".equals(codeString)) 347 return new Enumeration<SearchEntryMode>(this, SearchEntryMode.OUTCOME); 348 throw new FHIRException("Unknown SearchEntryMode code '"+codeString+"'"); 349 } 350 public String toCode(SearchEntryMode code) { 351 if (code == SearchEntryMode.MATCH) 352 return "match"; 353 if (code == SearchEntryMode.INCLUDE) 354 return "include"; 355 if (code == SearchEntryMode.OUTCOME) 356 return "outcome"; 357 return "?"; 358 } 359 } 360 361 public enum HTTPVerb { 362 /** 363 * HTTP GET 364 */ 365 GET, 366 /** 367 * HTTP POST 368 */ 369 POST, 370 /** 371 * HTTP PUT 372 */ 373 PUT, 374 /** 375 * HTTP DELETE 376 */ 377 DELETE, 378 /** 379 * added to help the parsers 380 */ 381 NULL; 382 public static HTTPVerb fromCode(String codeString) throws FHIRException { 383 if (codeString == null || "".equals(codeString)) 384 return null; 385 if ("GET".equals(codeString)) 386 return GET; 387 if ("POST".equals(codeString)) 388 return POST; 389 if ("PUT".equals(codeString)) 390 return PUT; 391 if ("DELETE".equals(codeString)) 392 return DELETE; 393 throw new FHIRException("Unknown HTTPVerb code '"+codeString+"'"); 394 } 395 public String toCode() { 396 switch (this) { 397 case GET: return "GET"; 398 case POST: return "POST"; 399 case PUT: return "PUT"; 400 case DELETE: return "DELETE"; 401 case NULL: return null; 402 default: return "?"; 403 } 404 } 405 public String getSystem() { 406 switch (this) { 407 case GET: return "http://hl7.org/fhir/http-verb"; 408 case POST: return "http://hl7.org/fhir/http-verb"; 409 case PUT: return "http://hl7.org/fhir/http-verb"; 410 case DELETE: return "http://hl7.org/fhir/http-verb"; 411 case NULL: return null; 412 default: return "?"; 413 } 414 } 415 public String getDefinition() { 416 switch (this) { 417 case GET: return "HTTP GET"; 418 case POST: return "HTTP POST"; 419 case PUT: return "HTTP PUT"; 420 case DELETE: return "HTTP DELETE"; 421 case NULL: return null; 422 default: return "?"; 423 } 424 } 425 public String getDisplay() { 426 switch (this) { 427 case GET: return "GET"; 428 case POST: return "POST"; 429 case PUT: return "PUT"; 430 case DELETE: return "DELETE"; 431 case NULL: return null; 432 default: return "?"; 433 } 434 } 435 } 436 437 public static class HTTPVerbEnumFactory implements EnumFactory<HTTPVerb> { 438 public HTTPVerb fromCode(String codeString) throws IllegalArgumentException { 439 if (codeString == null || "".equals(codeString)) 440 if (codeString == null || "".equals(codeString)) 441 return null; 442 if ("GET".equals(codeString)) 443 return HTTPVerb.GET; 444 if ("POST".equals(codeString)) 445 return HTTPVerb.POST; 446 if ("PUT".equals(codeString)) 447 return HTTPVerb.PUT; 448 if ("DELETE".equals(codeString)) 449 return HTTPVerb.DELETE; 450 throw new IllegalArgumentException("Unknown HTTPVerb code '"+codeString+"'"); 451 } 452 public Enumeration<HTTPVerb> fromType(Base code) throws FHIRException { 453 if (code == null || code.isEmpty()) 454 return null; 455 String codeString = ((PrimitiveType) code).asStringValue(); 456 if (codeString == null || "".equals(codeString)) 457 return null; 458 if ("GET".equals(codeString)) 459 return new Enumeration<HTTPVerb>(this, HTTPVerb.GET); 460 if ("POST".equals(codeString)) 461 return new Enumeration<HTTPVerb>(this, HTTPVerb.POST); 462 if ("PUT".equals(codeString)) 463 return new Enumeration<HTTPVerb>(this, HTTPVerb.PUT); 464 if ("DELETE".equals(codeString)) 465 return new Enumeration<HTTPVerb>(this, HTTPVerb.DELETE); 466 throw new FHIRException("Unknown HTTPVerb code '"+codeString+"'"); 467 } 468 public String toCode(HTTPVerb code) { 469 if (code == HTTPVerb.GET) 470 return "GET"; 471 if (code == HTTPVerb.POST) 472 return "POST"; 473 if (code == HTTPVerb.PUT) 474 return "PUT"; 475 if (code == HTTPVerb.DELETE) 476 return "DELETE"; 477 return "?"; 478 } 479 } 480 481 @Block() 482 public static class BundleLinkComponent extends BackboneElement implements IBaseBackboneElement { 483 /** 484 * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. 485 */ 486 @Child(name = "relation", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) 487 @Description(shortDefinition="http://www.iana.org/assignments/link-relations/link-relations.xhtml", formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." ) 488 protected StringType relation; 489 490 /** 491 * The reference details for the link. 492 */ 493 @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) 494 @Description(shortDefinition="Reference details for the link", formalDefinition="The reference details for the link." ) 495 protected UriType url; 496 497 private static final long serialVersionUID = -1010386066L; 498 499 /* 500 * Constructor 501 */ 502 public BundleLinkComponent() { 503 super(); 504 } 505 506 /* 507 * Constructor 508 */ 509 public BundleLinkComponent(StringType relation, UriType url) { 510 super(); 511 this.relation = relation; 512 this.url = url; 513 } 514 515 /** 516 * @return {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value 517 */ 518 public StringType getRelationElement() { 519 if (this.relation == null) 520 if (Configuration.errorOnAutoCreate()) 521 throw new Error("Attempt to auto-create BundleLinkComponent.relation"); 522 else if (Configuration.doAutoCreate()) 523 this.relation = new StringType(); // bb 524 return this.relation; 525 } 526 527 public boolean hasRelationElement() { 528 return this.relation != null && !this.relation.isEmpty(); 529 } 530 531 public boolean hasRelation() { 532 return this.relation != null && !this.relation.isEmpty(); 533 } 534 535 /** 536 * @param value {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value 537 */ 538 public BundleLinkComponent setRelationElement(StringType value) { 539 this.relation = value; 540 return this; 541 } 542 543 /** 544 * @return A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. 545 */ 546 public String getRelation() { 547 return this.relation == null ? null : this.relation.getValue(); 548 } 549 550 /** 551 * @param value A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. 552 */ 553 public BundleLinkComponent setRelation(String value) { 554 if (this.relation == null) 555 this.relation = new StringType(); 556 this.relation.setValue(value); 557 return this; 558 } 559 560 /** 561 * @return {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 562 */ 563 public UriType getUrlElement() { 564 if (this.url == null) 565 if (Configuration.errorOnAutoCreate()) 566 throw new Error("Attempt to auto-create BundleLinkComponent.url"); 567 else if (Configuration.doAutoCreate()) 568 this.url = new UriType(); // bb 569 return this.url; 570 } 571 572 public boolean hasUrlElement() { 573 return this.url != null && !this.url.isEmpty(); 574 } 575 576 public boolean hasUrl() { 577 return this.url != null && !this.url.isEmpty(); 578 } 579 580 /** 581 * @param value {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 582 */ 583 public BundleLinkComponent setUrlElement(UriType value) { 584 this.url = value; 585 return this; 586 } 587 588 /** 589 * @return The reference details for the link. 590 */ 591 public String getUrl() { 592 return this.url == null ? null : this.url.getValue(); 593 } 594 595 /** 596 * @param value The reference details for the link. 597 */ 598 public BundleLinkComponent setUrl(String value) { 599 if (this.url == null) 600 this.url = new UriType(); 601 this.url.setValue(value); 602 return this; 603 } 604 605 protected void listChildren(List<Property> childrenList) { 606 super.listChildren(childrenList); 607 childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].", 0, java.lang.Integer.MAX_VALUE, relation)); 608 childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url)); 609 } 610 611 @Override 612 public void setProperty(String name, Base value) throws FHIRException { 613 if (name.equals("relation")) 614 this.relation = castToString(value); // StringType 615 else if (name.equals("url")) 616 this.url = castToUri(value); // UriType 617 else 618 super.setProperty(name, value); 619 } 620 621 @Override 622 public Base addChild(String name) throws FHIRException { 623 if (name.equals("relation")) { 624 throw new FHIRException("Cannot call addChild on a primitive type Bundle.relation"); 625 } 626 else if (name.equals("url")) { 627 throw new FHIRException("Cannot call addChild on a primitive type Bundle.url"); 628 } 629 else 630 return super.addChild(name); 631 } 632 633 public BundleLinkComponent copy() { 634 BundleLinkComponent dst = new BundleLinkComponent(); 635 copyValues(dst); 636 dst.relation = relation == null ? null : relation.copy(); 637 dst.url = url == null ? null : url.copy(); 638 return dst; 639 } 640 641 @Override 642 public boolean equalsDeep(Base other) { 643 if (!super.equalsDeep(other)) 644 return false; 645 if (!(other instanceof BundleLinkComponent)) 646 return false; 647 BundleLinkComponent o = (BundleLinkComponent) other; 648 return compareDeep(relation, o.relation, true) && compareDeep(url, o.url, true); 649 } 650 651 @Override 652 public boolean equalsShallow(Base other) { 653 if (!super.equalsShallow(other)) 654 return false; 655 if (!(other instanceof BundleLinkComponent)) 656 return false; 657 BundleLinkComponent o = (BundleLinkComponent) other; 658 return compareValues(relation, o.relation, true) && compareValues(url, o.url, true); 659 } 660 661 public boolean isEmpty() { 662 return super.isEmpty() && (relation == null || relation.isEmpty()) && (url == null || url.isEmpty()) 663 ; 664 } 665 666 public String fhirType() { 667 return "Bundle.link"; 668 669 } 670 671 } 672 673 @Block() 674 public static class BundleEntryComponent extends BackboneElement implements IBaseBackboneElement { 675 /** 676 * A series of links that provide context to this entry. 677 */ 678 @Child(name = "link", type = {BundleLinkComponent.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 679 @Description(shortDefinition="Links related to this entry", formalDefinition="A series of links that provide context to this entry." ) 680 protected List<BundleLinkComponent> link; 681 682 /** 683 * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. 684 */ 685 @Child(name = "fullUrl", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) 686 @Description(shortDefinition="Absolute URL for resource (server address, or UUID/OID)", formalDefinition="The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource." ) 687 protected UriType fullUrl; 688 689 /** 690 * The Resources for the entry. 691 */ 692 @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=true) 693 @Description(shortDefinition="A resource in the bundle", formalDefinition="The Resources for the entry." ) 694 protected Resource resource; 695 696 /** 697 * Information about the search process that lead to the creation of this entry. 698 */ 699 @Child(name = "search", type = {}, order=4, min=0, max=1, modifier=false, summary=true) 700 @Description(shortDefinition="Search related information", formalDefinition="Information about the search process that lead to the creation of this entry." ) 701 protected BundleEntrySearchComponent search; 702 703 /** 704 * Additional information about how this entry should be processed as part of a transaction. 705 */ 706 @Child(name = "request", type = {}, order=5, min=0, max=1, modifier=false, summary=true) 707 @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) 708 protected BundleEntryRequestComponent request; 709 710 /** 711 * Additional information about how this entry should be processed as part of a transaction. 712 */ 713 @Child(name = "response", type = {}, order=6, min=0, max=1, modifier=false, summary=true) 714 @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) 715 protected BundleEntryResponseComponent response; 716 717 private static final long serialVersionUID = 517783054L; 718 719 /* 720 * Constructor 721 */ 722 public BundleEntryComponent() { 723 super(); 724 } 725 726 /** 727 * @return {@link #link} (A series of links that provide context to this entry.) 728 */ 729 public List<BundleLinkComponent> getLink() { 730 if (this.link == null) 731 this.link = new ArrayList<BundleLinkComponent>(); 732 return this.link; 733 } 734 735 public boolean hasLink() { 736 if (this.link == null) 737 return false; 738 for (BundleLinkComponent item : this.link) 739 if (!item.isEmpty()) 740 return true; 741 return false; 742 } 743 744 /** 745 * @return {@link #link} (A series of links that provide context to this entry.) 746 */ 747 // syntactic sugar 748 public BundleLinkComponent addLink() { //3 749 BundleLinkComponent t = new BundleLinkComponent(); 750 if (this.link == null) 751 this.link = new ArrayList<BundleLinkComponent>(); 752 this.link.add(t); 753 return t; 754 } 755 756 // syntactic sugar 757 public BundleEntryComponent addLink(BundleLinkComponent t) { //3 758 if (t == null) 759 return this; 760 if (this.link == null) 761 this.link = new ArrayList<BundleLinkComponent>(); 762 this.link.add(t); 763 return this; 764 } 765 766 /** 767 * @return {@link #fullUrl} (The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource.). This is the underlying object with id, value and extensions. The accessor "getFullUrl" gives direct access to the value 768 */ 769 public UriType getFullUrlElement() { 770 if (this.fullUrl == null) 771 if (Configuration.errorOnAutoCreate()) 772 throw new Error("Attempt to auto-create BundleEntryComponent.fullUrl"); 773 else if (Configuration.doAutoCreate()) 774 this.fullUrl = new UriType(); // bb 775 return this.fullUrl; 776 } 777 778 public boolean hasFullUrlElement() { 779 return this.fullUrl != null && !this.fullUrl.isEmpty(); 780 } 781 782 public boolean hasFullUrl() { 783 return this.fullUrl != null && !this.fullUrl.isEmpty(); 784 } 785 786 /** 787 * @param value {@link #fullUrl} (The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource.). This is the underlying object with id, value and extensions. The accessor "getFullUrl" gives direct access to the value 788 */ 789 public BundleEntryComponent setFullUrlElement(UriType value) { 790 this.fullUrl = value; 791 return this; 792 } 793 794 /** 795 * @return The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. 796 */ 797 public String getFullUrl() { 798 return this.fullUrl == null ? null : this.fullUrl.getValue(); 799 } 800 801 /** 802 * @param value The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. 803 */ 804 public BundleEntryComponent setFullUrl(String value) { 805 if (Utilities.noString(value)) 806 this.fullUrl = null; 807 else { 808 if (this.fullUrl == null) 809 this.fullUrl = new UriType(); 810 this.fullUrl.setValue(value); 811 } 812 return this; 813 } 814 815 /** 816 * @return {@link #resource} (The Resources for the entry.) 817 */ 818 public Resource getResource() { 819 return this.resource; 820 } 821 822 public boolean hasResource() { 823 return this.resource != null && !this.resource.isEmpty(); 824 } 825 826 /** 827 * @param value {@link #resource} (The Resources for the entry.) 828 */ 829 public BundleEntryComponent setResource(Resource value) { 830 this.resource = value; 831 return this; 832 } 833 834 /** 835 * @return {@link #search} (Information about the search process that lead to the creation of this entry.) 836 */ 837 public BundleEntrySearchComponent getSearch() { 838 if (this.search == null) 839 if (Configuration.errorOnAutoCreate()) 840 throw new Error("Attempt to auto-create BundleEntryComponent.search"); 841 else if (Configuration.doAutoCreate()) 842 this.search = new BundleEntrySearchComponent(); // cc 843 return this.search; 844 } 845 846 public boolean hasSearch() { 847 return this.search != null && !this.search.isEmpty(); 848 } 849 850 /** 851 * @param value {@link #search} (Information about the search process that lead to the creation of this entry.) 852 */ 853 public BundleEntryComponent setSearch(BundleEntrySearchComponent value) { 854 this.search = value; 855 return this; 856 } 857 858 /** 859 * @return {@link #request} (Additional information about how this entry should be processed as part of a transaction.) 860 */ 861 public BundleEntryRequestComponent getRequest() { 862 if (this.request == null) 863 if (Configuration.errorOnAutoCreate()) 864 throw new Error("Attempt to auto-create BundleEntryComponent.request"); 865 else if (Configuration.doAutoCreate()) 866 this.request = new BundleEntryRequestComponent(); // cc 867 return this.request; 868 } 869 870 public boolean hasRequest() { 871 return this.request != null && !this.request.isEmpty(); 872 } 873 874 /** 875 * @param value {@link #request} (Additional information about how this entry should be processed as part of a transaction.) 876 */ 877 public BundleEntryComponent setRequest(BundleEntryRequestComponent value) { 878 this.request = value; 879 return this; 880 } 881 882 /** 883 * @return {@link #response} (Additional information about how this entry should be processed as part of a transaction.) 884 */ 885 public BundleEntryResponseComponent getResponse() { 886 if (this.response == null) 887 if (Configuration.errorOnAutoCreate()) 888 throw new Error("Attempt to auto-create BundleEntryComponent.response"); 889 else if (Configuration.doAutoCreate()) 890 this.response = new BundleEntryResponseComponent(); // cc 891 return this.response; 892 } 893 894 public boolean hasResponse() { 895 return this.response != null && !this.response.isEmpty(); 896 } 897 898 /** 899 * @param value {@link #response} (Additional information about how this entry should be processed as part of a transaction.) 900 */ 901 public BundleEntryComponent setResponse(BundleEntryResponseComponent value) { 902 this.response = value; 903 return this; 904 } 905 906 protected void listChildren(List<Property> childrenList) { 907 super.listChildren(childrenList); 908 childrenList.add(new Property("link", "@Bundle.link", "A series of links that provide context to this entry.", 0, java.lang.Integer.MAX_VALUE, link)); 909 childrenList.add(new Property("fullUrl", "uri", "The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource.", 0, java.lang.Integer.MAX_VALUE, fullUrl)); 910 childrenList.add(new Property("resource", "Resource", "The Resources for the entry.", 0, java.lang.Integer.MAX_VALUE, resource)); 911 childrenList.add(new Property("search", "", "Information about the search process that lead to the creation of this entry.", 0, java.lang.Integer.MAX_VALUE, search)); 912 childrenList.add(new Property("request", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, request)); 913 childrenList.add(new Property("response", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, response)); 914 } 915 916 @Override 917 public void setProperty(String name, Base value) throws FHIRException { 918 if (name.equals("link")) 919 this.getLink().add((BundleLinkComponent) value); 920 else if (name.equals("fullUrl")) 921 this.fullUrl = castToUri(value); // UriType 922 else if (name.equals("resource")) 923 this.resource = castToResource(value); // Resource 924 else if (name.equals("search")) 925 this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent 926 else if (name.equals("request")) 927 this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent 928 else if (name.equals("response")) 929 this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent 930 else 931 super.setProperty(name, value); 932 } 933 934 @Override 935 public Base addChild(String name) throws FHIRException { 936 if (name.equals("link")) { 937 return addLink(); 938 } 939 else if (name.equals("fullUrl")) { 940 throw new FHIRException("Cannot call addChild on a primitive type Bundle.fullUrl"); 941 } 942 else if (name.equals("resource")) { 943 throw new FHIRException("Cannot call addChild on an abstract type Bundle.resource"); 944 } 945 else if (name.equals("search")) { 946 this.search = new BundleEntrySearchComponent(); 947 return this.search; 948 } 949 else if (name.equals("request")) { 950 this.request = new BundleEntryRequestComponent(); 951 return this.request; 952 } 953 else if (name.equals("response")) { 954 this.response = new BundleEntryResponseComponent(); 955 return this.response; 956 } 957 else 958 return super.addChild(name); 959 } 960 961 public BundleEntryComponent copy() { 962 BundleEntryComponent dst = new BundleEntryComponent(); 963 copyValues(dst); 964 if (link != null) { 965 dst.link = new ArrayList<BundleLinkComponent>(); 966 for (BundleLinkComponent i : link) 967 dst.link.add(i.copy()); 968 }; 969 dst.fullUrl = fullUrl == null ? null : fullUrl.copy(); 970 dst.resource = resource == null ? null : resource.copy(); 971 dst.search = search == null ? null : search.copy(); 972 dst.request = request == null ? null : request.copy(); 973 dst.response = response == null ? null : response.copy(); 974 return dst; 975 } 976 977 @Override 978 public boolean equalsDeep(Base other) { 979 if (!super.equalsDeep(other)) 980 return false; 981 if (!(other instanceof BundleEntryComponent)) 982 return false; 983 BundleEntryComponent o = (BundleEntryComponent) other; 984 return compareDeep(link, o.link, true) && compareDeep(fullUrl, o.fullUrl, true) && compareDeep(resource, o.resource, true) 985 && compareDeep(search, o.search, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) 986 ; 987 } 988 989 @Override 990 public boolean equalsShallow(Base other) { 991 if (!super.equalsShallow(other)) 992 return false; 993 if (!(other instanceof BundleEntryComponent)) 994 return false; 995 BundleEntryComponent o = (BundleEntryComponent) other; 996 return compareValues(fullUrl, o.fullUrl, true); 997 } 998 999 public boolean isEmpty() { 1000 return super.isEmpty() && (link == null || link.isEmpty()) && (fullUrl == null || fullUrl.isEmpty()) 1001 && (resource == null || resource.isEmpty()) && (search == null || search.isEmpty()) && (request == null || request.isEmpty()) 1002 && (response == null || response.isEmpty()); 1003 } 1004 1005 public String fhirType() { 1006 return "Bundle.entry"; 1007 1008 } 1009 1010 } 1011 1012 @Block() 1013 public static class BundleEntrySearchComponent extends BackboneElement implements IBaseBackboneElement { 1014 /** 1015 * Why this entry is in the result set - whether it's included as a match or because of an _include requirement. 1016 */ 1017 @Child(name = "mode", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) 1018 @Description(shortDefinition="match | include | outcome - why this is in the result set", formalDefinition="Why this entry is in the result set - whether it's included as a match or because of an _include requirement." ) 1019 protected Enumeration<SearchEntryMode> mode; 1020 1021 /** 1022 * When searching, the server's search ranking score for the entry. 1023 */ 1024 @Child(name = "score", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true) 1025 @Description(shortDefinition="Search ranking (between 0 and 1)", formalDefinition="When searching, the server's search ranking score for the entry." ) 1026 protected DecimalType score; 1027 1028 private static final long serialVersionUID = 837739866L; 1029 1030 /* 1031 * Constructor 1032 */ 1033 public BundleEntrySearchComponent() { 1034 super(); 1035 } 1036 1037 /** 1038 * @return {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 1039 */ 1040 public Enumeration<SearchEntryMode> getModeElement() { 1041 if (this.mode == null) 1042 if (Configuration.errorOnAutoCreate()) 1043 throw new Error("Attempt to auto-create BundleEntrySearchComponent.mode"); 1044 else if (Configuration.doAutoCreate()) 1045 this.mode = new Enumeration<SearchEntryMode>(new SearchEntryModeEnumFactory()); // bb 1046 return this.mode; 1047 } 1048 1049 public boolean hasModeElement() { 1050 return this.mode != null && !this.mode.isEmpty(); 1051 } 1052 1053 public boolean hasMode() { 1054 return this.mode != null && !this.mode.isEmpty(); 1055 } 1056 1057 /** 1058 * @param value {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 1059 */ 1060 public BundleEntrySearchComponent setModeElement(Enumeration<SearchEntryMode> value) { 1061 this.mode = value; 1062 return this; 1063 } 1064 1065 /** 1066 * @return Why this entry is in the result set - whether it's included as a match or because of an _include requirement. 1067 */ 1068 public SearchEntryMode getMode() { 1069 return this.mode == null ? null : this.mode.getValue(); 1070 } 1071 1072 /** 1073 * @param value Why this entry is in the result set - whether it's included as a match or because of an _include requirement. 1074 */ 1075 public BundleEntrySearchComponent setMode(SearchEntryMode value) { 1076 if (value == null) 1077 this.mode = null; 1078 else { 1079 if (this.mode == null) 1080 this.mode = new Enumeration<SearchEntryMode>(new SearchEntryModeEnumFactory()); 1081 this.mode.setValue(value); 1082 } 1083 return this; 1084 } 1085 1086 /** 1087 * @return {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value 1088 */ 1089 public DecimalType getScoreElement() { 1090 if (this.score == null) 1091 if (Configuration.errorOnAutoCreate()) 1092 throw new Error("Attempt to auto-create BundleEntrySearchComponent.score"); 1093 else if (Configuration.doAutoCreate()) 1094 this.score = new DecimalType(); // bb 1095 return this.score; 1096 } 1097 1098 public boolean hasScoreElement() { 1099 return this.score != null && !this.score.isEmpty(); 1100 } 1101 1102 public boolean hasScore() { 1103 return this.score != null && !this.score.isEmpty(); 1104 } 1105 1106 /** 1107 * @param value {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value 1108 */ 1109 public BundleEntrySearchComponent setScoreElement(DecimalType value) { 1110 this.score = value; 1111 return this; 1112 } 1113 1114 /** 1115 * @return When searching, the server's search ranking score for the entry. 1116 */ 1117 public BigDecimal getScore() { 1118 return this.score == null ? null : this.score.getValue(); 1119 } 1120 1121 /** 1122 * @param value When searching, the server's search ranking score for the entry. 1123 */ 1124 public BundleEntrySearchComponent setScore(BigDecimal value) { 1125 if (value == null) 1126 this.score = null; 1127 else { 1128 if (this.score == null) 1129 this.score = new DecimalType(); 1130 this.score.setValue(value); 1131 } 1132 return this; 1133 } 1134 1135 protected void listChildren(List<Property> childrenList) { 1136 super.listChildren(childrenList); 1137 childrenList.add(new Property("mode", "code", "Why this entry is in the result set - whether it's included as a match or because of an _include requirement.", 0, java.lang.Integer.MAX_VALUE, mode)); 1138 childrenList.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.", 0, java.lang.Integer.MAX_VALUE, score)); 1139 } 1140 1141 @Override 1142 public void setProperty(String name, Base value) throws FHIRException { 1143 if (name.equals("mode")) 1144 this.mode = new SearchEntryModeEnumFactory().fromType(value); // Enumeration<SearchEntryMode> 1145 else if (name.equals("score")) 1146 this.score = castToDecimal(value); // DecimalType 1147 else 1148 super.setProperty(name, value); 1149 } 1150 1151 @Override 1152 public Base addChild(String name) throws FHIRException { 1153 if (name.equals("mode")) { 1154 throw new FHIRException("Cannot call addChild on a primitive type Bundle.mode"); 1155 } 1156 else if (name.equals("score")) { 1157 throw new FHIRException("Cannot call addChild on a primitive type Bundle.score"); 1158 } 1159 else 1160 return super.addChild(name); 1161 } 1162 1163 public BundleEntrySearchComponent copy() { 1164 BundleEntrySearchComponent dst = new BundleEntrySearchComponent(); 1165 copyValues(dst); 1166 dst.mode = mode == null ? null : mode.copy(); 1167 dst.score = score == null ? null : score.copy(); 1168 return dst; 1169 } 1170 1171 @Override 1172 public boolean equalsDeep(Base other) { 1173 if (!super.equalsDeep(other)) 1174 return false; 1175 if (!(other instanceof BundleEntrySearchComponent)) 1176 return false; 1177 BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; 1178 return compareDeep(mode, o.mode, true) && compareDeep(score, o.score, true); 1179 } 1180 1181 @Override 1182 public boolean equalsShallow(Base other) { 1183 if (!super.equalsShallow(other)) 1184 return false; 1185 if (!(other instanceof BundleEntrySearchComponent)) 1186 return false; 1187 BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; 1188 return compareValues(mode, o.mode, true) && compareValues(score, o.score, true); 1189 } 1190 1191 public boolean isEmpty() { 1192 return super.isEmpty() && (mode == null || mode.isEmpty()) && (score == null || score.isEmpty()) 1193 ; 1194 } 1195 1196 public String fhirType() { 1197 return "Bundle.entry.search"; 1198 1199 } 1200 1201 } 1202 1203 @Block() 1204 public static class BundleEntryRequestComponent extends BackboneElement implements IBaseBackboneElement { 1205 /** 1206 * The HTTP verb for this entry in either a update history, or a transaction/ transaction response. 1207 */ 1208 @Child(name = "method", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) 1209 @Description(shortDefinition="GET | POST | PUT | DELETE", formalDefinition="The HTTP verb for this entry in either a update history, or a transaction/ transaction response." ) 1210 protected Enumeration<HTTPVerb> method; 1211 1212 /** 1213 * The URL for this entry, relative to the root (the address to which the request is posted). 1214 */ 1215 @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) 1216 @Description(shortDefinition="URL for HTTP equivalent of this entry", formalDefinition="The URL for this entry, relative to the root (the address to which the request is posted)." ) 1217 protected UriType url; 1218 1219 /** 1220 * If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). 1221 */ 1222 @Child(name = "ifNoneMatch", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) 1223 @Description(shortDefinition="For managing cache currency", formalDefinition="If the ETag values match, return a 304 Not modified status. See the API documentation for [\"Conditional Read\"](http.html#cread)." ) 1224 protected StringType ifNoneMatch; 1225 1226 /** 1227 * Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). 1228 */ 1229 @Child(name = "ifModifiedSince", type = {InstantType.class}, order=4, min=0, max=1, modifier=false, summary=true) 1230 @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread)." ) 1231 protected InstantType ifModifiedSince; 1232 1233 /** 1234 * Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). 1235 */ 1236 @Child(name = "ifMatch", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) 1237 @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency)." ) 1238 protected StringType ifMatch; 1239 1240 /** 1241 * Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). 1242 */ 1243 @Child(name = "ifNoneExist", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) 1244 @Description(shortDefinition="For conditional creates", formalDefinition="Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\"Conditional Create\"](http.html#ccreate). This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")." ) 1245 protected StringType ifNoneExist; 1246 1247 private static final long serialVersionUID = -1349769744L; 1248 1249 /* 1250 * Constructor 1251 */ 1252 public BundleEntryRequestComponent() { 1253 super(); 1254 } 1255 1256 /* 1257 * Constructor 1258 */ 1259 public BundleEntryRequestComponent(Enumeration<HTTPVerb> method, UriType url) { 1260 super(); 1261 this.method = method; 1262 this.url = url; 1263 } 1264 1265 /** 1266 * @return {@link #method} (The HTTP verb for this entry in either a update history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value 1267 */ 1268 public Enumeration<HTTPVerb> getMethodElement() { 1269 if (this.method == null) 1270 if (Configuration.errorOnAutoCreate()) 1271 throw new Error("Attempt to auto-create BundleEntryRequestComponent.method"); 1272 else if (Configuration.doAutoCreate()) 1273 this.method = new Enumeration<HTTPVerb>(new HTTPVerbEnumFactory()); // bb 1274 return this.method; 1275 } 1276 1277 public boolean hasMethodElement() { 1278 return this.method != null && !this.method.isEmpty(); 1279 } 1280 1281 public boolean hasMethod() { 1282 return this.method != null && !this.method.isEmpty(); 1283 } 1284 1285 /** 1286 * @param value {@link #method} (The HTTP verb for this entry in either a update history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value 1287 */ 1288 public BundleEntryRequestComponent setMethodElement(Enumeration<HTTPVerb> value) { 1289 this.method = value; 1290 return this; 1291 } 1292 1293 /** 1294 * @return The HTTP verb for this entry in either a update history, or a transaction/ transaction response. 1295 */ 1296 public HTTPVerb getMethod() { 1297 return this.method == null ? null : this.method.getValue(); 1298 } 1299 1300 /** 1301 * @param value The HTTP verb for this entry in either a update history, or a transaction/ transaction response. 1302 */ 1303 public BundleEntryRequestComponent setMethod(HTTPVerb value) { 1304 if (this.method == null) 1305 this.method = new Enumeration<HTTPVerb>(new HTTPVerbEnumFactory()); 1306 this.method.setValue(value); 1307 return this; 1308 } 1309 1310 /** 1311 * @return {@link #url} (The URL for this entry, relative to the root (the address to which the request is posted).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 1312 */ 1313 public UriType getUrlElement() { 1314 if (this.url == null) 1315 if (Configuration.errorOnAutoCreate()) 1316 throw new Error("Attempt to auto-create BundleEntryRequestComponent.url"); 1317 else if (Configuration.doAutoCreate()) 1318 this.url = new UriType(); // bb 1319 return this.url; 1320 } 1321 1322 public boolean hasUrlElement() { 1323 return this.url != null && !this.url.isEmpty(); 1324 } 1325 1326 public boolean hasUrl() { 1327 return this.url != null && !this.url.isEmpty(); 1328 } 1329 1330 /** 1331 * @param value {@link #url} (The URL for this entry, relative to the root (the address to which the request is posted).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 1332 */ 1333 public BundleEntryRequestComponent setUrlElement(UriType value) { 1334 this.url = value; 1335 return this; 1336 } 1337 1338 /** 1339 * @return The URL for this entry, relative to the root (the address to which the request is posted). 1340 */ 1341 public String getUrl() { 1342 return this.url == null ? null : this.url.getValue(); 1343 } 1344 1345 /** 1346 * @param value The URL for this entry, relative to the root (the address to which the request is posted). 1347 */ 1348 public BundleEntryRequestComponent setUrl(String value) { 1349 if (this.url == null) 1350 this.url = new UriType(); 1351 this.url.setValue(value); 1352 return this; 1353 } 1354 1355 /** 1356 * @return {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value 1357 */ 1358 public StringType getIfNoneMatchElement() { 1359 if (this.ifNoneMatch == null) 1360 if (Configuration.errorOnAutoCreate()) 1361 throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneMatch"); 1362 else if (Configuration.doAutoCreate()) 1363 this.ifNoneMatch = new StringType(); // bb 1364 return this.ifNoneMatch; 1365 } 1366 1367 public boolean hasIfNoneMatchElement() { 1368 return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); 1369 } 1370 1371 public boolean hasIfNoneMatch() { 1372 return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); 1373 } 1374 1375 /** 1376 * @param value {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value 1377 */ 1378 public BundleEntryRequestComponent setIfNoneMatchElement(StringType value) { 1379 this.ifNoneMatch = value; 1380 return this; 1381 } 1382 1383 /** 1384 * @return If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). 1385 */ 1386 public String getIfNoneMatch() { 1387 return this.ifNoneMatch == null ? null : this.ifNoneMatch.getValue(); 1388 } 1389 1390 /** 1391 * @param value If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). 1392 */ 1393 public BundleEntryRequestComponent setIfNoneMatch(String value) { 1394 if (Utilities.noString(value)) 1395 this.ifNoneMatch = null; 1396 else { 1397 if (this.ifNoneMatch == null) 1398 this.ifNoneMatch = new StringType(); 1399 this.ifNoneMatch.setValue(value); 1400 } 1401 return this; 1402 } 1403 1404 /** 1405 * @return {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value 1406 */ 1407 public InstantType getIfModifiedSinceElement() { 1408 if (this.ifModifiedSince == null) 1409 if (Configuration.errorOnAutoCreate()) 1410 throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifModifiedSince"); 1411 else if (Configuration.doAutoCreate()) 1412 this.ifModifiedSince = new InstantType(); // bb 1413 return this.ifModifiedSince; 1414 } 1415 1416 public boolean hasIfModifiedSinceElement() { 1417 return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); 1418 } 1419 1420 public boolean hasIfModifiedSince() { 1421 return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); 1422 } 1423 1424 /** 1425 * @param value {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value 1426 */ 1427 public BundleEntryRequestComponent setIfModifiedSinceElement(InstantType value) { 1428 this.ifModifiedSince = value; 1429 return this; 1430 } 1431 1432 /** 1433 * @return Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). 1434 */ 1435 public Date getIfModifiedSince() { 1436 return this.ifModifiedSince == null ? null : this.ifModifiedSince.getValue(); 1437 } 1438 1439 /** 1440 * @param value Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). 1441 */ 1442 public BundleEntryRequestComponent setIfModifiedSince(Date value) { 1443 if (value == null) 1444 this.ifModifiedSince = null; 1445 else { 1446 if (this.ifModifiedSince == null) 1447 this.ifModifiedSince = new InstantType(); 1448 this.ifModifiedSince.setValue(value); 1449 } 1450 return this; 1451 } 1452 1453 /** 1454 * @return {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value 1455 */ 1456 public StringType getIfMatchElement() { 1457 if (this.ifMatch == null) 1458 if (Configuration.errorOnAutoCreate()) 1459 throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifMatch"); 1460 else if (Configuration.doAutoCreate()) 1461 this.ifMatch = new StringType(); // bb 1462 return this.ifMatch; 1463 } 1464 1465 public boolean hasIfMatchElement() { 1466 return this.ifMatch != null && !this.ifMatch.isEmpty(); 1467 } 1468 1469 public boolean hasIfMatch() { 1470 return this.ifMatch != null && !this.ifMatch.isEmpty(); 1471 } 1472 1473 /** 1474 * @param value {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value 1475 */ 1476 public BundleEntryRequestComponent setIfMatchElement(StringType value) { 1477 this.ifMatch = value; 1478 return this; 1479 } 1480 1481 /** 1482 * @return Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). 1483 */ 1484 public String getIfMatch() { 1485 return this.ifMatch == null ? null : this.ifMatch.getValue(); 1486 } 1487 1488 /** 1489 * @param value Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). 1490 */ 1491 public BundleEntryRequestComponent setIfMatch(String value) { 1492 if (Utilities.noString(value)) 1493 this.ifMatch = null; 1494 else { 1495 if (this.ifMatch == null) 1496 this.ifMatch = new StringType(); 1497 this.ifMatch.setValue(value); 1498 } 1499 return this; 1500 } 1501 1502 /** 1503 * @return {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value 1504 */ 1505 public StringType getIfNoneExistElement() { 1506 if (this.ifNoneExist == null) 1507 if (Configuration.errorOnAutoCreate()) 1508 throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneExist"); 1509 else if (Configuration.doAutoCreate()) 1510 this.ifNoneExist = new StringType(); // bb 1511 return this.ifNoneExist; 1512 } 1513 1514 public boolean hasIfNoneExistElement() { 1515 return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); 1516 } 1517 1518 public boolean hasIfNoneExist() { 1519 return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); 1520 } 1521 1522 /** 1523 * @param value {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value 1524 */ 1525 public BundleEntryRequestComponent setIfNoneExistElement(StringType value) { 1526 this.ifNoneExist = value; 1527 return this; 1528 } 1529 1530 /** 1531 * @return Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). 1532 */ 1533 public String getIfNoneExist() { 1534 return this.ifNoneExist == null ? null : this.ifNoneExist.getValue(); 1535 } 1536 1537 /** 1538 * @param value Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). 1539 */ 1540 public BundleEntryRequestComponent setIfNoneExist(String value) { 1541 if (Utilities.noString(value)) 1542 this.ifNoneExist = null; 1543 else { 1544 if (this.ifNoneExist == null) 1545 this.ifNoneExist = new StringType(); 1546 this.ifNoneExist.setValue(value); 1547 } 1548 return this; 1549 } 1550 1551 protected void listChildren(List<Property> childrenList) { 1552 super.listChildren(childrenList); 1553 childrenList.add(new Property("method", "code", "The HTTP verb for this entry in either a update history, or a transaction/ transaction response.", 0, java.lang.Integer.MAX_VALUE, method)); 1554 childrenList.add(new Property("url", "uri", "The URL for this entry, relative to the root (the address to which the request is posted).", 0, java.lang.Integer.MAX_VALUE, url)); 1555 childrenList.add(new Property("ifNoneMatch", "string", "If the ETag values match, return a 304 Not modified status. See the API documentation for [\"Conditional Read\"](http.html#cread).", 0, java.lang.Integer.MAX_VALUE, ifNoneMatch)); 1556 childrenList.add(new Property("ifModifiedSince", "instant", "Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread).", 0, java.lang.Integer.MAX_VALUE, ifModifiedSince)); 1557 childrenList.add(new Property("ifMatch", "string", "Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency).", 0, java.lang.Integer.MAX_VALUE, ifMatch)); 1558 childrenList.add(new Property("ifNoneExist", "string", "Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\"Conditional Create\"](http.html#ccreate). This is just the query portion of the URL - what follows the \"?\" (not including the \"?\").", 0, java.lang.Integer.MAX_VALUE, ifNoneExist)); 1559 } 1560 1561 @Override 1562 public void setProperty(String name, Base value) throws FHIRException { 1563 if (name.equals("method")) 1564 this.method = new HTTPVerbEnumFactory().fromType(value); // Enumeration<HTTPVerb> 1565 else if (name.equals("url")) 1566 this.url = castToUri(value); // UriType 1567 else if (name.equals("ifNoneMatch")) 1568 this.ifNoneMatch = castToString(value); // StringType 1569 else if (name.equals("ifModifiedSince")) 1570 this.ifModifiedSince = castToInstant(value); // InstantType 1571 else if (name.equals("ifMatch")) 1572 this.ifMatch = castToString(value); // StringType 1573 else if (name.equals("ifNoneExist")) 1574 this.ifNoneExist = castToString(value); // StringType 1575 else 1576 super.setProperty(name, value); 1577 } 1578 1579 @Override 1580 public Base addChild(String name) throws FHIRException { 1581 if (name.equals("method")) { 1582 throw new FHIRException("Cannot call addChild on a primitive type Bundle.method"); 1583 } 1584 else if (name.equals("url")) { 1585 throw new FHIRException("Cannot call addChild on a primitive type Bundle.url"); 1586 } 1587 else if (name.equals("ifNoneMatch")) { 1588 throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifNoneMatch"); 1589 } 1590 else if (name.equals("ifModifiedSince")) { 1591 throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifModifiedSince"); 1592 } 1593 else if (name.equals("ifMatch")) { 1594 throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifMatch"); 1595 } 1596 else if (name.equals("ifNoneExist")) { 1597 throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifNoneExist"); 1598 } 1599 else 1600 return super.addChild(name); 1601 } 1602 1603 public BundleEntryRequestComponent copy() { 1604 BundleEntryRequestComponent dst = new BundleEntryRequestComponent(); 1605 copyValues(dst); 1606 dst.method = method == null ? null : method.copy(); 1607 dst.url = url == null ? null : url.copy(); 1608 dst.ifNoneMatch = ifNoneMatch == null ? null : ifNoneMatch.copy(); 1609 dst.ifModifiedSince = ifModifiedSince == null ? null : ifModifiedSince.copy(); 1610 dst.ifMatch = ifMatch == null ? null : ifMatch.copy(); 1611 dst.ifNoneExist = ifNoneExist == null ? null : ifNoneExist.copy(); 1612 return dst; 1613 } 1614 1615 @Override 1616 public boolean equalsDeep(Base other) { 1617 if (!super.equalsDeep(other)) 1618 return false; 1619 if (!(other instanceof BundleEntryRequestComponent)) 1620 return false; 1621 BundleEntryRequestComponent o = (BundleEntryRequestComponent) other; 1622 return compareDeep(method, o.method, true) && compareDeep(url, o.url, true) && compareDeep(ifNoneMatch, o.ifNoneMatch, true) 1623 && compareDeep(ifModifiedSince, o.ifModifiedSince, true) && compareDeep(ifMatch, o.ifMatch, true) 1624 && compareDeep(ifNoneExist, o.ifNoneExist, true); 1625 } 1626 1627 @Override 1628 public boolean equalsShallow(Base other) { 1629 if (!super.equalsShallow(other)) 1630 return false; 1631 if (!(other instanceof BundleEntryRequestComponent)) 1632 return false; 1633 BundleEntryRequestComponent o = (BundleEntryRequestComponent) other; 1634 return compareValues(method, o.method, true) && compareValues(url, o.url, true) && compareValues(ifNoneMatch, o.ifNoneMatch, true) 1635 && compareValues(ifModifiedSince, o.ifModifiedSince, true) && compareValues(ifMatch, o.ifMatch, true) 1636 && compareValues(ifNoneExist, o.ifNoneExist, true); 1637 } 1638 1639 public boolean isEmpty() { 1640 return super.isEmpty() && (method == null || method.isEmpty()) && (url == null || url.isEmpty()) 1641 && (ifNoneMatch == null || ifNoneMatch.isEmpty()) && (ifModifiedSince == null || ifModifiedSince.isEmpty()) 1642 && (ifMatch == null || ifMatch.isEmpty()) && (ifNoneExist == null || ifNoneExist.isEmpty()) 1643 ; 1644 } 1645 1646 public String fhirType() { 1647 return "Bundle.entry.request"; 1648 1649 } 1650 1651 } 1652 1653 @Block() 1654 public static class BundleEntryResponseComponent extends BackboneElement implements IBaseBackboneElement { 1655 /** 1656 * The status code returned by processing this entry. 1657 */ 1658 @Child(name = "status", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) 1659 @Description(shortDefinition="Status return code for entry", formalDefinition="The status code returned by processing this entry." ) 1660 protected StringType status; 1661 1662 /** 1663 * The location header created by processing this operation. 1664 */ 1665 @Child(name = "location", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) 1666 @Description(shortDefinition="The location, if the operation returns a location", formalDefinition="The location header created by processing this operation." ) 1667 protected UriType location; 1668 1669 /** 1670 * The etag for the resource, it the operation for the entry produced a versioned resource. 1671 */ 1672 @Child(name = "etag", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) 1673 @Description(shortDefinition="The etag for the resource (if relevant)", formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource." ) 1674 protected StringType etag; 1675 1676 /** 1677 * The date/time that the resource was modified on the server. 1678 */ 1679 @Child(name = "lastModified", type = {InstantType.class}, order=4, min=0, max=1, modifier=false, summary=true) 1680 @Description(shortDefinition="Server's date time modified", formalDefinition="The date/time that the resource was modified on the server." ) 1681 protected InstantType lastModified; 1682 1683 private static final long serialVersionUID = -1526413234L; 1684 1685 /* 1686 * Constructor 1687 */ 1688 public BundleEntryResponseComponent() { 1689 super(); 1690 } 1691 1692 /* 1693 * Constructor 1694 */ 1695 public BundleEntryResponseComponent(StringType status) { 1696 super(); 1697 this.status = status; 1698 } 1699 1700 /** 1701 * @return {@link #status} (The status code returned by processing this entry.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 1702 */ 1703 public StringType getStatusElement() { 1704 if (this.status == null) 1705 if (Configuration.errorOnAutoCreate()) 1706 throw new Error("Attempt to auto-create BundleEntryResponseComponent.status"); 1707 else if (Configuration.doAutoCreate()) 1708 this.status = new StringType(); // bb 1709 return this.status; 1710 } 1711 1712 public boolean hasStatusElement() { 1713 return this.status != null && !this.status.isEmpty(); 1714 } 1715 1716 public boolean hasStatus() { 1717 return this.status != null && !this.status.isEmpty(); 1718 } 1719 1720 /** 1721 * @param value {@link #status} (The status code returned by processing this entry.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 1722 */ 1723 public BundleEntryResponseComponent setStatusElement(StringType value) { 1724 this.status = value; 1725 return this; 1726 } 1727 1728 /** 1729 * @return The status code returned by processing this entry. 1730 */ 1731 public String getStatus() { 1732 return this.status == null ? null : this.status.getValue(); 1733 } 1734 1735 /** 1736 * @param value The status code returned by processing this entry. 1737 */ 1738 public BundleEntryResponseComponent setStatus(String value) { 1739 if (this.status == null) 1740 this.status = new StringType(); 1741 this.status.setValue(value); 1742 return this; 1743 } 1744 1745 /** 1746 * @return {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value 1747 */ 1748 public UriType getLocationElement() { 1749 if (this.location == null) 1750 if (Configuration.errorOnAutoCreate()) 1751 throw new Error("Attempt to auto-create BundleEntryResponseComponent.location"); 1752 else if (Configuration.doAutoCreate()) 1753 this.location = new UriType(); // bb 1754 return this.location; 1755 } 1756 1757 public boolean hasLocationElement() { 1758 return this.location != null && !this.location.isEmpty(); 1759 } 1760 1761 public boolean hasLocation() { 1762 return this.location != null && !this.location.isEmpty(); 1763 } 1764 1765 /** 1766 * @param value {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value 1767 */ 1768 public BundleEntryResponseComponent setLocationElement(UriType value) { 1769 this.location = value; 1770 return this; 1771 } 1772 1773 /** 1774 * @return The location header created by processing this operation. 1775 */ 1776 public String getLocation() { 1777 return this.location == null ? null : this.location.getValue(); 1778 } 1779 1780 /** 1781 * @param value The location header created by processing this operation. 1782 */ 1783 public BundleEntryResponseComponent setLocation(String value) { 1784 if (Utilities.noString(value)) 1785 this.location = null; 1786 else { 1787 if (this.location == null) 1788 this.location = new UriType(); 1789 this.location.setValue(value); 1790 } 1791 return this; 1792 } 1793 1794 /** 1795 * @return {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value 1796 */ 1797 public StringType getEtagElement() { 1798 if (this.etag == null) 1799 if (Configuration.errorOnAutoCreate()) 1800 throw new Error("Attempt to auto-create BundleEntryResponseComponent.etag"); 1801 else if (Configuration.doAutoCreate()) 1802 this.etag = new StringType(); // bb 1803 return this.etag; 1804 } 1805 1806 public boolean hasEtagElement() { 1807 return this.etag != null && !this.etag.isEmpty(); 1808 } 1809 1810 public boolean hasEtag() { 1811 return this.etag != null && !this.etag.isEmpty(); 1812 } 1813 1814 /** 1815 * @param value {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value 1816 */ 1817 public BundleEntryResponseComponent setEtagElement(StringType value) { 1818 this.etag = value; 1819 return this; 1820 } 1821 1822 /** 1823 * @return The etag for the resource, it the operation for the entry produced a versioned resource. 1824 */ 1825 public String getEtag() { 1826 return this.etag == null ? null : this.etag.getValue(); 1827 } 1828 1829 /** 1830 * @param value The etag for the resource, it the operation for the entry produced a versioned resource. 1831 */ 1832 public BundleEntryResponseComponent setEtag(String value) { 1833 if (Utilities.noString(value)) 1834 this.etag = null; 1835 else { 1836 if (this.etag == null) 1837 this.etag = new StringType(); 1838 this.etag.setValue(value); 1839 } 1840 return this; 1841 } 1842 1843 /** 1844 * @return {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value 1845 */ 1846 public InstantType getLastModifiedElement() { 1847 if (this.lastModified == null) 1848 if (Configuration.errorOnAutoCreate()) 1849 throw new Error("Attempt to auto-create BundleEntryResponseComponent.lastModified"); 1850 else if (Configuration.doAutoCreate()) 1851 this.lastModified = new InstantType(); // bb 1852 return this.lastModified; 1853 } 1854 1855 public boolean hasLastModifiedElement() { 1856 return this.lastModified != null && !this.lastModified.isEmpty(); 1857 } 1858 1859 public boolean hasLastModified() { 1860 return this.lastModified != null && !this.lastModified.isEmpty(); 1861 } 1862 1863 /** 1864 * @param value {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value 1865 */ 1866 public BundleEntryResponseComponent setLastModifiedElement(InstantType value) { 1867 this.lastModified = value; 1868 return this; 1869 } 1870 1871 /** 1872 * @return The date/time that the resource was modified on the server. 1873 */ 1874 public Date getLastModified() { 1875 return this.lastModified == null ? null : this.lastModified.getValue(); 1876 } 1877 1878 /** 1879 * @param value The date/time that the resource was modified on the server. 1880 */ 1881 public BundleEntryResponseComponent setLastModified(Date value) { 1882 if (value == null) 1883 this.lastModified = null; 1884 else { 1885 if (this.lastModified == null) 1886 this.lastModified = new InstantType(); 1887 this.lastModified.setValue(value); 1888 } 1889 return this; 1890 } 1891 1892 protected void listChildren(List<Property> childrenList) { 1893 super.listChildren(childrenList); 1894 childrenList.add(new Property("status", "string", "The status code returned by processing this entry.", 0, java.lang.Integer.MAX_VALUE, status)); 1895 childrenList.add(new Property("location", "uri", "The location header created by processing this operation.", 0, java.lang.Integer.MAX_VALUE, location)); 1896 childrenList.add(new Property("etag", "string", "The etag for the resource, it the operation for the entry produced a versioned resource.", 0, java.lang.Integer.MAX_VALUE, etag)); 1897 childrenList.add(new Property("lastModified", "instant", "The date/time that the resource was modified on the server.", 0, java.lang.Integer.MAX_VALUE, lastModified)); 1898 } 1899 1900 @Override 1901 public void setProperty(String name, Base value) throws FHIRException { 1902 if (name.equals("status")) 1903 this.status = castToString(value); // StringType 1904 else if (name.equals("location")) 1905 this.location = castToUri(value); // UriType 1906 else if (name.equals("etag")) 1907 this.etag = castToString(value); // StringType 1908 else if (name.equals("lastModified")) 1909 this.lastModified = castToInstant(value); // InstantType 1910 else 1911 super.setProperty(name, value); 1912 } 1913 1914 @Override 1915 public Base addChild(String name) throws FHIRException { 1916 if (name.equals("status")) { 1917 throw new FHIRException("Cannot call addChild on a primitive type Bundle.status"); 1918 } 1919 else if (name.equals("location")) { 1920 throw new FHIRException("Cannot call addChild on a primitive type Bundle.location"); 1921 } 1922 else if (name.equals("etag")) { 1923 throw new FHIRException("Cannot call addChild on a primitive type Bundle.etag"); 1924 } 1925 else if (name.equals("lastModified")) { 1926 throw new FHIRException("Cannot call addChild on a primitive type Bundle.lastModified"); 1927 } 1928 else 1929 return super.addChild(name); 1930 } 1931 1932 public BundleEntryResponseComponent copy() { 1933 BundleEntryResponseComponent dst = new BundleEntryResponseComponent(); 1934 copyValues(dst); 1935 dst.status = status == null ? null : status.copy(); 1936 dst.location = location == null ? null : location.copy(); 1937 dst.etag = etag == null ? null : etag.copy(); 1938 dst.lastModified = lastModified == null ? null : lastModified.copy(); 1939 return dst; 1940 } 1941 1942 @Override 1943 public boolean equalsDeep(Base other) { 1944 if (!super.equalsDeep(other)) 1945 return false; 1946 if (!(other instanceof BundleEntryResponseComponent)) 1947 return false; 1948 BundleEntryResponseComponent o = (BundleEntryResponseComponent) other; 1949 return compareDeep(status, o.status, true) && compareDeep(location, o.location, true) && compareDeep(etag, o.etag, true) 1950 && compareDeep(lastModified, o.lastModified, true); 1951 } 1952 1953 @Override 1954 public boolean equalsShallow(Base other) { 1955 if (!super.equalsShallow(other)) 1956 return false; 1957 if (!(other instanceof BundleEntryResponseComponent)) 1958 return false; 1959 BundleEntryResponseComponent o = (BundleEntryResponseComponent) other; 1960 return compareValues(status, o.status, true) && compareValues(location, o.location, true) && compareValues(etag, o.etag, true) 1961 && compareValues(lastModified, o.lastModified, true); 1962 } 1963 1964 public boolean isEmpty() { 1965 return super.isEmpty() && (status == null || status.isEmpty()) && (location == null || location.isEmpty()) 1966 && (etag == null || etag.isEmpty()) && (lastModified == null || lastModified.isEmpty()); 1967 } 1968 1969 public String fhirType() { 1970 return "Bundle.entry.response"; 1971 1972 } 1973 1974 } 1975 1976 /** 1977 * Indicates the purpose of this bundle- how it was intended to be used. 1978 */ 1979 @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) 1980 @Description(shortDefinition="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", formalDefinition="Indicates the purpose of this bundle- how it was intended to be used." ) 1981 protected Enumeration<BundleType> type; 1982 1983 /** 1984 * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). 1985 */ 1986 @Child(name = "total", type = {UnsignedIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) 1987 @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." ) 1988 protected UnsignedIntType total; 1989 1990 /** 1991 * A series of links that provide context to this bundle. 1992 */ 1993 @Child(name = "link", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1994 @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." ) 1995 protected List<BundleLinkComponent> link; 1996 1997 /** 1998 * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). 1999 */ 2000 @Child(name = "entry", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2001 @Description(shortDefinition="Entry in the bundle - will have a resource, or information", formalDefinition="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." ) 2002 protected List<BundleEntryComponent> entry; 2003 2004 /** 2005 * Digital Signature - base64 encoded. XML DigSIg or a JWT. 2006 */ 2007 @Child(name = "signature", type = {Signature.class}, order=4, min=0, max=1, modifier=false, summary=true) 2008 @Description(shortDefinition="Digital Signature", formalDefinition="Digital Signature - base64 encoded. XML DigSIg or a JWT." ) 2009 protected Signature signature; 2010 2011 private static final long serialVersionUID = -2041954721L; 2012 2013 /* 2014 * Constructor 2015 */ 2016 public Bundle() { 2017 super(); 2018 } 2019 2020 /* 2021 * Constructor 2022 */ 2023 public Bundle(Enumeration<BundleType> type) { 2024 super(); 2025 this.type = type; 2026 } 2027 2028 /** 2029 * @return {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 2030 */ 2031 public Enumeration<BundleType> getTypeElement() { 2032 if (this.type == null) 2033 if (Configuration.errorOnAutoCreate()) 2034 throw new Error("Attempt to auto-create Bundle.type"); 2035 else if (Configuration.doAutoCreate()) 2036 this.type = new Enumeration<BundleType>(new BundleTypeEnumFactory()); // bb 2037 return this.type; 2038 } 2039 2040 public boolean hasTypeElement() { 2041 return this.type != null && !this.type.isEmpty(); 2042 } 2043 2044 public boolean hasType() { 2045 return this.type != null && !this.type.isEmpty(); 2046 } 2047 2048 /** 2049 * @param value {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 2050 */ 2051 public Bundle setTypeElement(Enumeration<BundleType> value) { 2052 this.type = value; 2053 return this; 2054 } 2055 2056 /** 2057 * @return Indicates the purpose of this bundle- how it was intended to be used. 2058 */ 2059 public BundleType getType() { 2060 return this.type == null ? null : this.type.getValue(); 2061 } 2062 2063 /** 2064 * @param value Indicates the purpose of this bundle- how it was intended to be used. 2065 */ 2066 public Bundle setType(BundleType value) { 2067 if (this.type == null) 2068 this.type = new Enumeration<BundleType>(new BundleTypeEnumFactory()); 2069 this.type.setValue(value); 2070 return this; 2071 } 2072 2073 /** 2074 * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value 2075 */ 2076 public UnsignedIntType getTotalElement() { 2077 if (this.total == null) 2078 if (Configuration.errorOnAutoCreate()) 2079 throw new Error("Attempt to auto-create Bundle.total"); 2080 else if (Configuration.doAutoCreate()) 2081 this.total = new UnsignedIntType(); // bb 2082 return this.total; 2083 } 2084 2085 public boolean hasTotalElement() { 2086 return this.total != null && !this.total.isEmpty(); 2087 } 2088 2089 public boolean hasTotal() { 2090 return this.total != null && !this.total.isEmpty(); 2091 } 2092 2093 /** 2094 * @param value {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value 2095 */ 2096 public Bundle setTotalElement(UnsignedIntType value) { 2097 this.total = value; 2098 return this; 2099 } 2100 2101 /** 2102 * @return If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). 2103 */ 2104 public int getTotal() { 2105 return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue(); 2106 } 2107 2108 /** 2109 * @param value If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). 2110 */ 2111 public Bundle setTotal(int value) { 2112 if (this.total == null) 2113 this.total = new UnsignedIntType(); 2114 this.total.setValue(value); 2115 return this; 2116 } 2117 2118 /** 2119 * @return {@link #link} (A series of links that provide context to this bundle.) 2120 */ 2121 public List<BundleLinkComponent> getLink() { 2122 if (this.link == null) 2123 this.link = new ArrayList<BundleLinkComponent>(); 2124 return this.link; 2125 } 2126 2127 public boolean hasLink() { 2128 if (this.link == null) 2129 return false; 2130 for (BundleLinkComponent item : this.link) 2131 if (!item.isEmpty()) 2132 return true; 2133 return false; 2134 } 2135 2136 /** 2137 * @return {@link #link} (A series of links that provide context to this bundle.) 2138 */ 2139 // syntactic sugar 2140 public BundleLinkComponent addLink() { //3 2141 BundleLinkComponent t = new BundleLinkComponent(); 2142 if (this.link == null) 2143 this.link = new ArrayList<BundleLinkComponent>(); 2144 this.link.add(t); 2145 return t; 2146 } 2147 2148 // syntactic sugar 2149 public Bundle addLink(BundleLinkComponent t) { //3 2150 if (t == null) 2151 return this; 2152 if (this.link == null) 2153 this.link = new ArrayList<BundleLinkComponent>(); 2154 this.link.add(t); 2155 return this; 2156 } 2157 2158 /** 2159 * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) 2160 */ 2161 public List<BundleEntryComponent> getEntry() { 2162 if (this.entry == null) 2163 this.entry = new ArrayList<BundleEntryComponent>(); 2164 return this.entry; 2165 } 2166 2167 public boolean hasEntry() { 2168 if (this.entry == null) 2169 return false; 2170 for (BundleEntryComponent item : this.entry) 2171 if (!item.isEmpty()) 2172 return true; 2173 return false; 2174 } 2175 2176 /** 2177 * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) 2178 */ 2179 // syntactic sugar 2180 public BundleEntryComponent addEntry() { //3 2181 BundleEntryComponent t = new BundleEntryComponent(); 2182 if (this.entry == null) 2183 this.entry = new ArrayList<BundleEntryComponent>(); 2184 this.entry.add(t); 2185 return t; 2186 } 2187 2188 // syntactic sugar 2189 public Bundle addEntry(BundleEntryComponent t) { //3 2190 if (t == null) 2191 return this; 2192 if (this.entry == null) 2193 this.entry = new ArrayList<BundleEntryComponent>(); 2194 this.entry.add(t); 2195 return this; 2196 } 2197 2198 /** 2199 * @return {@link #signature} (Digital Signature - base64 encoded. XML DigSIg or a JWT.) 2200 */ 2201 public Signature getSignature() { 2202 if (this.signature == null) 2203 if (Configuration.errorOnAutoCreate()) 2204 throw new Error("Attempt to auto-create Bundle.signature"); 2205 else if (Configuration.doAutoCreate()) 2206 this.signature = new Signature(); // cc 2207 return this.signature; 2208 } 2209 2210 public boolean hasSignature() { 2211 return this.signature != null && !this.signature.isEmpty(); 2212 } 2213 2214 /** 2215 * @param value {@link #signature} (Digital Signature - base64 encoded. XML DigSIg or a JWT.) 2216 */ 2217 public Bundle setSignature(Signature value) { 2218 this.signature = value; 2219 return this; 2220 } 2221 2222 /** 2223 * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. 2224 * If no link is found which matches the given relation, returns <code>null</code>. If more than one 2225 * link is found which matches the given relation, returns the first matching BundleLinkComponent. 2226 * 2227 * @param theRelation 2228 * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. 2229 * @return Returns a matching BundleLinkComponent, or <code>null</code> 2230 * @see IBaseBundle#LINK_NEXT 2231 * @see IBaseBundle#LINK_PREV 2232 * @see IBaseBundle#LINK_SELF 2233 */ 2234 public BundleLinkComponent getLink(String theRelation) { 2235 org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); 2236 for (BundleLinkComponent next : getLink()) { 2237 if (theRelation.equals(next.getRelation())) { 2238 return next; 2239 } 2240 } 2241 return null; 2242 } 2243 2244 /** 2245 * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. 2246 * If no link is found which matches the given relation, creates a new BundleLinkComponent with the 2247 * given relation and adds it to this Bundle. If more than one 2248 * link is found which matches the given relation, returns the first matching BundleLinkComponent. 2249 * 2250 * @param theRelation 2251 * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. 2252 * @return Returns a matching BundleLinkComponent, or <code>null</code> 2253 * @see IBaseBundle#LINK_NEXT 2254 * @see IBaseBundle#LINK_PREV 2255 * @see IBaseBundle#LINK_SELF 2256 */ 2257 public BundleLinkComponent getLinkOrCreate(String theRelation) { 2258 org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); 2259 for (BundleLinkComponent next : getLink()) { 2260 if (theRelation.equals(next.getRelation())) { 2261 return next; 2262 } 2263 } 2264 BundleLinkComponent retVal = new BundleLinkComponent(); 2265 retVal.setRelation(theRelation); 2266 getLink().add(retVal); 2267 return retVal; 2268 } 2269 protected void listChildren(List<Property> childrenList) { 2270 super.listChildren(childrenList); 2271 childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle- how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type)); 2272 childrenList.add(new Property("total", "unsignedInt", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total)); 2273 childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link)); 2274 childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).", 0, java.lang.Integer.MAX_VALUE, entry)); 2275 childrenList.add(new Property("signature", "Signature", "Digital Signature - base64 encoded. XML DigSIg or a JWT.", 0, java.lang.Integer.MAX_VALUE, signature)); 2276 } 2277 2278 @Override 2279 public void setProperty(String name, Base value) throws FHIRException { 2280 if (name.equals("type")) 2281 this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration<BundleType> 2282 else if (name.equals("total")) 2283 this.total = castToUnsignedInt(value); // UnsignedIntType 2284 else if (name.equals("link")) 2285 this.getLink().add((BundleLinkComponent) value); 2286 else if (name.equals("entry")) 2287 this.getEntry().add((BundleEntryComponent) value); 2288 else if (name.equals("signature")) 2289 this.signature = castToSignature(value); // Signature 2290 else 2291 super.setProperty(name, value); 2292 } 2293 2294 @Override 2295 public Base addChild(String name) throws FHIRException { 2296 if (name.equals("type")) { 2297 throw new FHIRException("Cannot call addChild on a primitive type Bundle.type"); 2298 } 2299 else if (name.equals("total")) { 2300 throw new FHIRException("Cannot call addChild on a primitive type Bundle.total"); 2301 } 2302 else if (name.equals("link")) { 2303 return addLink(); 2304 } 2305 else if (name.equals("entry")) { 2306 return addEntry(); 2307 } 2308 else if (name.equals("signature")) { 2309 this.signature = new Signature(); 2310 return this.signature; 2311 } 2312 else 2313 return super.addChild(name); 2314 } 2315 2316 public String fhirType() { 2317 return "Bundle"; 2318 2319 } 2320 2321 public Bundle copy() { 2322 Bundle dst = new Bundle(); 2323 copyValues(dst); 2324 dst.type = type == null ? null : type.copy(); 2325 dst.total = total == null ? null : total.copy(); 2326 if (link != null) { 2327 dst.link = new ArrayList<BundleLinkComponent>(); 2328 for (BundleLinkComponent i : link) 2329 dst.link.add(i.copy()); 2330 }; 2331 if (entry != null) { 2332 dst.entry = new ArrayList<BundleEntryComponent>(); 2333 for (BundleEntryComponent i : entry) 2334 dst.entry.add(i.copy()); 2335 }; 2336 dst.signature = signature == null ? null : signature.copy(); 2337 return dst; 2338 } 2339 2340 protected Bundle typedCopy() { 2341 return copy(); 2342 } 2343 2344 @Override 2345 public boolean equalsDeep(Base other) { 2346 if (!super.equalsDeep(other)) 2347 return false; 2348 if (!(other instanceof Bundle)) 2349 return false; 2350 Bundle o = (Bundle) other; 2351 return compareDeep(type, o.type, true) && compareDeep(total, o.total, true) && compareDeep(link, o.link, true) 2352 && compareDeep(entry, o.entry, true) && compareDeep(signature, o.signature, true); 2353 } 2354 2355 @Override 2356 public boolean equalsShallow(Base other) { 2357 if (!super.equalsShallow(other)) 2358 return false; 2359 if (!(other instanceof Bundle)) 2360 return false; 2361 Bundle o = (Bundle) other; 2362 return compareValues(type, o.type, true) && compareValues(total, o.total, true); 2363 } 2364 2365 public boolean isEmpty() { 2366 return super.isEmpty() && (type == null || type.isEmpty()) && (total == null || total.isEmpty()) 2367 && (link == null || link.isEmpty()) && (entry == null || entry.isEmpty()) && (signature == null || signature.isEmpty()) 2368 ; 2369 } 2370 2371 @Override 2372 public ResourceType getResourceType() { 2373 return ResourceType.Bundle; 2374 } 2375 2376 @SearchParamDefinition(name="composition", path="Bundle.entry.resource.item(0)", description="The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to searches its contents", type="reference" ) 2377 public static final String SP_COMPOSITION = "composition"; 2378 @SearchParamDefinition(name="type", path="Bundle.type", description="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", type="token" ) 2379 public static final String SP_TYPE = "type"; 2380 @SearchParamDefinition(name="message", path="Bundle.entry.resource.item(0)", description="The first resource in the bundle, if the bundle type is \"message\" - this is a message header, and this parameter provides access to search its contents", type="reference" ) 2381 public static final String SP_MESSAGE = "message"; 2382 2383}