Unmapped Results
When Vorian Connect receives analyzer results with instrument-specific test codes that have no LOINC mapping, those results are flagged in the unmapped results queue. Interface engineers review these unmapped codes — grouped by source instrument and code — and assign LOINC mappings, accept ML-generated suggestions, or mark codes as intentionally ignored. Each mapping action triggers automatic reprocessing so previously unmapped results flow through auto-verification with the new mapping applied.
How It Works
- When a message arrives with an instrument code that has no entry in
test_code_mappings, the gateway records it inunmapped_resultswith statuspending, tracking the source instrument, instrument code, analyte name (if available), units, and occurrence count - The unmapped queue API (
GET /api/unmapped-results?status=pending) groups results by source and instrument code, returning aggregated counts and the latest occurrence timestamp. Each group may include an ML-generated mapping suggestion from the mapping intelligence service - Interface engineers open the
/unmappeddashboard page to review the queue — sorted by occurrence count (most frequent first) — and can either manually enter a LOINC code and display name, accept an ML suggestion, or mark the group as ignored - When a mapping is created (via
POST /api/unmapped-results/:id/map), the system inserts the LOINC mapping intotest_code_mappings, marks all pending unmapped results for that source+code combination asmapped, and enqueues a one-message reprocess job through Redis. This reprocesses the original message with the new mapping active, so auto-verification rules can run against the now-mapped result - When a group is marked ignored (via
POST /api/unmapped-results/:id/ignore), all pending results for that source+code combination are set toignored— they will not reappear in the pending queue - Every map and ignore action writes an audit event (
unmapped_result_maporunmapped_result_ignore) recording the actor, source, instrument code, and LOINC assignment
What's Included
- Source-scoped queue: Operators see only unmapped results from instruments they are authorized to access. Source-scope filtering is applied server-side through
sourceScopeSql - Group-level actions: Map and Ignore actions operate on the entire group (all pending results for that source+code combination), not individual rows. This prevents operators from having to map the same instrument code hundreds of times
- ML suggestion integration: The mapping intelligence service can generate LOINC suggestions for unmapped instrument codes based on analyte name, units, and historical mapping patterns. Suggestions appear alongside each group in the dashboard and can be accepted with one click — the LOINC code, display name, and unit are pre-filled from the suggestion
- Auto-reprocessing: Each mapping action enqueues a single-message reprocess job for the message that originally produced the unmapped result. When the reprocessor picks up the job, it re-runs auto-verification with the new mapping active — the same message that previously produced an unmapped result now flows through the full verification pipeline
- Status filtering: The dashboard supports filtering by status —
pending(default, unmapped),mapped(resolved, for audit review),ignored(intentionally skipped), andall(full history) - Summary mode: The API supports a
summary=1parameter that returns only counts by status without the full detail rows — useful for nav badges and dashboard widgets - Manual mapping form: Operators enter a LOINC code (required), display name, unit, and optional resolution note. The form validates that the LOINC code is non-empty before submission and provides inline error feedback. All mapping data is human-reviewed — AI suggestions are never auto-applied without operator approval
Where It Fits
Unmapped results are the bridge between raw instrument traffic and the auto-verification engine. Before Vorian can apply clinical rules, delta checks, and QC monitoring to a result, it needs to know what the result represents — and that requires a LOINC mapping. The unmapped queue is where interface engineers close that gap during implementation, mapping instrument-specific codes to standard LOINC codes as they appear in live traffic.
This is especially valuable during the shadow-mode validation period before go-live. As instrument traffic flows through Vorian in parallel with the existing middleware, every unmapped code is surfaced immediately — the interface team doesn't discover missing mappings at cutover. The queue also serves as ongoing operations monitoring: if a new test is added to an analyzer without updating the mapping table, it appears in the unmapped queue the same day.
Technical Details (for evaluators)
The unmapped results API is built around a group-by pattern: the GET /api/unmapped-results endpoint queries pending results, groups them by (source_id, instrument_code) using a client-side map, and returns aggregated groups with total occurrence counts, latest seen timestamps, and ML suggestions (when available). Source-scope filtering is applied through the sourceScopeSql helper using the operator's authorized source IDs.
The map endpoint (POST /api/unmapped-results/:id/map) requires config:mappings permission, validates the unmapped result UUID and request body, looks up the result row with source-scope filtering, and then within the same tenant-scoped transaction: upserts the mapping into test_code_mappings (using ON CONFLICT (source_id, instrument_code) DO UPDATE), marks all pending results for that source+code combination as mapped, creates a reprocess job targeting the original message with a one-second time window, and notifies the edge agent of the config change. The reprocess job is enqueued through Redis RPUSH to the reprocess queue key, and a unmapped_result_map audit event is written.
The ignore endpoint (POST /api/unmapped-results/:id/ignore) follows the same pattern but updates status to ignored without creating a mapping or triggering reprocessing. Both endpoints fail with clean 400s for malformed JSON, invalid UUIDs, or missing required fields. The results:view permission controls whether operators see individual result values in the detail view — mapping-only users see source, analyte code, and unit context without result values or message IDs.