Skip to main content

set_resource_meta

Function set_resource_meta 

Source
pub fn set_resource_meta(
    resource: &mut Resource,
    author_type: &AuthorKind,
    author_id: &AuthorId,
) -> Result<(), OperationOutcomeError>
Expand description

Sets the metadata for a FHIR resource, including the versionId, lastUpdated, and Haste authoring extensions.

If the resource does not have a meta element, one is created. The versionId field is then populated with a newly generated ID and the extensions are set to include the authoring information.

ยงErrors

Returns an [OperationOutcomeError] if the resource does not contain a meta field or if the meta field is not of type Option<Box<Meta>>.