Class Bundle

java.lang.Object
ca.uhn.fhir.model.api.BaseElement
ca.uhn.fhir.model.dstu2.resource.BaseResource
ca.uhn.fhir.model.dstu2.resource.Bundle
All Implemented Interfaces:
ca.uhn.fhir.model.api.ICompositeElement, ca.uhn.fhir.model.api.IElement, ca.uhn.fhir.model.api.IResource, ca.uhn.fhir.model.api.ISupportsUndeclaredExtensions, Serializable, 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 BaseResource implements ca.uhn.fhir.model.api.IResource, org.hl7.fhir.instance.model.api.IBaseBundle
HAPI/FHIR Bundle Resource ()

Definition: A container for a collection of resources.

Requirements:

Profile Definition: http://hl7.org/fhir/profiles/Bundle

See Also:
Serialized Form
  • Field Details

    • SP_TYPE

      public static final String SP_TYPE
      Search parameter constant for type

      Description:
      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:
      Type: token
      Path: Bundle.type

    • SP_MESSAGE

      public static final String SP_MESSAGE
      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.resource(0)

      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.resource(0)

    • SP_COMPOSITION

      public static final String SP_COMPOSITION
      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 searches its contents
      Type: reference
      Path: Bundle.entry.resource(0)

      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 searches its contents
      Type: reference
      Path: Bundle.entry.resource(0)

    • 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".
    • 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".
  • Constructor Details

  • Method Details

    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.hl7.fhir.instance.model.api.IBase
    • getAllPopulatedChildElementsOfType

      public <T extends ca.uhn.fhir.model.api.IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType)
      Specified by:
      getAllPopulatedChildElementsOfType in interface ca.uhn.fhir.model.api.ICompositeElement
    • getTypeElement

      public ca.uhn.fhir.model.primitive.BoundCodeDt<BundleTypeEnum> getTypeElement()
      Gets the value(s) for type (). creating it if it does not exist. Will not return null.

      Definition: Indicates the purpose of this bundle- how it was intended to be used

    • getType

      public String getType()
      Gets the value(s) for type (). creating it if it does not exist. This method may return null.

      Definition: Indicates the purpose of this bundle- how it was intended to be used

    • setType

      public Bundle setType(ca.uhn.fhir.model.primitive.BoundCodeDt<BundleTypeEnum> theValue)
      Sets the value(s) for type ()

      Definition: Indicates the purpose of this bundle- how it was intended to be used

    • setType

      public Bundle setType(BundleTypeEnum theValue)
      Sets the value(s) for type ()

      Definition: Indicates the purpose of this bundle- how it was intended to be used

    • getTotalElement

      public ca.uhn.fhir.model.primitive.UnsignedIntDt getTotalElement()
      Gets the value(s) for total (). creating it if it does not exist. Will not return null.

      Definition: 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)

    • getTotal

      public Integer getTotal()
      Gets the value(s) for total (). creating it if it does not exist. This method may return null.

      Definition: 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)

    • setTotal

      public Bundle setTotal(ca.uhn.fhir.model.primitive.UnsignedIntDt theValue)
      Sets the value(s) for total ()

      Definition: 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)

    • setTotal

      public Bundle setTotal(int theInteger)
      Sets the value for total ()

      Definition: 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)

    • getLink

      Gets the value(s) for link (). creating it if it does not exist. Will not return null.

      Definition: A series of links that provide context to this bundle

    • setLink

      public Bundle setLink(List<Bundle.Link> theValue)
      Sets the value(s) for link ()

      Definition: A series of links that provide context to this bundle

    • addLink

      public Bundle.Link addLink()
      Adds and returns a new value for link ()

      Definition: A series of links that provide context to this bundle

    • addLink

      public Bundle addLink(Bundle.Link theValue)
      Adds a given new value for link ()

      Definition: A series of links that provide context to this bundle

      Parameters:
      theValue - The link to add (must not be null)
    • getLinkFirstRep

      Gets the first repetition for link (), creating it if it does not already exist.

      Definition: A series of links that provide context to this bundle

    • getEntry

      Gets the value(s) for entry (). creating it if it does not exist. Will not return null.

      Definition: An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)

    • setEntry

      public Bundle setEntry(List<Bundle.Entry> theValue)
      Sets the value(s) for entry ()

      Definition: An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)

    • addEntry

      Adds and returns a new value for entry ()

      Definition: An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)

    • addEntry

      public Bundle addEntry(Bundle.Entry theValue)
      Adds a given new value for entry ()

      Definition: An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)

      Parameters:
      theValue - The entry to add (must not be null)
    • getEntryFirstRep

      Gets the first repetition for entry (), creating it if it does not already exist.

      Definition: An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)

    • getSignature

      Gets the value(s) for signature (). creating it if it does not exist. Will not return null.

      Definition: Digital Signature - base64 encoded. XML DigSIg or a JWT

    • setSignature

      public Bundle setSignature(SignatureDt theValue)
      Sets the value(s) for signature ()

      Definition: Digital Signature - base64 encoded. XML DigSIg or a JWT

    • getResourceName

      Specified by:
      getResourceName in interface ca.uhn.fhir.model.api.IResource
    • getStructureFhirVersionEnum

      public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum()
      Specified by:
      getStructureFhirVersionEnum in interface org.hl7.fhir.instance.model.api.IBaseResource
      Specified by:
      getStructureFhirVersionEnum in interface ca.uhn.fhir.model.api.IResource
    • getLink

      public Bundle.Link 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 Link.
      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 Link, or null
      See Also:
      IBaseBundle#LINK_NEXT, IBaseBundle#LINK_PREV, IBaseBundle#LINK_SELF
    • getLinkOrCreate

      public Bundle.Link getLinkOrCreate(String theRelation)
      Returns the link which matches a given relation. If no link is found which matches the given relation, creates a new Link 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 Link.
      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 Link, or null
      See Also:
      IBaseBundle#LINK_NEXT, IBaseBundle#LINK_PREV, IBaseBundle#LINK_SELF