Skip to main content

set_resource_id

Function set_resource_id 

Source
pub fn set_resource_id(
    resource: &mut Resource,
    id_: Option<String>,
) -> Result<(), OperationOutcomeError>
Expand description

Sets the ID of a FHIR resource.

If id_ is Some, that value is assigned as the resource ID. Otherwise, a new ID is generated and assigned.

ยงErrors

Returns an [OperationOutcomeError] if the resource does not contain an id field or if the id field is not of type Option<String>.