Skip to main content

transform

Function transform 

Source
pub fn transform<S>(
    template: &Template<'_, '_>,
    ctx: S,
    output: &OutputFormat,
) -> Result<Output, OperationOutcomeError>
where S: Serialize,
Expand description

Renders a template into the requested output format.

The template is rendered using the provided serializable context and the resulting text is validated or parsed according to output.

ยงErrors

Returns an [OperationOutcomeError] if:

  • template rendering fails,
  • the rendered output cannot be parsed as the requested format, or
  • HL7 v2 validation fails.