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.
OutputFormat::FHIRparses the rendered output as a FHIR resource.OutputFormat::JSONparses the rendered output as arbitrary JSON.OutputFormat::HL7V2validates that the rendered output is a valid HL7 v2 message.
ยงErrors
Returns an [OperationOutcomeError] if:
- template rendering fails,
- the rendered output cannot be parsed as the requested format, or
- HL7 v2 validation fails.