Flat-File Templates
Generate deterministic field-mapping templates from sample instrument exports, review the detected file shape and proposed HL7 mappings, and approve templates to activate them for runtime file-ingest channels.
What It Does
Many lab instruments — especially legacy chemistry analyzers, hematology counters, and coagulation platforms — export results as flat files: CSV, TSV, or fixed-width text. Vorian Connect reads these files through watched-folder source channels, but it needs a template that describes the file structure and maps each column to its HL7 target.
Flat-file Templates let interface engineers generate these templates from a single sample export. Upload a sample file or paste sample text, and Vorian produces a deterministic draft with detected columns, inferred data types, and automatic HL7 field mapping — all without calling a hosted model provider. You then review the proposal, edit mappings if needed, and approve the template. Once approved, runtime file-ingest channels can use it immediately.
Local and deterministic. Sample files stay on the dashboard path. No hosted model provider is involved — format detection, column inference, and HL7 target mapping are all run locally.
How It Works
- Select a source — pick the instrument from your configured sources.
- Provide a sample — upload a sample export file (up to 5 MiB) or paste sample text. Supported formats: CSV, TSV, and fixed-width.
- Generate a draft — Vorian detects the file format, delimiter, field boundaries, data types, and proposed HL7 targets. A draft template is created in
draftstatus. - Review the proposal — inspect the detected file shape (format, delimiter, skip rows, footer rows), examine each proposed field mapping (column, header, sample, data type, HL7 target), and read the generator notes.
- Edit or reject — if the draft needs corrections, edit field mappings directly and save. If the proposal is fundamentally wrong, reject it with a reviewer reason; the draft returns to editable state.
- Approve and activate — when the template is correct, approve it. Approval retires any previously approved template for the same vendor and instrument model, and atomically moves any affected source channels to the new template.
Template Fields
Each field mapping row includes:
- Column index — zero-based position in the file row.
- Header — the detected or entered column name.
- Masked sample — a shape-preserving mask of the sample value (letters become
A, digits become9). - Data type — one of
string,numeric,code, ordate, inferred from the sample value and header name. - HL7 target — the HL7 segment and field where this column maps. Auto-populated for columns whose headers match a deterministic dictionary (e.g., "MRN" →
PID.3, "TestCode" →OBX.3, "Result" →OBX.5, "Unit" →OBX.6, "Flag" →OBX.8).
Activation Impact
Approving a template is an atomic replacement. If a previously approved template exists for the same vendor and instrument, it is retired, and all source channels currently using it are moved to the new template in a single transaction. The approval panel lists every affected source channel and requires explicit confirmation before proceeding.
There is no "approve without activating" option — approving a replacement replaces the runtime template atomically. Templates that replace nothing (no previously approved template for the same vendor+instrument) activate without moving channels.
Where It Fits
Flat-file Templates are part of the Interface Builder workflow, accessed at /flatfile-templates in the dashboard under Configure. The feature requires the interface:build permission scoped to the selected source.
It complements the Interface Analyzer (/hl7-analyzer), which handles ad-hoc sample classification and mapping proposals, and the Flat File Parser, which performs the actual runtime parsing of CSV, TSV, and fixed-width files using approved templates.
Vendor implementation guides and PDF specification documents should use the separate Docbuilder extraction path, not Flat-file Templates.
Technical Details
- Supports CSV, TSV, and fixed-width formats.
- Sample size limit: 5 MiB. Request body limit: 6 MiB.
- Template name, vendor, and instrument fields are capped at 180 characters each.
- One source column maps to one HL7 target in this release. Compound cells containing several discrete results are not decomposed.
- Fixed-width column boundaries are inferred from spacing patterns and require reviewer confirmation before approval.
- Automatic HL7 target mapping uses a deterministic dictionary matching common header names (MRN → PID.3, TestCode → OBX.3, Result → OBX.5, Unit → OBX.6, Flag → OBX.8). Columns without a clear match are left unmapped for manual assignment.
- Template lifecycle:
draft→rejected(returns to editable without activation) →approved(atomic activation with channel reassignment).retiredtemplates are preserved for historical evidence.