pub struct BundleBuilder { /* private fields */ }
Expand description
Builder for BundleInner
.
Implementations§
Source§impl BundleBuilder
impl BundleBuilder
Sourcepub fn id(self, value: String) -> BundleBuilder
pub fn id(self, value: String) -> BundleBuilder
Logical id of this artifact
The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.
Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.
Sourcepub fn meta(self, value: Meta) -> BundleBuilder
pub fn meta(self, value: Meta) -> BundleBuilder
Metadata about the resource
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.
Sourcepub fn implicit_rules(self, value: String) -> BundleBuilder
pub fn implicit_rules(self, value: String) -> BundleBuilder
A set of rules under which this content was created
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.
Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.
Sourcepub fn language(self, value: String) -> BundleBuilder
pub fn language(self, value: String) -> BundleBuilder
Language; Language of the resource content
The base language in which the resource is written.
Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).
Sourcepub fn identifier(self, value: Identifier) -> BundleBuilder
pub fn identifier(self, value: Identifier) -> BundleBuilder
Persistent identifier for the bundle
A persistent identifier for the bundle that won’t change as a bundle is copied from server to server.
Persistent identity generally only matters for batches of type Document, Message, and Collection. It would not normally be populated for search and history results and servers ignore Bundle.identifier when processing batches and transactions. For Documents the .identifier SHALL be populated such that the .identifier is globally unique.
Sourcepub fn identifier_ext(self, value: FieldExtension) -> BundleBuilder
pub fn identifier_ext(self, value: FieldExtension) -> BundleBuilder
Extension field.
Sourcepub fn type(self, value: BundleType) -> BundleBuilder
pub fn type(self, value: BundleType) -> BundleBuilder
BundleType; document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification
Indicates the purpose of this bundle - how it is intended to be used.
It’s possible to use a bundle for other purposes (e.g. a document can be accepted as a transaction). This is primarily defined so that there can be specific rules for some of the bundle types.
Sourcepub fn type_ext(self, value: FieldExtension) -> BundleBuilder
pub fn type_ext(self, value: FieldExtension) -> BundleBuilder
Extension field.
Sourcepub fn timestamp(self, value: Instant) -> BundleBuilder
pub fn timestamp(self, value: Instant) -> BundleBuilder
When the bundle was assembled
The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.
For many bundles, the timestamp is equal to .meta.lastUpdated, because they are not stored (e.g. search results). When a bundle is placed in a persistent store, .meta.lastUpdated will be usually be changed by the server. When the bundle is a message, a middleware agent altering the message (even if not stored) SHOULD update .meta.lastUpdated. .timestamp is used to track the original time of the Bundle, and SHOULD be populated.
Usage:
- document : the date the document was created. Note: the composition may predate the document, or be associated with multiple documents. The date of the composition - the authoring time - may be earlier than the document assembly time
- message : the date that the content of the message was assembled. This date is not changed by middleware engines unless they add additional data that changes the meaning of the time of the message
- history : the date that the history was assembled. This time would be used as the _since time to ask for subsequent updates
- searchset : the time that the search set was assembled. Note that different pages MAY have different timestamps but need not. Having different timestamps does not imply that subsequent pages will represent or include changes made since the initial query
- transaction | transaction-response | batch | batch-response | collection : no particular assigned meaning
The timestamp value should be greater than the lastUpdated and other timestamps in the resources in the bundle, and it should be equal or earlier than the .meta.lastUpdated on the Bundle itself.
Sourcepub fn timestamp_ext(self, value: FieldExtension) -> BundleBuilder
pub fn timestamp_ext(self, value: FieldExtension) -> BundleBuilder
Extension field.
Sourcepub fn total(self, value: u32) -> BundleBuilder
pub fn total(self, value: u32) -> BundleBuilder
If search, the total number of matches
If a set of search matches, this is the (potentially estimated) 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.
Only used if the bundle is a search result set. The total does not include resources such as OperationOutcome and included resources, only the total number of matching resources.
Sourcepub fn total_ext(self, value: FieldExtension) -> BundleBuilder
pub fn total_ext(self, value: FieldExtension) -> BundleBuilder
Extension field.
Sourcepub fn link(self, value: Vec<Option<BundleLink>>) -> BundleBuilder
pub fn link(self, value: Vec<Option<BundleLink>>) -> BundleBuilder
Links related to this Bundle
A series of links that provide context to this bundle.
Both Bundle.link and Bundle.entry.link are defined to support providing additional context when Bundles are used (e.g. HATEOAS).
Bundle.entry.link corresponds to links found in the HTTP header if the resource in the entry was read directly.
This specification defines some specific uses of Bundle.link for searching and paging, but no specific uses for Bundle.entry.link, and no defined function in a transaction - the meaning is implementation specific. The behavior of navigation link types (next/prev/first/last) are well defined for searchset and history Bundles but are not currently defined for other types. Implementers who choose to use such link relationships for other bundle types will need to negotiate behavior with their interoperability partners.
Sourcepub fn link_ext(self, value: Vec<Option<FieldExtension>>) -> BundleBuilder
pub fn link_ext(self, value: Vec<Option<FieldExtension>>) -> BundleBuilder
Extension field.
Sourcepub fn entry(self, value: Vec<Option<BundleEntry>>) -> BundleBuilder
pub fn entry(self, value: Vec<Option<BundleEntry>>) -> BundleBuilder
Entry in the bundle - will have a resource or information
An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).
Sourcepub fn entry_ext(self, value: Vec<Option<FieldExtension>>) -> BundleBuilder
pub fn entry_ext(self, value: Vec<Option<FieldExtension>>) -> BundleBuilder
Extension field.
Sourcepub fn signature(self, value: Signature) -> BundleBuilder
pub fn signature(self, value: Signature) -> BundleBuilder
Digital Signature
Digital Signature - base64 encoded. XML-DSig or a JWS.
The signature could be created by the “author” of the bundle or by the originating device. Requirements around inclusion of a signature, verification of signatures and treatment of signed/non-signed bundles is implementation-environment specific.
Sourcepub fn signature_ext(self, value: FieldExtension) -> BundleBuilder
pub fn signature_ext(self, value: FieldExtension) -> BundleBuilder
Extension field.
Sourcepub fn issues(self, value: Resource) -> BundleBuilder
pub fn issues(self, value: Resource) -> BundleBuilder
Issues with the Bundle
Captures issues and warnings that relate to the construction of the Bundle and the content within it.
Usage notes: These issues and warnings must apply to the Bundle as a whole, not to individual entries.Messages relating to the processing of individual entries (e.g. in a batch or transaction) SHALL be reported in the entry.response.outcome for that entry. If there are errors that arise in the creation of the Bundle, then that should be handled by an OperationOutcome being returned instead of the Bundle.
Sourcepub fn issues_ext(self, value: FieldExtension) -> BundleBuilder
pub fn issues_ext(self, value: FieldExtension) -> BundleBuilder
Extension field.
Sourcepub fn build_inner(self) -> Result<BundleInner, BuilderError>
pub fn build_inner(self) -> Result<BundleInner, BuilderError>
Source§impl BundleBuilder
impl BundleBuilder
Sourcepub fn build(self) -> Result<Bundle, BuilderError>
pub fn build(self) -> Result<Bundle, BuilderError>
Finalize building Bundle.