Delivered remotely for a business based in Leeds, United Kingdom. Names withheld by agreement.
Project Overview
A high-volume diagnostic laboratory operates like an air-traffic control tower for biological samples. Every morning in Leeds, couriers drop off hundreds of primary blood tubes, swabs, and histology cassettes that must be accessioned, centrifuged, split into barcoded aliquots, routed across automated chemistry and hematology analyzers, and verified before evening clinic rounds. Any mismatch between a tube barcode and an order—or a transcription slip between an analyzer screen and a reporting portal—creates immediate clinical risk.
We engineered a comprehensive Laboratory Information System (LIS) using .NET, Angular, and SQL Server to unify pre-analytical intake, instrument interfacing, analytical quality control, and post-analytical reporting. Biomedical scientists work inside keyboard-driven Angular worklists updated live via SignalR, while resilient .NET worker services manage bidirectional HL7 v2 and ASTM analyzer traffic against an auditable SQL Server core.
Diagnostic Workflow Bottlenecks
Before consolidating onto a unified LIS, multi-discipline laboratories frequently struggle with four operational fractures:
- Manual analyzer re-keying: Standalone bench instruments lacking bidirectional order download and result upload force technicians to type decimals by hand.
- Opaque specimen custody: Without scan-enforced aliquot tracking, misplaced racks stall turnaround times and trigger avoidable patient redraws.
- Noisy exception triage: Sending every normal automated test alongside genuinely abnormal results buries critical pathology findings under routine volume.
- Fragile compliance evidence: Disconnected instrument logs make proving which calibration lot and QC run backed a given patient report tedious during UKAS / ISO 15189 inspections.
Architectural Strategy
The architecture separates high-speed deterministic instrument I/O from interactive clinical validation. Laboratory analyzers cannot wait on browser sessions or heavy ORM abstractions; they expect immediate ACK/NAK protocol acknowledgments over local TCP sockets.
Accordingly, .NET hosted background services manage raw HL7 v2 and ASTM framing directly at the laboratory LAN edge, persisting unmodified raw frames to SQL Server staging tables before parsing observations. Once parsed, a stateless validation engine evaluates Westgard QC rules, biological plausibility limits, and historical patient delta checks, publishing status updates over SignalR to Angular workbenches.
Core Capabilities
- Barcode-First Accessioning & Aliquoting: Generates hierarchical parent-child specimen barcodes (e.g., separating serum, EDTA, and urine fractions) with scan-verified rack placement.
- Bidirectional Analyzer Interfacing: Downloads test worklists to automated chemistry, immunoassay, and hematology lines via HL7 v2 / ASTM and ingests raw quantitative and flag payloads automatically.
- Configurable Auto-Verification Engine: Evaluates instrument error flags, active QC lot pass status, critical bounds, and patient delta percentages to auto-release clean routine panels while routing anomalies to pathologists.
- Microbiology Culture Progression: Supports multi-day plate incubation states, organism identification, and antibiotic susceptibility (MIC/zone) sensitivity grids.
- Critical Value Callback Tracking: Enforces documented phone escalation workflows with timestamps and receiving-clinician names whenever panic thresholds trigger.
- Turnaround-Time (TAT) Dashboards: Live SignalR bench monitors surface aging urgent stat samples before SLA windows breach.
Technical Architecture
The Angular frontend serves role-tailored views for specimen reception, bench validation, quality control, and consultant authorization, communicating over HTTPS with ASP.NET Core Web APIs and SignalR hubs. Instrument drivers run as isolated .NET worker processes inside the lab network segment, writing raw protocol payloads and structured test observations into SQL Server.
Flow: Barcode Intake / Clinic Order → ASP.NET Core API → SQL Server Worklist → .NET HL7/ASTM Instrument Worker → Bench Analyzer → Raw Frame Staging → Auto-Verification & Delta-Check Engine → SignalR → Angular Pathologist Review & Report Release
Using SQL Server temporal tables alongside Entity Framework Core ensures every edit to a patient demographic, specimen state, or preliminary interpretation automatically records valid-from and valid-to audit history at the database layer.
Technology Stack
| Category | Technology detail |
|---|---|
| Backend API & Workers | .NET 8 ASP.NET Core Web API and hosted background worker services |
| Laboratory Workbench | Angular SPA with keyboard-first barcode scanning and multi-pane validation grids |
| Transactional Database | SQL Server with temporal audit tables, row-version concurrency, and filtered indexes |
| Instrument Middleware | .NET TCP/MLLP and serial socket listeners parsing HL7 v2 and ASTM E1381/E1394 frames |
| Real-Time Bench Sync | ASP.NET Core SignalR pushing live sample statuses and critical-value alerts |
| Data Access Layer | Entity Framework Core paired with Dapper stored-procedure queries for heavy worklists |
| Queue & Ephemeral Cache | Redis coordinating instrument message buffering and QC rule evaluation state |
| Report Rendering | Server-side PDF diagnostic report generator with electronic pathologist signatures |
| Access & Compliance | Role-based clinical sign-off permissions aligned with ISO 15189 audit expectations |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Analyzer TCP drops or malformed ASTM checksums risk silent data loss | Persisted raw socket frames to an immutable staging table prior to domain parsing and implemented automatic NAK/retry handshakes; increases disk footprint slightly for complete replayability. |
| Large pending-worklist grids degrade under Entity Framework Core tracking overhead | Used Dapper with targeted SQL Server filtered indexes (WHERE Status IN ('Pending', 'Exception')) for read-heavy Angular worklists while keeping EF Core for transactional mutations; mixes two data-access idioms to preserve sub-second bench responsiveness. |
| Auto-verification rules vary sharply across hematology, biochemistry, and serology | Built a declarative rule table linking assay codes, reagent lots, and delta-check windows evaluated in deterministic priority order rather than hardcoding C# branches; requires structured rule governance by senior scientists. |
| Multiple scientists opening urgent samples can overwrite manual reflex-test additions | Combined SQL Server rowversion optimistic locking with ephemeral Redis bench presence locks over SignalR; prevents silent collisions while displaying who holds a specimen. |
Security & Traceability
Medical laboratory records carry strict regulatory and patient-safety obligations. Authentication integrates with institutional directory SSO and role-based clinical authorizations distinguishing trainees, state-registered biomedical scientists, and consultant pathologists permitted to issue final diagnostic amendments.
Every specimen scan, rack transfer, QC override, reflex test addition, and amended report stamps a non-repudiable user ID, workstation identifier, and UTC timestamp into SQL Server temporal audit history. Once a clinical report is authorized, its content hash locks permanently; subsequent corrections generate formal versioned addenda preserving the original released text alongside clear amendment reasons.
Performance & Bench Scale
Morning courier surges concentrate thousands of barcode scans and analyzer messages into short two-hour windows. Partitioned SQL Server indexes keep active-day sample lookups crisp even across multi-year diagnostic archives, while Redis absorbs transient SignalR fan-out across dozens of laboratory workstations.
Keyboard-wedge barcode scanner listeners inside Angular bypass unnecessary mouse clicks, allowing reception staff to accession continuous racks of tubes without focus loss. Heavy cumulative PDF report batches and billing/EHR HL7 outbound transmissions execute in asynchronous .NET background queues so bench validation never stalls waiting on downstream network links.
Operational Outcomes
Replacing fragmented bench tools with an integrated .NET, Angular, and SQL Server LIS elevated laboratory reliability and clinical clarity across every department:
- End-to-end specimen accountability: Barcoded custody from intake through freezer archiving eliminates guesswork over sample whereabouts.
- Focused expert attention: Automated QC checks and delta-check filtering let biomedical scientists and pathologists concentrate immediately on abnormal and urgent cases.
- Zero-transcription analyzer flow: Direct HL7 v2 and ASTM integration removes manual keyboard entry errors between instruments and final reports.
- Inspection-ready governance: Complete versioned histories linking reagent lots, QC runs, and sign-off identities simplify ISO 15189 quality audits.