Liquid and Razor Transformation
Liquid and Razor Transformation
Connexion v26 adds a Liquid Template Device for healthcare transformations and modernizes the existing Razor template runtime for .NET 10 and Linux.
Liquid Template Device
The new Liquid Template Device can run templates compatible with Microsoft's FHIR Converter inside a Connexion channel. This supports common transformation work such as HL7 v2 to FHIR, CCDA to FHIR, and JSON to FHIR without rewriting the community template catalog as custom C#.
The device includes:
An embedded catalog from which operators can deliberately import templates.
HL7-aware Liquid objects for navigating segments, fields, and components.
Healthcare-oriented filters and tags.
Optional FHIR code-system mapping data.
The Custom Code Device v2 lifecycle, diagnostics, and package-reference facilities.
Per-device template dictionaries and compiled-template caches.
Templates are stored with channel configuration, so they participate in normal export, import, version-control, and audit workflows.
Controlled template sourcing
Connexion does not automatically download templates from the internet. Operators import from the bundled catalog or an audited external copy. This matters in regulated and disconnected environments: the exact template entering production remains an explicit configuration decision.
Record the source repository, commit or release, local modifications, and validation cases for every production template. Treat template changes like code changes.
Liquid templates are trusted channel configuration. They are not compiled as arbitrary C#, but they can invoke the bounded helpers exposed by the device. Apply normal Connexion authorization and change-control practices to authorship and deployment.
HL7-aware authoring
Templates can address HL7 structure directly rather than first flattening the message into an ad hoc dictionary. For example, a template can locate PID, PV1, OBR, and OBX segments, traverse fields and components with healthcare indexing conventions, and use FHIR-oriented mappings during rendering.
Missing or optional data should be handled explicitly in the template. Validate representative messages as well as absent, repeated, and malformed fields before deployment.
Modern Razor runtime
Existing Razor-based transformation features now use RazorEngineCore rather than the legacy System.Web-era Razor stack.
The v26 Razor runtime provides:
.NET 10 and Linux compatibility.
Removal of the old
System.Webdependency chain.Cached template compilation.
A preserved
ViewBagand explicit@Raw(...)surface.HTML encoding enabled by default.
The encoding default is an intentional safety improvement. Template authors should use @Raw(...) only when the value is known to be appropriate for unescaped output. Existing custom Razor templates should be regression-tested because small surface changes may be required during migration.
Upgrade and rollout checklist
Identify existing Razor templates and test them on the v26 engine.
Review uses of raw, encoded, and attribute output.
Import Liquid/FHIR templates only from an audited catalog or repository revision.
Store test messages and expected FHIR output alongside the template change.
Validate repeated and missing HL7 fields, code-system mappings, and date handling.
Check logs and diagnostics without allowing PHI into general operational logs.
Load-test large transformations at the intended channel concurrency.
Promote templates through the same authorization, audit, and configuration workflow as other channel changes.