Package com.ibm.fhir.model.resource
Class Bundle.Builder
- java.lang.Object
-
- com.ibm.fhir.model.builder.AbstractBuilder<Resource>
-
- com.ibm.fhir.model.resource.Resource.Builder
-
- com.ibm.fhir.model.resource.Bundle.Builder
-
- Enclosing class:
- Bundle
public static class Bundle.Builder extends Resource.Builder
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.model.resource.Resource.Builder
id, implicitRules, language, meta
-
Fields inherited from class com.ibm.fhir.model.builder.AbstractBuilder
validating
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bundle
build()
Build theBundle
Bundle.Builder
entry(Bundle.Entry... entry)
An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).Bundle.Builder
entry(Collection<Bundle.Entry> entry)
An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).protected Bundle.Builder
from(Bundle bundle)
Bundle.Builder
id(String id)
The logical id of the resource, as used in the URL for the resource.Bundle.Builder
identifier(Identifier identifier)
A persistent identifier for the bundle that won't change as a bundle is copied from server to server.Bundle.Builder
implicitRules(Uri implicitRules)
A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.Bundle.Builder
language(Code language)
The base language in which the resource is written.Bundle.Builder
link(Bundle.Link... link)
A series of links that provide context to this bundle.Bundle.Builder
link(Collection<Bundle.Link> link)
A series of links that provide context to this bundle.Bundle.Builder
meta(Meta meta)
The metadata about the resource.Bundle.Builder
signature(Signature signature)
Digital Signature - base64 encoded.Bundle.Builder
timestamp(Instant timestamp)
The date/time that the bundle was assembled - i.e.Bundle.Builder
total(UnsignedInt total)
If a set of search matches, this is the total number of entries of type 'match' across all pages in the search.Bundle.Builder
type(BundleType type)
Indicates the purpose of this bundle - how it is intended to be used.protected void
validate(Bundle bundle)
-
Methods inherited from class com.ibm.fhir.model.resource.Resource.Builder
from, validate
-
Methods inherited from class com.ibm.fhir.model.builder.AbstractBuilder
isValidating, setValidating
-
-
-
-
Method Detail
-
id
public Bundle.Builder id(String id)
The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.- Overrides:
id
in classResource.Builder
- Parameters:
id
- Logical id of this artifact- Returns:
- A reference to this Builder instance
-
meta
public Bundle.Builder meta(Meta meta)
The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.- Overrides:
meta
in classResource.Builder
- Parameters:
meta
- Metadata about the resource- Returns:
- A reference to this Builder instance
-
implicitRules
public Bundle.Builder implicitRules(Uri implicitRules)
A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.- Overrides:
implicitRules
in classResource.Builder
- Parameters:
implicitRules
- A set of rules under which this content was created- Returns:
- A reference to this Builder instance
-
language
public Bundle.Builder language(Code language)
The base language in which the resource is written.- Overrides:
language
in classResource.Builder
- Parameters:
language
- Language of the resource content- Returns:
- A reference to this Builder instance
-
identifier
public Bundle.Builder identifier(Identifier identifier)
A persistent identifier for the bundle that won't change as a bundle is copied from server to server.- Parameters:
identifier
- Persistent identifier for the bundle- Returns:
- A reference to this Builder instance
-
type
public Bundle.Builder type(BundleType type)
Indicates the purpose of this bundle - how it is intended to be used.This element is required.
- Parameters:
type
- document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection- Returns:
- A reference to this Builder instance
-
timestamp
public Bundle.Builder timestamp(Instant timestamp)
The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.- Parameters:
timestamp
- When the bundle was assembled- Returns:
- A reference to this Builder instance
-
total
public Bundle.Builder total(UnsignedInt 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.- Parameters:
total
- If search, the total number of matches- Returns:
- A reference to this Builder instance
-
link
public Bundle.Builder link(Bundle.Link... link)
A series of links that provide context to this bundle.Adds new element(s) to the existing list
- Parameters:
link
- Links related to this Bundle- Returns:
- A reference to this Builder instance
-
link
public Bundle.Builder link(Collection<Bundle.Link> link)
A series of links that provide context to this bundle.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
link
- Links related to this Bundle- Returns:
- A reference to this Builder instance
-
entry
public Bundle.Builder entry(Bundle.Entry... entry)
An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).Adds new element(s) to the existing list
- Parameters:
entry
- Entry in the bundle - will have a resource or information- Returns:
- A reference to this Builder instance
-
entry
public Bundle.Builder entry(Collection<Bundle.Entry> entry)
An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).Replaces the existing list with a new one containing elements from the Collection
- Parameters:
entry
- Entry in the bundle - will have a resource or information- Returns:
- A reference to this Builder instance
-
signature
public Bundle.Builder signature(Signature signature)
Digital Signature - base64 encoded. XML-DSig or a JWT.- Parameters:
signature
- Digital Signature- Returns:
- A reference to this Builder instance
-
build
public Bundle build()
- Specified by:
build
in interfaceBuilder<Resource>
- Specified by:
build
in classResource.Builder
- Returns:
- An immutable object of type
Bundle
- Throws:
IllegalStateException
- if the current state cannot be built into a valid Bundle per the base specification
-
validate
protected void validate(Bundle bundle)
-
from
protected Bundle.Builder from(Bundle bundle)
-
-