001package org.hl7.fhir.dstu3.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1
033
034import java.util.*;
035
036import java.math.*;
037import org.hl7.fhir.utilities.Utilities;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * A container for a collection of resources.
048 */
049@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle")
050public class Bundle extends Resource implements IBaseBundle {
051
052    public enum BundleType {
053        /**
054         * The bundle is a document. The first resource is a Composition.
055         */
056        DOCUMENT, 
057        /**
058         * The bundle is a message. The first resource is a MessageHeader.
059         */
060        MESSAGE, 
061        /**
062         * The bundle is a transaction - intended to be processed by a server as an atomic commit.
063         */
064        TRANSACTION, 
065        /**
066         * The bundle is a transaction response. Because the response is a transaction response, the transaction has succeeded, and all responses are error free.
067         */
068        TRANSACTIONRESPONSE, 
069        /**
070         * The bundle is a transaction - intended to be processed by a server as a group of actions.
071         */
072        BATCH, 
073        /**
074         * The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success.
075         */
076        BATCHRESPONSE, 
077        /**
078         * The bundle is a list of resources from a history interaction on a server.
079         */
080        HISTORY, 
081        /**
082         * The bundle is a list of resources returned as a result of a search/query interaction, operation, or message.
083         */
084        SEARCHSET, 
085        /**
086         * The bundle is a set of resources collected into a single package for ease of distribution.
087         */
088        COLLECTION, 
089        /**
090         * added to help the parsers with the generic types
091         */
092        NULL;
093        public static BundleType fromCode(String codeString) throws FHIRException {
094            if (codeString == null || "".equals(codeString))
095                return null;
096        if ("document".equals(codeString))
097          return DOCUMENT;
098        if ("message".equals(codeString))
099          return MESSAGE;
100        if ("transaction".equals(codeString))
101          return TRANSACTION;
102        if ("transaction-response".equals(codeString))
103          return TRANSACTIONRESPONSE;
104        if ("batch".equals(codeString))
105          return BATCH;
106        if ("batch-response".equals(codeString))
107          return BATCHRESPONSE;
108        if ("history".equals(codeString))
109          return HISTORY;
110        if ("searchset".equals(codeString))
111          return SEARCHSET;
112        if ("collection".equals(codeString))
113          return COLLECTION;
114        if (Configuration.isAcceptInvalidEnums())
115          return null;
116        else
117          throw new FHIRException("Unknown BundleType code '"+codeString+"'");
118        }
119        public String toCode() {
120          switch (this) {
121            case DOCUMENT: return "document";
122            case MESSAGE: return "message";
123            case TRANSACTION: return "transaction";
124            case TRANSACTIONRESPONSE: return "transaction-response";
125            case BATCH: return "batch";
126            case BATCHRESPONSE: return "batch-response";
127            case HISTORY: return "history";
128            case SEARCHSET: return "searchset";
129            case COLLECTION: return "collection";
130            default: return "?";
131          }
132        }
133        public String getSystem() {
134          switch (this) {
135            case DOCUMENT: return "http://hl7.org/fhir/bundle-type";
136            case MESSAGE: return "http://hl7.org/fhir/bundle-type";
137            case TRANSACTION: return "http://hl7.org/fhir/bundle-type";
138            case TRANSACTIONRESPONSE: return "http://hl7.org/fhir/bundle-type";
139            case BATCH: return "http://hl7.org/fhir/bundle-type";
140            case BATCHRESPONSE: return "http://hl7.org/fhir/bundle-type";
141            case HISTORY: return "http://hl7.org/fhir/bundle-type";
142            case SEARCHSET: return "http://hl7.org/fhir/bundle-type";
143            case COLLECTION: return "http://hl7.org/fhir/bundle-type";
144            default: return "?";
145          }
146        }
147        public String getDefinition() {
148          switch (this) {
149            case DOCUMENT: return "The bundle is a document. The first resource is a Composition.";
150            case MESSAGE: return "The bundle is a message. The first resource is a MessageHeader.";
151            case TRANSACTION: return "The bundle is a transaction - intended to be processed by a server as an atomic commit.";
152            case TRANSACTIONRESPONSE: return "The bundle is a transaction response. Because the response is a transaction response, the transaction has succeeded, and all responses are error free.";
153            case BATCH: return "The bundle is a transaction - intended to be processed by a server as a group of actions.";
154            case BATCHRESPONSE: return "The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success.";
155            case HISTORY: return "The bundle is a list of resources from a history interaction on a server.";
156            case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message.";
157            case COLLECTION: return "The bundle is a set of resources collected into a single package for ease of distribution.";
158            default: return "?";
159          }
160        }
161        public String getDisplay() {
162          switch (this) {
163            case DOCUMENT: return "Document";
164            case MESSAGE: return "Message";
165            case TRANSACTION: return "Transaction";
166            case TRANSACTIONRESPONSE: return "Transaction Response";
167            case BATCH: return "Batch";
168            case BATCHRESPONSE: return "Batch Response";
169            case HISTORY: return "History List";
170            case SEARCHSET: return "Search Results";
171            case COLLECTION: return "Collection";
172            default: return "?";
173          }
174        }
175    }
176
177  public static class BundleTypeEnumFactory implements EnumFactory<BundleType> {
178    public BundleType fromCode(String codeString) throws IllegalArgumentException {
179      if (codeString == null || "".equals(codeString))
180            if (codeString == null || "".equals(codeString))
181                return null;
182        if ("document".equals(codeString))
183          return BundleType.DOCUMENT;
184        if ("message".equals(codeString))
185          return BundleType.MESSAGE;
186        if ("transaction".equals(codeString))
187          return BundleType.TRANSACTION;
188        if ("transaction-response".equals(codeString))
189          return BundleType.TRANSACTIONRESPONSE;
190        if ("batch".equals(codeString))
191          return BundleType.BATCH;
192        if ("batch-response".equals(codeString))
193          return BundleType.BATCHRESPONSE;
194        if ("history".equals(codeString))
195          return BundleType.HISTORY;
196        if ("searchset".equals(codeString))
197          return BundleType.SEARCHSET;
198        if ("collection".equals(codeString))
199          return BundleType.COLLECTION;
200        throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'");
201        }
202        public Enumeration<BundleType> fromType(Base code) throws FHIRException {
203          if (code == null)
204            return null;
205          if (code.isEmpty())
206            return new Enumeration<BundleType>(this);
207          String codeString = ((PrimitiveType) code).asStringValue();
208          if (codeString == null || "".equals(codeString))
209            return null;
210        if ("document".equals(codeString))
211          return new Enumeration<BundleType>(this, BundleType.DOCUMENT);
212        if ("message".equals(codeString))
213          return new Enumeration<BundleType>(this, BundleType.MESSAGE);
214        if ("transaction".equals(codeString))
215          return new Enumeration<BundleType>(this, BundleType.TRANSACTION);
216        if ("transaction-response".equals(codeString))
217          return new Enumeration<BundleType>(this, BundleType.TRANSACTIONRESPONSE);
218        if ("batch".equals(codeString))
219          return new Enumeration<BundleType>(this, BundleType.BATCH);
220        if ("batch-response".equals(codeString))
221          return new Enumeration<BundleType>(this, BundleType.BATCHRESPONSE);
222        if ("history".equals(codeString))
223          return new Enumeration<BundleType>(this, BundleType.HISTORY);
224        if ("searchset".equals(codeString))
225          return new Enumeration<BundleType>(this, BundleType.SEARCHSET);
226        if ("collection".equals(codeString))
227          return new Enumeration<BundleType>(this, BundleType.COLLECTION);
228        throw new FHIRException("Unknown BundleType code '"+codeString+"'");
229        }
230    public String toCode(BundleType code) {
231      if (code == BundleType.DOCUMENT)
232        return "document";
233      if (code == BundleType.MESSAGE)
234        return "message";
235      if (code == BundleType.TRANSACTION)
236        return "transaction";
237      if (code == BundleType.TRANSACTIONRESPONSE)
238        return "transaction-response";
239      if (code == BundleType.BATCH)
240        return "batch";
241      if (code == BundleType.BATCHRESPONSE)
242        return "batch-response";
243      if (code == BundleType.HISTORY)
244        return "history";
245      if (code == BundleType.SEARCHSET)
246        return "searchset";
247      if (code == BundleType.COLLECTION)
248        return "collection";
249      return "?";
250      }
251    public String toSystem(BundleType code) {
252      return code.getSystem();
253      }
254    }
255
256    public enum SearchEntryMode {
257        /**
258         * This resource matched the search specification.
259         */
260        MATCH, 
261        /**
262         * This resource is returned because it is referred to from another resource in the search set.
263         */
264        INCLUDE, 
265        /**
266         * An OperationOutcome that provides additional information about the processing of a search.
267         */
268        OUTCOME, 
269        /**
270         * added to help the parsers with the generic types
271         */
272        NULL;
273        public static SearchEntryMode fromCode(String codeString) throws FHIRException {
274            if (codeString == null || "".equals(codeString))
275                return null;
276        if ("match".equals(codeString))
277          return MATCH;
278        if ("include".equals(codeString))
279          return INCLUDE;
280        if ("outcome".equals(codeString))
281          return OUTCOME;
282        if (Configuration.isAcceptInvalidEnums())
283          return null;
284        else
285          throw new FHIRException("Unknown SearchEntryMode code '"+codeString+"'");
286        }
287        public String toCode() {
288          switch (this) {
289            case MATCH: return "match";
290            case INCLUDE: return "include";
291            case OUTCOME: return "outcome";
292            default: return "?";
293          }
294        }
295        public String getSystem() {
296          switch (this) {
297            case MATCH: return "http://hl7.org/fhir/search-entry-mode";
298            case INCLUDE: return "http://hl7.org/fhir/search-entry-mode";
299            case OUTCOME: return "http://hl7.org/fhir/search-entry-mode";
300            default: return "?";
301          }
302        }
303        public String getDefinition() {
304          switch (this) {
305            case MATCH: return "This resource matched the search specification.";
306            case INCLUDE: return "This resource is returned because it is referred to from another resource in the search set.";
307            case OUTCOME: return "An OperationOutcome that provides additional information about the processing of a search.";
308            default: return "?";
309          }
310        }
311        public String getDisplay() {
312          switch (this) {
313            case MATCH: return "Match";
314            case INCLUDE: return "Include";
315            case OUTCOME: return "Outcome";
316            default: return "?";
317          }
318        }
319    }
320
321  public static class SearchEntryModeEnumFactory implements EnumFactory<SearchEntryMode> {
322    public SearchEntryMode fromCode(String codeString) throws IllegalArgumentException {
323      if (codeString == null || "".equals(codeString))
324            if (codeString == null || "".equals(codeString))
325                return null;
326        if ("match".equals(codeString))
327          return SearchEntryMode.MATCH;
328        if ("include".equals(codeString))
329          return SearchEntryMode.INCLUDE;
330        if ("outcome".equals(codeString))
331          return SearchEntryMode.OUTCOME;
332        throw new IllegalArgumentException("Unknown SearchEntryMode code '"+codeString+"'");
333        }
334        public Enumeration<SearchEntryMode> fromType(Base code) throws FHIRException {
335          if (code == null)
336            return null;
337          if (code.isEmpty())
338            return new Enumeration<SearchEntryMode>(this);
339          String codeString = ((PrimitiveType) code).asStringValue();
340          if (codeString == null || "".equals(codeString))
341            return null;
342        if ("match".equals(codeString))
343          return new Enumeration<SearchEntryMode>(this, SearchEntryMode.MATCH);
344        if ("include".equals(codeString))
345          return new Enumeration<SearchEntryMode>(this, SearchEntryMode.INCLUDE);
346        if ("outcome".equals(codeString))
347          return new Enumeration<SearchEntryMode>(this, SearchEntryMode.OUTCOME);
348        throw new FHIRException("Unknown SearchEntryMode code '"+codeString+"'");
349        }
350    public String toCode(SearchEntryMode code) {
351      if (code == SearchEntryMode.MATCH)
352        return "match";
353      if (code == SearchEntryMode.INCLUDE)
354        return "include";
355      if (code == SearchEntryMode.OUTCOME)
356        return "outcome";
357      return "?";
358      }
359    public String toSystem(SearchEntryMode code) {
360      return code.getSystem();
361      }
362    }
363
364    public enum HTTPVerb {
365        /**
366         * HTTP GET
367         */
368        GET, 
369        /**
370         * HTTP POST
371         */
372        POST, 
373        /**
374         * HTTP PUT
375         */
376        PUT, 
377        /**
378         * HTTP DELETE
379         */
380        DELETE, 
381        /**
382         * added to help the parsers with the generic types
383         */
384        NULL;
385        public static HTTPVerb fromCode(String codeString) throws FHIRException {
386            if (codeString == null || "".equals(codeString))
387                return null;
388        if ("GET".equals(codeString))
389          return GET;
390        if ("POST".equals(codeString))
391          return POST;
392        if ("PUT".equals(codeString))
393          return PUT;
394        if ("DELETE".equals(codeString))
395          return DELETE;
396        if (Configuration.isAcceptInvalidEnums())
397          return null;
398        else
399          throw new FHIRException("Unknown HTTPVerb code '"+codeString+"'");
400        }
401        public String toCode() {
402          switch (this) {
403            case GET: return "GET";
404            case POST: return "POST";
405            case PUT: return "PUT";
406            case DELETE: return "DELETE";
407            default: return "?";
408          }
409        }
410        public String getSystem() {
411          switch (this) {
412            case GET: return "http://hl7.org/fhir/http-verb";
413            case POST: return "http://hl7.org/fhir/http-verb";
414            case PUT: return "http://hl7.org/fhir/http-verb";
415            case DELETE: return "http://hl7.org/fhir/http-verb";
416            default: return "?";
417          }
418        }
419        public String getDefinition() {
420          switch (this) {
421            case GET: return "HTTP GET";
422            case POST: return "HTTP POST";
423            case PUT: return "HTTP PUT";
424            case DELETE: return "HTTP DELETE";
425            default: return "?";
426          }
427        }
428        public String getDisplay() {
429          switch (this) {
430            case GET: return "GET";
431            case POST: return "POST";
432            case PUT: return "PUT";
433            case DELETE: return "DELETE";
434            default: return "?";
435          }
436        }
437    }
438
439  public static class HTTPVerbEnumFactory implements EnumFactory<HTTPVerb> {
440    public HTTPVerb fromCode(String codeString) throws IllegalArgumentException {
441      if (codeString == null || "".equals(codeString))
442            if (codeString == null || "".equals(codeString))
443                return null;
444        if ("GET".equals(codeString))
445          return HTTPVerb.GET;
446        if ("POST".equals(codeString))
447          return HTTPVerb.POST;
448        if ("PUT".equals(codeString))
449          return HTTPVerb.PUT;
450        if ("DELETE".equals(codeString))
451          return HTTPVerb.DELETE;
452        throw new IllegalArgumentException("Unknown HTTPVerb code '"+codeString+"'");
453        }
454        public Enumeration<HTTPVerb> fromType(Base code) throws FHIRException {
455          if (code == null)
456            return null;
457          if (code.isEmpty())
458            return new Enumeration<HTTPVerb>(this);
459          String codeString = ((PrimitiveType) code).asStringValue();
460          if (codeString == null || "".equals(codeString))
461            return null;
462        if ("GET".equals(codeString))
463          return new Enumeration<HTTPVerb>(this, HTTPVerb.GET);
464        if ("POST".equals(codeString))
465          return new Enumeration<HTTPVerb>(this, HTTPVerb.POST);
466        if ("PUT".equals(codeString))
467          return new Enumeration<HTTPVerb>(this, HTTPVerb.PUT);
468        if ("DELETE".equals(codeString))
469          return new Enumeration<HTTPVerb>(this, HTTPVerb.DELETE);
470        throw new FHIRException("Unknown HTTPVerb code '"+codeString+"'");
471        }
472    public String toCode(HTTPVerb code) {
473      if (code == HTTPVerb.GET)
474        return "GET";
475      if (code == HTTPVerb.POST)
476        return "POST";
477      if (code == HTTPVerb.PUT)
478        return "PUT";
479      if (code == HTTPVerb.DELETE)
480        return "DELETE";
481      return "?";
482      }
483    public String toSystem(HTTPVerb code) {
484      return code.getSystem();
485      }
486    }
487
488    @Block()
489    public static class BundleLinkComponent extends BackboneElement implements IBaseBackboneElement {
490        /**
491         * 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).
492         */
493        @Child(name = "relation", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
494        @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)." )
495        protected StringType relation;
496
497        /**
498         * The reference details for the link.
499         */
500        @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true)
501        @Description(shortDefinition="Reference details for the link", formalDefinition="The reference details for the link." )
502        protected UriType url;
503
504        private static final long serialVersionUID = -1010386066L;
505
506    /**
507     * Constructor
508     */
509      public BundleLinkComponent() {
510        super();
511      }
512
513    /**
514     * Constructor
515     */
516      public BundleLinkComponent(StringType relation, UriType url) {
517        super();
518        this.relation = relation;
519        this.url = url;
520      }
521
522        /**
523         * @return {@link #relation} (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).). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value
524         */
525        public StringType getRelationElement() { 
526          if (this.relation == null)
527            if (Configuration.errorOnAutoCreate())
528              throw new Error("Attempt to auto-create BundleLinkComponent.relation");
529            else if (Configuration.doAutoCreate())
530              this.relation = new StringType(); // bb
531          return this.relation;
532        }
533
534        public boolean hasRelationElement() { 
535          return this.relation != null && !this.relation.isEmpty();
536        }
537
538        public boolean hasRelation() { 
539          return this.relation != null && !this.relation.isEmpty();
540        }
541
542        /**
543         * @param value {@link #relation} (A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value
544         */
545        public BundleLinkComponent setRelationElement(StringType value) { 
546          this.relation = value;
547          return this;
548        }
549
550        /**
551         * @return 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).
552         */
553        public String getRelation() { 
554          return this.relation == null ? null : this.relation.getValue();
555        }
556
557        /**
558         * @param value 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).
559         */
560        public BundleLinkComponent setRelation(String value) { 
561            if (this.relation == null)
562              this.relation = new StringType();
563            this.relation.setValue(value);
564          return this;
565        }
566
567        /**
568         * @return {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
569         */
570        public UriType getUrlElement() { 
571          if (this.url == null)
572            if (Configuration.errorOnAutoCreate())
573              throw new Error("Attempt to auto-create BundleLinkComponent.url");
574            else if (Configuration.doAutoCreate())
575              this.url = new UriType(); // bb
576          return this.url;
577        }
578
579        public boolean hasUrlElement() { 
580          return this.url != null && !this.url.isEmpty();
581        }
582
583        public boolean hasUrl() { 
584          return this.url != null && !this.url.isEmpty();
585        }
586
587        /**
588         * @param value {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
589         */
590        public BundleLinkComponent setUrlElement(UriType value) { 
591          this.url = value;
592          return this;
593        }
594
595        /**
596         * @return The reference details for the link.
597         */
598        public String getUrl() { 
599          return this.url == null ? null : this.url.getValue();
600        }
601
602        /**
603         * @param value The reference details for the link.
604         */
605        public BundleLinkComponent setUrl(String value) { 
606            if (this.url == null)
607              this.url = new UriType();
608            this.url.setValue(value);
609          return this;
610        }
611
612        protected void listChildren(List<Property> childrenList) {
613          super.listChildren(childrenList);
614          childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).", 0, java.lang.Integer.MAX_VALUE, relation));
615          childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url));
616        }
617
618      @Override
619      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
620        switch (hash) {
621        case -554436100: /*relation*/ return this.relation == null ? new Base[0] : new Base[] {this.relation}; // StringType
622        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
623        default: return super.getProperty(hash, name, checkValid);
624        }
625
626      }
627
628      @Override
629      public Base setProperty(int hash, String name, Base value) throws FHIRException {
630        switch (hash) {
631        case -554436100: // relation
632          this.relation = castToString(value); // StringType
633          return value;
634        case 116079: // url
635          this.url = castToUri(value); // UriType
636          return value;
637        default: return super.setProperty(hash, name, value);
638        }
639
640      }
641
642      @Override
643      public Base setProperty(String name, Base value) throws FHIRException {
644        if (name.equals("relation")) {
645          this.relation = castToString(value); // StringType
646        } else if (name.equals("url")) {
647          this.url = castToUri(value); // UriType
648        } else
649          return super.setProperty(name, value);
650        return value;
651      }
652
653      @Override
654      public Base makeProperty(int hash, String name) throws FHIRException {
655        switch (hash) {
656        case -554436100:  return getRelationElement();
657        case 116079:  return getUrlElement();
658        default: return super.makeProperty(hash, name);
659        }
660
661      }
662
663      @Override
664      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
665        switch (hash) {
666        case -554436100: /*relation*/ return new String[] {"string"};
667        case 116079: /*url*/ return new String[] {"uri"};
668        default: return super.getTypesForProperty(hash, name);
669        }
670
671      }
672
673      @Override
674      public Base addChild(String name) throws FHIRException {
675        if (name.equals("relation")) {
676          throw new FHIRException("Cannot call addChild on a primitive type Bundle.relation");
677        }
678        else if (name.equals("url")) {
679          throw new FHIRException("Cannot call addChild on a primitive type Bundle.url");
680        }
681        else
682          return super.addChild(name);
683      }
684
685      public BundleLinkComponent copy() {
686        BundleLinkComponent dst = new BundleLinkComponent();
687        copyValues(dst);
688        dst.relation = relation == null ? null : relation.copy();
689        dst.url = url == null ? null : url.copy();
690        return dst;
691      }
692
693      @Override
694      public boolean equalsDeep(Base other) {
695        if (!super.equalsDeep(other))
696          return false;
697        if (!(other instanceof BundleLinkComponent))
698          return false;
699        BundleLinkComponent o = (BundleLinkComponent) other;
700        return compareDeep(relation, o.relation, true) && compareDeep(url, o.url, true);
701      }
702
703      @Override
704      public boolean equalsShallow(Base other) {
705        if (!super.equalsShallow(other))
706          return false;
707        if (!(other instanceof BundleLinkComponent))
708          return false;
709        BundleLinkComponent o = (BundleLinkComponent) other;
710        return compareValues(relation, o.relation, true) && compareValues(url, o.url, true);
711      }
712
713      public boolean isEmpty() {
714        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relation, url);
715      }
716
717  public String fhirType() {
718    return "Bundle.link";
719
720  }
721
722  }
723
724    @Block()
725    public static class BundleEntryComponent extends BackboneElement implements IBaseBackboneElement {
726        /**
727         * A series of links that provide context to this entry.
728         */
729        @Child(name = "link", type = {BundleLinkComponent.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
730        @Description(shortDefinition="Links related to this entry", formalDefinition="A series of links that provide context to this entry." )
731        protected List<BundleLinkComponent> link;
732
733        /**
734         * The Absolute URL for the resource.  The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: 
735* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)
736* Results from operations might involve resources that are not identified.
737         */
738        @Child(name = "fullUrl", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
739        @Description(shortDefinition="Absolute URL for resource (server address, or UUID/OID)", formalDefinition="The Absolute URL for the resource.  The fullUrl SHALL not disagree with the id in the resource. 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." )
740        protected UriType fullUrl;
741
742        /**
743         * The Resources for the entry.
744         */
745        @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=true)
746        @Description(shortDefinition="A resource in the bundle", formalDefinition="The Resources for the entry." )
747        protected Resource resource;
748
749        /**
750         * Information about the search process that lead to the creation of this entry.
751         */
752        @Child(name = "search", type = {}, order=4, min=0, max=1, modifier=false, summary=true)
753        @Description(shortDefinition="Search related information", formalDefinition="Information about the search process that lead to the creation of this entry." )
754        protected BundleEntrySearchComponent search;
755
756        /**
757         * Additional information about how this entry should be processed as part of a transaction.
758         */
759        @Child(name = "request", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
760        @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." )
761        protected BundleEntryRequestComponent request;
762
763        /**
764         * Additional information about how this entry should be processed as part of a transaction.
765         */
766        @Child(name = "response", type = {}, order=6, min=0, max=1, modifier=false, summary=true)
767        @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." )
768        protected BundleEntryResponseComponent response;
769
770        private static final long serialVersionUID = 517783054L;
771
772    /**
773     * Constructor
774     */
775      public BundleEntryComponent() {
776        super();
777      }
778
779        /**
780         * @return {@link #link} (A series of links that provide context to this entry.)
781         */
782        public List<BundleLinkComponent> getLink() { 
783          if (this.link == null)
784            this.link = new ArrayList<BundleLinkComponent>();
785          return this.link;
786        }
787
788        /**
789         * @return Returns a reference to <code>this</code> for easy method chaining
790         */
791        public BundleEntryComponent setLink(List<BundleLinkComponent> theLink) { 
792          this.link = theLink;
793          return this;
794        }
795
796        public boolean hasLink() { 
797          if (this.link == null)
798            return false;
799          for (BundleLinkComponent item : this.link)
800            if (!item.isEmpty())
801              return true;
802          return false;
803        }
804
805        public BundleLinkComponent addLink() { //3
806          BundleLinkComponent t = new BundleLinkComponent();
807          if (this.link == null)
808            this.link = new ArrayList<BundleLinkComponent>();
809          this.link.add(t);
810          return t;
811        }
812
813        public BundleEntryComponent addLink(BundleLinkComponent t) { //3
814          if (t == null)
815            return this;
816          if (this.link == null)
817            this.link = new ArrayList<BundleLinkComponent>();
818          this.link.add(t);
819          return this;
820        }
821
822        /**
823         * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist
824         */
825        public BundleLinkComponent getLinkFirstRep() { 
826          if (getLink().isEmpty()) {
827            addLink();
828          }
829          return getLink().get(0);
830        }
831
832        /**
833         * @return {@link #fullUrl} (The Absolute URL for the resource.  The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: 
834* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)
835* Results from operations might involve resources that are not identified.). This is the underlying object with id, value and extensions. The accessor "getFullUrl" gives direct access to the value
836         */
837        public UriType getFullUrlElement() { 
838          if (this.fullUrl == null)
839            if (Configuration.errorOnAutoCreate())
840              throw new Error("Attempt to auto-create BundleEntryComponent.fullUrl");
841            else if (Configuration.doAutoCreate())
842              this.fullUrl = new UriType(); // bb
843          return this.fullUrl;
844        }
845
846        public boolean hasFullUrlElement() { 
847          return this.fullUrl != null && !this.fullUrl.isEmpty();
848        }
849
850        public boolean hasFullUrl() { 
851          return this.fullUrl != null && !this.fullUrl.isEmpty();
852        }
853
854        /**
855         * @param value {@link #fullUrl} (The Absolute URL for the resource.  The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: 
856* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)
857* Results from operations might involve resources that are not identified.). This is the underlying object with id, value and extensions. The accessor "getFullUrl" gives direct access to the value
858         */
859        public BundleEntryComponent setFullUrlElement(UriType value) { 
860          this.fullUrl = value;
861          return this;
862        }
863
864        /**
865         * @return The Absolute URL for the resource.  The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: 
866* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)
867* Results from operations might involve resources that are not identified.
868         */
869        public String getFullUrl() { 
870          return this.fullUrl == null ? null : this.fullUrl.getValue();
871        }
872
873        /**
874         * @param value The Absolute URL for the resource.  The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: 
875* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)
876* Results from operations might involve resources that are not identified.
877         */
878        public BundleEntryComponent setFullUrl(String value) { 
879          if (Utilities.noString(value))
880            this.fullUrl = null;
881          else {
882            if (this.fullUrl == null)
883              this.fullUrl = new UriType();
884            this.fullUrl.setValue(value);
885          }
886          return this;
887        }
888
889        /**
890         * @return {@link #resource} (The Resources for the entry.)
891         */
892        public Resource getResource() { 
893          return this.resource;
894        }
895
896        public boolean hasResource() { 
897          return this.resource != null && !this.resource.isEmpty();
898        }
899
900        /**
901         * @param value {@link #resource} (The Resources for the entry.)
902         */
903        public BundleEntryComponent setResource(Resource value) { 
904          this.resource = value;
905          return this;
906        }
907
908        /**
909         * @return {@link #search} (Information about the search process that lead to the creation of this entry.)
910         */
911        public BundleEntrySearchComponent getSearch() { 
912          if (this.search == null)
913            if (Configuration.errorOnAutoCreate())
914              throw new Error("Attempt to auto-create BundleEntryComponent.search");
915            else if (Configuration.doAutoCreate())
916              this.search = new BundleEntrySearchComponent(); // cc
917          return this.search;
918        }
919
920        public boolean hasSearch() { 
921          return this.search != null && !this.search.isEmpty();
922        }
923
924        /**
925         * @param value {@link #search} (Information about the search process that lead to the creation of this entry.)
926         */
927        public BundleEntryComponent setSearch(BundleEntrySearchComponent value) { 
928          this.search = value;
929          return this;
930        }
931
932        /**
933         * @return {@link #request} (Additional information about how this entry should be processed as part of a transaction.)
934         */
935        public BundleEntryRequestComponent getRequest() { 
936          if (this.request == null)
937            if (Configuration.errorOnAutoCreate())
938              throw new Error("Attempt to auto-create BundleEntryComponent.request");
939            else if (Configuration.doAutoCreate())
940              this.request = new BundleEntryRequestComponent(); // cc
941          return this.request;
942        }
943
944        public boolean hasRequest() { 
945          return this.request != null && !this.request.isEmpty();
946        }
947
948        /**
949         * @param value {@link #request} (Additional information about how this entry should be processed as part of a transaction.)
950         */
951        public BundleEntryComponent setRequest(BundleEntryRequestComponent value) { 
952          this.request = value;
953          return this;
954        }
955
956        /**
957         * @return {@link #response} (Additional information about how this entry should be processed as part of a transaction.)
958         */
959        public BundleEntryResponseComponent getResponse() { 
960          if (this.response == null)
961            if (Configuration.errorOnAutoCreate())
962              throw new Error("Attempt to auto-create BundleEntryComponent.response");
963            else if (Configuration.doAutoCreate())
964              this.response = new BundleEntryResponseComponent(); // cc
965          return this.response;
966        }
967
968        public boolean hasResponse() { 
969          return this.response != null && !this.response.isEmpty();
970        }
971
972        /**
973         * @param value {@link #response} (Additional information about how this entry should be processed as part of a transaction.)
974         */
975        public BundleEntryComponent setResponse(BundleEntryResponseComponent value) { 
976          this.response = value;
977          return this;
978        }
979
980 /**
981   * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. 
982   * If no link is found which matches the given relation, returns <code>null</code>. If more than one
983   * link is found which matches the given relation, returns the first matching BundleLinkComponent.
984   * 
985   * @param theRelation
986   *            The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}.
987   * @return Returns a matching BundleLinkComponent, or <code>null</code>
988   * @see IBaseBundle#LINK_NEXT
989   * @see IBaseBundle#LINK_PREV
990   * @see IBaseBundle#LINK_SELF
991   */
992  public BundleLinkComponent getLink(String theRelation) {
993    org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
994    for (BundleLinkComponent next : getLink()) {
995      if (theRelation.equals(next.getRelation())) {
996        return next;
997      }
998    }
999    return null;
1000  }
1001
1002  /**
1003   * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. 
1004   * If no link is found which matches the given relation, creates a new BundleLinkComponent with the
1005   * given relation and adds it to this Bundle. If more than one
1006   * link is found which matches the given relation, returns the first matching BundleLinkComponent.
1007   * 
1008   * @param theRelation
1009   *            The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}.
1010   * @return Returns a matching BundleLinkComponent, or <code>null</code>
1011   * @see IBaseBundle#LINK_NEXT
1012   * @see IBaseBundle#LINK_PREV
1013   * @see IBaseBundle#LINK_SELF
1014   */
1015  public BundleLinkComponent getLinkOrCreate(String theRelation) {
1016    org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
1017    for (BundleLinkComponent next : getLink()) {
1018      if (theRelation.equals(next.getRelation())) {
1019        return next;
1020      }
1021    }
1022    BundleLinkComponent retVal = new BundleLinkComponent();
1023    retVal.setRelation(theRelation);
1024    getLink().add(retVal);
1025    return retVal;
1026  }
1027        protected void listChildren(List<Property> childrenList) {
1028          super.listChildren(childrenList);
1029          childrenList.add(new Property("link", "@Bundle.link", "A series of links that provide context to this entry.", 0, java.lang.Integer.MAX_VALUE, link));
1030          childrenList.add(new Property("fullUrl", "uri", "The Absolute URL for the resource.  The fullUrl SHALL not disagree with the id in the resource. 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.", 0, java.lang.Integer.MAX_VALUE, fullUrl));
1031          childrenList.add(new Property("resource", "Resource", "The Resources for the entry.", 0, java.lang.Integer.MAX_VALUE, resource));
1032          childrenList.add(new Property("search", "", "Information about the search process that lead to the creation of this entry.", 0, java.lang.Integer.MAX_VALUE, search));
1033          childrenList.add(new Property("request", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, request));
1034          childrenList.add(new Property("response", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, response));
1035        }
1036
1037      @Override
1038      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1039        switch (hash) {
1040        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent
1041        case -511251360: /*fullUrl*/ return this.fullUrl == null ? new Base[0] : new Base[] {this.fullUrl}; // UriType
1042        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource
1043        case -906336856: /*search*/ return this.search == null ? new Base[0] : new Base[] {this.search}; // BundleEntrySearchComponent
1044        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // BundleEntryRequestComponent
1045        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // BundleEntryResponseComponent
1046        default: return super.getProperty(hash, name, checkValid);
1047        }
1048
1049      }
1050
1051      @Override
1052      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1053        switch (hash) {
1054        case 3321850: // link
1055          this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent
1056          return value;
1057        case -511251360: // fullUrl
1058          this.fullUrl = castToUri(value); // UriType
1059          return value;
1060        case -341064690: // resource
1061          this.resource = castToResource(value); // Resource
1062          return value;
1063        case -906336856: // search
1064          this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent
1065          return value;
1066        case 1095692943: // request
1067          this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent
1068          return value;
1069        case -340323263: // response
1070          this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent
1071          return value;
1072        default: return super.setProperty(hash, name, value);
1073        }
1074
1075      }
1076
1077      @Override
1078      public Base setProperty(String name, Base value) throws FHIRException {
1079        if (name.equals("link")) {
1080          this.getLink().add((BundleLinkComponent) value);
1081        } else if (name.equals("fullUrl")) {
1082          this.fullUrl = castToUri(value); // UriType
1083        } else if (name.equals("resource")) {
1084          this.resource = castToResource(value); // Resource
1085        } else if (name.equals("search")) {
1086          this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent
1087        } else if (name.equals("request")) {
1088          this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent
1089        } else if (name.equals("response")) {
1090          this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent
1091        } else
1092          return super.setProperty(name, value);
1093        return value;
1094      }
1095
1096      @Override
1097      public Base makeProperty(int hash, String name) throws FHIRException {
1098        switch (hash) {
1099        case 3321850:  return addLink(); 
1100        case -511251360:  return getFullUrlElement();
1101        case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource
1102        case -906336856:  return getSearch(); 
1103        case 1095692943:  return getRequest(); 
1104        case -340323263:  return getResponse(); 
1105        default: return super.makeProperty(hash, name);
1106        }
1107
1108      }
1109
1110      @Override
1111      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1112        switch (hash) {
1113        case 3321850: /*link*/ return new String[] {"@Bundle.link"};
1114        case -511251360: /*fullUrl*/ return new String[] {"uri"};
1115        case -341064690: /*resource*/ return new String[] {"Resource"};
1116        case -906336856: /*search*/ return new String[] {};
1117        case 1095692943: /*request*/ return new String[] {};
1118        case -340323263: /*response*/ return new String[] {};
1119        default: return super.getTypesForProperty(hash, name);
1120        }
1121
1122      }
1123
1124      @Override
1125      public Base addChild(String name) throws FHIRException {
1126        if (name.equals("link")) {
1127          return addLink();
1128        }
1129        else if (name.equals("fullUrl")) {
1130          throw new FHIRException("Cannot call addChild on a primitive type Bundle.fullUrl");
1131        }
1132        else if (name.equals("resource")) {
1133          throw new FHIRException("Cannot call addChild on an abstract type Bundle.resource");
1134        }
1135        else if (name.equals("search")) {
1136          this.search = new BundleEntrySearchComponent();
1137          return this.search;
1138        }
1139        else if (name.equals("request")) {
1140          this.request = new BundleEntryRequestComponent();
1141          return this.request;
1142        }
1143        else if (name.equals("response")) {
1144          this.response = new BundleEntryResponseComponent();
1145          return this.response;
1146        }
1147        else
1148          return super.addChild(name);
1149      }
1150
1151      public BundleEntryComponent copy() {
1152        BundleEntryComponent dst = new BundleEntryComponent();
1153        copyValues(dst);
1154        if (link != null) {
1155          dst.link = new ArrayList<BundleLinkComponent>();
1156          for (BundleLinkComponent i : link)
1157            dst.link.add(i.copy());
1158        };
1159        dst.fullUrl = fullUrl == null ? null : fullUrl.copy();
1160        dst.resource = resource == null ? null : resource.copy();
1161        dst.search = search == null ? null : search.copy();
1162        dst.request = request == null ? null : request.copy();
1163        dst.response = response == null ? null : response.copy();
1164        return dst;
1165      }
1166
1167      @Override
1168      public boolean equalsDeep(Base other) {
1169        if (!super.equalsDeep(other))
1170          return false;
1171        if (!(other instanceof BundleEntryComponent))
1172          return false;
1173        BundleEntryComponent o = (BundleEntryComponent) other;
1174        return compareDeep(link, o.link, true) && compareDeep(fullUrl, o.fullUrl, true) && compareDeep(resource, o.resource, true)
1175           && compareDeep(search, o.search, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true)
1176          ;
1177      }
1178
1179      @Override
1180      public boolean equalsShallow(Base other) {
1181        if (!super.equalsShallow(other))
1182          return false;
1183        if (!(other instanceof BundleEntryComponent))
1184          return false;
1185        BundleEntryComponent o = (BundleEntryComponent) other;
1186        return compareValues(fullUrl, o.fullUrl, true);
1187      }
1188
1189      public boolean isEmpty() {
1190        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(link, fullUrl, resource
1191          , search, request, response);
1192      }
1193
1194  public String fhirType() {
1195    return "Bundle.entry";
1196
1197  }
1198
1199  }
1200
1201    @Block()
1202    public static class BundleEntrySearchComponent extends BackboneElement implements IBaseBackboneElement {
1203        /**
1204         * Why this entry is in the result set - whether it's included as a match or because of an _include requirement.
1205         */
1206        @Child(name = "mode", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1207        @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." )
1208        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-entry-mode")
1209        protected Enumeration<SearchEntryMode> mode;
1210
1211        /**
1212         * When searching, the server's search ranking score for the entry.
1213         */
1214        @Child(name = "score", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1215        @Description(shortDefinition="Search ranking (between 0 and 1)", formalDefinition="When searching, the server's search ranking score for the entry." )
1216        protected DecimalType score;
1217
1218        private static final long serialVersionUID = 837739866L;
1219
1220    /**
1221     * Constructor
1222     */
1223      public BundleEntrySearchComponent() {
1224        super();
1225      }
1226
1227        /**
1228         * @return {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
1229         */
1230        public Enumeration<SearchEntryMode> getModeElement() { 
1231          if (this.mode == null)
1232            if (Configuration.errorOnAutoCreate())
1233              throw new Error("Attempt to auto-create BundleEntrySearchComponent.mode");
1234            else if (Configuration.doAutoCreate())
1235              this.mode = new Enumeration<SearchEntryMode>(new SearchEntryModeEnumFactory()); // bb
1236          return this.mode;
1237        }
1238
1239        public boolean hasModeElement() { 
1240          return this.mode != null && !this.mode.isEmpty();
1241        }
1242
1243        public boolean hasMode() { 
1244          return this.mode != null && !this.mode.isEmpty();
1245        }
1246
1247        /**
1248         * @param value {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
1249         */
1250        public BundleEntrySearchComponent setModeElement(Enumeration<SearchEntryMode> value) { 
1251          this.mode = value;
1252          return this;
1253        }
1254
1255        /**
1256         * @return Why this entry is in the result set - whether it's included as a match or because of an _include requirement.
1257         */
1258        public SearchEntryMode getMode() { 
1259          return this.mode == null ? null : this.mode.getValue();
1260        }
1261
1262        /**
1263         * @param value Why this entry is in the result set - whether it's included as a match or because of an _include requirement.
1264         */
1265        public BundleEntrySearchComponent setMode(SearchEntryMode value) { 
1266          if (value == null)
1267            this.mode = null;
1268          else {
1269            if (this.mode == null)
1270              this.mode = new Enumeration<SearchEntryMode>(new SearchEntryModeEnumFactory());
1271            this.mode.setValue(value);
1272          }
1273          return this;
1274        }
1275
1276        /**
1277         * @return {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value
1278         */
1279        public DecimalType getScoreElement() { 
1280          if (this.score == null)
1281            if (Configuration.errorOnAutoCreate())
1282              throw new Error("Attempt to auto-create BundleEntrySearchComponent.score");
1283            else if (Configuration.doAutoCreate())
1284              this.score = new DecimalType(); // bb
1285          return this.score;
1286        }
1287
1288        public boolean hasScoreElement() { 
1289          return this.score != null && !this.score.isEmpty();
1290        }
1291
1292        public boolean hasScore() { 
1293          return this.score != null && !this.score.isEmpty();
1294        }
1295
1296        /**
1297         * @param value {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value
1298         */
1299        public BundleEntrySearchComponent setScoreElement(DecimalType value) { 
1300          this.score = value;
1301          return this;
1302        }
1303
1304        /**
1305         * @return When searching, the server's search ranking score for the entry.
1306         */
1307        public BigDecimal getScore() { 
1308          return this.score == null ? null : this.score.getValue();
1309        }
1310
1311        /**
1312         * @param value When searching, the server's search ranking score for the entry.
1313         */
1314        public BundleEntrySearchComponent setScore(BigDecimal value) { 
1315          if (value == null)
1316            this.score = null;
1317          else {
1318            if (this.score == null)
1319              this.score = new DecimalType();
1320            this.score.setValue(value);
1321          }
1322          return this;
1323        }
1324
1325        /**
1326         * @param value When searching, the server's search ranking score for the entry.
1327         */
1328        public BundleEntrySearchComponent setScore(long value) { 
1329              this.score = new DecimalType();
1330            this.score.setValue(value);
1331          return this;
1332        }
1333
1334        /**
1335         * @param value When searching, the server's search ranking score for the entry.
1336         */
1337        public BundleEntrySearchComponent setScore(double value) { 
1338              this.score = new DecimalType();
1339            this.score.setValue(value);
1340          return this;
1341        }
1342
1343        protected void listChildren(List<Property> childrenList) {
1344          super.listChildren(childrenList);
1345          childrenList.add(new Property("mode", "code", "Why this entry is in the result set - whether it's included as a match or because of an _include requirement.", 0, java.lang.Integer.MAX_VALUE, mode));
1346          childrenList.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.", 0, java.lang.Integer.MAX_VALUE, score));
1347        }
1348
1349      @Override
1350      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1351        switch (hash) {
1352        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<SearchEntryMode>
1353        case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // DecimalType
1354        default: return super.getProperty(hash, name, checkValid);
1355        }
1356
1357      }
1358
1359      @Override
1360      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1361        switch (hash) {
1362        case 3357091: // mode
1363          value = new SearchEntryModeEnumFactory().fromType(castToCode(value));
1364          this.mode = (Enumeration) value; // Enumeration<SearchEntryMode>
1365          return value;
1366        case 109264530: // score
1367          this.score = castToDecimal(value); // DecimalType
1368          return value;
1369        default: return super.setProperty(hash, name, value);
1370        }
1371
1372      }
1373
1374      @Override
1375      public Base setProperty(String name, Base value) throws FHIRException {
1376        if (name.equals("mode")) {
1377          value = new SearchEntryModeEnumFactory().fromType(castToCode(value));
1378          this.mode = (Enumeration) value; // Enumeration<SearchEntryMode>
1379        } else if (name.equals("score")) {
1380          this.score = castToDecimal(value); // DecimalType
1381        } else
1382          return super.setProperty(name, value);
1383        return value;
1384      }
1385
1386      @Override
1387      public Base makeProperty(int hash, String name) throws FHIRException {
1388        switch (hash) {
1389        case 3357091:  return getModeElement();
1390        case 109264530:  return getScoreElement();
1391        default: return super.makeProperty(hash, name);
1392        }
1393
1394      }
1395
1396      @Override
1397      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1398        switch (hash) {
1399        case 3357091: /*mode*/ return new String[] {"code"};
1400        case 109264530: /*score*/ return new String[] {"decimal"};
1401        default: return super.getTypesForProperty(hash, name);
1402        }
1403
1404      }
1405
1406      @Override
1407      public Base addChild(String name) throws FHIRException {
1408        if (name.equals("mode")) {
1409          throw new FHIRException("Cannot call addChild on a primitive type Bundle.mode");
1410        }
1411        else if (name.equals("score")) {
1412          throw new FHIRException("Cannot call addChild on a primitive type Bundle.score");
1413        }
1414        else
1415          return super.addChild(name);
1416      }
1417
1418      public BundleEntrySearchComponent copy() {
1419        BundleEntrySearchComponent dst = new BundleEntrySearchComponent();
1420        copyValues(dst);
1421        dst.mode = mode == null ? null : mode.copy();
1422        dst.score = score == null ? null : score.copy();
1423        return dst;
1424      }
1425
1426      @Override
1427      public boolean equalsDeep(Base other) {
1428        if (!super.equalsDeep(other))
1429          return false;
1430        if (!(other instanceof BundleEntrySearchComponent))
1431          return false;
1432        BundleEntrySearchComponent o = (BundleEntrySearchComponent) other;
1433        return compareDeep(mode, o.mode, true) && compareDeep(score, o.score, true);
1434      }
1435
1436      @Override
1437      public boolean equalsShallow(Base other) {
1438        if (!super.equalsShallow(other))
1439          return false;
1440        if (!(other instanceof BundleEntrySearchComponent))
1441          return false;
1442        BundleEntrySearchComponent o = (BundleEntrySearchComponent) other;
1443        return compareValues(mode, o.mode, true) && compareValues(score, o.score, true);
1444      }
1445
1446      public boolean isEmpty() {
1447        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, score);
1448      }
1449
1450  public String fhirType() {
1451    return "Bundle.entry.search";
1452
1453  }
1454
1455  }
1456
1457    @Block()
1458    public static class BundleEntryRequestComponent extends BackboneElement implements IBaseBackboneElement {
1459        /**
1460         * The HTTP verb for this entry in either a change history, or a transaction/ transaction response.
1461         */
1462        @Child(name = "method", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1463        @Description(shortDefinition="GET | POST | PUT | DELETE", formalDefinition="The HTTP verb for this entry in either a change history, or a transaction/ transaction response." )
1464        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/http-verb")
1465        protected Enumeration<HTTPVerb> method;
1466
1467        /**
1468         * The URL for this entry, relative to the root (the address to which the request is posted).
1469         */
1470        @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1471        @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)." )
1472        protected UriType url;
1473
1474        /**
1475         * If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread).
1476         */
1477        @Child(name = "ifNoneMatch", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1478        @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)." )
1479        protected StringType ifNoneMatch;
1480
1481        /**
1482         * Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).
1483         */
1484        @Child(name = "ifModifiedSince", type = {InstantType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1485        @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread)." )
1486        protected InstantType ifModifiedSince;
1487
1488        /**
1489         * Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).
1490         */
1491        @Child(name = "ifMatch", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1492        @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)." )
1493        protected StringType ifMatch;
1494
1495        /**
1496         * 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 "?").
1497         */
1498        @Child(name = "ifNoneExist", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
1499        @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 \"?\")." )
1500        protected StringType ifNoneExist;
1501
1502        private static final long serialVersionUID = -1349769744L;
1503
1504    /**
1505     * Constructor
1506     */
1507      public BundleEntryRequestComponent() {
1508        super();
1509      }
1510
1511    /**
1512     * Constructor
1513     */
1514      public BundleEntryRequestComponent(Enumeration<HTTPVerb> method, UriType url) {
1515        super();
1516        this.method = method;
1517        this.url = url;
1518      }
1519
1520        /**
1521         * @return {@link #method} (The HTTP verb for this entry in either a change history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value
1522         */
1523        public Enumeration<HTTPVerb> getMethodElement() { 
1524          if (this.method == null)
1525            if (Configuration.errorOnAutoCreate())
1526              throw new Error("Attempt to auto-create BundleEntryRequestComponent.method");
1527            else if (Configuration.doAutoCreate())
1528              this.method = new Enumeration<HTTPVerb>(new HTTPVerbEnumFactory()); // bb
1529          return this.method;
1530        }
1531
1532        public boolean hasMethodElement() { 
1533          return this.method != null && !this.method.isEmpty();
1534        }
1535
1536        public boolean hasMethod() { 
1537          return this.method != null && !this.method.isEmpty();
1538        }
1539
1540        /**
1541         * @param value {@link #method} (The HTTP verb for this entry in either a change history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value
1542         */
1543        public BundleEntryRequestComponent setMethodElement(Enumeration<HTTPVerb> value) { 
1544          this.method = value;
1545          return this;
1546        }
1547
1548        /**
1549         * @return The HTTP verb for this entry in either a change history, or a transaction/ transaction response.
1550         */
1551        public HTTPVerb getMethod() { 
1552          return this.method == null ? null : this.method.getValue();
1553        }
1554
1555        /**
1556         * @param value The HTTP verb for this entry in either a change history, or a transaction/ transaction response.
1557         */
1558        public BundleEntryRequestComponent setMethod(HTTPVerb value) { 
1559            if (this.method == null)
1560              this.method = new Enumeration<HTTPVerb>(new HTTPVerbEnumFactory());
1561            this.method.setValue(value);
1562          return this;
1563        }
1564
1565        /**
1566         * @return {@link #url} (The URL for this entry, relative to the root (the address to which the request is posted).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1567         */
1568        public UriType getUrlElement() { 
1569          if (this.url == null)
1570            if (Configuration.errorOnAutoCreate())
1571              throw new Error("Attempt to auto-create BundleEntryRequestComponent.url");
1572            else if (Configuration.doAutoCreate())
1573              this.url = new UriType(); // bb
1574          return this.url;
1575        }
1576
1577        public boolean hasUrlElement() { 
1578          return this.url != null && !this.url.isEmpty();
1579        }
1580
1581        public boolean hasUrl() { 
1582          return this.url != null && !this.url.isEmpty();
1583        }
1584
1585        /**
1586         * @param value {@link #url} (The URL for this entry, relative to the root (the address to which the request is posted).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1587         */
1588        public BundleEntryRequestComponent setUrlElement(UriType value) { 
1589          this.url = value;
1590          return this;
1591        }
1592
1593        /**
1594         * @return The URL for this entry, relative to the root (the address to which the request is posted).
1595         */
1596        public String getUrl() { 
1597          return this.url == null ? null : this.url.getValue();
1598        }
1599
1600        /**
1601         * @param value The URL for this entry, relative to the root (the address to which the request is posted).
1602         */
1603        public BundleEntryRequestComponent setUrl(String value) { 
1604            if (this.url == null)
1605              this.url = new UriType();
1606            this.url.setValue(value);
1607          return this;
1608        }
1609
1610        /**
1611         * @return {@link #ifNoneMatch} (If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value
1612         */
1613        public StringType getIfNoneMatchElement() { 
1614          if (this.ifNoneMatch == null)
1615            if (Configuration.errorOnAutoCreate())
1616              throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneMatch");
1617            else if (Configuration.doAutoCreate())
1618              this.ifNoneMatch = new StringType(); // bb
1619          return this.ifNoneMatch;
1620        }
1621
1622        public boolean hasIfNoneMatchElement() { 
1623          return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty();
1624        }
1625
1626        public boolean hasIfNoneMatch() { 
1627          return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty();
1628        }
1629
1630        /**
1631         * @param value {@link #ifNoneMatch} (If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value
1632         */
1633        public BundleEntryRequestComponent setIfNoneMatchElement(StringType value) { 
1634          this.ifNoneMatch = value;
1635          return this;
1636        }
1637
1638        /**
1639         * @return If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread).
1640         */
1641        public String getIfNoneMatch() { 
1642          return this.ifNoneMatch == null ? null : this.ifNoneMatch.getValue();
1643        }
1644
1645        /**
1646         * @param value If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread).
1647         */
1648        public BundleEntryRequestComponent setIfNoneMatch(String value) { 
1649          if (Utilities.noString(value))
1650            this.ifNoneMatch = null;
1651          else {
1652            if (this.ifNoneMatch == null)
1653              this.ifNoneMatch = new StringType();
1654            this.ifNoneMatch.setValue(value);
1655          }
1656          return this;
1657        }
1658
1659        /**
1660         * @return {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value
1661         */
1662        public InstantType getIfModifiedSinceElement() { 
1663          if (this.ifModifiedSince == null)
1664            if (Configuration.errorOnAutoCreate())
1665              throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifModifiedSince");
1666            else if (Configuration.doAutoCreate())
1667              this.ifModifiedSince = new InstantType(); // bb
1668          return this.ifModifiedSince;
1669        }
1670
1671        public boolean hasIfModifiedSinceElement() { 
1672          return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty();
1673        }
1674
1675        public boolean hasIfModifiedSince() { 
1676          return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty();
1677        }
1678
1679        /**
1680         * @param value {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value
1681         */
1682        public BundleEntryRequestComponent setIfModifiedSinceElement(InstantType value) { 
1683          this.ifModifiedSince = value;
1684          return this;
1685        }
1686
1687        /**
1688         * @return Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).
1689         */
1690        public Date getIfModifiedSince() { 
1691          return this.ifModifiedSince == null ? null : this.ifModifiedSince.getValue();
1692        }
1693
1694        /**
1695         * @param value Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).
1696         */
1697        public BundleEntryRequestComponent setIfModifiedSince(Date value) { 
1698          if (value == null)
1699            this.ifModifiedSince = null;
1700          else {
1701            if (this.ifModifiedSince == null)
1702              this.ifModifiedSince = new InstantType();
1703            this.ifModifiedSince.setValue(value);
1704          }
1705          return this;
1706        }
1707
1708        /**
1709         * @return {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value
1710         */
1711        public StringType getIfMatchElement() { 
1712          if (this.ifMatch == null)
1713            if (Configuration.errorOnAutoCreate())
1714              throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifMatch");
1715            else if (Configuration.doAutoCreate())
1716              this.ifMatch = new StringType(); // bb
1717          return this.ifMatch;
1718        }
1719
1720        public boolean hasIfMatchElement() { 
1721          return this.ifMatch != null && !this.ifMatch.isEmpty();
1722        }
1723
1724        public boolean hasIfMatch() { 
1725          return this.ifMatch != null && !this.ifMatch.isEmpty();
1726        }
1727
1728        /**
1729         * @param value {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value
1730         */
1731        public BundleEntryRequestComponent setIfMatchElement(StringType value) { 
1732          this.ifMatch = value;
1733          return this;
1734        }
1735
1736        /**
1737         * @return Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).
1738         */
1739        public String getIfMatch() { 
1740          return this.ifMatch == null ? null : this.ifMatch.getValue();
1741        }
1742
1743        /**
1744         * @param value Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).
1745         */
1746        public BundleEntryRequestComponent setIfMatch(String value) { 
1747          if (Utilities.noString(value))
1748            this.ifMatch = null;
1749          else {
1750            if (this.ifMatch == null)
1751              this.ifMatch = new StringType();
1752            this.ifMatch.setValue(value);
1753          }
1754          return this;
1755        }
1756
1757        /**
1758         * @return {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value
1759         */
1760        public StringType getIfNoneExistElement() { 
1761          if (this.ifNoneExist == null)
1762            if (Configuration.errorOnAutoCreate())
1763              throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneExist");
1764            else if (Configuration.doAutoCreate())
1765              this.ifNoneExist = new StringType(); // bb
1766          return this.ifNoneExist;
1767        }
1768
1769        public boolean hasIfNoneExistElement() { 
1770          return this.ifNoneExist != null && !this.ifNoneExist.isEmpty();
1771        }
1772
1773        public boolean hasIfNoneExist() { 
1774          return this.ifNoneExist != null && !this.ifNoneExist.isEmpty();
1775        }
1776
1777        /**
1778         * @param value {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value
1779         */
1780        public BundleEntryRequestComponent setIfNoneExistElement(StringType value) { 
1781          this.ifNoneExist = value;
1782          return this;
1783        }
1784
1785        /**
1786         * @return Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").
1787         */
1788        public String getIfNoneExist() { 
1789          return this.ifNoneExist == null ? null : this.ifNoneExist.getValue();
1790        }
1791
1792        /**
1793         * @param value Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").
1794         */
1795        public BundleEntryRequestComponent setIfNoneExist(String value) { 
1796          if (Utilities.noString(value))
1797            this.ifNoneExist = null;
1798          else {
1799            if (this.ifNoneExist == null)
1800              this.ifNoneExist = new StringType();
1801            this.ifNoneExist.setValue(value);
1802          }
1803          return this;
1804        }
1805
1806        protected void listChildren(List<Property> childrenList) {
1807          super.listChildren(childrenList);
1808          childrenList.add(new Property("method", "code", "The HTTP verb for this entry in either a change history, or a transaction/ transaction response.", 0, java.lang.Integer.MAX_VALUE, method));
1809          childrenList.add(new Property("url", "uri", "The URL for this entry, relative to the root (the address to which the request is posted).", 0, java.lang.Integer.MAX_VALUE, url));
1810          childrenList.add(new Property("ifNoneMatch", "string", "If the ETag values match, return a 304 Not Modified status. See the API documentation for [\"Conditional Read\"](http.html#cread).", 0, java.lang.Integer.MAX_VALUE, ifNoneMatch));
1811          childrenList.add(new Property("ifModifiedSince", "instant", "Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread).", 0, java.lang.Integer.MAX_VALUE, ifModifiedSince));
1812          childrenList.add(new Property("ifMatch", "string", "Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency).", 0, java.lang.Integer.MAX_VALUE, ifMatch));
1813          childrenList.add(new Property("ifNoneExist", "string", "Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\"Conditional Create\"](http.html#ccreate). This is just the query portion of the URL - what follows the \"?\" (not including the \"?\").", 0, java.lang.Integer.MAX_VALUE, ifNoneExist));
1814        }
1815
1816      @Override
1817      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1818        switch (hash) {
1819        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // Enumeration<HTTPVerb>
1820        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1821        case 171868368: /*ifNoneMatch*/ return this.ifNoneMatch == null ? new Base[0] : new Base[] {this.ifNoneMatch}; // StringType
1822        case -2061602860: /*ifModifiedSince*/ return this.ifModifiedSince == null ? new Base[0] : new Base[] {this.ifModifiedSince}; // InstantType
1823        case 1692894888: /*ifMatch*/ return this.ifMatch == null ? new Base[0] : new Base[] {this.ifMatch}; // StringType
1824        case 165155330: /*ifNoneExist*/ return this.ifNoneExist == null ? new Base[0] : new Base[] {this.ifNoneExist}; // StringType
1825        default: return super.getProperty(hash, name, checkValid);
1826        }
1827
1828      }
1829
1830      @Override
1831      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1832        switch (hash) {
1833        case -1077554975: // method
1834          value = new HTTPVerbEnumFactory().fromType(castToCode(value));
1835          this.method = (Enumeration) value; // Enumeration<HTTPVerb>
1836          return value;
1837        case 116079: // url
1838          this.url = castToUri(value); // UriType
1839          return value;
1840        case 171868368: // ifNoneMatch
1841          this.ifNoneMatch = castToString(value); // StringType
1842          return value;
1843        case -2061602860: // ifModifiedSince
1844          this.ifModifiedSince = castToInstant(value); // InstantType
1845          return value;
1846        case 1692894888: // ifMatch
1847          this.ifMatch = castToString(value); // StringType
1848          return value;
1849        case 165155330: // ifNoneExist
1850          this.ifNoneExist = castToString(value); // StringType
1851          return value;
1852        default: return super.setProperty(hash, name, value);
1853        }
1854
1855      }
1856
1857      @Override
1858      public Base setProperty(String name, Base value) throws FHIRException {
1859        if (name.equals("method")) {
1860          value = new HTTPVerbEnumFactory().fromType(castToCode(value));
1861          this.method = (Enumeration) value; // Enumeration<HTTPVerb>
1862        } else if (name.equals("url")) {
1863          this.url = castToUri(value); // UriType
1864        } else if (name.equals("ifNoneMatch")) {
1865          this.ifNoneMatch = castToString(value); // StringType
1866        } else if (name.equals("ifModifiedSince")) {
1867          this.ifModifiedSince = castToInstant(value); // InstantType
1868        } else if (name.equals("ifMatch")) {
1869          this.ifMatch = castToString(value); // StringType
1870        } else if (name.equals("ifNoneExist")) {
1871          this.ifNoneExist = castToString(value); // StringType
1872        } else
1873          return super.setProperty(name, value);
1874        return value;
1875      }
1876
1877      @Override
1878      public Base makeProperty(int hash, String name) throws FHIRException {
1879        switch (hash) {
1880        case -1077554975:  return getMethodElement();
1881        case 116079:  return getUrlElement();
1882        case 171868368:  return getIfNoneMatchElement();
1883        case -2061602860:  return getIfModifiedSinceElement();
1884        case 1692894888:  return getIfMatchElement();
1885        case 165155330:  return getIfNoneExistElement();
1886        default: return super.makeProperty(hash, name);
1887        }
1888
1889      }
1890
1891      @Override
1892      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1893        switch (hash) {
1894        case -1077554975: /*method*/ return new String[] {"code"};
1895        case 116079: /*url*/ return new String[] {"uri"};
1896        case 171868368: /*ifNoneMatch*/ return new String[] {"string"};
1897        case -2061602860: /*ifModifiedSince*/ return new String[] {"instant"};
1898        case 1692894888: /*ifMatch*/ return new String[] {"string"};
1899        case 165155330: /*ifNoneExist*/ return new String[] {"string"};
1900        default: return super.getTypesForProperty(hash, name);
1901        }
1902
1903      }
1904
1905      @Override
1906      public Base addChild(String name) throws FHIRException {
1907        if (name.equals("method")) {
1908          throw new FHIRException("Cannot call addChild on a primitive type Bundle.method");
1909        }
1910        else if (name.equals("url")) {
1911          throw new FHIRException("Cannot call addChild on a primitive type Bundle.url");
1912        }
1913        else if (name.equals("ifNoneMatch")) {
1914          throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifNoneMatch");
1915        }
1916        else if (name.equals("ifModifiedSince")) {
1917          throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifModifiedSince");
1918        }
1919        else if (name.equals("ifMatch")) {
1920          throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifMatch");
1921        }
1922        else if (name.equals("ifNoneExist")) {
1923          throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifNoneExist");
1924        }
1925        else
1926          return super.addChild(name);
1927      }
1928
1929      public BundleEntryRequestComponent copy() {
1930        BundleEntryRequestComponent dst = new BundleEntryRequestComponent();
1931        copyValues(dst);
1932        dst.method = method == null ? null : method.copy();
1933        dst.url = url == null ? null : url.copy();
1934        dst.ifNoneMatch = ifNoneMatch == null ? null : ifNoneMatch.copy();
1935        dst.ifModifiedSince = ifModifiedSince == null ? null : ifModifiedSince.copy();
1936        dst.ifMatch = ifMatch == null ? null : ifMatch.copy();
1937        dst.ifNoneExist = ifNoneExist == null ? null : ifNoneExist.copy();
1938        return dst;
1939      }
1940
1941      @Override
1942      public boolean equalsDeep(Base other) {
1943        if (!super.equalsDeep(other))
1944          return false;
1945        if (!(other instanceof BundleEntryRequestComponent))
1946          return false;
1947        BundleEntryRequestComponent o = (BundleEntryRequestComponent) other;
1948        return compareDeep(method, o.method, true) && compareDeep(url, o.url, true) && compareDeep(ifNoneMatch, o.ifNoneMatch, true)
1949           && compareDeep(ifModifiedSince, o.ifModifiedSince, true) && compareDeep(ifMatch, o.ifMatch, true)
1950           && compareDeep(ifNoneExist, o.ifNoneExist, true);
1951      }
1952
1953      @Override
1954      public boolean equalsShallow(Base other) {
1955        if (!super.equalsShallow(other))
1956          return false;
1957        if (!(other instanceof BundleEntryRequestComponent))
1958          return false;
1959        BundleEntryRequestComponent o = (BundleEntryRequestComponent) other;
1960        return compareValues(method, o.method, true) && compareValues(url, o.url, true) && compareValues(ifNoneMatch, o.ifNoneMatch, true)
1961           && compareValues(ifModifiedSince, o.ifModifiedSince, true) && compareValues(ifMatch, o.ifMatch, true)
1962           && compareValues(ifNoneExist, o.ifNoneExist, true);
1963      }
1964
1965      public boolean isEmpty() {
1966        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(method, url, ifNoneMatch
1967          , ifModifiedSince, ifMatch, ifNoneExist);
1968      }
1969
1970  public String fhirType() {
1971    return "Bundle.entry.request";
1972
1973  }
1974
1975  }
1976
1977    @Block()
1978    public static class BundleEntryResponseComponent extends BackboneElement implements IBaseBackboneElement {
1979        /**
1980         * 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.
1981         */
1982        @Child(name = "status", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1983        @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." )
1984        protected StringType status;
1985
1986        /**
1987         * The location header created by processing this operation.
1988         */
1989        @Child(name = "location", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1990        @Description(shortDefinition="The location, if the operation returns a location", formalDefinition="The location header created by processing this operation." )
1991        protected UriType location;
1992
1993        /**
1994         * The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).
1995         */
1996        @Child(name = "etag", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1997        @Description(shortDefinition="The etag for the resource (if relevant)", formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency))." )
1998        protected StringType etag;
1999
2000        /**
2001         * The date/time that the resource was modified on the server.
2002         */
2003        @Child(name = "lastModified", type = {InstantType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2004        @Description(shortDefinition="Server's date time modified", formalDefinition="The date/time that the resource was modified on the server." )
2005        protected InstantType lastModified;
2006
2007        /**
2008         * An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.
2009         */
2010        @Child(name = "outcome", type = {Resource.class}, order=5, min=0, max=1, modifier=false, summary=true)
2011        @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." )
2012        protected Resource outcome;
2013
2014        private static final long serialVersionUID = 923278008L;
2015
2016    /**
2017     * Constructor
2018     */
2019      public BundleEntryResponseComponent() {
2020        super();
2021      }
2022
2023    /**
2024     * Constructor
2025     */
2026      public BundleEntryResponseComponent(StringType status) {
2027        super();
2028        this.status = status;
2029      }
2030
2031        /**
2032         * @return {@link #status} (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.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2033         */
2034        public StringType getStatusElement() { 
2035          if (this.status == null)
2036            if (Configuration.errorOnAutoCreate())
2037              throw new Error("Attempt to auto-create BundleEntryResponseComponent.status");
2038            else if (Configuration.doAutoCreate())
2039              this.status = new StringType(); // bb
2040          return this.status;
2041        }
2042
2043        public boolean hasStatusElement() { 
2044          return this.status != null && !this.status.isEmpty();
2045        }
2046
2047        public boolean hasStatus() { 
2048          return this.status != null && !this.status.isEmpty();
2049        }
2050
2051        /**
2052         * @param value {@link #status} (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.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2053         */
2054        public BundleEntryResponseComponent setStatusElement(StringType value) { 
2055          this.status = value;
2056          return this;
2057        }
2058
2059        /**
2060         * @return 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.
2061         */
2062        public String getStatus() { 
2063          return this.status == null ? null : this.status.getValue();
2064        }
2065
2066        /**
2067         * @param value 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.
2068         */
2069        public BundleEntryResponseComponent setStatus(String value) { 
2070            if (this.status == null)
2071              this.status = new StringType();
2072            this.status.setValue(value);
2073          return this;
2074        }
2075
2076        /**
2077         * @return {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value
2078         */
2079        public UriType getLocationElement() { 
2080          if (this.location == null)
2081            if (Configuration.errorOnAutoCreate())
2082              throw new Error("Attempt to auto-create BundleEntryResponseComponent.location");
2083            else if (Configuration.doAutoCreate())
2084              this.location = new UriType(); // bb
2085          return this.location;
2086        }
2087
2088        public boolean hasLocationElement() { 
2089          return this.location != null && !this.location.isEmpty();
2090        }
2091
2092        public boolean hasLocation() { 
2093          return this.location != null && !this.location.isEmpty();
2094        }
2095
2096        /**
2097         * @param value {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value
2098         */
2099        public BundleEntryResponseComponent setLocationElement(UriType value) { 
2100          this.location = value;
2101          return this;
2102        }
2103
2104        /**
2105         * @return The location header created by processing this operation.
2106         */
2107        public String getLocation() { 
2108          return this.location == null ? null : this.location.getValue();
2109        }
2110
2111        /**
2112         * @param value The location header created by processing this operation.
2113         */
2114        public BundleEntryResponseComponent setLocation(String value) { 
2115          if (Utilities.noString(value))
2116            this.location = null;
2117          else {
2118            if (this.location == null)
2119              this.location = new UriType();
2120            this.location.setValue(value);
2121          }
2122          return this;
2123        }
2124
2125        /**
2126         * @return {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value
2127         */
2128        public StringType getEtagElement() { 
2129          if (this.etag == null)
2130            if (Configuration.errorOnAutoCreate())
2131              throw new Error("Attempt to auto-create BundleEntryResponseComponent.etag");
2132            else if (Configuration.doAutoCreate())
2133              this.etag = new StringType(); // bb
2134          return this.etag;
2135        }
2136
2137        public boolean hasEtagElement() { 
2138          return this.etag != null && !this.etag.isEmpty();
2139        }
2140
2141        public boolean hasEtag() { 
2142          return this.etag != null && !this.etag.isEmpty();
2143        }
2144
2145        /**
2146         * @param value {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value
2147         */
2148        public BundleEntryResponseComponent setEtagElement(StringType value) { 
2149          this.etag = value;
2150          return this;
2151        }
2152
2153        /**
2154         * @return The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).
2155         */
2156        public String getEtag() { 
2157          return this.etag == null ? null : this.etag.getValue();
2158        }
2159
2160        /**
2161         * @param value The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).
2162         */
2163        public BundleEntryResponseComponent setEtag(String value) { 
2164          if (Utilities.noString(value))
2165            this.etag = null;
2166          else {
2167            if (this.etag == null)
2168              this.etag = new StringType();
2169            this.etag.setValue(value);
2170          }
2171          return this;
2172        }
2173
2174        /**
2175         * @return {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value
2176         */
2177        public InstantType getLastModifiedElement() { 
2178          if (this.lastModified == null)
2179            if (Configuration.errorOnAutoCreate())
2180              throw new Error("Attempt to auto-create BundleEntryResponseComponent.lastModified");
2181            else if (Configuration.doAutoCreate())
2182              this.lastModified = new InstantType(); // bb
2183          return this.lastModified;
2184        }
2185
2186        public boolean hasLastModifiedElement() { 
2187          return this.lastModified != null && !this.lastModified.isEmpty();
2188        }
2189
2190        public boolean hasLastModified() { 
2191          return this.lastModified != null && !this.lastModified.isEmpty();
2192        }
2193
2194        /**
2195         * @param value {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value
2196         */
2197        public BundleEntryResponseComponent setLastModifiedElement(InstantType value) { 
2198          this.lastModified = value;
2199          return this;
2200        }
2201
2202        /**
2203         * @return The date/time that the resource was modified on the server.
2204         */
2205        public Date getLastModified() { 
2206          return this.lastModified == null ? null : this.lastModified.getValue();
2207        }
2208
2209        /**
2210         * @param value The date/time that the resource was modified on the server.
2211         */
2212        public BundleEntryResponseComponent setLastModified(Date value) { 
2213          if (value == null)
2214            this.lastModified = null;
2215          else {
2216            if (this.lastModified == null)
2217              this.lastModified = new InstantType();
2218            this.lastModified.setValue(value);
2219          }
2220          return this;
2221        }
2222
2223        /**
2224         * @return {@link #outcome} (An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.)
2225         */
2226        public Resource getOutcome() { 
2227          return this.outcome;
2228        }
2229
2230        public boolean hasOutcome() { 
2231          return this.outcome != null && !this.outcome.isEmpty();
2232        }
2233
2234        /**
2235         * @param value {@link #outcome} (An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.)
2236         */
2237        public BundleEntryResponseComponent setOutcome(Resource value) { 
2238          this.outcome = value;
2239          return this;
2240        }
2241
2242        protected void listChildren(List<Property> childrenList) {
2243          super.listChildren(childrenList);
2244          childrenList.add(new Property("status", "string", "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.", 0, java.lang.Integer.MAX_VALUE, status));
2245          childrenList.add(new Property("location", "uri", "The location header created by processing this operation.", 0, java.lang.Integer.MAX_VALUE, location));
2246          childrenList.add(new Property("etag", "string", "The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).", 0, java.lang.Integer.MAX_VALUE, etag));
2247          childrenList.add(new Property("lastModified", "instant", "The date/time that the resource was modified on the server.", 0, java.lang.Integer.MAX_VALUE, lastModified));
2248          childrenList.add(new Property("outcome", "Resource", "An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.", 0, java.lang.Integer.MAX_VALUE, outcome));
2249        }
2250
2251      @Override
2252      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2253        switch (hash) {
2254        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // StringType
2255        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // UriType
2256        case 3123477: /*etag*/ return this.etag == null ? new Base[0] : new Base[] {this.etag}; // StringType
2257        case 1959003007: /*lastModified*/ return this.lastModified == null ? new Base[0] : new Base[] {this.lastModified}; // InstantType
2258        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Resource
2259        default: return super.getProperty(hash, name, checkValid);
2260        }
2261
2262      }
2263
2264      @Override
2265      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2266        switch (hash) {
2267        case -892481550: // status
2268          this.status = castToString(value); // StringType
2269          return value;
2270        case 1901043637: // location
2271          this.location = castToUri(value); // UriType
2272          return value;
2273        case 3123477: // etag
2274          this.etag = castToString(value); // StringType
2275          return value;
2276        case 1959003007: // lastModified
2277          this.lastModified = castToInstant(value); // InstantType
2278          return value;
2279        case -1106507950: // outcome
2280          this.outcome = castToResource(value); // Resource
2281          return value;
2282        default: return super.setProperty(hash, name, value);
2283        }
2284
2285      }
2286
2287      @Override
2288      public Base setProperty(String name, Base value) throws FHIRException {
2289        if (name.equals("status")) {
2290          this.status = castToString(value); // StringType
2291        } else if (name.equals("location")) {
2292          this.location = castToUri(value); // UriType
2293        } else if (name.equals("etag")) {
2294          this.etag = castToString(value); // StringType
2295        } else if (name.equals("lastModified")) {
2296          this.lastModified = castToInstant(value); // InstantType
2297        } else if (name.equals("outcome")) {
2298          this.outcome = castToResource(value); // Resource
2299        } else
2300          return super.setProperty(name, value);
2301        return value;
2302      }
2303
2304      @Override
2305      public Base makeProperty(int hash, String name) throws FHIRException {
2306        switch (hash) {
2307        case -892481550:  return getStatusElement();
2308        case 1901043637:  return getLocationElement();
2309        case 3123477:  return getEtagElement();
2310        case 1959003007:  return getLastModifiedElement();
2311        case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Resource
2312        default: return super.makeProperty(hash, name);
2313        }
2314
2315      }
2316
2317      @Override
2318      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2319        switch (hash) {
2320        case -892481550: /*status*/ return new String[] {"string"};
2321        case 1901043637: /*location*/ return new String[] {"uri"};
2322        case 3123477: /*etag*/ return new String[] {"string"};
2323        case 1959003007: /*lastModified*/ return new String[] {"instant"};
2324        case -1106507950: /*outcome*/ return new String[] {"Resource"};
2325        default: return super.getTypesForProperty(hash, name);
2326        }
2327
2328      }
2329
2330      @Override
2331      public Base addChild(String name) throws FHIRException {
2332        if (name.equals("status")) {
2333          throw new FHIRException("Cannot call addChild on a primitive type Bundle.status");
2334        }
2335        else if (name.equals("location")) {
2336          throw new FHIRException("Cannot call addChild on a primitive type Bundle.location");
2337        }
2338        else if (name.equals("etag")) {
2339          throw new FHIRException("Cannot call addChild on a primitive type Bundle.etag");
2340        }
2341        else if (name.equals("lastModified")) {
2342          throw new FHIRException("Cannot call addChild on a primitive type Bundle.lastModified");
2343        }
2344        else if (name.equals("outcome")) {
2345          throw new FHIRException("Cannot call addChild on an abstract type Bundle.outcome");
2346        }
2347        else
2348          return super.addChild(name);
2349      }
2350
2351      public BundleEntryResponseComponent copy() {
2352        BundleEntryResponseComponent dst = new BundleEntryResponseComponent();
2353        copyValues(dst);
2354        dst.status = status == null ? null : status.copy();
2355        dst.location = location == null ? null : location.copy();
2356        dst.etag = etag == null ? null : etag.copy();
2357        dst.lastModified = lastModified == null ? null : lastModified.copy();
2358        dst.outcome = outcome == null ? null : outcome.copy();
2359        return dst;
2360      }
2361
2362      @Override
2363      public boolean equalsDeep(Base other) {
2364        if (!super.equalsDeep(other))
2365          return false;
2366        if (!(other instanceof BundleEntryResponseComponent))
2367          return false;
2368        BundleEntryResponseComponent o = (BundleEntryResponseComponent) other;
2369        return compareDeep(status, o.status, true) && compareDeep(location, o.location, true) && compareDeep(etag, o.etag, true)
2370           && compareDeep(lastModified, o.lastModified, true) && compareDeep(outcome, o.outcome, true);
2371      }
2372
2373      @Override
2374      public boolean equalsShallow(Base other) {
2375        if (!super.equalsShallow(other))
2376          return false;
2377        if (!(other instanceof BundleEntryResponseComponent))
2378          return false;
2379        BundleEntryResponseComponent o = (BundleEntryResponseComponent) other;
2380        return compareValues(status, o.status, true) && compareValues(location, o.location, true) && compareValues(etag, o.etag, true)
2381           && compareValues(lastModified, o.lastModified, true);
2382      }
2383
2384      public boolean isEmpty() {
2385        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(status, location, etag, lastModified
2386          , outcome);
2387      }
2388
2389  public String fhirType() {
2390    return "Bundle.entry.response";
2391
2392  }
2393
2394  }
2395
2396    /**
2397     * A persistent identifier for the batch that won't change as a batch is copied from server to server.
2398     */
2399    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
2400    @Description(shortDefinition="Persistent identifier for the bundle", formalDefinition="A persistent identifier for the batch that won't change as a batch is copied from server to server." )
2401    protected Identifier identifier;
2402
2403    /**
2404     * Indicates the purpose of this bundle - how it was intended to be used.
2405     */
2406    @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2407    @Description(shortDefinition="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", formalDefinition="Indicates the purpose of this bundle - how it was intended to be used." )
2408    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/bundle-type")
2409    protected Enumeration<BundleType> type;
2410
2411    /**
2412     * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).
2413     */
2414    @Child(name = "total", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2415    @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." )
2416    protected UnsignedIntType total;
2417
2418    /**
2419     * A series of links that provide context to this bundle.
2420     */
2421    @Child(name = "link", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2422    @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." )
2423    protected List<BundleLinkComponent> link;
2424
2425    /**
2426     * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).
2427     */
2428    @Child(name = "entry", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2429    @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)." )
2430    protected List<BundleEntryComponent> entry;
2431
2432    /**
2433     * Digital Signature - base64 encoded. XML-DSIg or a JWT.
2434     */
2435    @Child(name = "signature", type = {Signature.class}, order=5, min=0, max=1, modifier=false, summary=true)
2436    @Description(shortDefinition="Digital Signature", formalDefinition="Digital Signature - base64 encoded. XML-DSIg or a JWT." )
2437    protected Signature signature;
2438
2439    private static final long serialVersionUID = 982760501L;
2440
2441  /**
2442   * Constructor
2443   */
2444    public Bundle() {
2445      super();
2446    }
2447
2448  /**
2449   * Constructor
2450   */
2451    public Bundle(Enumeration<BundleType> type) {
2452      super();
2453      this.type = type;
2454    }
2455
2456    /**
2457     * @return {@link #identifier} (A persistent identifier for the batch that won't change as a batch is copied from server to server.)
2458     */
2459    public Identifier getIdentifier() { 
2460      if (this.identifier == null)
2461        if (Configuration.errorOnAutoCreate())
2462          throw new Error("Attempt to auto-create Bundle.identifier");
2463        else if (Configuration.doAutoCreate())
2464          this.identifier = new Identifier(); // cc
2465      return this.identifier;
2466    }
2467
2468    public boolean hasIdentifier() { 
2469      return this.identifier != null && !this.identifier.isEmpty();
2470    }
2471
2472    /**
2473     * @param value {@link #identifier} (A persistent identifier for the batch that won't change as a batch is copied from server to server.)
2474     */
2475    public Bundle setIdentifier(Identifier value) { 
2476      this.identifier = value;
2477      return this;
2478    }
2479
2480    /**
2481     * @return {@link #type} (Indicates the purpose of this bundle - how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2482     */
2483    public Enumeration<BundleType> getTypeElement() { 
2484      if (this.type == null)
2485        if (Configuration.errorOnAutoCreate())
2486          throw new Error("Attempt to auto-create Bundle.type");
2487        else if (Configuration.doAutoCreate())
2488          this.type = new Enumeration<BundleType>(new BundleTypeEnumFactory()); // bb
2489      return this.type;
2490    }
2491
2492    public boolean hasTypeElement() { 
2493      return this.type != null && !this.type.isEmpty();
2494    }
2495
2496    public boolean hasType() { 
2497      return this.type != null && !this.type.isEmpty();
2498    }
2499
2500    /**
2501     * @param value {@link #type} (Indicates the purpose of this bundle - how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2502     */
2503    public Bundle setTypeElement(Enumeration<BundleType> value) { 
2504      this.type = value;
2505      return this;
2506    }
2507
2508    /**
2509     * @return Indicates the purpose of this bundle - how it was intended to be used.
2510     */
2511    public BundleType getType() { 
2512      return this.type == null ? null : this.type.getValue();
2513    }
2514
2515    /**
2516     * @param value Indicates the purpose of this bundle - how it was intended to be used.
2517     */
2518    public Bundle setType(BundleType value) { 
2519        if (this.type == null)
2520          this.type = new Enumeration<BundleType>(new BundleTypeEnumFactory());
2521        this.type.setValue(value);
2522      return this;
2523    }
2524
2525    /**
2526     * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value
2527     */
2528    public UnsignedIntType getTotalElement() { 
2529      if (this.total == null)
2530        if (Configuration.errorOnAutoCreate())
2531          throw new Error("Attempt to auto-create Bundle.total");
2532        else if (Configuration.doAutoCreate())
2533          this.total = new UnsignedIntType(); // bb
2534      return this.total;
2535    }
2536
2537    public boolean hasTotalElement() { 
2538      return this.total != null && !this.total.isEmpty();
2539    }
2540
2541    public boolean hasTotal() { 
2542      return this.total != null && !this.total.isEmpty();
2543    }
2544
2545    /**
2546     * @param value {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value
2547     */
2548    public Bundle setTotalElement(UnsignedIntType value) { 
2549      this.total = value;
2550      return this;
2551    }
2552
2553    /**
2554     * @return If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).
2555     */
2556    public int getTotal() { 
2557      return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue();
2558    }
2559
2560    /**
2561     * @param value If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).
2562     */
2563    public Bundle setTotal(int value) { 
2564        if (this.total == null)
2565          this.total = new UnsignedIntType();
2566        this.total.setValue(value);
2567      return this;
2568    }
2569
2570    /**
2571     * @return {@link #link} (A series of links that provide context to this bundle.)
2572     */
2573    public List<BundleLinkComponent> getLink() { 
2574      if (this.link == null)
2575        this.link = new ArrayList<BundleLinkComponent>();
2576      return this.link;
2577    }
2578
2579    /**
2580     * @return Returns a reference to <code>this</code> for easy method chaining
2581     */
2582    public Bundle setLink(List<BundleLinkComponent> theLink) { 
2583      this.link = theLink;
2584      return this;
2585    }
2586
2587    public boolean hasLink() { 
2588      if (this.link == null)
2589        return false;
2590      for (BundleLinkComponent item : this.link)
2591        if (!item.isEmpty())
2592          return true;
2593      return false;
2594    }
2595
2596    public BundleLinkComponent addLink() { //3
2597      BundleLinkComponent t = new BundleLinkComponent();
2598      if (this.link == null)
2599        this.link = new ArrayList<BundleLinkComponent>();
2600      this.link.add(t);
2601      return t;
2602    }
2603
2604    public Bundle addLink(BundleLinkComponent t) { //3
2605      if (t == null)
2606        return this;
2607      if (this.link == null)
2608        this.link = new ArrayList<BundleLinkComponent>();
2609      this.link.add(t);
2610      return this;
2611    }
2612
2613    /**
2614     * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist
2615     */
2616    public BundleLinkComponent getLinkFirstRep() { 
2617      if (getLink().isEmpty()) {
2618        addLink();
2619      }
2620      return getLink().get(0);
2621    }
2622
2623    /**
2624     * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).)
2625     */
2626    public List<BundleEntryComponent> getEntry() { 
2627      if (this.entry == null)
2628        this.entry = new ArrayList<BundleEntryComponent>();
2629      return this.entry;
2630    }
2631
2632    /**
2633     * @return Returns a reference to <code>this</code> for easy method chaining
2634     */
2635    public Bundle setEntry(List<BundleEntryComponent> theEntry) { 
2636      this.entry = theEntry;
2637      return this;
2638    }
2639
2640    public boolean hasEntry() { 
2641      if (this.entry == null)
2642        return false;
2643      for (BundleEntryComponent item : this.entry)
2644        if (!item.isEmpty())
2645          return true;
2646      return false;
2647    }
2648
2649    public BundleEntryComponent addEntry() { //3
2650      BundleEntryComponent t = new BundleEntryComponent();
2651      if (this.entry == null)
2652        this.entry = new ArrayList<BundleEntryComponent>();
2653      this.entry.add(t);
2654      return t;
2655    }
2656
2657    public Bundle addEntry(BundleEntryComponent t) { //3
2658      if (t == null)
2659        return this;
2660      if (this.entry == null)
2661        this.entry = new ArrayList<BundleEntryComponent>();
2662      this.entry.add(t);
2663      return this;
2664    }
2665
2666    /**
2667     * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist
2668     */
2669    public BundleEntryComponent getEntryFirstRep() { 
2670      if (getEntry().isEmpty()) {
2671        addEntry();
2672      }
2673      return getEntry().get(0);
2674    }
2675
2676    /**
2677     * @return {@link #signature} (Digital Signature - base64 encoded. XML-DSIg or a JWT.)
2678     */
2679    public Signature getSignature() { 
2680      if (this.signature == null)
2681        if (Configuration.errorOnAutoCreate())
2682          throw new Error("Attempt to auto-create Bundle.signature");
2683        else if (Configuration.doAutoCreate())
2684          this.signature = new Signature(); // cc
2685      return this.signature;
2686    }
2687
2688    public boolean hasSignature() { 
2689      return this.signature != null && !this.signature.isEmpty();
2690    }
2691
2692    /**
2693     * @param value {@link #signature} (Digital Signature - base64 encoded. XML-DSIg or a JWT.)
2694     */
2695    public Bundle setSignature(Signature value) { 
2696      this.signature = value;
2697      return this;
2698    }
2699
2700 /**
2701   * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. 
2702   * If no link is found which matches the given relation, returns <code>null</code>. If more than one
2703   * link is found which matches the given relation, returns the first matching BundleLinkComponent.
2704   * 
2705   * @param theRelation
2706   *            The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}.
2707   * @return Returns a matching BundleLinkComponent, or <code>null</code>
2708   * @see IBaseBundle#LINK_NEXT
2709   * @see IBaseBundle#LINK_PREV
2710   * @see IBaseBundle#LINK_SELF
2711   */
2712  public BundleLinkComponent getLink(String theRelation) {
2713    org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
2714    for (BundleLinkComponent next : getLink()) {
2715      if (theRelation.equals(next.getRelation())) {
2716        return next;
2717      }
2718    }
2719    return null;
2720  }
2721
2722  /**
2723   * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. 
2724   * If no link is found which matches the given relation, creates a new BundleLinkComponent with the
2725   * given relation and adds it to this Bundle. If more than one
2726   * link is found which matches the given relation, returns the first matching BundleLinkComponent.
2727   * 
2728   * @param theRelation
2729   *            The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}.
2730   * @return Returns a matching BundleLinkComponent, or <code>null</code>
2731   * @see IBaseBundle#LINK_NEXT
2732   * @see IBaseBundle#LINK_PREV
2733   * @see IBaseBundle#LINK_SELF
2734   */
2735  public BundleLinkComponent getLinkOrCreate(String theRelation) {
2736    org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
2737    for (BundleLinkComponent next : getLink()) {
2738      if (theRelation.equals(next.getRelation())) {
2739        return next;
2740      }
2741    }
2742    BundleLinkComponent retVal = new BundleLinkComponent();
2743    retVal.setRelation(theRelation);
2744    getLink().add(retVal);
2745    return retVal;
2746  }
2747      protected void listChildren(List<Property> childrenList) {
2748        super.listChildren(childrenList);
2749        childrenList.add(new Property("identifier", "Identifier", "A persistent identifier for the batch that won't change as a batch is copied from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
2750        childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle - how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type));
2751        childrenList.add(new Property("total", "unsignedInt", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total));
2752        childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link));
2753        childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).", 0, java.lang.Integer.MAX_VALUE, entry));
2754        childrenList.add(new Property("signature", "Signature", "Digital Signature - base64 encoded. XML-DSIg or a JWT.", 0, java.lang.Integer.MAX_VALUE, signature));
2755      }
2756
2757      @Override
2758      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2759        switch (hash) {
2760        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
2761        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<BundleType>
2762        case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // UnsignedIntType
2763        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent
2764        case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // BundleEntryComponent
2765        case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : new Base[] {this.signature}; // Signature
2766        default: return super.getProperty(hash, name, checkValid);
2767        }
2768
2769      }
2770
2771      @Override
2772      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2773        switch (hash) {
2774        case -1618432855: // identifier
2775          this.identifier = castToIdentifier(value); // Identifier
2776          return value;
2777        case 3575610: // type
2778          value = new BundleTypeEnumFactory().fromType(castToCode(value));
2779          this.type = (Enumeration) value; // Enumeration<BundleType>
2780          return value;
2781        case 110549828: // total
2782          this.total = castToUnsignedInt(value); // UnsignedIntType
2783          return value;
2784        case 3321850: // link
2785          this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent
2786          return value;
2787        case 96667762: // entry
2788          this.getEntry().add((BundleEntryComponent) value); // BundleEntryComponent
2789          return value;
2790        case 1073584312: // signature
2791          this.signature = castToSignature(value); // Signature
2792          return value;
2793        default: return super.setProperty(hash, name, value);
2794        }
2795
2796      }
2797
2798      @Override
2799      public Base setProperty(String name, Base value) throws FHIRException {
2800        if (name.equals("identifier")) {
2801          this.identifier = castToIdentifier(value); // Identifier
2802        } else if (name.equals("type")) {
2803          value = new BundleTypeEnumFactory().fromType(castToCode(value));
2804          this.type = (Enumeration) value; // Enumeration<BundleType>
2805        } else if (name.equals("total")) {
2806          this.total = castToUnsignedInt(value); // UnsignedIntType
2807        } else if (name.equals("link")) {
2808          this.getLink().add((BundleLinkComponent) value);
2809        } else if (name.equals("entry")) {
2810          this.getEntry().add((BundleEntryComponent) value);
2811        } else if (name.equals("signature")) {
2812          this.signature = castToSignature(value); // Signature
2813        } else
2814          return super.setProperty(name, value);
2815        return value;
2816      }
2817
2818      @Override
2819      public Base makeProperty(int hash, String name) throws FHIRException {
2820        switch (hash) {
2821        case -1618432855:  return getIdentifier(); 
2822        case 3575610:  return getTypeElement();
2823        case 110549828:  return getTotalElement();
2824        case 3321850:  return addLink(); 
2825        case 96667762:  return addEntry(); 
2826        case 1073584312:  return getSignature(); 
2827        default: return super.makeProperty(hash, name);
2828        }
2829
2830      }
2831
2832      @Override
2833      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2834        switch (hash) {
2835        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2836        case 3575610: /*type*/ return new String[] {"code"};
2837        case 110549828: /*total*/ return new String[] {"unsignedInt"};
2838        case 3321850: /*link*/ return new String[] {};
2839        case 96667762: /*entry*/ return new String[] {};
2840        case 1073584312: /*signature*/ return new String[] {"Signature"};
2841        default: return super.getTypesForProperty(hash, name);
2842        }
2843
2844      }
2845
2846      @Override
2847      public Base addChild(String name) throws FHIRException {
2848        if (name.equals("identifier")) {
2849          this.identifier = new Identifier();
2850          return this.identifier;
2851        }
2852        else if (name.equals("type")) {
2853          throw new FHIRException("Cannot call addChild on a primitive type Bundle.type");
2854        }
2855        else if (name.equals("total")) {
2856          throw new FHIRException("Cannot call addChild on a primitive type Bundle.total");
2857        }
2858        else if (name.equals("link")) {
2859          return addLink();
2860        }
2861        else if (name.equals("entry")) {
2862          return addEntry();
2863        }
2864        else if (name.equals("signature")) {
2865          this.signature = new Signature();
2866          return this.signature;
2867        }
2868        else
2869          return super.addChild(name);
2870      }
2871
2872  public String fhirType() {
2873    return "Bundle";
2874
2875  }
2876
2877      public Bundle copy() {
2878        Bundle dst = new Bundle();
2879        copyValues(dst);
2880        dst.identifier = identifier == null ? null : identifier.copy();
2881        dst.type = type == null ? null : type.copy();
2882        dst.total = total == null ? null : total.copy();
2883        if (link != null) {
2884          dst.link = new ArrayList<BundleLinkComponent>();
2885          for (BundleLinkComponent i : link)
2886            dst.link.add(i.copy());
2887        };
2888        if (entry != null) {
2889          dst.entry = new ArrayList<BundleEntryComponent>();
2890          for (BundleEntryComponent i : entry)
2891            dst.entry.add(i.copy());
2892        };
2893        dst.signature = signature == null ? null : signature.copy();
2894        return dst;
2895      }
2896
2897      protected Bundle typedCopy() {
2898        return copy();
2899      }
2900
2901      @Override
2902      public boolean equalsDeep(Base other) {
2903        if (!super.equalsDeep(other))
2904          return false;
2905        if (!(other instanceof Bundle))
2906          return false;
2907        Bundle o = (Bundle) other;
2908        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(total, o.total, true)
2909           && compareDeep(link, o.link, true) && compareDeep(entry, o.entry, true) && compareDeep(signature, o.signature, true)
2910          ;
2911      }
2912
2913      @Override
2914      public boolean equalsShallow(Base other) {
2915        if (!super.equalsShallow(other))
2916          return false;
2917        if (!(other instanceof Bundle))
2918          return false;
2919        Bundle o = (Bundle) other;
2920        return compareValues(type, o.type, true) && compareValues(total, o.total, true);
2921      }
2922
2923      public boolean isEmpty() {
2924        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, total
2925          , link, entry, signature);
2926      }
2927
2928  @Override
2929  public ResourceType getResourceType() {
2930    return ResourceType.Bundle;
2931   }
2932
2933 /**
2934   * Search parameter: <b>identifier</b>
2935   * <p>
2936   * Description: <b>Persistent identifier for the bundle</b><br>
2937   * Type: <b>token</b><br>
2938   * Path: <b>Bundle.identifier</b><br>
2939   * </p>
2940   */
2941  @SearchParamDefinition(name="identifier", path="Bundle.identifier", description="Persistent identifier for the bundle", type="token" )
2942  public static final String SP_IDENTIFIER = "identifier";
2943 /**
2944   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2945   * <p>
2946   * Description: <b>Persistent identifier for the bundle</b><br>
2947   * Type: <b>token</b><br>
2948   * Path: <b>Bundle.identifier</b><br>
2949   * </p>
2950   */
2951  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2952
2953 /**
2954   * Search parameter: <b>composition</b>
2955   * <p>
2956   * Description: <b>The first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to searches its contents</b><br>
2957   * Type: <b>reference</b><br>
2958   * Path: <b>Bundle.entry(0).resource</b><br>
2959   * </p>
2960   */
2961  @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 searches its contents", type="reference", target={Composition.class } )
2962  public static final String SP_COMPOSITION = "composition";
2963 /**
2964   * <b>Fluent Client</b> search parameter constant for <b>composition</b>
2965   * <p>
2966   * Description: <b>The first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to searches its contents</b><br>
2967   * Type: <b>reference</b><br>
2968   * Path: <b>Bundle.entry(0).resource</b><br>
2969   * </p>
2970   */
2971  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COMPOSITION);
2972
2973/**
2974   * Constant for fluent queries to be used to add include statements. Specifies
2975   * the path value of "<b>Bundle:composition</b>".
2976   */
2977  public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSITION = new ca.uhn.fhir.model.api.Include("Bundle:composition").toLocked();
2978
2979 /**
2980   * Search parameter: <b>type</b>
2981   * <p>
2982   * Description: <b>document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection</b><br>
2983   * Type: <b>token</b><br>
2984   * Path: <b>Bundle.type</b><br>
2985   * </p>
2986   */
2987  @SearchParamDefinition(name="type", path="Bundle.type", description="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", type="token" )
2988  public static final String SP_TYPE = "type";
2989 /**
2990   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2991   * <p>
2992   * Description: <b>document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection</b><br>
2993   * Type: <b>token</b><br>
2994   * Path: <b>Bundle.type</b><br>
2995   * </p>
2996   */
2997  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2998
2999 /**
3000   * Search parameter: <b>message</b>
3001   * <p>
3002   * Description: <b>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</b><br>
3003   * Type: <b>reference</b><br>
3004   * Path: <b>Bundle.entry(0).resource</b><br>
3005   * </p>
3006   */
3007  @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={MessageHeader.class } )
3008  public static final String SP_MESSAGE = "message";
3009 /**
3010   * <b>Fluent Client</b> search parameter constant for <b>message</b>
3011   * <p>
3012   * Description: <b>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</b><br>
3013   * Type: <b>reference</b><br>
3014   * Path: <b>Bundle.entry(0).resource</b><br>
3015   * </p>
3016   */
3017  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MESSAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MESSAGE);
3018
3019/**
3020   * Constant for fluent queries to be used to add include statements. Specifies
3021   * the path value of "<b>Bundle:message</b>".
3022   */
3023  public static final ca.uhn.fhir.model.api.Include INCLUDE_MESSAGE = new ca.uhn.fhir.model.api.Include("Bundle:message").toLocked();
3024
3025
3026}
3027