Class Bundle

  • All Implemented Interfaces:
    ca.uhn.fhir.model.api.IElement, Serializable, org.hl7.fhir.instance.model.api.IAnyResource, org.hl7.fhir.instance.model.api.IBase, org.hl7.fhir.instance.model.api.IBaseBundle, org.hl7.fhir.instance.model.api.IBaseResource

    public class Bundle
    extends Resource
    implements org.hl7.fhir.instance.model.api.IBaseBundle
    A container for a collection of resources.
    See Also:
    Serialized Form
    • Field Detail

      • identifier

        protected Identifier identifier
        A persistent identifier for the bundle that won't change as a bundle is copied from server to server.
      • timestamp

        protected InstantType timestamp
        The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.
      • total

        protected UnsignedIntType total
        If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.
      • entry

        protected List<Bundle.BundleEntryComponent> entry
        An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).
      • signature

        protected Signature signature
        Digital Signature - base64 encoded. XML-DSig or a JWT.
      • SP_IDENTIFIER

        public static final String SP_IDENTIFIER
        Search parameter: identifier

        Description: Persistent identifier for the bundle
        Type: token
        Path: Bundle.identifier

        See Also:
        Constant Field Values
      • IDENTIFIER

        public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER
        Fluent Client search parameter constant for identifier

        Description: Persistent identifier for the bundle
        Type: token
        Path: Bundle.identifier

      • SP_COMPOSITION

        public static final String SP_COMPOSITION
        Search parameter: composition

        Description: The first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to search its contents
        Type: reference
        Path: Bundle.entry(0).resource

        See Also:
        Constant Field Values
      • COMPOSITION

        public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSITION
        Fluent Client search parameter constant for composition

        Description: The first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to search its contents
        Type: reference
        Path: Bundle.entry(0).resource

      • INCLUDE_COMPOSITION

        public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSITION
        Constant for fluent queries to be used to add include statements. Specifies the path value of "Bundle:composition".
      • SP_TYPE

        public static final String SP_TYPE
        Search parameter: type

        Description: document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection
        Type: token
        Path: Bundle.type

        See Also:
        Constant Field Values
      • TYPE

        public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE
        Fluent Client search parameter constant for type

        Description: document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection
        Type: token
        Path: Bundle.type

      • SP_MESSAGE

        public static final String SP_MESSAGE
        Search parameter: message

        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
        Path: Bundle.entry(0).resource

        See Also:
        Constant Field Values
      • MESSAGE

        public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MESSAGE
        Fluent Client search parameter constant for message

        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
        Path: Bundle.entry(0).resource

      • INCLUDE_MESSAGE

        public static final ca.uhn.fhir.model.api.Include INCLUDE_MESSAGE
        Constant for fluent queries to be used to add include statements. Specifies the path value of "Bundle:message".
      • TIMESTAMP

        public static final ca.uhn.fhir.rest.gclient.DateClientParam TIMESTAMP
        Fluent Client search parameter constant for timestamp

        Description: When the bundle was assembled
        Type: date
        Path: Bundle.timestamp

    • Method Detail

      • getIdentifier

        public Identifier getIdentifier()
        Returns:
        identifier (A persistent identifier for the bundle that won't change as a bundle is copied from server to server.)
      • setIdentifier

        public Bundle setIdentifier​(Identifier value)
        Parameters:
        value - identifier (A persistent identifier for the bundle that won't change as a bundle is copied from server to server.)
      • getTypeElement

        public Enumeration<Bundle.BundleTypegetTypeElement()
        Returns:
        type (Indicates the purpose of this bundle - how it is intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
      • hasType

        public boolean hasType()
      • setTypeElement

        public Bundle setTypeElement​(Enumeration<Bundle.BundleType> value)
        Parameters:
        value - type (Indicates the purpose of this bundle - how it is intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
      • getType

        public Bundle.BundleType getType()
        Returns:
        Indicates the purpose of this bundle - how it is intended to be used.
      • setType

        public Bundle setType​(Bundle.BundleType value)
        Parameters:
        value - Indicates the purpose of this bundle - how it is intended to be used.
      • getTimestampElement

        public InstantType getTimestampElement()
        Returns:
        timestamp (The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value
      • setTimestampElement

        public Bundle setTimestampElement​(InstantType value)
        Parameters:
        value - timestamp (The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value
      • getTimestamp

        public Date getTimestamp()
        Returns:
        The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.
      • setTimestamp

        public Bundle setTimestamp​(Date value)
        Parameters:
        value - The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.
      • getTotalElement

        public UnsignedIntType getTotalElement()
        Returns:
        total (If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value
      • setTotalElement

        public Bundle setTotalElement​(UnsignedIntType value)
        Parameters:
        value - total (If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value
      • getTotal

        public int getTotal()
        Returns:
        If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.
      • setTotal

        public Bundle setTotal​(int value)
        Parameters:
        value - If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.
      • hasLink

        public boolean hasLink()
      • getLink

        public Bundle.BundleLinkComponent getLink​(String theRelation)
        Returns the link which matches a given relation. If no link is found which matches the given relation, returns null. If more than one link is found which matches the given relation, returns the first matching BundleLinkComponent.
        Parameters:
        theRelation - The relation, such as "next", or "self. See the constants such as IBaseBundle.LINK_SELF and IBaseBundle.LINK_NEXT.
        Returns:
        Returns a matching BundleLinkComponent, or null
        See Also:
        IBaseBundle.LINK_NEXT, IBaseBundle.LINK_PREV, IBaseBundle.LINK_SELF
      • getLinkOrCreate

        public Bundle.BundleLinkComponent getLinkOrCreate​(String theRelation)
        Returns the link which matches a given relation. If no link is found which matches the given relation, creates a new BundleLinkComponent with the given relation and adds it to this Bundle. If more than one link is found which matches the given relation, returns the first matching BundleLinkComponent.
        Parameters:
        theRelation - The relation, such as "next", or "self. See the constants such as IBaseBundle.LINK_SELF and IBaseBundle.LINK_NEXT.
        Returns:
        Returns a matching BundleLinkComponent, or null
        See Also:
        IBaseBundle.LINK_NEXT, IBaseBundle.LINK_PREV, IBaseBundle.LINK_SELF
      • getProperty

        public Base[] getProperty​(int hash,
                                  String name,
                                  boolean checkValid)
                           throws org.hl7.fhir.exceptions.FHIRException
        Overrides:
        getProperty in class Resource
        Throws:
        org.hl7.fhir.exceptions.FHIRException
      • addChild

        public Base addChild​(String name)
                      throws org.hl7.fhir.exceptions.FHIRException
        Overrides:
        addChild in class Resource
        Throws:
        org.hl7.fhir.exceptions.FHIRException
      • fhirType

        public String fhirType()
        Specified by:
        fhirType in interface org.hl7.fhir.instance.model.api.IBase
        Overrides:
        fhirType in class Resource
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface org.hl7.fhir.instance.model.api.IBase
        Overrides:
        isEmpty in class Resource