001package org.hl7.fhir.r4.model;
002
003import java.math.BigDecimal;
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.instance.model.api.IBaseBundle;
042import org.hl7.fhir.utilities.Utilities;
043
044import ca.uhn.fhir.model.api.annotation.Block;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049
050/**
051 * A container for a collection of resources.
052 */
053@ResourceDef(name = "Bundle", profile = "http://hl7.org/fhir/StructureDefinition/Bundle")
054public class Bundle extends Resource implements IBaseBundle {
055
056  public enum BundleType {
057    /**
058     * The bundle is a document. The first resource is a Composition.
059     */
060    DOCUMENT,
061    /**
062     * The bundle is a message. The first resource is a MessageHeader.
063     */
064    MESSAGE,
065    /**
066     * The bundle is a transaction - intended to be processed by a server as an
067     * atomic commit.
068     */
069    TRANSACTION,
070    /**
071     * The bundle is a transaction response. Because the response is a transaction
072     * response, the transaction has succeeded, and all responses are error free.
073     */
074    TRANSACTIONRESPONSE,
075    /**
076     * The bundle is a set of actions - intended to be processed by a server as a
077     * group of independent actions.
078     */
079    BATCH,
080    /**
081     * The bundle is a batch response. Note that as a batch, some responses may
082     * indicate failure and others success.
083     */
084    BATCHRESPONSE,
085    /**
086     * The bundle is a list of resources from a history interaction on a server.
087     */
088    HISTORY,
089    /**
090     * The bundle is a list of resources returned as a result of a search/query
091     * interaction, operation, or message.
092     */
093    SEARCHSET,
094    /**
095     * The bundle is a set of resources collected into a single package for ease of
096     * distribution that imposes no processing obligations or behavioral rules
097     * beyond persistence.
098     */
099    COLLECTION,
100    /**
101     * added to help the parsers with the generic types
102     */
103    NULL;
104
105    public static BundleType fromCode(String codeString) throws FHIRException {
106      if (codeString == null || "".equals(codeString))
107        return null;
108      if ("document".equals(codeString))
109        return DOCUMENT;
110      if ("message".equals(codeString))
111        return MESSAGE;
112      if ("transaction".equals(codeString))
113        return TRANSACTION;
114      if ("transaction-response".equals(codeString))
115        return TRANSACTIONRESPONSE;
116      if ("batch".equals(codeString))
117        return BATCH;
118      if ("batch-response".equals(codeString))
119        return BATCHRESPONSE;
120      if ("history".equals(codeString))
121        return HISTORY;
122      if ("searchset".equals(codeString))
123        return SEARCHSET;
124      if ("collection".equals(codeString))
125        return COLLECTION;
126      if (Configuration.isAcceptInvalidEnums())
127        return null;
128      else
129        throw new FHIRException("Unknown BundleType code '" + codeString + "'");
130    }
131
132    public String toCode() {
133      switch (this) {
134      case DOCUMENT:
135        return "document";
136      case MESSAGE:
137        return "message";
138      case TRANSACTION:
139        return "transaction";
140      case TRANSACTIONRESPONSE:
141        return "transaction-response";
142      case BATCH:
143        return "batch";
144      case BATCHRESPONSE:
145        return "batch-response";
146      case HISTORY:
147        return "history";
148      case SEARCHSET:
149        return "searchset";
150      case COLLECTION:
151        return "collection";
152      case NULL:
153        return null;
154      default:
155        return "?";
156      }
157    }
158
159    public String getSystem() {
160      switch (this) {
161      case DOCUMENT:
162        return "http://hl7.org/fhir/bundle-type";
163      case MESSAGE:
164        return "http://hl7.org/fhir/bundle-type";
165      case TRANSACTION:
166        return "http://hl7.org/fhir/bundle-type";
167      case TRANSACTIONRESPONSE:
168        return "http://hl7.org/fhir/bundle-type";
169      case BATCH:
170        return "http://hl7.org/fhir/bundle-type";
171      case BATCHRESPONSE:
172        return "http://hl7.org/fhir/bundle-type";
173      case HISTORY:
174        return "http://hl7.org/fhir/bundle-type";
175      case SEARCHSET:
176        return "http://hl7.org/fhir/bundle-type";
177      case COLLECTION:
178        return "http://hl7.org/fhir/bundle-type";
179      case NULL:
180        return null;
181      default:
182        return "?";
183      }
184    }
185
186    public String getDefinition() {
187      switch (this) {
188      case DOCUMENT:
189        return "The bundle is a document. The first resource is a Composition.";
190      case MESSAGE:
191        return "The bundle is a message. The first resource is a MessageHeader.";
192      case TRANSACTION:
193        return "The bundle is a transaction - intended to be processed by a server as an atomic commit.";
194      case TRANSACTIONRESPONSE:
195        return "The bundle is a transaction response. Because the response is a transaction response, the transaction has succeeded, and all responses are error free.";
196      case BATCH:
197        return "The bundle is a set of actions - intended to be processed by a server as a group of independent actions.";
198      case BATCHRESPONSE:
199        return "The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success.";
200      case HISTORY:
201        return "The bundle is a list of resources from a history interaction on a server.";
202      case SEARCHSET:
203        return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message.";
204      case COLLECTION:
205        return "The bundle is a set of resources collected into a single package for ease of distribution that imposes no processing obligations or behavioral rules beyond persistence.";
206      case NULL:
207        return null;
208      default:
209        return "?";
210      }
211    }
212
213    public String getDisplay() {
214      switch (this) {
215      case DOCUMENT:
216        return "Document";
217      case MESSAGE:
218        return "Message";
219      case TRANSACTION:
220        return "Transaction";
221      case TRANSACTIONRESPONSE:
222        return "Transaction Response";
223      case BATCH:
224        return "Batch";
225      case BATCHRESPONSE:
226        return "Batch Response";
227      case HISTORY:
228        return "History List";
229      case SEARCHSET:
230        return "Search Results";
231      case COLLECTION:
232        return "Collection";
233      case NULL:
234        return null;
235      default:
236        return "?";
237      }
238    }
239  }
240
241  public static class BundleTypeEnumFactory implements EnumFactory<BundleType> {
242    public BundleType fromCode(String codeString) throws IllegalArgumentException {
243      if (codeString == null || "".equals(codeString))
244        if (codeString == null || "".equals(codeString))
245          return null;
246      if ("document".equals(codeString))
247        return BundleType.DOCUMENT;
248      if ("message".equals(codeString))
249        return BundleType.MESSAGE;
250      if ("transaction".equals(codeString))
251        return BundleType.TRANSACTION;
252      if ("transaction-response".equals(codeString))
253        return BundleType.TRANSACTIONRESPONSE;
254      if ("batch".equals(codeString))
255        return BundleType.BATCH;
256      if ("batch-response".equals(codeString))
257        return BundleType.BATCHRESPONSE;
258      if ("history".equals(codeString))
259        return BundleType.HISTORY;
260      if ("searchset".equals(codeString))
261        return BundleType.SEARCHSET;
262      if ("collection".equals(codeString))
263        return BundleType.COLLECTION;
264      throw new IllegalArgumentException("Unknown BundleType code '" + codeString + "'");
265    }
266
267    public Enumeration<BundleType> fromType(PrimitiveType<?> code) throws FHIRException {
268      if (code == null)
269        return null;
270      if (code.isEmpty())
271        return new Enumeration<BundleType>(this, BundleType.NULL, code);
272      String codeString = code.asStringValue();
273      if (codeString == null || "".equals(codeString))
274        return new Enumeration<BundleType>(this, BundleType.NULL, code);
275      if ("document".equals(codeString))
276        return new Enumeration<BundleType>(this, BundleType.DOCUMENT, code);
277      if ("message".equals(codeString))
278        return new Enumeration<BundleType>(this, BundleType.MESSAGE, code);
279      if ("transaction".equals(codeString))
280        return new Enumeration<BundleType>(this, BundleType.TRANSACTION, code);
281      if ("transaction-response".equals(codeString))
282        return new Enumeration<BundleType>(this, BundleType.TRANSACTIONRESPONSE, code);
283      if ("batch".equals(codeString))
284        return new Enumeration<BundleType>(this, BundleType.BATCH, code);
285      if ("batch-response".equals(codeString))
286        return new Enumeration<BundleType>(this, BundleType.BATCHRESPONSE, code);
287      if ("history".equals(codeString))
288        return new Enumeration<BundleType>(this, BundleType.HISTORY, code);
289      if ("searchset".equals(codeString))
290        return new Enumeration<BundleType>(this, BundleType.SEARCHSET, code);
291      if ("collection".equals(codeString))
292        return new Enumeration<BundleType>(this, BundleType.COLLECTION, code);
293      throw new FHIRException("Unknown BundleType code '" + codeString + "'");
294    }
295
296    public String toCode(BundleType code) {
297      if (code == BundleType.DOCUMENT)
298        return "document";
299      if (code == BundleType.MESSAGE)
300        return "message";
301      if (code == BundleType.TRANSACTION)
302        return "transaction";
303      if (code == BundleType.TRANSACTIONRESPONSE)
304        return "transaction-response";
305      if (code == BundleType.BATCH)
306        return "batch";
307      if (code == BundleType.BATCHRESPONSE)
308        return "batch-response";
309      if (code == BundleType.HISTORY)
310        return "history";
311      if (code == BundleType.SEARCHSET)
312        return "searchset";
313      if (code == BundleType.COLLECTION)
314        return "collection";
315      return "?";
316    }
317
318    public String toSystem(BundleType code) {
319      return code.getSystem();
320    }
321  }
322
323  public enum SearchEntryMode {
324    /**
325     * This resource matched the search specification.
326     */
327    MATCH,
328    /**
329     * This resource is returned because it is referred to from another resource in
330     * the search set.
331     */
332    INCLUDE,
333    /**
334     * An OperationOutcome that provides additional information about the processing
335     * of a search.
336     */
337    OUTCOME,
338    /**
339     * added to help the parsers with the generic types
340     */
341    NULL;
342
343    public static SearchEntryMode fromCode(String codeString) throws FHIRException {
344      if (codeString == null || "".equals(codeString))
345        return null;
346      if ("match".equals(codeString))
347        return MATCH;
348      if ("include".equals(codeString))
349        return INCLUDE;
350      if ("outcome".equals(codeString))
351        return OUTCOME;
352      if (Configuration.isAcceptInvalidEnums())
353        return null;
354      else
355        throw new FHIRException("Unknown SearchEntryMode code '" + codeString + "'");
356    }
357
358    public String toCode() {
359      switch (this) {
360      case MATCH:
361        return "match";
362      case INCLUDE:
363        return "include";
364      case OUTCOME:
365        return "outcome";
366      case NULL:
367        return null;
368      default:
369        return "?";
370      }
371    }
372
373    public String getSystem() {
374      switch (this) {
375      case MATCH:
376        return "http://hl7.org/fhir/search-entry-mode";
377      case INCLUDE:
378        return "http://hl7.org/fhir/search-entry-mode";
379      case OUTCOME:
380        return "http://hl7.org/fhir/search-entry-mode";
381      case NULL:
382        return null;
383      default:
384        return "?";
385      }
386    }
387
388    public String getDefinition() {
389      switch (this) {
390      case MATCH:
391        return "This resource matched the search specification.";
392      case INCLUDE:
393        return "This resource is returned because it is referred to from another resource in the search set.";
394      case OUTCOME:
395        return "An OperationOutcome that provides additional information about the processing of a search.";
396      case NULL:
397        return null;
398      default:
399        return "?";
400      }
401    }
402
403    public String getDisplay() {
404      switch (this) {
405      case MATCH:
406        return "Match";
407      case INCLUDE:
408        return "Include";
409      case OUTCOME:
410        return "Outcome";
411      case NULL:
412        return null;
413      default:
414        return "?";
415      }
416    }
417  }
418
419  public static class SearchEntryModeEnumFactory implements EnumFactory<SearchEntryMode> {
420    public SearchEntryMode fromCode(String codeString) throws IllegalArgumentException {
421      if (codeString == null || "".equals(codeString))
422        if (codeString == null || "".equals(codeString))
423          return null;
424      if ("match".equals(codeString))
425        return SearchEntryMode.MATCH;
426      if ("include".equals(codeString))
427        return SearchEntryMode.INCLUDE;
428      if ("outcome".equals(codeString))
429        return SearchEntryMode.OUTCOME;
430      throw new IllegalArgumentException("Unknown SearchEntryMode code '" + codeString + "'");
431    }
432
433    public Enumeration<SearchEntryMode> fromType(PrimitiveType<?> code) throws FHIRException {
434      if (code == null)
435        return null;
436      if (code.isEmpty())
437        return new Enumeration<SearchEntryMode>(this, SearchEntryMode.NULL, code);
438      String codeString = code.asStringValue();
439      if (codeString == null || "".equals(codeString))
440        return new Enumeration<SearchEntryMode>(this, SearchEntryMode.NULL, code);
441      if ("match".equals(codeString))
442        return new Enumeration<SearchEntryMode>(this, SearchEntryMode.MATCH, code);
443      if ("include".equals(codeString))
444        return new Enumeration<SearchEntryMode>(this, SearchEntryMode.INCLUDE, code);
445      if ("outcome".equals(codeString))
446        return new Enumeration<SearchEntryMode>(this, SearchEntryMode.OUTCOME, code);
447      throw new FHIRException("Unknown SearchEntryMode code '" + codeString + "'");
448    }
449
450    public String toCode(SearchEntryMode code) {
451      if (code == SearchEntryMode.MATCH)
452        return "match";
453      if (code == SearchEntryMode.INCLUDE)
454        return "include";
455      if (code == SearchEntryMode.OUTCOME)
456        return "outcome";
457      return "?";
458    }
459
460    public String toSystem(SearchEntryMode code) {
461      return code.getSystem();
462    }
463  }
464
465  public enum HTTPVerb {
466    /**
467     * HTTP GET Command.
468     */
469    GET,
470    /**
471     * HTTP HEAD Command.
472     */
473    HEAD,
474    /**
475     * HTTP POST Command.
476     */
477    POST,
478    /**
479     * HTTP PUT Command.
480     */
481    PUT,
482    /**
483     * HTTP DELETE Command.
484     */
485    DELETE,
486    /**
487     * HTTP PATCH Command.
488     */
489    PATCH,
490    /**
491     * added to help the parsers with the generic types
492     */
493    NULL;
494
495    public static HTTPVerb fromCode(String codeString) throws FHIRException {
496      if (codeString == null || "".equals(codeString))
497        return null;
498      if ("GET".equals(codeString))
499        return GET;
500      if ("HEAD".equals(codeString))
501        return HEAD;
502      if ("POST".equals(codeString))
503        return POST;
504      if ("PUT".equals(codeString))
505        return PUT;
506      if ("DELETE".equals(codeString))
507        return DELETE;
508      if ("PATCH".equals(codeString))
509        return PATCH;
510      if (Configuration.isAcceptInvalidEnums())
511        return null;
512      else
513        throw new FHIRException("Unknown HTTPVerb code '" + codeString + "'");
514    }
515
516    public String toCode() {
517      switch (this) {
518      case GET:
519        return "GET";
520      case HEAD:
521        return "HEAD";
522      case POST:
523        return "POST";
524      case PUT:
525        return "PUT";
526      case DELETE:
527        return "DELETE";
528      case PATCH:
529        return "PATCH";
530      case NULL:
531        return null;
532      default:
533        return "?";
534      }
535    }
536
537    public String getSystem() {
538      switch (this) {
539      case GET:
540        return "http://hl7.org/fhir/http-verb";
541      case HEAD:
542        return "http://hl7.org/fhir/http-verb";
543      case POST:
544        return "http://hl7.org/fhir/http-verb";
545      case PUT:
546        return "http://hl7.org/fhir/http-verb";
547      case DELETE:
548        return "http://hl7.org/fhir/http-verb";
549      case PATCH:
550        return "http://hl7.org/fhir/http-verb";
551      case NULL:
552        return null;
553      default:
554        return "?";
555      }
556    }
557
558    public String getDefinition() {
559      switch (this) {
560      case GET:
561        return "HTTP GET Command.";
562      case HEAD:
563        return "HTTP HEAD Command.";
564      case POST:
565        return "HTTP POST Command.";
566      case PUT:
567        return "HTTP PUT Command.";
568      case DELETE:
569        return "HTTP DELETE Command.";
570      case PATCH:
571        return "HTTP PATCH Command.";
572      case NULL:
573        return null;
574      default:
575        return "?";
576      }
577    }
578
579    public String getDisplay() {
580      switch (this) {
581      case GET:
582        return "GET";
583      case HEAD:
584        return "HEAD";
585      case POST:
586        return "POST";
587      case PUT:
588        return "PUT";
589      case DELETE:
590        return "DELETE";
591      case PATCH:
592        return "PATCH";
593      case NULL:
594        return null;
595      default:
596        return "?";
597      }
598    }
599  }
600
601  public static class HTTPVerbEnumFactory implements EnumFactory<HTTPVerb> {
602    public HTTPVerb fromCode(String codeString) throws IllegalArgumentException {
603      if (codeString == null || "".equals(codeString))
604        if (codeString == null || "".equals(codeString))
605          return null;
606      if ("GET".equals(codeString))
607        return HTTPVerb.GET;
608      if ("HEAD".equals(codeString))
609        return HTTPVerb.HEAD;
610      if ("POST".equals(codeString))
611        return HTTPVerb.POST;
612      if ("PUT".equals(codeString))
613        return HTTPVerb.PUT;
614      if ("DELETE".equals(codeString))
615        return HTTPVerb.DELETE;
616      if ("PATCH".equals(codeString))
617        return HTTPVerb.PATCH;
618      throw new IllegalArgumentException("Unknown HTTPVerb code '" + codeString + "'");
619    }
620
621    public Enumeration<HTTPVerb> fromType(PrimitiveType<?> code) throws FHIRException {
622      if (code == null)
623        return null;
624      if (code.isEmpty())
625        return new Enumeration<HTTPVerb>(this, HTTPVerb.NULL, code);
626      String codeString = code.asStringValue();
627      if (codeString == null || "".equals(codeString))
628        return new Enumeration<HTTPVerb>(this, HTTPVerb.NULL, code);
629      if ("GET".equals(codeString))
630        return new Enumeration<HTTPVerb>(this, HTTPVerb.GET, code);
631      if ("HEAD".equals(codeString))
632        return new Enumeration<HTTPVerb>(this, HTTPVerb.HEAD, code);
633      if ("POST".equals(codeString))
634        return new Enumeration<HTTPVerb>(this, HTTPVerb.POST, code);
635      if ("PUT".equals(codeString))
636        return new Enumeration<HTTPVerb>(this, HTTPVerb.PUT, code);
637      if ("DELETE".equals(codeString))
638        return new Enumeration<HTTPVerb>(this, HTTPVerb.DELETE, code);
639      if ("PATCH".equals(codeString))
640        return new Enumeration<HTTPVerb>(this, HTTPVerb.PATCH, code);
641      throw new FHIRException("Unknown HTTPVerb code '" + codeString + "'");
642    }
643
644    public String toCode(HTTPVerb code) {
645      if (code == HTTPVerb.GET)
646        return "GET";
647      if (code == HTTPVerb.HEAD)
648        return "HEAD";
649      if (code == HTTPVerb.POST)
650        return "POST";
651      if (code == HTTPVerb.PUT)
652        return "PUT";
653      if (code == HTTPVerb.DELETE)
654        return "DELETE";
655      if (code == HTTPVerb.PATCH)
656        return "PATCH";
657      return "?";
658    }
659
660    public String toSystem(HTTPVerb code) {
661      return code.getSystem();
662    }
663  }
664
665  @Block()
666  public static class BundleLinkComponent extends BackboneElement implements IBaseBackboneElement {
667    /**
668     * A name which details the functional use for this link - see
669     * [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).
670     */
671    @Child(name = "relation", type = {
672        StringType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
673    @Description(shortDefinition = "See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1", formalDefinition = "A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).")
674    protected StringType relation;
675
676    /**
677     * The reference details for the link.
678     */
679    @Child(name = "url", type = { UriType.class }, order = 2, min = 1, max = 1, modifier = false, summary = true)
680    @Description(shortDefinition = "Reference details for the link", formalDefinition = "The reference details for the link.")
681    protected UriType url;
682
683    private static final long serialVersionUID = -1010386066L;
684
685    /**
686     * Constructor
687     */
688    public BundleLinkComponent() {
689      super();
690    }
691
692    /**
693     * Constructor
694     */
695    public BundleLinkComponent(StringType relation, UriType url) {
696      super();
697      this.relation = relation;
698      this.url = url;
699    }
700
701    /**
702     * @return {@link #relation} (A name which details the functional use for this
703     *         link - see
704     *         [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).).
705     *         This is the underlying object with id, value and extensions. The
706     *         accessor "getRelation" gives direct access to the value
707     */
708    public StringType getRelationElement() {
709      if (this.relation == null)
710        if (Configuration.errorOnAutoCreate())
711          throw new Error("Attempt to auto-create BundleLinkComponent.relation");
712        else if (Configuration.doAutoCreate())
713          this.relation = new StringType(); // bb
714      return this.relation;
715    }
716
717    public boolean hasRelationElement() {
718      return this.relation != null && !this.relation.isEmpty();
719    }
720
721    public boolean hasRelation() {
722      return this.relation != null && !this.relation.isEmpty();
723    }
724
725    /**
726     * @param value {@link #relation} (A name which details the functional use for
727     *              this link - see
728     *              [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).).
729     *              This is the underlying object with id, value and extensions. The
730     *              accessor "getRelation" gives direct access to the value
731     */
732    public BundleLinkComponent setRelationElement(StringType value) {
733      this.relation = value;
734      return this;
735    }
736
737    /**
738     * @return A name which details the functional use for this link - see
739     *         [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).
740     */
741    public String getRelation() {
742      return this.relation == null ? null : this.relation.getValue();
743    }
744
745    /**
746     * @param value A name which details the functional use for this link - see
747     *              [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).
748     */
749    public BundleLinkComponent setRelation(String value) {
750      if (this.relation == null)
751        this.relation = new StringType();
752      this.relation.setValue(value);
753      return this;
754    }
755
756    /**
757     * @return {@link #url} (The reference details for the link.). This is the
758     *         underlying object with id, value and extensions. The accessor
759     *         "getUrl" gives direct access to the value
760     */
761    public UriType getUrlElement() {
762      if (this.url == null)
763        if (Configuration.errorOnAutoCreate())
764          throw new Error("Attempt to auto-create BundleLinkComponent.url");
765        else if (Configuration.doAutoCreate())
766          this.url = new UriType(); // bb
767      return this.url;
768    }
769
770    public boolean hasUrlElement() {
771      return this.url != null && !this.url.isEmpty();
772    }
773
774    public boolean hasUrl() {
775      return this.url != null && !this.url.isEmpty();
776    }
777
778    /**
779     * @param value {@link #url} (The reference details for the link.). This is the
780     *              underlying object with id, value and extensions. The accessor
781     *              "getUrl" gives direct access to the value
782     */
783    public BundleLinkComponent setUrlElement(UriType value) {
784      this.url = value;
785      return this;
786    }
787
788    /**
789     * @return The reference details for the link.
790     */
791    public String getUrl() {
792      return this.url == null ? null : this.url.getValue();
793    }
794
795    /**
796     * @param value The reference details for the link.
797     */
798    public BundleLinkComponent setUrl(String value) {
799      if (this.url == null)
800        this.url = new UriType();
801      this.url.setValue(value);
802      return this;
803    }
804
805    protected void listChildren(List<Property> children) {
806      super.listChildren(children);
807      children.add(new Property("relation", "string",
808          "A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).",
809          0, 1, relation));
810      children.add(new Property("url", "uri", "The reference details for the link.", 0, 1, url));
811    }
812
813    @Override
814    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
815      switch (_hash) {
816      case -554436100:
817        /* relation */ return new Property("relation", "string",
818            "A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).",
819            0, 1, relation);
820      case 116079:
821        /* url */ return new Property("url", "uri", "The reference details for the link.", 0, 1, url);
822      default:
823        return super.getNamedProperty(_hash, _name, _checkValid);
824      }
825
826    }
827
828    @Override
829    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
830      switch (hash) {
831      case -554436100:
832        /* relation */ return this.relation == null ? new Base[0] : new Base[] { this.relation }; // StringType
833      case 116079:
834        /* url */ return this.url == null ? new Base[0] : new Base[] { this.url }; // UriType
835      default:
836        return super.getProperty(hash, name, checkValid);
837      }
838
839    }
840
841    @Override
842    public Base setProperty(int hash, String name, Base value) throws FHIRException {
843      switch (hash) {
844      case -554436100: // relation
845        this.relation = castToString(value); // StringType
846        return value;
847      case 116079: // url
848        this.url = castToUri(value); // UriType
849        return value;
850      default:
851        return super.setProperty(hash, name, value);
852      }
853
854    }
855
856    @Override
857    public Base setProperty(String name, Base value) throws FHIRException {
858      if (name.equals("relation")) {
859        this.relation = castToString(value); // StringType
860      } else if (name.equals("url")) {
861        this.url = castToUri(value); // UriType
862      } else
863        return super.setProperty(name, value);
864      return value;
865    }
866
867    @Override
868    public Base makeProperty(int hash, String name) throws FHIRException {
869      switch (hash) {
870      case -554436100:
871        return getRelationElement();
872      case 116079:
873        return getUrlElement();
874      default:
875        return super.makeProperty(hash, name);
876      }
877
878    }
879
880    @Override
881    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
882      switch (hash) {
883      case -554436100:
884        /* relation */ return new String[] { "string" };
885      case 116079:
886        /* url */ return new String[] { "uri" };
887      default:
888        return super.getTypesForProperty(hash, name);
889      }
890
891    }
892
893    @Override
894    public Base addChild(String name) throws FHIRException {
895      if (name.equals("relation")) {
896        throw new FHIRException("Cannot call addChild on a singleton property Bundle.relation");
897      } else if (name.equals("url")) {
898        throw new FHIRException("Cannot call addChild on a singleton property Bundle.url");
899      } else
900        return super.addChild(name);
901    }
902
903    public BundleLinkComponent copy() {
904      BundleLinkComponent dst = new BundleLinkComponent();
905      copyValues(dst);
906      return dst;
907    }
908
909    public void copyValues(BundleLinkComponent dst) {
910      super.copyValues(dst);
911      dst.relation = relation == null ? null : relation.copy();
912      dst.url = url == null ? null : url.copy();
913    }
914
915    @Override
916    public boolean equalsDeep(Base other_) {
917      if (!super.equalsDeep(other_))
918        return false;
919      if (!(other_ instanceof BundleLinkComponent))
920        return false;
921      BundleLinkComponent o = (BundleLinkComponent) other_;
922      return compareDeep(relation, o.relation, true) && compareDeep(url, o.url, true);
923    }
924
925    @Override
926    public boolean equalsShallow(Base other_) {
927      if (!super.equalsShallow(other_))
928        return false;
929      if (!(other_ instanceof BundleLinkComponent))
930        return false;
931      BundleLinkComponent o = (BundleLinkComponent) other_;
932      return compareValues(relation, o.relation, true) && compareValues(url, o.url, true);
933    }
934
935    public boolean isEmpty() {
936      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relation, url);
937    }
938
939    public String fhirType() {
940      return "Bundle.link";
941
942    }
943
944  }
945
946  @Block()
947  public static class BundleEntryComponent extends BackboneElement implements IBaseBackboneElement {
948    /**
949     * A series of links that provide context to this entry.
950     */
951    @Child(name = "link", type = {
952        BundleLinkComponent.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
953    @Description(shortDefinition = "Links related to this entry", formalDefinition = "A series of links that provide context to this entry.")
954    protected List<BundleLinkComponent> link;
955
956    /**
957     * The Absolute URL for the resource. The fullUrl SHALL NOT disagree with the id
958     * in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be
959     * version-independent URL consistent with the Resource.id. The fullUrl is a
960     * version independent reference to the resource. The fullUrl element SHALL have
961     * a value except that: fullUrl can be empty on a POST (although it does not
962     * need to when specifying a temporary id for reference in the bundle) Results
963     * from operations might involve resources that are not identified.
964     */
965    @Child(name = "fullUrl", type = { UriType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
966    @Description(shortDefinition = "URI for resource (Absolute URL server address or URI for UUID/OID)", formalDefinition = "The Absolute URL for the resource.  The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified.")
967    protected UriType fullUrl;
968
969    /**
970     * The Resource for the entry. The purpose/meaning of the resource is determined
971     * by the Bundle.type.
972     */
973    @Child(name = "resource", type = { Resource.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
974    @Description(shortDefinition = "A resource in the bundle", formalDefinition = "The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type.")
975    protected Resource resource;
976
977    /**
978     * Information about the search process that lead to the creation of this entry.
979     */
980    @Child(name = "search", type = {}, order = 4, min = 0, max = 1, modifier = false, summary = true)
981    @Description(shortDefinition = "Search related information", formalDefinition = "Information about the search process that lead to the creation of this entry.")
982    protected BundleEntrySearchComponent search;
983
984    /**
985     * Additional information about how this entry should be processed as part of a
986     * transaction or batch. For history, it shows how the entry was processed to
987     * create the version contained in the entry.
988     */
989    @Child(name = "request", type = {}, order = 5, min = 0, max = 1, modifier = false, summary = true)
990    @Description(shortDefinition = "Additional execution information (transaction/batch/history)", formalDefinition = "Additional information about how this entry should be processed as part of a transaction or batch.  For history, it shows how the entry was processed to create the version contained in the entry.")
991    protected BundleEntryRequestComponent request;
992
993    /**
994     * Indicates the results of processing the corresponding 'request' entry in the
995     * batch or transaction being responded to or what the results of an operation
996     * where when returning history.
997     */
998    @Child(name = "response", type = {}, order = 6, min = 0, max = 1, modifier = false, summary = true)
999    @Description(shortDefinition = "Results of execution (transaction/batch/history)", formalDefinition = "Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history.")
1000    protected BundleEntryResponseComponent response;
1001
1002    private static final long serialVersionUID = 517783054L;
1003
1004    /**
1005     * Constructor
1006     */
1007    public BundleEntryComponent() {
1008      super();
1009    }
1010
1011    /**
1012     * @return {@link #link} (A series of links that provide context to this entry.)
1013     */
1014    public List<BundleLinkComponent> getLink() {
1015      if (this.link == null)
1016        this.link = new ArrayList<BundleLinkComponent>();
1017      return this.link;
1018    }
1019
1020    /**
1021     * @return Returns a reference to <code>this</code> for easy method chaining
1022     */
1023    public BundleEntryComponent setLink(List<BundleLinkComponent> theLink) {
1024      this.link = theLink;
1025      return this;
1026    }
1027
1028    public boolean hasLink() {
1029      if (this.link == null)
1030        return false;
1031      for (BundleLinkComponent item : this.link)
1032        if (!item.isEmpty())
1033          return true;
1034      return false;
1035    }
1036
1037    public BundleLinkComponent addLink() { // 3
1038      BundleLinkComponent t = new BundleLinkComponent();
1039      if (this.link == null)
1040        this.link = new ArrayList<BundleLinkComponent>();
1041      this.link.add(t);
1042      return t;
1043    }
1044
1045    public BundleEntryComponent addLink(BundleLinkComponent t) { // 3
1046      if (t == null)
1047        return this;
1048      if (this.link == null)
1049        this.link = new ArrayList<BundleLinkComponent>();
1050      this.link.add(t);
1051      return this;
1052    }
1053
1054    /**
1055     * @return The first repetition of repeating field {@link #link}, creating it if
1056     *         it does not already exist
1057     */
1058    public BundleLinkComponent getLinkFirstRep() {
1059      if (getLink().isEmpty()) {
1060        addLink();
1061      }
1062      return getLink().get(0);
1063    }
1064
1065    /**
1066     * @return {@link #fullUrl} (The Absolute URL for the resource. The fullUrl
1067     *         SHALL NOT disagree with the id in the resource - i.e. if the fullUrl
1068     *         is not a urn:uuid, the URL shall be version-independent URL
1069     *         consistent with the Resource.id. The fullUrl is a version independent
1070     *         reference to the resource. The fullUrl element SHALL have a value
1071     *         except that: fullUrl can be empty on a POST (although it does not
1072     *         need to when specifying a temporary id for reference in the bundle)
1073     *         Results from operations might involve resources that are not
1074     *         identified.). This is the underlying object with id, value and
1075     *         extensions. The accessor "getFullUrl" gives direct access to the
1076     *         value
1077     */
1078    public UriType getFullUrlElement() {
1079      if (this.fullUrl == null)
1080        if (Configuration.errorOnAutoCreate())
1081          throw new Error("Attempt to auto-create BundleEntryComponent.fullUrl");
1082        else if (Configuration.doAutoCreate())
1083          this.fullUrl = new UriType(); // bb
1084      return this.fullUrl;
1085    }
1086
1087    public boolean hasFullUrlElement() {
1088      return this.fullUrl != null && !this.fullUrl.isEmpty();
1089    }
1090
1091    public boolean hasFullUrl() {
1092      return this.fullUrl != null && !this.fullUrl.isEmpty();
1093    }
1094
1095    /**
1096     * @param value {@link #fullUrl} (The Absolute URL for the resource. The fullUrl
1097     *              SHALL NOT disagree with the id in the resource - i.e. if the
1098     *              fullUrl is not a urn:uuid, the URL shall be version-independent
1099     *              URL consistent with the Resource.id. The fullUrl is a version
1100     *              independent reference to the resource. The fullUrl element SHALL
1101     *              have a value except that: fullUrl can be empty on a POST
1102     *              (although it does not need to when specifying a temporary id for
1103     *              reference in the bundle) Results from operations might involve
1104     *              resources that are not identified.). This is the underlying
1105     *              object with id, value and extensions. The accessor "getFullUrl"
1106     *              gives direct access to the value
1107     */
1108    public BundleEntryComponent setFullUrlElement(UriType value) {
1109      this.fullUrl = value;
1110      return this;
1111    }
1112
1113    /**
1114     * @return The Absolute URL for the resource. The fullUrl SHALL NOT disagree
1115     *         with the id in the resource - i.e. if the fullUrl is not a urn:uuid,
1116     *         the URL shall be version-independent URL consistent with the
1117     *         Resource.id. The fullUrl is a version independent reference to the
1118     *         resource. The fullUrl element SHALL have a value except that: fullUrl
1119     *         can be empty on a POST (although it does not need to when specifying
1120     *         a temporary id for reference in the bundle) Results from operations
1121     *         might involve resources that are not identified.
1122     */
1123    public String getFullUrl() {
1124      return this.fullUrl == null ? null : this.fullUrl.getValue();
1125    }
1126
1127    /**
1128     * @param value The Absolute URL for the resource. The fullUrl SHALL NOT
1129     *              disagree with the id in the resource - i.e. if the fullUrl is
1130     *              not a urn:uuid, the URL shall be version-independent URL
1131     *              consistent with the Resource.id. The fullUrl is a version
1132     *              independent reference to the resource. The fullUrl element SHALL
1133     *              have a value except that: fullUrl can be empty on a POST
1134     *              (although it does not need to when specifying a temporary id for
1135     *              reference in the bundle) Results from operations might involve
1136     *              resources that are not identified.
1137     */
1138    public BundleEntryComponent setFullUrl(String value) {
1139      if (Utilities.noString(value))
1140        this.fullUrl = null;
1141      else {
1142        if (this.fullUrl == null)
1143          this.fullUrl = new UriType();
1144        this.fullUrl.setValue(value);
1145      }
1146      return this;
1147    }
1148
1149    /**
1150     * @return {@link #resource} (The Resource for the entry. The purpose/meaning of
1151     *         the resource is determined by the Bundle.type.)
1152     */
1153    public Resource getResource() {
1154      return this.resource;
1155    }
1156
1157    public boolean hasResource() {
1158      return this.resource != null && !this.resource.isEmpty();
1159    }
1160
1161    /**
1162     * @param value {@link #resource} (The Resource for the entry. The
1163     *              purpose/meaning of the resource is determined by the
1164     *              Bundle.type.)
1165     */
1166    public BundleEntryComponent setResource(Resource value) {
1167      this.resource = value;
1168      return this;
1169    }
1170
1171    /**
1172     * @return {@link #search} (Information about the search process that lead to
1173     *         the creation of this entry.)
1174     */
1175    public BundleEntrySearchComponent getSearch() {
1176      if (this.search == null)
1177        if (Configuration.errorOnAutoCreate())
1178          throw new Error("Attempt to auto-create BundleEntryComponent.search");
1179        else if (Configuration.doAutoCreate())
1180          this.search = new BundleEntrySearchComponent(); // cc
1181      return this.search;
1182    }
1183
1184    public boolean hasSearch() {
1185      return this.search != null && !this.search.isEmpty();
1186    }
1187
1188    /**
1189     * @param value {@link #search} (Information about the search process that lead
1190     *              to the creation of this entry.)
1191     */
1192    public BundleEntryComponent setSearch(BundleEntrySearchComponent value) {
1193      this.search = value;
1194      return this;
1195    }
1196
1197    /**
1198     * @return {@link #request} (Additional information about how this entry should
1199     *         be processed as part of a transaction or batch. For history, it shows
1200     *         how the entry was processed to create the version contained in the
1201     *         entry.)
1202     */
1203    public BundleEntryRequestComponent getRequest() {
1204      if (this.request == null)
1205        if (Configuration.errorOnAutoCreate())
1206          throw new Error("Attempt to auto-create BundleEntryComponent.request");
1207        else if (Configuration.doAutoCreate())
1208          this.request = new BundleEntryRequestComponent(); // cc
1209      return this.request;
1210    }
1211
1212    public boolean hasRequest() {
1213      return this.request != null && !this.request.isEmpty();
1214    }
1215
1216    /**
1217     * @param value {@link #request} (Additional information about how this entry
1218     *              should be processed as part of a transaction or batch. For
1219     *              history, it shows how the entry was processed to create the
1220     *              version contained in the entry.)
1221     */
1222    public BundleEntryComponent setRequest(BundleEntryRequestComponent value) {
1223      this.request = value;
1224      return this;
1225    }
1226
1227    /**
1228     * @return {@link #response} (Indicates the results of processing the
1229     *         corresponding 'request' entry in the batch or transaction being
1230     *         responded to or what the results of an operation where when returning
1231     *         history.)
1232     */
1233    public BundleEntryResponseComponent getResponse() {
1234      if (this.response == null)
1235        if (Configuration.errorOnAutoCreate())
1236          throw new Error("Attempt to auto-create BundleEntryComponent.response");
1237        else if (Configuration.doAutoCreate())
1238          this.response = new BundleEntryResponseComponent(); // cc
1239      return this.response;
1240    }
1241
1242    public boolean hasResponse() {
1243      return this.response != null && !this.response.isEmpty();
1244    }
1245
1246    /**
1247     * @param value {@link #response} (Indicates the results of processing the
1248     *              corresponding 'request' entry in the batch or transaction being
1249     *              responded to or what the results of an operation where when
1250     *              returning history.)
1251     */
1252    public BundleEntryComponent setResponse(BundleEntryResponseComponent value) {
1253      this.response = value;
1254      return this;
1255    }
1256
1257    /**
1258     * Returns the {@link #getLink() link} which matches a given
1259     * {@link BundleLinkComponent#getRelation() relation}. If no link is found which
1260     * matches the given relation, returns <code>null</code>. If more than one link
1261     * is found which matches the given relation, returns the first matching
1262     * BundleLinkComponent.
1263     * 
1264     * @param theRelation The relation, such as "next", or "self. See the constants
1265     *                    such as {@link IBaseBundle#LINK_SELF} and
1266     *                    {@link IBaseBundle#LINK_NEXT}.
1267     * @return Returns a matching BundleLinkComponent, or <code>null</code>
1268     * @see IBaseBundle#LINK_NEXT
1269     * @see IBaseBundle#LINK_PREV
1270     * @see IBaseBundle#LINK_SELF
1271     */
1272    public BundleLinkComponent getLink(String theRelation) {
1273      org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
1274      for (BundleLinkComponent next : getLink()) {
1275        if (theRelation.equals(next.getRelation())) {
1276          return next;
1277        }
1278      }
1279      return null;
1280    }
1281
1282    /**
1283     * Returns the {@link #getLink() link} which matches a given
1284     * {@link BundleLinkComponent#getRelation() relation}. If no link is found which
1285     * matches the given relation, creates a new BundleLinkComponent with the given
1286     * relation and adds it to this Bundle. If more than one link is found which
1287     * matches the given relation, returns the first matching BundleLinkComponent.
1288     * 
1289     * @param theRelation The relation, such as "next", or "self. See the constants
1290     *                    such as {@link IBaseBundle#LINK_SELF} and
1291     *                    {@link IBaseBundle#LINK_NEXT}.
1292     * @return Returns a matching BundleLinkComponent, or <code>null</code>
1293     * @see IBaseBundle#LINK_NEXT
1294     * @see IBaseBundle#LINK_PREV
1295     * @see IBaseBundle#LINK_SELF
1296     */
1297    public BundleLinkComponent getLinkOrCreate(String theRelation) {
1298      org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
1299      for (BundleLinkComponent next : getLink()) {
1300        if (theRelation.equals(next.getRelation())) {
1301          return next;
1302        }
1303      }
1304      BundleLinkComponent retVal = new BundleLinkComponent();
1305      retVal.setRelation(theRelation);
1306      getLink().add(retVal);
1307      return retVal;
1308    }
1309
1310    protected void listChildren(List<Property> children) {
1311      super.listChildren(children);
1312      children.add(new Property("link", "@Bundle.link", "A series of links that provide context to this entry.", 0,
1313          java.lang.Integer.MAX_VALUE, link));
1314      children.add(new Property("fullUrl", "uri",
1315          "The Absolute URL for the resource.  The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified.",
1316          0, 1, fullUrl));
1317      children.add(new Property("resource", "Resource",
1318          "The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type.", 0, 1,
1319          resource));
1320      children.add(new Property("search", "",
1321          "Information about the search process that lead to the creation of this entry.", 0, 1, search));
1322      children.add(new Property("request", "",
1323          "Additional information about how this entry should be processed as part of a transaction or batch.  For history, it shows how the entry was processed to create the version contained in the entry.",
1324          0, 1, request));
1325      children.add(new Property("response", "",
1326          "Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history.",
1327          0, 1, response));
1328    }
1329
1330    @Override
1331    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1332      switch (_hash) {
1333      case 3321850:
1334        /* link */ return new Property("link", "@Bundle.link", "A series of links that provide context to this entry.",
1335            0, java.lang.Integer.MAX_VALUE, link);
1336      case -511251360:
1337        /* fullUrl */ return new Property("fullUrl", "uri",
1338            "The Absolute URL for the resource.  The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified.",
1339            0, 1, fullUrl);
1340      case -341064690:
1341        /* resource */ return new Property("resource", "Resource",
1342            "The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type.", 0, 1,
1343            resource);
1344      case -906336856:
1345        /* search */ return new Property("search", "",
1346            "Information about the search process that lead to the creation of this entry.", 0, 1, search);
1347      case 1095692943:
1348        /* request */ return new Property("request", "",
1349            "Additional information about how this entry should be processed as part of a transaction or batch.  For history, it shows how the entry was processed to create the version contained in the entry.",
1350            0, 1, request);
1351      case -340323263:
1352        /* response */ return new Property("response", "",
1353            "Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history.",
1354            0, 1, response);
1355      default:
1356        return super.getNamedProperty(_hash, _name, _checkValid);
1357      }
1358
1359    }
1360
1361    @Override
1362    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1363      switch (hash) {
1364      case 3321850:
1365        /* link */ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent
1366      case -511251360:
1367        /* fullUrl */ return this.fullUrl == null ? new Base[0] : new Base[] { this.fullUrl }; // UriType
1368      case -341064690:
1369        /* resource */ return this.resource == null ? new Base[0] : new Base[] { this.resource }; // Resource
1370      case -906336856:
1371        /* search */ return this.search == null ? new Base[0] : new Base[] { this.search }; // BundleEntrySearchComponent
1372      case 1095692943:
1373        /* request */ return this.request == null ? new Base[0] : new Base[] { this.request }; // BundleEntryRequestComponent
1374      case -340323263:
1375        /* response */ return this.response == null ? new Base[0] : new Base[] { this.response }; // BundleEntryResponseComponent
1376      default:
1377        return super.getProperty(hash, name, checkValid);
1378      }
1379
1380    }
1381
1382    @Override
1383    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1384      switch (hash) {
1385      case 3321850: // link
1386        this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent
1387        return value;
1388      case -511251360: // fullUrl
1389        this.fullUrl = castToUri(value); // UriType
1390        return value;
1391      case -341064690: // resource
1392        this.resource = castToResource(value); // Resource
1393        return value;
1394      case -906336856: // search
1395        this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent
1396        return value;
1397      case 1095692943: // request
1398        this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent
1399        return value;
1400      case -340323263: // response
1401        this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent
1402        return value;
1403      default:
1404        return super.setProperty(hash, name, value);
1405      }
1406
1407    }
1408
1409    @Override
1410    public Base setProperty(String name, Base value) throws FHIRException {
1411      if (name.equals("link")) {
1412        this.getLink().add((BundleLinkComponent) value);
1413      } else if (name.equals("fullUrl")) {
1414        this.fullUrl = castToUri(value); // UriType
1415      } else if (name.equals("resource")) {
1416        this.resource = castToResource(value); // Resource
1417      } else if (name.equals("search")) {
1418        this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent
1419      } else if (name.equals("request")) {
1420        this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent
1421      } else if (name.equals("response")) {
1422        this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent
1423      } else
1424        return super.setProperty(name, value);
1425      return value;
1426    }
1427
1428    @Override
1429    public Base makeProperty(int hash, String name) throws FHIRException {
1430      switch (hash) {
1431      case 3321850:
1432        return addLink();
1433      case -511251360:
1434        return getFullUrlElement();
1435      case -341064690:
1436        throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource
1437      case -906336856:
1438        return getSearch();
1439      case 1095692943:
1440        return getRequest();
1441      case -340323263:
1442        return getResponse();
1443      default:
1444        return super.makeProperty(hash, name);
1445      }
1446
1447    }
1448
1449    @Override
1450    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1451      switch (hash) {
1452      case 3321850:
1453        /* link */ return new String[] { "@Bundle.link" };
1454      case -511251360:
1455        /* fullUrl */ return new String[] { "uri" };
1456      case -341064690:
1457        /* resource */ return new String[] { "Resource" };
1458      case -906336856:
1459        /* search */ return new String[] {};
1460      case 1095692943:
1461        /* request */ return new String[] {};
1462      case -340323263:
1463        /* response */ return new String[] {};
1464      default:
1465        return super.getTypesForProperty(hash, name);
1466      }
1467
1468    }
1469
1470    @Override
1471    public Base addChild(String name) throws FHIRException {
1472      if (name.equals("link")) {
1473        return addLink();
1474      } else if (name.equals("fullUrl")) {
1475        throw new FHIRException("Cannot call addChild on a singleton property Bundle.fullUrl");
1476      } else if (name.equals("resource")) {
1477        throw new FHIRException("Cannot call addChild on an abstract type Bundle.resource");
1478      } else if (name.equals("search")) {
1479        this.search = new BundleEntrySearchComponent();
1480        return this.search;
1481      } else if (name.equals("request")) {
1482        this.request = new BundleEntryRequestComponent();
1483        return this.request;
1484      } else if (name.equals("response")) {
1485        this.response = new BundleEntryResponseComponent();
1486        return this.response;
1487      } else
1488        return super.addChild(name);
1489    }
1490
1491    public BundleEntryComponent copy() {
1492      BundleEntryComponent dst = new BundleEntryComponent();
1493      copyValues(dst);
1494      return dst;
1495    }
1496
1497    public void copyValues(BundleEntryComponent dst) {
1498      super.copyValues(dst);
1499      if (link != null) {
1500        dst.link = new ArrayList<BundleLinkComponent>();
1501        for (BundleLinkComponent i : link)
1502          dst.link.add(i.copy());
1503      }
1504      ;
1505      dst.fullUrl = fullUrl == null ? null : fullUrl.copy();
1506      dst.resource = resource == null ? null : resource.copy();
1507      dst.search = search == null ? null : search.copy();
1508      dst.request = request == null ? null : request.copy();
1509      dst.response = response == null ? null : response.copy();
1510    }
1511
1512    @Override
1513    public boolean equalsDeep(Base other_) {
1514      if (!super.equalsDeep(other_))
1515        return false;
1516      if (!(other_ instanceof BundleEntryComponent))
1517        return false;
1518      BundleEntryComponent o = (BundleEntryComponent) other_;
1519      return compareDeep(link, o.link, true) && compareDeep(fullUrl, o.fullUrl, true)
1520          && compareDeep(resource, o.resource, true) && compareDeep(search, o.search, true)
1521          && compareDeep(request, o.request, true) && compareDeep(response, o.response, true);
1522    }
1523
1524    @Override
1525    public boolean equalsShallow(Base other_) {
1526      if (!super.equalsShallow(other_))
1527        return false;
1528      if (!(other_ instanceof BundleEntryComponent))
1529        return false;
1530      BundleEntryComponent o = (BundleEntryComponent) other_;
1531      return compareValues(fullUrl, o.fullUrl, true);
1532    }
1533
1534    public boolean isEmpty() {
1535      return super.isEmpty()
1536          && ca.uhn.fhir.util.ElementUtil.isEmpty(link, fullUrl, resource, search, request, response);
1537    }
1538
1539    public String fhirType() {
1540      return "Bundle.entry";
1541
1542    }
1543
1544  }
1545
1546  @Block()
1547  public static class BundleEntrySearchComponent extends BackboneElement implements IBaseBackboneElement {
1548    /**
1549     * Why this entry is in the result set - whether it's included as a match or
1550     * because of an _include requirement, or to convey information or warning
1551     * information about the search process.
1552     */
1553    @Child(name = "mode", type = { CodeType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
1554    @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, or to convey information or warning information about the search process.")
1555    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/search-entry-mode")
1556    protected Enumeration<SearchEntryMode> mode;
1557
1558    /**
1559     * When searching, the server's search ranking score for the entry.
1560     */
1561    @Child(name = "score", type = { DecimalType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
1562    @Description(shortDefinition = "Search ranking (between 0 and 1)", formalDefinition = "When searching, the server's search ranking score for the entry.")
1563    protected DecimalType score;
1564
1565    private static final long serialVersionUID = 837739866L;
1566
1567    /**
1568     * Constructor
1569     */
1570    public BundleEntrySearchComponent() {
1571      super();
1572    }
1573
1574    /**
1575     * @return {@link #mode} (Why this entry is in the result set - whether it's
1576     *         included as a match or because of an _include requirement, or to
1577     *         convey information or warning information about the search process.).
1578     *         This is the underlying object with id, value and extensions. The
1579     *         accessor "getMode" gives direct access to the value
1580     */
1581    public Enumeration<SearchEntryMode> getModeElement() {
1582      if (this.mode == null)
1583        if (Configuration.errorOnAutoCreate())
1584          throw new Error("Attempt to auto-create BundleEntrySearchComponent.mode");
1585        else if (Configuration.doAutoCreate())
1586          this.mode = new Enumeration<SearchEntryMode>(new SearchEntryModeEnumFactory()); // bb
1587      return this.mode;
1588    }
1589
1590    public boolean hasModeElement() {
1591      return this.mode != null && !this.mode.isEmpty();
1592    }
1593
1594    public boolean hasMode() {
1595      return this.mode != null && !this.mode.isEmpty();
1596    }
1597
1598    /**
1599     * @param value {@link #mode} (Why this entry is in the result set - whether
1600     *              it's included as a match or because of an _include requirement,
1601     *              or to convey information or warning information about the search
1602     *              process.). This is the underlying object with id, value and
1603     *              extensions. The accessor "getMode" gives direct access to the
1604     *              value
1605     */
1606    public BundleEntrySearchComponent setModeElement(Enumeration<SearchEntryMode> value) {
1607      this.mode = value;
1608      return this;
1609    }
1610
1611    /**
1612     * @return Why this entry is in the result set - whether it's included as a
1613     *         match or because of an _include requirement, or to convey information
1614     *         or warning information about the search process.
1615     */
1616    public SearchEntryMode getMode() {
1617      return this.mode == null ? null : this.mode.getValue();
1618    }
1619
1620    /**
1621     * @param value Why this entry is in the result set - whether it's included as a
1622     *              match or because of an _include requirement, or to convey
1623     *              information or warning information about the search process.
1624     */
1625    public BundleEntrySearchComponent setMode(SearchEntryMode value) {
1626      if (value == null)
1627        this.mode = null;
1628      else {
1629        if (this.mode == null)
1630          this.mode = new Enumeration<SearchEntryMode>(new SearchEntryModeEnumFactory());
1631        this.mode.setValue(value);
1632      }
1633      return this;
1634    }
1635
1636    /**
1637     * @return {@link #score} (When searching, the server's search ranking score for
1638     *         the entry.). This is the underlying object with id, value and
1639     *         extensions. The accessor "getScore" gives direct access to the value
1640     */
1641    public DecimalType getScoreElement() {
1642      if (this.score == null)
1643        if (Configuration.errorOnAutoCreate())
1644          throw new Error("Attempt to auto-create BundleEntrySearchComponent.score");
1645        else if (Configuration.doAutoCreate())
1646          this.score = new DecimalType(); // bb
1647      return this.score;
1648    }
1649
1650    public boolean hasScoreElement() {
1651      return this.score != null && !this.score.isEmpty();
1652    }
1653
1654    public boolean hasScore() {
1655      return this.score != null && !this.score.isEmpty();
1656    }
1657
1658    /**
1659     * @param value {@link #score} (When searching, the server's search ranking
1660     *              score for the entry.). This is the underlying object with id,
1661     *              value and extensions. The accessor "getScore" gives direct
1662     *              access to the value
1663     */
1664    public BundleEntrySearchComponent setScoreElement(DecimalType value) {
1665      this.score = value;
1666      return this;
1667    }
1668
1669    /**
1670     * @return When searching, the server's search ranking score for the entry.
1671     */
1672    public BigDecimal getScore() {
1673      return this.score == null ? null : this.score.getValue();
1674    }
1675
1676    /**
1677     * @param value When searching, the server's search ranking score for the entry.
1678     */
1679    public BundleEntrySearchComponent setScore(BigDecimal value) {
1680      if (value == null)
1681        this.score = null;
1682      else {
1683        if (this.score == null)
1684          this.score = new DecimalType();
1685        this.score.setValue(value);
1686      }
1687      return this;
1688    }
1689
1690    /**
1691     * @param value When searching, the server's search ranking score for the entry.
1692     */
1693    public BundleEntrySearchComponent setScore(long value) {
1694      this.score = new DecimalType();
1695      this.score.setValue(value);
1696      return this;
1697    }
1698
1699    /**
1700     * @param value When searching, the server's search ranking score for the entry.
1701     */
1702    public BundleEntrySearchComponent setScore(double value) {
1703      this.score = new DecimalType();
1704      this.score.setValue(value);
1705      return this;
1706    }
1707
1708    protected void listChildren(List<Property> children) {
1709      super.listChildren(children);
1710      children.add(new Property("mode", "code",
1711          "Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.",
1712          0, 1, mode));
1713      children.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.",
1714          0, 1, score));
1715    }
1716
1717    @Override
1718    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1719      switch (_hash) {
1720      case 3357091:
1721        /* mode */ return new Property("mode", "code",
1722            "Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.",
1723            0, 1, mode);
1724      case 109264530:
1725        /* score */ return new Property("score", "decimal",
1726            "When searching, the server's search ranking score for the entry.", 0, 1, score);
1727      default:
1728        return super.getNamedProperty(_hash, _name, _checkValid);
1729      }
1730
1731    }
1732
1733    @Override
1734    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1735      switch (hash) {
1736      case 3357091:
1737        /* mode */ return this.mode == null ? new Base[0] : new Base[] { this.mode }; // Enumeration<SearchEntryMode>
1738      case 109264530:
1739        /* score */ return this.score == null ? new Base[0] : new Base[] { this.score }; // DecimalType
1740      default:
1741        return super.getProperty(hash, name, checkValid);
1742      }
1743
1744    }
1745
1746    @Override
1747    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1748      switch (hash) {
1749      case 3357091: // mode
1750        value = new SearchEntryModeEnumFactory().fromType(castToCode(value));
1751        this.mode = (Enumeration) value; // Enumeration<SearchEntryMode>
1752        return value;
1753      case 109264530: // score
1754        this.score = castToDecimal(value); // DecimalType
1755        return value;
1756      default:
1757        return super.setProperty(hash, name, value);
1758      }
1759
1760    }
1761
1762    @Override
1763    public Base setProperty(String name, Base value) throws FHIRException {
1764      if (name.equals("mode")) {
1765        value = new SearchEntryModeEnumFactory().fromType(castToCode(value));
1766        this.mode = (Enumeration) value; // Enumeration<SearchEntryMode>
1767      } else if (name.equals("score")) {
1768        this.score = castToDecimal(value); // DecimalType
1769      } else
1770        return super.setProperty(name, value);
1771      return value;
1772    }
1773
1774    @Override
1775    public Base makeProperty(int hash, String name) throws FHIRException {
1776      switch (hash) {
1777      case 3357091:
1778        return getModeElement();
1779      case 109264530:
1780        return getScoreElement();
1781      default:
1782        return super.makeProperty(hash, name);
1783      }
1784
1785    }
1786
1787    @Override
1788    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1789      switch (hash) {
1790      case 3357091:
1791        /* mode */ return new String[] { "code" };
1792      case 109264530:
1793        /* score */ return new String[] { "decimal" };
1794      default:
1795        return super.getTypesForProperty(hash, name);
1796      }
1797
1798    }
1799
1800    @Override
1801    public Base addChild(String name) throws FHIRException {
1802      if (name.equals("mode")) {
1803        throw new FHIRException("Cannot call addChild on a singleton property Bundle.mode");
1804      } else if (name.equals("score")) {
1805        throw new FHIRException("Cannot call addChild on a singleton property Bundle.score");
1806      } else
1807        return super.addChild(name);
1808    }
1809
1810    public BundleEntrySearchComponent copy() {
1811      BundleEntrySearchComponent dst = new BundleEntrySearchComponent();
1812      copyValues(dst);
1813      return dst;
1814    }
1815
1816    public void copyValues(BundleEntrySearchComponent dst) {
1817      super.copyValues(dst);
1818      dst.mode = mode == null ? null : mode.copy();
1819      dst.score = score == null ? null : score.copy();
1820    }
1821
1822    @Override
1823    public boolean equalsDeep(Base other_) {
1824      if (!super.equalsDeep(other_))
1825        return false;
1826      if (!(other_ instanceof BundleEntrySearchComponent))
1827        return false;
1828      BundleEntrySearchComponent o = (BundleEntrySearchComponent) other_;
1829      return compareDeep(mode, o.mode, true) && compareDeep(score, o.score, true);
1830    }
1831
1832    @Override
1833    public boolean equalsShallow(Base other_) {
1834      if (!super.equalsShallow(other_))
1835        return false;
1836      if (!(other_ instanceof BundleEntrySearchComponent))
1837        return false;
1838      BundleEntrySearchComponent o = (BundleEntrySearchComponent) other_;
1839      return compareValues(mode, o.mode, true) && compareValues(score, o.score, true);
1840    }
1841
1842    public boolean isEmpty() {
1843      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, score);
1844    }
1845
1846    public String fhirType() {
1847      return "Bundle.entry.search";
1848
1849    }
1850
1851  }
1852
1853  @Block()
1854  public static class BundleEntryRequestComponent extends BackboneElement implements IBaseBackboneElement {
1855    /**
1856     * In a transaction or batch, this is the HTTP action to be executed for this
1857     * entry. In a history bundle, this indicates the HTTP action that occurred.
1858     */
1859    @Child(name = "method", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
1860    @Description(shortDefinition = "GET | HEAD | POST | PUT | DELETE | PATCH", formalDefinition = "In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred.")
1861    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/http-verb")
1862    protected Enumeration<HTTPVerb> method;
1863
1864    /**
1865     * The URL for this entry, relative to the root (the address to which the
1866     * request is posted).
1867     */
1868    @Child(name = "url", type = { UriType.class }, order = 2, min = 1, max = 1, modifier = false, summary = true)
1869    @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).")
1870    protected UriType url;
1871
1872    /**
1873     * If the ETag values match, return a 304 Not Modified status. See the API
1874     * documentation for ["Conditional Read"](http.html#cread).
1875     */
1876    @Child(name = "ifNoneMatch", type = {
1877        StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
1878    @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).")
1879    protected StringType ifNoneMatch;
1880
1881    /**
1882     * Only perform the operation if the last updated date matches. See the API
1883     * documentation for ["Conditional Read"](http.html#cread).
1884     */
1885    @Child(name = "ifModifiedSince", type = {
1886        InstantType.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
1887    @Description(shortDefinition = "For managing cache currency", formalDefinition = "Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread).")
1888    protected InstantType ifModifiedSince;
1889
1890    /**
1891     * Only perform the operation if the Etag value matches. For more information,
1892     * see the API section ["Managing Resource Contention"](http.html#concurrency).
1893     */
1894    @Child(name = "ifMatch", type = { StringType.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
1895    @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).")
1896    protected StringType ifMatch;
1897
1898    /**
1899     * Instruct the server not to perform the create if a specified resource already
1900     * exists. For further information, see the API documentation for ["Conditional
1901     * Create"](http.html#ccreate). This is just the query portion of the URL - what
1902     * follows the "?" (not including the "?").
1903     */
1904    @Child(name = "ifNoneExist", type = {
1905        StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
1906    @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 \"?\").")
1907    protected StringType ifNoneExist;
1908
1909    private static final long serialVersionUID = -1349769744L;
1910
1911    /**
1912     * Constructor
1913     */
1914    public BundleEntryRequestComponent() {
1915      super();
1916    }
1917
1918    /**
1919     * Constructor
1920     */
1921    public BundleEntryRequestComponent(Enumeration<HTTPVerb> method, UriType url) {
1922      super();
1923      this.method = method;
1924      this.url = url;
1925    }
1926
1927    /**
1928     * @return {@link #method} (In a transaction or batch, this is the HTTP action
1929     *         to be executed for this entry. In a history bundle, this indicates
1930     *         the HTTP action that occurred.). This is the underlying object with
1931     *         id, value and extensions. The accessor "getMethod" gives direct
1932     *         access to the value
1933     */
1934    public Enumeration<HTTPVerb> getMethodElement() {
1935      if (this.method == null)
1936        if (Configuration.errorOnAutoCreate())
1937          throw new Error("Attempt to auto-create BundleEntryRequestComponent.method");
1938        else if (Configuration.doAutoCreate())
1939          this.method = new Enumeration<HTTPVerb>(new HTTPVerbEnumFactory()); // bb
1940      return this.method;
1941    }
1942
1943    public boolean hasMethodElement() {
1944      return this.method != null && !this.method.isEmpty();
1945    }
1946
1947    public boolean hasMethod() {
1948      return this.method != null && !this.method.isEmpty();
1949    }
1950
1951    /**
1952     * @param value {@link #method} (In a transaction or batch, this is the HTTP
1953     *              action to be executed for this entry. In a history bundle, this
1954     *              indicates the HTTP action that occurred.). This is the
1955     *              underlying object with id, value and extensions. The accessor
1956     *              "getMethod" gives direct access to the value
1957     */
1958    public BundleEntryRequestComponent setMethodElement(Enumeration<HTTPVerb> value) {
1959      this.method = value;
1960      return this;
1961    }
1962
1963    /**
1964     * @return In a transaction or batch, this is the HTTP action to be executed for
1965     *         this entry. In a history bundle, this indicates the HTTP action that
1966     *         occurred.
1967     */
1968    public HTTPVerb getMethod() {
1969      return this.method == null ? null : this.method.getValue();
1970    }
1971
1972    /**
1973     * @param value In a transaction or batch, this is the HTTP action to be
1974     *              executed for this entry. In a history bundle, this indicates the
1975     *              HTTP action that occurred.
1976     */
1977    public BundleEntryRequestComponent setMethod(HTTPVerb value) {
1978      if (this.method == null)
1979        this.method = new Enumeration<HTTPVerb>(new HTTPVerbEnumFactory());
1980      this.method.setValue(value);
1981      return this;
1982    }
1983
1984    /**
1985     * @return {@link #url} (The URL for this entry, relative to the root (the
1986     *         address to which the request is posted).). This is the underlying
1987     *         object with id, value and extensions. The accessor "getUrl" gives
1988     *         direct access to the value
1989     */
1990    public UriType getUrlElement() {
1991      if (this.url == null)
1992        if (Configuration.errorOnAutoCreate())
1993          throw new Error("Attempt to auto-create BundleEntryRequestComponent.url");
1994        else if (Configuration.doAutoCreate())
1995          this.url = new UriType(); // bb
1996      return this.url;
1997    }
1998
1999    public boolean hasUrlElement() {
2000      return this.url != null && !this.url.isEmpty();
2001    }
2002
2003    public boolean hasUrl() {
2004      return this.url != null && !this.url.isEmpty();
2005    }
2006
2007    /**
2008     * @param value {@link #url} (The URL for this entry, relative to the root (the
2009     *              address to which the request is posted).). This is the
2010     *              underlying object with id, value and extensions. The accessor
2011     *              "getUrl" gives direct access to the value
2012     */
2013    public BundleEntryRequestComponent setUrlElement(UriType value) {
2014      this.url = value;
2015      return this;
2016    }
2017
2018    /**
2019     * @return The URL for this entry, relative to the root (the address to which
2020     *         the request is posted).
2021     */
2022    public String getUrl() {
2023      return this.url == null ? null : this.url.getValue();
2024    }
2025
2026    /**
2027     * @param value The URL for this entry, relative to the root (the address to
2028     *              which the request is posted).
2029     */
2030    public BundleEntryRequestComponent setUrl(String value) {
2031      if (this.url == null)
2032        this.url = new UriType();
2033      this.url.setValue(value);
2034      return this;
2035    }
2036
2037    /**
2038     * @return {@link #ifNoneMatch} (If the ETag values match, return a 304 Not
2039     *         Modified status. See the API documentation for ["Conditional
2040     *         Read"](http.html#cread).). This is the underlying object with id,
2041     *         value and extensions. The accessor "getIfNoneMatch" gives direct
2042     *         access to the value
2043     */
2044    public StringType getIfNoneMatchElement() {
2045      if (this.ifNoneMatch == null)
2046        if (Configuration.errorOnAutoCreate())
2047          throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneMatch");
2048        else if (Configuration.doAutoCreate())
2049          this.ifNoneMatch = new StringType(); // bb
2050      return this.ifNoneMatch;
2051    }
2052
2053    public boolean hasIfNoneMatchElement() {
2054      return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty();
2055    }
2056
2057    public boolean hasIfNoneMatch() {
2058      return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty();
2059    }
2060
2061    /**
2062     * @param value {@link #ifNoneMatch} (If the ETag values match, return a 304 Not
2063     *              Modified status. See the API documentation for ["Conditional
2064     *              Read"](http.html#cread).). This is the underlying object with
2065     *              id, value and extensions. The accessor "getIfNoneMatch" gives
2066     *              direct access to the value
2067     */
2068    public BundleEntryRequestComponent setIfNoneMatchElement(StringType value) {
2069      this.ifNoneMatch = value;
2070      return this;
2071    }
2072
2073    /**
2074     * @return If the ETag values match, return a 304 Not Modified status. See the
2075     *         API documentation for ["Conditional Read"](http.html#cread).
2076     */
2077    public String getIfNoneMatch() {
2078      return this.ifNoneMatch == null ? null : this.ifNoneMatch.getValue();
2079    }
2080
2081    /**
2082     * @param value If the ETag values match, return a 304 Not Modified status. See
2083     *              the API documentation for ["Conditional Read"](http.html#cread).
2084     */
2085    public BundleEntryRequestComponent setIfNoneMatch(String value) {
2086      if (Utilities.noString(value))
2087        this.ifNoneMatch = null;
2088      else {
2089        if (this.ifNoneMatch == null)
2090          this.ifNoneMatch = new StringType();
2091        this.ifNoneMatch.setValue(value);
2092      }
2093      return this;
2094    }
2095
2096    /**
2097     * @return {@link #ifModifiedSince} (Only perform the operation if the last
2098     *         updated date matches. See the API documentation for ["Conditional
2099     *         Read"](http.html#cread).). This is the underlying object with id,
2100     *         value and extensions. The accessor "getIfModifiedSince" gives direct
2101     *         access to the value
2102     */
2103    public InstantType getIfModifiedSinceElement() {
2104      if (this.ifModifiedSince == null)
2105        if (Configuration.errorOnAutoCreate())
2106          throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifModifiedSince");
2107        else if (Configuration.doAutoCreate())
2108          this.ifModifiedSince = new InstantType(); // bb
2109      return this.ifModifiedSince;
2110    }
2111
2112    public boolean hasIfModifiedSinceElement() {
2113      return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty();
2114    }
2115
2116    public boolean hasIfModifiedSince() {
2117      return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty();
2118    }
2119
2120    /**
2121     * @param value {@link #ifModifiedSince} (Only perform the operation if the last
2122     *              updated date matches. See the API documentation for
2123     *              ["Conditional Read"](http.html#cread).). This is the underlying
2124     *              object with id, value and extensions. The accessor
2125     *              "getIfModifiedSince" gives direct access to the value
2126     */
2127    public BundleEntryRequestComponent setIfModifiedSinceElement(InstantType value) {
2128      this.ifModifiedSince = value;
2129      return this;
2130    }
2131
2132    /**
2133     * @return Only perform the operation if the last updated date matches. See the
2134     *         API documentation for ["Conditional Read"](http.html#cread).
2135     */
2136    public Date getIfModifiedSince() {
2137      return this.ifModifiedSince == null ? null : this.ifModifiedSince.getValue();
2138    }
2139
2140    /**
2141     * @param value Only perform the operation if the last updated date matches. See
2142     *              the API documentation for ["Conditional Read"](http.html#cread).
2143     */
2144    public BundleEntryRequestComponent setIfModifiedSince(Date value) {
2145      if (value == null)
2146        this.ifModifiedSince = null;
2147      else {
2148        if (this.ifModifiedSince == null)
2149          this.ifModifiedSince = new InstantType();
2150        this.ifModifiedSince.setValue(value);
2151      }
2152      return this;
2153    }
2154
2155    /**
2156     * @return {@link #ifMatch} (Only perform the operation if the Etag value
2157     *         matches. For more information, see the API section ["Managing
2158     *         Resource Contention"](http.html#concurrency).). This is the
2159     *         underlying object with id, value and extensions. The accessor
2160     *         "getIfMatch" gives direct access to the value
2161     */
2162    public StringType getIfMatchElement() {
2163      if (this.ifMatch == null)
2164        if (Configuration.errorOnAutoCreate())
2165          throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifMatch");
2166        else if (Configuration.doAutoCreate())
2167          this.ifMatch = new StringType(); // bb
2168      return this.ifMatch;
2169    }
2170
2171    public boolean hasIfMatchElement() {
2172      return this.ifMatch != null && !this.ifMatch.isEmpty();
2173    }
2174
2175    public boolean hasIfMatch() {
2176      return this.ifMatch != null && !this.ifMatch.isEmpty();
2177    }
2178
2179    /**
2180     * @param value {@link #ifMatch} (Only perform the operation if the Etag value
2181     *              matches. For more information, see the API section ["Managing
2182     *              Resource Contention"](http.html#concurrency).). This is the
2183     *              underlying object with id, value and extensions. The accessor
2184     *              "getIfMatch" gives direct access to the value
2185     */
2186    public BundleEntryRequestComponent setIfMatchElement(StringType value) {
2187      this.ifMatch = value;
2188      return this;
2189    }
2190
2191    /**
2192     * @return Only perform the operation if the Etag value matches. For more
2193     *         information, see the API section ["Managing Resource
2194     *         Contention"](http.html#concurrency).
2195     */
2196    public String getIfMatch() {
2197      return this.ifMatch == null ? null : this.ifMatch.getValue();
2198    }
2199
2200    /**
2201     * @param value Only perform the operation if the Etag value matches. For more
2202     *              information, see the API section ["Managing Resource
2203     *              Contention"](http.html#concurrency).
2204     */
2205    public BundleEntryRequestComponent setIfMatch(String value) {
2206      if (Utilities.noString(value))
2207        this.ifMatch = null;
2208      else {
2209        if (this.ifMatch == null)
2210          this.ifMatch = new StringType();
2211        this.ifMatch.setValue(value);
2212      }
2213      return this;
2214    }
2215
2216    /**
2217     * @return {@link #ifNoneExist} (Instruct the server not to perform the create
2218     *         if a specified resource already exists. For further information, see
2219     *         the API documentation for ["Conditional Create"](http.html#ccreate).
2220     *         This is just the query portion of the URL - what follows the "?" (not
2221     *         including the "?").). This is the underlying object with id, value
2222     *         and extensions. The accessor "getIfNoneExist" gives direct access to
2223     *         the value
2224     */
2225    public StringType getIfNoneExistElement() {
2226      if (this.ifNoneExist == null)
2227        if (Configuration.errorOnAutoCreate())
2228          throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneExist");
2229        else if (Configuration.doAutoCreate())
2230          this.ifNoneExist = new StringType(); // bb
2231      return this.ifNoneExist;
2232    }
2233
2234    public boolean hasIfNoneExistElement() {
2235      return this.ifNoneExist != null && !this.ifNoneExist.isEmpty();
2236    }
2237
2238    public boolean hasIfNoneExist() {
2239      return this.ifNoneExist != null && !this.ifNoneExist.isEmpty();
2240    }
2241
2242    /**
2243     * @param value {@link #ifNoneExist} (Instruct the server not to perform the
2244     *              create if a specified resource already exists. For further
2245     *              information, see the API documentation for ["Conditional
2246     *              Create"](http.html#ccreate). This is just the query portion of
2247     *              the URL - what follows the "?" (not including the "?").). This
2248     *              is the underlying object with id, value and extensions. The
2249     *              accessor "getIfNoneExist" gives direct access to the value
2250     */
2251    public BundleEntryRequestComponent setIfNoneExistElement(StringType value) {
2252      this.ifNoneExist = value;
2253      return this;
2254    }
2255
2256    /**
2257     * @return Instruct the server not to perform the create if a specified resource
2258     *         already exists. For further information, see the API documentation
2259     *         for ["Conditional Create"](http.html#ccreate). This is just the query
2260     *         portion of the URL - what follows the "?" (not including the "?").
2261     */
2262    public String getIfNoneExist() {
2263      return this.ifNoneExist == null ? null : this.ifNoneExist.getValue();
2264    }
2265
2266    /**
2267     * @param value Instruct the server not to perform the create if a specified
2268     *              resource already exists. For further information, see the API
2269     *              documentation for ["Conditional Create"](http.html#ccreate).
2270     *              This is just the query portion of the URL - what follows the "?"
2271     *              (not including the "?").
2272     */
2273    public BundleEntryRequestComponent setIfNoneExist(String value) {
2274      if (Utilities.noString(value))
2275        this.ifNoneExist = null;
2276      else {
2277        if (this.ifNoneExist == null)
2278          this.ifNoneExist = new StringType();
2279        this.ifNoneExist.setValue(value);
2280      }
2281      return this;
2282    }
2283
2284    protected void listChildren(List<Property> children) {
2285      super.listChildren(children);
2286      children.add(new Property("method", "code",
2287          "In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred.",
2288          0, 1, method));
2289      children.add(new Property("url", "uri",
2290          "The URL for this entry, relative to the root (the address to which the request is posted).", 0, 1, url));
2291      children.add(new Property("ifNoneMatch", "string",
2292          "If the ETag values match, return a 304 Not Modified status. See the API documentation for [\"Conditional Read\"](http.html#cread).",
2293          0, 1, ifNoneMatch));
2294      children.add(new Property("ifModifiedSince", "instant",
2295          "Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread).",
2296          0, 1, ifModifiedSince));
2297      children.add(new Property("ifMatch", "string",
2298          "Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency).",
2299          0, 1, ifMatch));
2300      children.add(new Property("ifNoneExist", "string",
2301          "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 \"?\").",
2302          0, 1, ifNoneExist));
2303    }
2304
2305    @Override
2306    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2307      switch (_hash) {
2308      case -1077554975:
2309        /* method */ return new Property("method", "code",
2310            "In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred.",
2311            0, 1, method);
2312      case 116079:
2313        /* url */ return new Property("url", "uri",
2314            "The URL for this entry, relative to the root (the address to which the request is posted).", 0, 1, url);
2315      case 171868368:
2316        /* ifNoneMatch */ return new Property("ifNoneMatch", "string",
2317            "If the ETag values match, return a 304 Not Modified status. See the API documentation for [\"Conditional Read\"](http.html#cread).",
2318            0, 1, ifNoneMatch);
2319      case -2061602860:
2320        /* ifModifiedSince */ return new Property("ifModifiedSince", "instant",
2321            "Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread).",
2322            0, 1, ifModifiedSince);
2323      case 1692894888:
2324        /* ifMatch */ return new Property("ifMatch", "string",
2325            "Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency).",
2326            0, 1, ifMatch);
2327      case 165155330:
2328        /* ifNoneExist */ return new Property("ifNoneExist", "string",
2329            "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 \"?\").",
2330            0, 1, ifNoneExist);
2331      default:
2332        return super.getNamedProperty(_hash, _name, _checkValid);
2333      }
2334
2335    }
2336
2337    @Override
2338    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2339      switch (hash) {
2340      case -1077554975:
2341        /* method */ return this.method == null ? new Base[0] : new Base[] { this.method }; // Enumeration<HTTPVerb>
2342      case 116079:
2343        /* url */ return this.url == null ? new Base[0] : new Base[] { this.url }; // UriType
2344      case 171868368:
2345        /* ifNoneMatch */ return this.ifNoneMatch == null ? new Base[0] : new Base[] { this.ifNoneMatch }; // StringType
2346      case -2061602860:
2347        /* ifModifiedSince */ return this.ifModifiedSince == null ? new Base[0] : new Base[] { this.ifModifiedSince }; // InstantType
2348      case 1692894888:
2349        /* ifMatch */ return this.ifMatch == null ? new Base[0] : new Base[] { this.ifMatch }; // StringType
2350      case 165155330:
2351        /* ifNoneExist */ return this.ifNoneExist == null ? new Base[0] : new Base[] { this.ifNoneExist }; // StringType
2352      default:
2353        return super.getProperty(hash, name, checkValid);
2354      }
2355
2356    }
2357
2358    @Override
2359    public Base setProperty(int hash, String name, Base value) throws FHIRException {
2360      switch (hash) {
2361      case -1077554975: // method
2362        value = new HTTPVerbEnumFactory().fromType(castToCode(value));
2363        this.method = (Enumeration) value; // Enumeration<HTTPVerb>
2364        return value;
2365      case 116079: // url
2366        this.url = castToUri(value); // UriType
2367        return value;
2368      case 171868368: // ifNoneMatch
2369        this.ifNoneMatch = castToString(value); // StringType
2370        return value;
2371      case -2061602860: // ifModifiedSince
2372        this.ifModifiedSince = castToInstant(value); // InstantType
2373        return value;
2374      case 1692894888: // ifMatch
2375        this.ifMatch = castToString(value); // StringType
2376        return value;
2377      case 165155330: // ifNoneExist
2378        this.ifNoneExist = castToString(value); // StringType
2379        return value;
2380      default:
2381        return super.setProperty(hash, name, value);
2382      }
2383
2384    }
2385
2386    @Override
2387    public Base setProperty(String name, Base value) throws FHIRException {
2388      if (name.equals("method")) {
2389        value = new HTTPVerbEnumFactory().fromType(castToCode(value));
2390        this.method = (Enumeration) value; // Enumeration<HTTPVerb>
2391      } else if (name.equals("url")) {
2392        this.url = castToUri(value); // UriType
2393      } else if (name.equals("ifNoneMatch")) {
2394        this.ifNoneMatch = castToString(value); // StringType
2395      } else if (name.equals("ifModifiedSince")) {
2396        this.ifModifiedSince = castToInstant(value); // InstantType
2397      } else if (name.equals("ifMatch")) {
2398        this.ifMatch = castToString(value); // StringType
2399      } else if (name.equals("ifNoneExist")) {
2400        this.ifNoneExist = castToString(value); // StringType
2401      } else
2402        return super.setProperty(name, value);
2403      return value;
2404    }
2405
2406    @Override
2407    public Base makeProperty(int hash, String name) throws FHIRException {
2408      switch (hash) {
2409      case -1077554975:
2410        return getMethodElement();
2411      case 116079:
2412        return getUrlElement();
2413      case 171868368:
2414        return getIfNoneMatchElement();
2415      case -2061602860:
2416        return getIfModifiedSinceElement();
2417      case 1692894888:
2418        return getIfMatchElement();
2419      case 165155330:
2420        return getIfNoneExistElement();
2421      default:
2422        return super.makeProperty(hash, name);
2423      }
2424
2425    }
2426
2427    @Override
2428    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2429      switch (hash) {
2430      case -1077554975:
2431        /* method */ return new String[] { "code" };
2432      case 116079:
2433        /* url */ return new String[] { "uri" };
2434      case 171868368:
2435        /* ifNoneMatch */ return new String[] { "string" };
2436      case -2061602860:
2437        /* ifModifiedSince */ return new String[] { "instant" };
2438      case 1692894888:
2439        /* ifMatch */ return new String[] { "string" };
2440      case 165155330:
2441        /* ifNoneExist */ return new String[] { "string" };
2442      default:
2443        return super.getTypesForProperty(hash, name);
2444      }
2445
2446    }
2447
2448    @Override
2449    public Base addChild(String name) throws FHIRException {
2450      if (name.equals("method")) {
2451        throw new FHIRException("Cannot call addChild on a singleton property Bundle.method");
2452      } else if (name.equals("url")) {
2453        throw new FHIRException("Cannot call addChild on a singleton property Bundle.url");
2454      } else if (name.equals("ifNoneMatch")) {
2455        throw new FHIRException("Cannot call addChild on a singleton property Bundle.ifNoneMatch");
2456      } else if (name.equals("ifModifiedSince")) {
2457        throw new FHIRException("Cannot call addChild on a singleton property Bundle.ifModifiedSince");
2458      } else if (name.equals("ifMatch")) {
2459        throw new FHIRException("Cannot call addChild on a singleton property Bundle.ifMatch");
2460      } else if (name.equals("ifNoneExist")) {
2461        throw new FHIRException("Cannot call addChild on a singleton property Bundle.ifNoneExist");
2462      } else
2463        return super.addChild(name);
2464    }
2465
2466    public BundleEntryRequestComponent copy() {
2467      BundleEntryRequestComponent dst = new BundleEntryRequestComponent();
2468      copyValues(dst);
2469      return dst;
2470    }
2471
2472    public void copyValues(BundleEntryRequestComponent dst) {
2473      super.copyValues(dst);
2474      dst.method = method == null ? null : method.copy();
2475      dst.url = url == null ? null : url.copy();
2476      dst.ifNoneMatch = ifNoneMatch == null ? null : ifNoneMatch.copy();
2477      dst.ifModifiedSince = ifModifiedSince == null ? null : ifModifiedSince.copy();
2478      dst.ifMatch = ifMatch == null ? null : ifMatch.copy();
2479      dst.ifNoneExist = ifNoneExist == null ? null : ifNoneExist.copy();
2480    }
2481
2482    @Override
2483    public boolean equalsDeep(Base other_) {
2484      if (!super.equalsDeep(other_))
2485        return false;
2486      if (!(other_ instanceof BundleEntryRequestComponent))
2487        return false;
2488      BundleEntryRequestComponent o = (BundleEntryRequestComponent) other_;
2489      return compareDeep(method, o.method, true) && compareDeep(url, o.url, true)
2490          && compareDeep(ifNoneMatch, o.ifNoneMatch, true) && compareDeep(ifModifiedSince, o.ifModifiedSince, true)
2491          && compareDeep(ifMatch, o.ifMatch, true) && compareDeep(ifNoneExist, o.ifNoneExist, true);
2492    }
2493
2494    @Override
2495    public boolean equalsShallow(Base other_) {
2496      if (!super.equalsShallow(other_))
2497        return false;
2498      if (!(other_ instanceof BundleEntryRequestComponent))
2499        return false;
2500      BundleEntryRequestComponent o = (BundleEntryRequestComponent) other_;
2501      return compareValues(method, o.method, true) && compareValues(url, o.url, true)
2502          && compareValues(ifNoneMatch, o.ifNoneMatch, true) && compareValues(ifModifiedSince, o.ifModifiedSince, true)
2503          && compareValues(ifMatch, o.ifMatch, true) && compareValues(ifNoneExist, o.ifNoneExist, true);
2504    }
2505
2506    public boolean isEmpty() {
2507      return super.isEmpty()
2508          && ca.uhn.fhir.util.ElementUtil.isEmpty(method, url, ifNoneMatch, ifModifiedSince, ifMatch, ifNoneExist);
2509    }
2510
2511    public String fhirType() {
2512      return "Bundle.entry.request";
2513
2514    }
2515
2516  }
2517
2518  @Block()
2519  public static class BundleEntryResponseComponent extends BackboneElement implements IBaseBackboneElement {
2520    /**
2521     * The status code returned by processing this entry. The status SHALL start
2522     * with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP
2523     * description associated with the status code.
2524     */
2525    @Child(name = "status", type = { StringType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
2526    @Description(shortDefinition = "Status response code (text optional)", formalDefinition = "The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.")
2527    protected StringType status;
2528
2529    /**
2530     * The location header created by processing this operation, populated if the
2531     * operation returns a location.
2532     */
2533    @Child(name = "location", type = { UriType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
2534    @Description(shortDefinition = "The location (if the operation returns a location)", formalDefinition = "The location header created by processing this operation, populated if the operation returns a location.")
2535    protected UriType location;
2536
2537    /**
2538     * The Etag for the resource, if the operation for the entry produced a
2539     * versioned resource (see [Resource Metadata and
2540     * Versioning](http.html#versioning) and [Managing Resource
2541     * Contention](http.html#concurrency)).
2542     */
2543    @Child(name = "etag", type = { StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
2544    @Description(shortDefinition = "The Etag for the resource (if relevant)", formalDefinition = "The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).")
2545    protected StringType etag;
2546
2547    /**
2548     * The date/time that the resource was modified on the server.
2549     */
2550    @Child(name = "lastModified", type = {
2551        InstantType.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
2552    @Description(shortDefinition = "Server's date time modified", formalDefinition = "The date/time that the resource was modified on the server.")
2553    protected InstantType lastModified;
2554
2555    /**
2556     * An OperationOutcome containing hints and warnings produced as part of
2557     * processing this entry in a batch or transaction.
2558     */
2559    @Child(name = "outcome", type = { Resource.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
2560    @Description(shortDefinition = "OperationOutcome with hints and warnings (for batch/transaction)", formalDefinition = "An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.")
2561    protected Resource outcome;
2562
2563    private static final long serialVersionUID = 923278008L;
2564
2565    /**
2566     * Constructor
2567     */
2568    public BundleEntryResponseComponent() {
2569      super();
2570    }
2571
2572    /**
2573     * Constructor
2574     */
2575    public BundleEntryResponseComponent(StringType status) {
2576      super();
2577      this.status = status;
2578    }
2579
2580    /**
2581     * @return {@link #status} (The status code returned by processing this entry.
2582     *         The status SHALL start with a 3 digit HTTP code (e.g. 404) and may
2583     *         contain the standard HTTP description associated with the status
2584     *         code.). This is the underlying object with id, value and extensions.
2585     *         The accessor "getStatus" gives direct access to the value
2586     */
2587    public StringType getStatusElement() {
2588      if (this.status == null)
2589        if (Configuration.errorOnAutoCreate())
2590          throw new Error("Attempt to auto-create BundleEntryResponseComponent.status");
2591        else if (Configuration.doAutoCreate())
2592          this.status = new StringType(); // bb
2593      return this.status;
2594    }
2595
2596    public boolean hasStatusElement() {
2597      return this.status != null && !this.status.isEmpty();
2598    }
2599
2600    public boolean hasStatus() {
2601      return this.status != null && !this.status.isEmpty();
2602    }
2603
2604    /**
2605     * @param value {@link #status} (The status code returned by processing this
2606     *              entry. The status SHALL start with a 3 digit HTTP code (e.g.
2607     *              404) and may contain the standard HTTP description associated
2608     *              with the status code.). This is the underlying object with id,
2609     *              value and extensions. The accessor "getStatus" gives direct
2610     *              access to the value
2611     */
2612    public BundleEntryResponseComponent setStatusElement(StringType value) {
2613      this.status = value;
2614      return this;
2615    }
2616
2617    /**
2618     * @return The status code returned by processing this entry. The status SHALL
2619     *         start with a 3 digit HTTP code (e.g. 404) and may contain the
2620     *         standard HTTP description associated with the status code.
2621     */
2622    public String getStatus() {
2623      return this.status == null ? null : this.status.getValue();
2624    }
2625
2626    /**
2627     * @param value The status code returned by processing this entry. The status
2628     *              SHALL start with a 3 digit HTTP code (e.g. 404) and may contain
2629     *              the standard HTTP description associated with the status code.
2630     */
2631    public BundleEntryResponseComponent setStatus(String value) {
2632      if (this.status == null)
2633        this.status = new StringType();
2634      this.status.setValue(value);
2635      return this;
2636    }
2637
2638    /**
2639     * @return {@link #location} (The location header created by processing this
2640     *         operation, populated if the operation returns a location.). This is
2641     *         the underlying object with id, value and extensions. The accessor
2642     *         "getLocation" gives direct access to the value
2643     */
2644    public UriType getLocationElement() {
2645      if (this.location == null)
2646        if (Configuration.errorOnAutoCreate())
2647          throw new Error("Attempt to auto-create BundleEntryResponseComponent.location");
2648        else if (Configuration.doAutoCreate())
2649          this.location = new UriType(); // bb
2650      return this.location;
2651    }
2652
2653    public boolean hasLocationElement() {
2654      return this.location != null && !this.location.isEmpty();
2655    }
2656
2657    public boolean hasLocation() {
2658      return this.location != null && !this.location.isEmpty();
2659    }
2660
2661    /**
2662     * @param value {@link #location} (The location header created by processing
2663     *              this operation, populated if the operation returns a location.).
2664     *              This is the underlying object with id, value and extensions. The
2665     *              accessor "getLocation" gives direct access to the value
2666     */
2667    public BundleEntryResponseComponent setLocationElement(UriType value) {
2668      this.location = value;
2669      return this;
2670    }
2671
2672    /**
2673     * @return The location header created by processing this operation, populated
2674     *         if the operation returns a location.
2675     */
2676    public String getLocation() {
2677      return this.location == null ? null : this.location.getValue();
2678    }
2679
2680    /**
2681     * @param value The location header created by processing this operation,
2682     *              populated if the operation returns a location.
2683     */
2684    public BundleEntryResponseComponent setLocation(String value) {
2685      if (Utilities.noString(value))
2686        this.location = null;
2687      else {
2688        if (this.location == null)
2689          this.location = new UriType();
2690        this.location.setValue(value);
2691      }
2692      return this;
2693    }
2694
2695    /**
2696     * @return {@link #etag} (The Etag for the resource, if the operation for the
2697     *         entry produced a versioned resource (see [Resource Metadata and
2698     *         Versioning](http.html#versioning) and [Managing Resource
2699     *         Contention](http.html#concurrency)).). This is the underlying object
2700     *         with id, value and extensions. The accessor "getEtag" gives direct
2701     *         access to the value
2702     */
2703    public StringType getEtagElement() {
2704      if (this.etag == null)
2705        if (Configuration.errorOnAutoCreate())
2706          throw new Error("Attempt to auto-create BundleEntryResponseComponent.etag");
2707        else if (Configuration.doAutoCreate())
2708          this.etag = new StringType(); // bb
2709      return this.etag;
2710    }
2711
2712    public boolean hasEtagElement() {
2713      return this.etag != null && !this.etag.isEmpty();
2714    }
2715
2716    public boolean hasEtag() {
2717      return this.etag != null && !this.etag.isEmpty();
2718    }
2719
2720    /**
2721     * @param value {@link #etag} (The Etag for the resource, if the operation for
2722     *              the entry produced a versioned resource (see [Resource Metadata
2723     *              and Versioning](http.html#versioning) and [Managing Resource
2724     *              Contention](http.html#concurrency)).). This is the underlying
2725     *              object with id, value and extensions. The accessor "getEtag"
2726     *              gives direct access to the value
2727     */
2728    public BundleEntryResponseComponent setEtagElement(StringType value) {
2729      this.etag = value;
2730      return this;
2731    }
2732
2733    /**
2734     * @return The Etag for the resource, if the operation for the entry produced a
2735     *         versioned resource (see [Resource Metadata and
2736     *         Versioning](http.html#versioning) and [Managing Resource
2737     *         Contention](http.html#concurrency)).
2738     */
2739    public String getEtag() {
2740      return this.etag == null ? null : this.etag.getValue();
2741    }
2742
2743    /**
2744     * @param value The Etag for the resource, if the operation for the entry
2745     *              produced a versioned resource (see [Resource Metadata and
2746     *              Versioning](http.html#versioning) and [Managing Resource
2747     *              Contention](http.html#concurrency)).
2748     */
2749    public BundleEntryResponseComponent setEtag(String value) {
2750      if (Utilities.noString(value))
2751        this.etag = null;
2752      else {
2753        if (this.etag == null)
2754          this.etag = new StringType();
2755        this.etag.setValue(value);
2756      }
2757      return this;
2758    }
2759
2760    /**
2761     * @return {@link #lastModified} (The date/time that the resource was modified
2762     *         on the server.). This is the underlying object with id, value and
2763     *         extensions. The accessor "getLastModified" gives direct access to the
2764     *         value
2765     */
2766    public InstantType getLastModifiedElement() {
2767      if (this.lastModified == null)
2768        if (Configuration.errorOnAutoCreate())
2769          throw new Error("Attempt to auto-create BundleEntryResponseComponent.lastModified");
2770        else if (Configuration.doAutoCreate())
2771          this.lastModified = new InstantType(); // bb
2772      return this.lastModified;
2773    }
2774
2775    public boolean hasLastModifiedElement() {
2776      return this.lastModified != null && !this.lastModified.isEmpty();
2777    }
2778
2779    public boolean hasLastModified() {
2780      return this.lastModified != null && !this.lastModified.isEmpty();
2781    }
2782
2783    /**
2784     * @param value {@link #lastModified} (The date/time that the resource was
2785     *              modified on the server.). This is the underlying object with id,
2786     *              value and extensions. The accessor "getLastModified" gives
2787     *              direct access to the value
2788     */
2789    public BundleEntryResponseComponent setLastModifiedElement(InstantType value) {
2790      this.lastModified = value;
2791      return this;
2792    }
2793
2794    /**
2795     * @return The date/time that the resource was modified on the server.
2796     */
2797    public Date getLastModified() {
2798      return this.lastModified == null ? null : this.lastModified.getValue();
2799    }
2800
2801    /**
2802     * @param value The date/time that the resource was modified on the server.
2803     */
2804    public BundleEntryResponseComponent setLastModified(Date value) {
2805      if (value == null)
2806        this.lastModified = null;
2807      else {
2808        if (this.lastModified == null)
2809          this.lastModified = new InstantType();
2810        this.lastModified.setValue(value);
2811      }
2812      return this;
2813    }
2814
2815    /**
2816     * @return {@link #outcome} (An OperationOutcome containing hints and warnings
2817     *         produced as part of processing this entry in a batch or transaction.)
2818     */
2819    public Resource getOutcome() {
2820      return this.outcome;
2821    }
2822
2823    public boolean hasOutcome() {
2824      return this.outcome != null && !this.outcome.isEmpty();
2825    }
2826
2827    /**
2828     * @param value {@link #outcome} (An OperationOutcome containing hints and
2829     *              warnings produced as part of processing this entry in a batch or
2830     *              transaction.)
2831     */
2832    public BundleEntryResponseComponent setOutcome(Resource value) {
2833      this.outcome = value;
2834      return this;
2835    }
2836
2837    protected void listChildren(List<Property> children) {
2838      super.listChildren(children);
2839      children.add(new Property("status", "string",
2840          "The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.",
2841          0, 1, status));
2842      children.add(new Property("location", "uri",
2843          "The location header created by processing this operation, populated if the operation returns a location.", 0,
2844          1, location));
2845      children.add(new Property("etag", "string",
2846          "The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).",
2847          0, 1, etag));
2848      children.add(new Property("lastModified", "instant",
2849          "The date/time that the resource was modified on the server.", 0, 1, lastModified));
2850      children.add(new Property("outcome", "Resource",
2851          "An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.",
2852          0, 1, outcome));
2853    }
2854
2855    @Override
2856    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2857      switch (_hash) {
2858      case -892481550:
2859        /* status */ return new Property("status", "string",
2860            "The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.",
2861            0, 1, status);
2862      case 1901043637:
2863        /* location */ return new Property("location", "uri",
2864            "The location header created by processing this operation, populated if the operation returns a location.",
2865            0, 1, location);
2866      case 3123477:
2867        /* etag */ return new Property("etag", "string",
2868            "The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).",
2869            0, 1, etag);
2870      case 1959003007:
2871        /* lastModified */ return new Property("lastModified", "instant",
2872            "The date/time that the resource was modified on the server.", 0, 1, lastModified);
2873      case -1106507950:
2874        /* outcome */ return new Property("outcome", "Resource",
2875            "An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.",
2876            0, 1, outcome);
2877      default:
2878        return super.getNamedProperty(_hash, _name, _checkValid);
2879      }
2880
2881    }
2882
2883    @Override
2884    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2885      switch (hash) {
2886      case -892481550:
2887        /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // StringType
2888      case 1901043637:
2889        /* location */ return this.location == null ? new Base[0] : new Base[] { this.location }; // UriType
2890      case 3123477:
2891        /* etag */ return this.etag == null ? new Base[0] : new Base[] { this.etag }; // StringType
2892      case 1959003007:
2893        /* lastModified */ return this.lastModified == null ? new Base[0] : new Base[] { this.lastModified }; // InstantType
2894      case -1106507950:
2895        /* outcome */ return this.outcome == null ? new Base[0] : new Base[] { this.outcome }; // Resource
2896      default:
2897        return super.getProperty(hash, name, checkValid);
2898      }
2899
2900    }
2901
2902    @Override
2903    public Base setProperty(int hash, String name, Base value) throws FHIRException {
2904      switch (hash) {
2905      case -892481550: // status
2906        this.status = castToString(value); // StringType
2907        return value;
2908      case 1901043637: // location
2909        this.location = castToUri(value); // UriType
2910        return value;
2911      case 3123477: // etag
2912        this.etag = castToString(value); // StringType
2913        return value;
2914      case 1959003007: // lastModified
2915        this.lastModified = castToInstant(value); // InstantType
2916        return value;
2917      case -1106507950: // outcome
2918        this.outcome = castToResource(value); // Resource
2919        return value;
2920      default:
2921        return super.setProperty(hash, name, value);
2922      }
2923
2924    }
2925
2926    @Override
2927    public Base setProperty(String name, Base value) throws FHIRException {
2928      if (name.equals("status")) {
2929        this.status = castToString(value); // StringType
2930      } else if (name.equals("location")) {
2931        this.location = castToUri(value); // UriType
2932      } else if (name.equals("etag")) {
2933        this.etag = castToString(value); // StringType
2934      } else if (name.equals("lastModified")) {
2935        this.lastModified = castToInstant(value); // InstantType
2936      } else if (name.equals("outcome")) {
2937        this.outcome = castToResource(value); // Resource
2938      } else
2939        return super.setProperty(name, value);
2940      return value;
2941    }
2942
2943    @Override
2944    public Base makeProperty(int hash, String name) throws FHIRException {
2945      switch (hash) {
2946      case -892481550:
2947        return getStatusElement();
2948      case 1901043637:
2949        return getLocationElement();
2950      case 3123477:
2951        return getEtagElement();
2952      case 1959003007:
2953        return getLastModifiedElement();
2954      case -1106507950:
2955        throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Resource
2956      default:
2957        return super.makeProperty(hash, name);
2958      }
2959
2960    }
2961
2962    @Override
2963    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2964      switch (hash) {
2965      case -892481550:
2966        /* status */ return new String[] { "string" };
2967      case 1901043637:
2968        /* location */ return new String[] { "uri" };
2969      case 3123477:
2970        /* etag */ return new String[] { "string" };
2971      case 1959003007:
2972        /* lastModified */ return new String[] { "instant" };
2973      case -1106507950:
2974        /* outcome */ return new String[] { "Resource" };
2975      default:
2976        return super.getTypesForProperty(hash, name);
2977      }
2978
2979    }
2980
2981    @Override
2982    public Base addChild(String name) throws FHIRException {
2983      if (name.equals("status")) {
2984        throw new FHIRException("Cannot call addChild on a singleton property Bundle.status");
2985      } else if (name.equals("location")) {
2986        throw new FHIRException("Cannot call addChild on a singleton property Bundle.location");
2987      } else if (name.equals("etag")) {
2988        throw new FHIRException("Cannot call addChild on a singleton property Bundle.etag");
2989      } else if (name.equals("lastModified")) {
2990        throw new FHIRException("Cannot call addChild on a singleton property Bundle.lastModified");
2991      } else if (name.equals("outcome")) {
2992        throw new FHIRException("Cannot call addChild on an abstract type Bundle.outcome");
2993      } else
2994        return super.addChild(name);
2995    }
2996
2997    public BundleEntryResponseComponent copy() {
2998      BundleEntryResponseComponent dst = new BundleEntryResponseComponent();
2999      copyValues(dst);
3000      return dst;
3001    }
3002
3003    public void copyValues(BundleEntryResponseComponent dst) {
3004      super.copyValues(dst);
3005      dst.status = status == null ? null : status.copy();
3006      dst.location = location == null ? null : location.copy();
3007      dst.etag = etag == null ? null : etag.copy();
3008      dst.lastModified = lastModified == null ? null : lastModified.copy();
3009      dst.outcome = outcome == null ? null : outcome.copy();
3010    }
3011
3012    @Override
3013    public boolean equalsDeep(Base other_) {
3014      if (!super.equalsDeep(other_))
3015        return false;
3016      if (!(other_ instanceof BundleEntryResponseComponent))
3017        return false;
3018      BundleEntryResponseComponent o = (BundleEntryResponseComponent) other_;
3019      return compareDeep(status, o.status, true) && compareDeep(location, o.location, true)
3020          && compareDeep(etag, o.etag, true) && compareDeep(lastModified, o.lastModified, true)
3021          && compareDeep(outcome, o.outcome, true);
3022    }
3023
3024    @Override
3025    public boolean equalsShallow(Base other_) {
3026      if (!super.equalsShallow(other_))
3027        return false;
3028      if (!(other_ instanceof BundleEntryResponseComponent))
3029        return false;
3030      BundleEntryResponseComponent o = (BundleEntryResponseComponent) other_;
3031      return compareValues(status, o.status, true) && compareValues(location, o.location, true)
3032          && compareValues(etag, o.etag, true) && compareValues(lastModified, o.lastModified, true);
3033    }
3034
3035    public boolean isEmpty() {
3036      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(status, location, etag, lastModified, outcome);
3037    }
3038
3039    public String fhirType() {
3040      return "Bundle.entry.response";
3041
3042    }
3043
3044  }
3045
3046  /**
3047   * A persistent identifier for the bundle that won't change as a bundle is
3048   * copied from server to server.
3049   */
3050  @Child(name = "identifier", type = {
3051      Identifier.class }, order = 0, min = 0, max = 1, modifier = false, summary = true)
3052  @Description(shortDefinition = "Persistent identifier for the bundle", formalDefinition = "A persistent identifier for the bundle that won't change as a bundle is copied from server to server.")
3053  protected Identifier identifier;
3054
3055  /**
3056   * Indicates the purpose of this bundle - how it is intended to be used.
3057   */
3058  @Child(name = "type", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
3059  @Description(shortDefinition = "document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", formalDefinition = "Indicates the purpose of this bundle - how it is intended to be used.")
3060  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/bundle-type")
3061  protected Enumeration<BundleType> type;
3062
3063  /**
3064   * The date/time that the bundle was assembled - i.e. when the resources were
3065   * placed in the bundle.
3066   */
3067  @Child(name = "timestamp", type = {
3068      InstantType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
3069  @Description(shortDefinition = "When the bundle was assembled", formalDefinition = "The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.")
3070  protected InstantType timestamp;
3071
3072  /**
3073   * If a set of search matches, this is the total number of entries of type
3074   * 'match' across all pages in the search. It does not include search.mode =
3075   * 'include' or 'outcome' entries and it does not provide a count of the number
3076   * of entries in the Bundle.
3077   */
3078  @Child(name = "total", type = {
3079      UnsignedIntType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
3080  @Description(shortDefinition = "If search, the total number of matches", formalDefinition = "If a set of search matches, this is the total number of entries of type 'match' across all pages in the search.  It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.")
3081  protected UnsignedIntType total;
3082
3083  /**
3084   * A series of links that provide context to this bundle.
3085   */
3086  @Child(name = "link", type = {}, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3087  @Description(shortDefinition = "Links related to this Bundle", formalDefinition = "A series of links that provide context to this bundle.")
3088  protected List<BundleLinkComponent> link;
3089
3090  /**
3091   * An entry in a bundle resource - will either contain a resource or information
3092   * about a resource (transactions and history only).
3093   */
3094  @Child(name = "entry", type = {}, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3095  @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).")
3096  protected List<BundleEntryComponent> entry;
3097
3098  /**
3099   * Digital Signature - base64 encoded. XML-DSig or a JWT.
3100   */
3101  @Child(name = "signature", type = { Signature.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
3102  @Description(shortDefinition = "Digital Signature", formalDefinition = "Digital Signature - base64 encoded. XML-DSig or a JWT.")
3103  protected Signature signature;
3104
3105  private static final long serialVersionUID = 1740470158L;
3106
3107  /**
3108   * Constructor
3109   */
3110  public Bundle() {
3111    super();
3112  }
3113
3114  /**
3115   * Constructor
3116   */
3117  public Bundle(Enumeration<BundleType> type) {
3118    super();
3119    this.type = type;
3120  }
3121
3122  /**
3123   * @return {@link #identifier} (A persistent identifier for the bundle that
3124   *         won't change as a bundle is copied from server to server.)
3125   */
3126  public Identifier getIdentifier() {
3127    if (this.identifier == null)
3128      if (Configuration.errorOnAutoCreate())
3129        throw new Error("Attempt to auto-create Bundle.identifier");
3130      else if (Configuration.doAutoCreate())
3131        this.identifier = new Identifier(); // cc
3132    return this.identifier;
3133  }
3134
3135  public boolean hasIdentifier() {
3136    return this.identifier != null && !this.identifier.isEmpty();
3137  }
3138
3139  /**
3140   * @param value {@link #identifier} (A persistent identifier for the bundle that
3141   *              won't change as a bundle is copied from server to server.)
3142   */
3143  public Bundle setIdentifier(Identifier value) {
3144    this.identifier = value;
3145    return this;
3146  }
3147
3148  /**
3149   * @return {@link #type} (Indicates the purpose of this bundle - how it is
3150   *         intended to be used.). This is the underlying object with id, value
3151   *         and extensions. The accessor "getType" gives direct access to the
3152   *         value
3153   */
3154  public Enumeration<BundleType> getTypeElement() {
3155    if (this.type == null)
3156      if (Configuration.errorOnAutoCreate())
3157        throw new Error("Attempt to auto-create Bundle.type");
3158      else if (Configuration.doAutoCreate())
3159        this.type = new Enumeration<BundleType>(new BundleTypeEnumFactory()); // bb
3160    return this.type;
3161  }
3162
3163  public boolean hasTypeElement() {
3164    return this.type != null && !this.type.isEmpty();
3165  }
3166
3167  public boolean hasType() {
3168    return this.type != null && !this.type.isEmpty();
3169  }
3170
3171  /**
3172   * @param value {@link #type} (Indicates the purpose of this bundle - how it is
3173   *              intended to be used.). This is the underlying object with id,
3174   *              value and extensions. The accessor "getType" gives direct access
3175   *              to the value
3176   */
3177  public Bundle setTypeElement(Enumeration<BundleType> value) {
3178    this.type = value;
3179    return this;
3180  }
3181
3182  /**
3183   * @return Indicates the purpose of this bundle - how it is intended to be used.
3184   */
3185  public BundleType getType() {
3186    return this.type == null ? null : this.type.getValue();
3187  }
3188
3189  /**
3190   * @param value Indicates the purpose of this bundle - how it is intended to be
3191   *              used.
3192   */
3193  public Bundle setType(BundleType value) {
3194    if (this.type == null)
3195      this.type = new Enumeration<BundleType>(new BundleTypeEnumFactory());
3196    this.type.setValue(value);
3197    return this;
3198  }
3199
3200  /**
3201   * @return {@link #timestamp} (The date/time that the bundle was assembled -
3202   *         i.e. when the resources were placed in the bundle.). This is the
3203   *         underlying object with id, value and extensions. The accessor
3204   *         "getTimestamp" gives direct access to the value
3205   */
3206  public InstantType getTimestampElement() {
3207    if (this.timestamp == null)
3208      if (Configuration.errorOnAutoCreate())
3209        throw new Error("Attempt to auto-create Bundle.timestamp");
3210      else if (Configuration.doAutoCreate())
3211        this.timestamp = new InstantType(); // bb
3212    return this.timestamp;
3213  }
3214
3215  public boolean hasTimestampElement() {
3216    return this.timestamp != null && !this.timestamp.isEmpty();
3217  }
3218
3219  public boolean hasTimestamp() {
3220    return this.timestamp != null && !this.timestamp.isEmpty();
3221  }
3222
3223  /**
3224   * @param value {@link #timestamp} (The date/time that the bundle was assembled
3225   *              - i.e. when the resources were placed in the bundle.). This is
3226   *              the underlying object with id, value and extensions. The
3227   *              accessor "getTimestamp" gives direct access to the value
3228   */
3229  public Bundle setTimestampElement(InstantType value) {
3230    this.timestamp = value;
3231    return this;
3232  }
3233
3234  /**
3235   * @return The date/time that the bundle was assembled - i.e. when the resources
3236   *         were placed in the bundle.
3237   */
3238  public Date getTimestamp() {
3239    return this.timestamp == null ? null : this.timestamp.getValue();
3240  }
3241
3242  /**
3243   * @param value The date/time that the bundle was assembled - i.e. when the
3244   *              resources were placed in the bundle.
3245   */
3246  public Bundle setTimestamp(Date value) {
3247    if (value == null)
3248      this.timestamp = null;
3249    else {
3250      if (this.timestamp == null)
3251        this.timestamp = new InstantType();
3252      this.timestamp.setValue(value);
3253    }
3254    return this;
3255  }
3256
3257  /**
3258   * @return {@link #total} (If a set of search matches, this is the total number
3259   *         of entries of type 'match' across all pages in the search. It does
3260   *         not include search.mode = 'include' or 'outcome' entries and it does
3261   *         not provide a count of the number of entries in the Bundle.). This is
3262   *         the underlying object with id, value and extensions. The accessor
3263   *         "getTotal" gives direct access to the value
3264   */
3265  public UnsignedIntType getTotalElement() {
3266    if (this.total == null)
3267      if (Configuration.errorOnAutoCreate())
3268        throw new Error("Attempt to auto-create Bundle.total");
3269      else if (Configuration.doAutoCreate())
3270        this.total = new UnsignedIntType(); // bb
3271    return this.total;
3272  }
3273
3274  public boolean hasTotalElement() {
3275    return this.total != null && !this.total.isEmpty();
3276  }
3277
3278  public boolean hasTotal() {
3279    return this.total != null && !this.total.isEmpty();
3280  }
3281
3282  /**
3283   * @param value {@link #total} (If a set of search matches, this is the total
3284   *              number of entries of type 'match' across all pages in the
3285   *              search. It does not include search.mode = 'include' or 'outcome'
3286   *              entries and it does not provide a count of the number of entries
3287   *              in the Bundle.). This is the underlying object with id, value
3288   *              and extensions. The accessor "getTotal" gives direct access to
3289   *              the value
3290   */
3291  public Bundle setTotalElement(UnsignedIntType value) {
3292    this.total = value;
3293    return this;
3294  }
3295
3296  /**
3297   * @return If a set of search matches, this is the total number of entries of
3298   *         type 'match' across all pages in the search. It does not include
3299   *         search.mode = 'include' or 'outcome' entries and it does not provide
3300   *         a count of the number of entries in the Bundle.
3301   */
3302  public int getTotal() {
3303    return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue();
3304  }
3305
3306  /**
3307   * @param value If a set of search matches, this is the total number of entries
3308   *              of type 'match' across all pages in the search. It does not
3309   *              include search.mode = 'include' or 'outcome' entries and it does
3310   *              not provide a count of the number of entries in the Bundle.
3311   */
3312  public Bundle setTotal(int value) {
3313    if (this.total == null)
3314      this.total = new UnsignedIntType();
3315    this.total.setValue(value);
3316    return this;
3317  }
3318
3319  /**
3320   * @return {@link #link} (A series of links that provide context to this
3321   *         bundle.)
3322   */
3323  public List<BundleLinkComponent> getLink() {
3324    if (this.link == null)
3325      this.link = new ArrayList<BundleLinkComponent>();
3326    return this.link;
3327  }
3328
3329  /**
3330   * @return Returns a reference to <code>this</code> for easy method chaining
3331   */
3332  public Bundle setLink(List<BundleLinkComponent> theLink) {
3333    this.link = theLink;
3334    return this;
3335  }
3336
3337  public boolean hasLink() {
3338    if (this.link == null)
3339      return false;
3340    for (BundleLinkComponent item : this.link)
3341      if (!item.isEmpty())
3342        return true;
3343    return false;
3344  }
3345
3346  public BundleLinkComponent addLink() { // 3
3347    BundleLinkComponent t = new BundleLinkComponent();
3348    if (this.link == null)
3349      this.link = new ArrayList<BundleLinkComponent>();
3350    this.link.add(t);
3351    return t;
3352  }
3353
3354  public Bundle addLink(BundleLinkComponent t) { // 3
3355    if (t == null)
3356      return this;
3357    if (this.link == null)
3358      this.link = new ArrayList<BundleLinkComponent>();
3359    this.link.add(t);
3360    return this;
3361  }
3362
3363  /**
3364   * @return The first repetition of repeating field {@link #link}, creating it if
3365   *         it does not already exist
3366   */
3367  public BundleLinkComponent getLinkFirstRep() {
3368    if (getLink().isEmpty()) {
3369      addLink();
3370    }
3371    return getLink().get(0);
3372  }
3373
3374  /**
3375   * @return {@link #entry} (An entry in a bundle resource - will either contain a
3376   *         resource or information about a resource (transactions and history
3377   *         only).)
3378   */
3379  public List<BundleEntryComponent> getEntry() {
3380    if (this.entry == null)
3381      this.entry = new ArrayList<BundleEntryComponent>();
3382    return this.entry;
3383  }
3384
3385  /**
3386   * @return Returns a reference to <code>this</code> for easy method chaining
3387   */
3388  public Bundle setEntry(List<BundleEntryComponent> theEntry) {
3389    this.entry = theEntry;
3390    return this;
3391  }
3392
3393  public boolean hasEntry() {
3394    if (this.entry == null)
3395      return false;
3396    for (BundleEntryComponent item : this.entry)
3397      if (!item.isEmpty())
3398        return true;
3399    return false;
3400  }
3401
3402  public BundleEntryComponent addEntry() { // 3
3403    BundleEntryComponent t = new BundleEntryComponent();
3404    if (this.entry == null)
3405      this.entry = new ArrayList<BundleEntryComponent>();
3406    this.entry.add(t);
3407    return t;
3408  }
3409
3410  public Bundle addEntry(BundleEntryComponent t) { // 3
3411    if (t == null)
3412      return this;
3413    if (this.entry == null)
3414      this.entry = new ArrayList<BundleEntryComponent>();
3415    this.entry.add(t);
3416    return this;
3417  }
3418
3419  /**
3420   * @return The first repetition of repeating field {@link #entry}, creating it
3421   *         if it does not already exist
3422   */
3423  public BundleEntryComponent getEntryFirstRep() {
3424    if (getEntry().isEmpty()) {
3425      addEntry();
3426    }
3427    return getEntry().get(0);
3428  }
3429
3430  /**
3431   * @return {@link #signature} (Digital Signature - base64 encoded. XML-DSig or a
3432   *         JWT.)
3433   */
3434  public Signature getSignature() {
3435    if (this.signature == null)
3436      if (Configuration.errorOnAutoCreate())
3437        throw new Error("Attempt to auto-create Bundle.signature");
3438      else if (Configuration.doAutoCreate())
3439        this.signature = new Signature(); // cc
3440    return this.signature;
3441  }
3442
3443  public boolean hasSignature() {
3444    return this.signature != null && !this.signature.isEmpty();
3445  }
3446
3447  /**
3448   * @param value {@link #signature} (Digital Signature - base64 encoded. XML-DSig
3449   *              or a JWT.)
3450   */
3451  public Bundle setSignature(Signature value) {
3452    this.signature = value;
3453    return this;
3454  }
3455
3456  /**
3457   * Returns the {@link #getLink() link} which matches a given
3458   * {@link BundleLinkComponent#getRelation() relation}. If no link is found which
3459   * matches the given relation, returns <code>null</code>. If more than one link
3460   * is found which matches the given relation, returns the first matching
3461   * BundleLinkComponent.
3462   * 
3463   * @param theRelation The relation, such as "next", or "self. See the constants
3464   *                    such as {@link IBaseBundle#LINK_SELF} and
3465   *                    {@link IBaseBundle#LINK_NEXT}.
3466   * @return Returns a matching BundleLinkComponent, or <code>null</code>
3467   * @see IBaseBundle#LINK_NEXT
3468   * @see IBaseBundle#LINK_PREV
3469   * @see IBaseBundle#LINK_SELF
3470   */
3471  public BundleLinkComponent getLink(String theRelation) {
3472    org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
3473    for (BundleLinkComponent next : getLink()) {
3474      if (theRelation.equals(next.getRelation())) {
3475        return next;
3476      }
3477    }
3478    return null;
3479  }
3480
3481  /**
3482   * Returns the {@link #getLink() link} which matches a given
3483   * {@link BundleLinkComponent#getRelation() relation}. If no link is found which
3484   * matches the given relation, creates a new BundleLinkComponent with the given
3485   * relation and adds it to this Bundle. If more than one link is found which
3486   * matches the given relation, returns the first matching BundleLinkComponent.
3487   * 
3488   * @param theRelation The relation, such as "next", or "self. See the constants
3489   *                    such as {@link IBaseBundle#LINK_SELF} and
3490   *                    {@link IBaseBundle#LINK_NEXT}.
3491   * @return Returns a matching BundleLinkComponent, or <code>null</code>
3492   * @see IBaseBundle#LINK_NEXT
3493   * @see IBaseBundle#LINK_PREV
3494   * @see IBaseBundle#LINK_SELF
3495   */
3496  public BundleLinkComponent getLinkOrCreate(String theRelation) {
3497    org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
3498    for (BundleLinkComponent next : getLink()) {
3499      if (theRelation.equals(next.getRelation())) {
3500        return next;
3501      }
3502    }
3503    BundleLinkComponent retVal = new BundleLinkComponent();
3504    retVal.setRelation(theRelation);
3505    getLink().add(retVal);
3506    return retVal;
3507  }
3508
3509  protected void listChildren(List<Property> children) {
3510    super.listChildren(children);
3511    children.add(new Property("identifier", "Identifier",
3512        "A persistent identifier for the bundle that won't change as a bundle is copied from server to server.", 0, 1,
3513        identifier));
3514    children.add(new Property("type", "code", "Indicates the purpose of this bundle - how it is intended to be used.",
3515        0, 1, type));
3516    children.add(new Property("timestamp", "instant",
3517        "The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.", 0, 1,
3518        timestamp));
3519    children.add(new Property("total", "unsignedInt",
3520        "If a set of search matches, this is the total number of entries of type 'match' across all pages in the search.  It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.",
3521        0, 1, total));
3522    children.add(new Property("link", "", "A series of links that provide context to this bundle.", 0,
3523        java.lang.Integer.MAX_VALUE, link));
3524    children.add(new Property("entry", "",
3525        "An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).",
3526        0, java.lang.Integer.MAX_VALUE, entry));
3527    children.add(new Property("signature", "Signature", "Digital Signature - base64 encoded. XML-DSig or a JWT.", 0, 1,
3528        signature));
3529  }
3530
3531  @Override
3532  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3533    switch (_hash) {
3534    case -1618432855:
3535      /* identifier */ return new Property("identifier", "Identifier",
3536          "A persistent identifier for the bundle that won't change as a bundle is copied from server to server.", 0, 1,
3537          identifier);
3538    case 3575610:
3539      /* type */ return new Property("type", "code",
3540          "Indicates the purpose of this bundle - how it is intended to be used.", 0, 1, type);
3541    case 55126294:
3542      /* timestamp */ return new Property("timestamp", "instant",
3543          "The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.", 0, 1,
3544          timestamp);
3545    case 110549828:
3546      /* total */ return new Property("total", "unsignedInt",
3547          "If a set of search matches, this is the total number of entries of type 'match' across all pages in the search.  It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.",
3548          0, 1, total);
3549    case 3321850:
3550      /* link */ return new Property("link", "", "A series of links that provide context to this bundle.", 0,
3551          java.lang.Integer.MAX_VALUE, link);
3552    case 96667762:
3553      /* entry */ return new Property("entry", "",
3554          "An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).",
3555          0, java.lang.Integer.MAX_VALUE, entry);
3556    case 1073584312:
3557      /* signature */ return new Property("signature", "Signature",
3558          "Digital Signature - base64 encoded. XML-DSig or a JWT.", 0, 1, signature);
3559    default:
3560      return super.getNamedProperty(_hash, _name, _checkValid);
3561    }
3562
3563  }
3564
3565  @Override
3566  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3567    switch (hash) {
3568    case -1618432855:
3569      /* identifier */ return this.identifier == null ? new Base[0] : new Base[] { this.identifier }; // Identifier
3570    case 3575610:
3571      /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<BundleType>
3572    case 55126294:
3573      /* timestamp */ return this.timestamp == null ? new Base[0] : new Base[] { this.timestamp }; // InstantType
3574    case 110549828:
3575      /* total */ return this.total == null ? new Base[0] : new Base[] { this.total }; // UnsignedIntType
3576    case 3321850:
3577      /* link */ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent
3578    case 96667762:
3579      /* entry */ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // BundleEntryComponent
3580    case 1073584312:
3581      /* signature */ return this.signature == null ? new Base[0] : new Base[] { this.signature }; // Signature
3582    default:
3583      return super.getProperty(hash, name, checkValid);
3584    }
3585
3586  }
3587
3588  @Override
3589  public Base setProperty(int hash, String name, Base value) throws FHIRException {
3590    switch (hash) {
3591    case -1618432855: // identifier
3592      this.identifier = castToIdentifier(value); // Identifier
3593      return value;
3594    case 3575610: // type
3595      value = new BundleTypeEnumFactory().fromType(castToCode(value));
3596      this.type = (Enumeration) value; // Enumeration<BundleType>
3597      return value;
3598    case 55126294: // timestamp
3599      this.timestamp = castToInstant(value); // InstantType
3600      return value;
3601    case 110549828: // total
3602      this.total = castToUnsignedInt(value); // UnsignedIntType
3603      return value;
3604    case 3321850: // link
3605      this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent
3606      return value;
3607    case 96667762: // entry
3608      this.getEntry().add((BundleEntryComponent) value); // BundleEntryComponent
3609      return value;
3610    case 1073584312: // signature
3611      this.signature = castToSignature(value); // Signature
3612      return value;
3613    default:
3614      return super.setProperty(hash, name, value);
3615    }
3616
3617  }
3618
3619  @Override
3620  public Base setProperty(String name, Base value) throws FHIRException {
3621    if (name.equals("identifier")) {
3622      this.identifier = castToIdentifier(value); // Identifier
3623    } else if (name.equals("type")) {
3624      value = new BundleTypeEnumFactory().fromType(castToCode(value));
3625      this.type = (Enumeration) value; // Enumeration<BundleType>
3626    } else if (name.equals("timestamp")) {
3627      this.timestamp = castToInstant(value); // InstantType
3628    } else if (name.equals("total")) {
3629      this.total = castToUnsignedInt(value); // UnsignedIntType
3630    } else if (name.equals("link")) {
3631      this.getLink().add((BundleLinkComponent) value);
3632    } else if (name.equals("entry")) {
3633      this.getEntry().add((BundleEntryComponent) value);
3634    } else if (name.equals("signature")) {
3635      this.signature = castToSignature(value); // Signature
3636    } else
3637      return super.setProperty(name, value);
3638    return value;
3639  }
3640
3641  @Override
3642  public Base makeProperty(int hash, String name) throws FHIRException {
3643    switch (hash) {
3644    case -1618432855:
3645      return getIdentifier();
3646    case 3575610:
3647      return getTypeElement();
3648    case 55126294:
3649      return getTimestampElement();
3650    case 110549828:
3651      return getTotalElement();
3652    case 3321850:
3653      return addLink();
3654    case 96667762:
3655      return addEntry();
3656    case 1073584312:
3657      return getSignature();
3658    default:
3659      return super.makeProperty(hash, name);
3660    }
3661
3662  }
3663
3664  @Override
3665  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3666    switch (hash) {
3667    case -1618432855:
3668      /* identifier */ return new String[] { "Identifier" };
3669    case 3575610:
3670      /* type */ return new String[] { "code" };
3671    case 55126294:
3672      /* timestamp */ return new String[] { "instant" };
3673    case 110549828:
3674      /* total */ return new String[] { "unsignedInt" };
3675    case 3321850:
3676      /* link */ return new String[] {};
3677    case 96667762:
3678      /* entry */ return new String[] {};
3679    case 1073584312:
3680      /* signature */ return new String[] { "Signature" };
3681    default:
3682      return super.getTypesForProperty(hash, name);
3683    }
3684
3685  }
3686
3687  @Override
3688  public Base addChild(String name) throws FHIRException {
3689    if (name.equals("identifier")) {
3690      this.identifier = new Identifier();
3691      return this.identifier;
3692    } else if (name.equals("type")) {
3693      throw new FHIRException("Cannot call addChild on a singleton property Bundle.type");
3694    } else if (name.equals("timestamp")) {
3695      throw new FHIRException("Cannot call addChild on a singleton property Bundle.timestamp");
3696    } else if (name.equals("total")) {
3697      throw new FHIRException("Cannot call addChild on a singleton property Bundle.total");
3698    } else if (name.equals("link")) {
3699      return addLink();
3700    } else if (name.equals("entry")) {
3701      return addEntry();
3702    } else if (name.equals("signature")) {
3703      this.signature = new Signature();
3704      return this.signature;
3705    } else
3706      return super.addChild(name);
3707  }
3708
3709  public String fhirType() {
3710    return "Bundle";
3711
3712  }
3713
3714  public Bundle copy() {
3715    Bundle dst = new Bundle();
3716    copyValues(dst);
3717    return dst;
3718  }
3719
3720  public void copyValues(Bundle dst) {
3721    super.copyValues(dst);
3722    dst.identifier = identifier == null ? null : identifier.copy();
3723    dst.type = type == null ? null : type.copy();
3724    dst.timestamp = timestamp == null ? null : timestamp.copy();
3725    dst.total = total == null ? null : total.copy();
3726    if (link != null) {
3727      dst.link = new ArrayList<BundleLinkComponent>();
3728      for (BundleLinkComponent i : link)
3729        dst.link.add(i.copy());
3730    }
3731    ;
3732    if (entry != null) {
3733      dst.entry = new ArrayList<BundleEntryComponent>();
3734      for (BundleEntryComponent i : entry)
3735        dst.entry.add(i.copy());
3736    }
3737    ;
3738    dst.signature = signature == null ? null : signature.copy();
3739  }
3740
3741  protected Bundle typedCopy() {
3742    return copy();
3743  }
3744
3745  @Override
3746  public boolean equalsDeep(Base other_) {
3747    if (!super.equalsDeep(other_))
3748      return false;
3749    if (!(other_ instanceof Bundle))
3750      return false;
3751    Bundle o = (Bundle) other_;
3752    return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true)
3753        && compareDeep(timestamp, o.timestamp, true) && compareDeep(total, o.total, true)
3754        && compareDeep(link, o.link, true) && compareDeep(entry, o.entry, true)
3755        && compareDeep(signature, o.signature, true);
3756  }
3757
3758  @Override
3759  public boolean equalsShallow(Base other_) {
3760    if (!super.equalsShallow(other_))
3761      return false;
3762    if (!(other_ instanceof Bundle))
3763      return false;
3764    Bundle o = (Bundle) other_;
3765    return compareValues(type, o.type, true) && compareValues(timestamp, o.timestamp, true)
3766        && compareValues(total, o.total, true);
3767  }
3768
3769  public boolean isEmpty() {
3770    return super.isEmpty()
3771        && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, timestamp, total, link, entry, signature);
3772  }
3773
3774  @Override
3775  public ResourceType getResourceType() {
3776    return ResourceType.Bundle;
3777  }
3778
3779  /**
3780   * Search parameter: <b>identifier</b>
3781   * <p>
3782   * Description: <b>Persistent identifier for the bundle</b><br>
3783   * Type: <b>token</b><br>
3784   * Path: <b>Bundle.identifier</b><br>
3785   * </p>
3786   */
3787  @SearchParamDefinition(name = "identifier", path = "Bundle.identifier", description = "Persistent identifier for the bundle", type = "token")
3788  public static final String SP_IDENTIFIER = "identifier";
3789  /**
3790   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3791   * <p>
3792   * Description: <b>Persistent identifier for the bundle</b><br>
3793   * Type: <b>token</b><br>
3794   * Path: <b>Bundle.identifier</b><br>
3795   * </p>
3796   */
3797  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3798      SP_IDENTIFIER);
3799
3800  /**
3801   * Search parameter: <b>composition</b>
3802   * <p>
3803   * Description: <b>The first resource in the bundle, if the bundle type is
3804   * "document" - this is a composition, and this parameter provides access to
3805   * search its contents</b><br>
3806   * Type: <b>reference</b><br>
3807   * Path: <b>Bundle.entry(0).resource</b><br>
3808   * </p>
3809   */
3810  @SearchParamDefinition(name = "composition", path = "Bundle.entry[0].resource", description = "The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to search its contents", type = "reference", target = {
3811      Composition.class })
3812  public static final String SP_COMPOSITION = "composition";
3813  /**
3814   * <b>Fluent Client</b> search parameter constant for <b>composition</b>
3815   * <p>
3816   * Description: <b>The first resource in the bundle, if the bundle type is
3817   * "document" - this is a composition, and this parameter provides access to
3818   * search its contents</b><br>
3819   * Type: <b>reference</b><br>
3820   * Path: <b>Bundle.entry(0).resource</b><br>
3821   * </p>
3822   */
3823  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3824      SP_COMPOSITION);
3825
3826  /**
3827   * Constant for fluent queries to be used to add include statements. Specifies
3828   * the path value of "<b>Bundle:composition</b>".
3829   */
3830  public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSITION = new ca.uhn.fhir.model.api.Include(
3831      "Bundle:composition").toLocked();
3832
3833  /**
3834   * Search parameter: <b>type</b>
3835   * <p>
3836   * Description: <b>document | message | transaction | transaction-response |
3837   * batch | batch-response | history | searchset | collection</b><br>
3838   * Type: <b>token</b><br>
3839   * Path: <b>Bundle.type</b><br>
3840   * </p>
3841   */
3842  @SearchParamDefinition(name = "type", path = "Bundle.type", description = "document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", type = "token")
3843  public static final String SP_TYPE = "type";
3844  /**
3845   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3846   * <p>
3847   * Description: <b>document | message | transaction | transaction-response |
3848   * batch | batch-response | history | searchset | collection</b><br>
3849   * Type: <b>token</b><br>
3850   * Path: <b>Bundle.type</b><br>
3851   * </p>
3852   */
3853  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3854      SP_TYPE);
3855
3856  /**
3857   * Search parameter: <b>message</b>
3858   * <p>
3859   * Description: <b>The first resource in the bundle, if the bundle type is
3860   * "message" - this is a message header, and this parameter provides access to
3861   * search its contents</b><br>
3862   * Type: <b>reference</b><br>
3863   * Path: <b>Bundle.entry(0).resource</b><br>
3864   * </p>
3865   */
3866  @SearchParamDefinition(name = "message", path = "Bundle.entry[0].resource", 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", target = {
3867      MessageHeader.class })
3868  public static final String SP_MESSAGE = "message";
3869  /**
3870   * <b>Fluent Client</b> search parameter constant for <b>message</b>
3871   * <p>
3872   * Description: <b>The first resource in the bundle, if the bundle type is
3873   * "message" - this is a message header, and this parameter provides access to
3874   * search its contents</b><br>
3875   * Type: <b>reference</b><br>
3876   * Path: <b>Bundle.entry(0).resource</b><br>
3877   * </p>
3878   */
3879  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MESSAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3880      SP_MESSAGE);
3881
3882  /**
3883   * Constant for fluent queries to be used to add include statements. Specifies
3884   * the path value of "<b>Bundle:message</b>".
3885   */
3886  public static final ca.uhn.fhir.model.api.Include INCLUDE_MESSAGE = new ca.uhn.fhir.model.api.Include(
3887      "Bundle:message").toLocked();
3888
3889  /**
3890   * Search parameter: <b>timestamp</b>
3891   * <p>
3892   * Description: <b>When the bundle was assembled</b><br>
3893   * Type: <b>date</b><br>
3894   * Path: <b>Bundle.timestamp</b><br>
3895   * </p>
3896   */
3897  @SearchParamDefinition(name = "timestamp", path = "Bundle.timestamp", description = "When the bundle was assembled", type = "date")
3898  public static final String SP_TIMESTAMP = "timestamp";
3899  /**
3900   * <b>Fluent Client</b> search parameter constant for <b>timestamp</b>
3901   * <p>
3902   * Description: <b>When the bundle was assembled</b><br>
3903   * Type: <b>date</b><br>
3904   * Path: <b>Bundle.timestamp</b><br>
3905   * </p>
3906   */
3907  public static final ca.uhn.fhir.rest.gclient.DateClientParam TIMESTAMP = new ca.uhn.fhir.rest.gclient.DateClientParam(
3908      SP_TIMESTAMP);
3909
3910}