← Back to projects
Case study · Nexus suite · Laboratory

LIS
Laboratory Information System

A complete laboratory system that also runs as its own business unit, with its own cashier, books and partner-lab network. It includes an HL7 v2 analyser gateway and a simulator that let the whole analyser-to-report path be tested without lab hardware.

Role
Solution architect & lead engineer
Client
Private hospital, Kurdistan Region of Iraq
Part of
Nexus suite, integrated with HMS & Accounting
Status
Going live at the reference hospital
Stack
Go · PostgreSQL · Lit · HL7 v2.5.1 / MLLP · LOINC · ZPL

01 at a glance

02 the workflow

Order, pay & collect

front of the lab

  • Order and pay in one transaction: patient → tests/panels → pricing → discount and tax → payment → order, all atomic.
  • Three billing modes: paid, deposit, or deferred to the inpatient bill in HMS.
  • Specimens: one specimen per tube type, derived automatically, with extra tubes added when tests are added later.
  • Labels: Code 128 and QR, with Zebra (ZPL) label printing.
  • Tracking from collection to disposal, with rejection and re-collection.

Results & safety gates

the bench

  • A 12-stage order status with an audited event for every step. Moving backward needs a supervisor.
  • Workbenches per specialty, driven by 10 versioned templates: haematology, biochemistry, microbiology, PCR/molecular, blood bank, urinalysis and others.
  • Automatic flagging (N/L/H/LL/HH) against reference ranges chosen by the patient's age and sex, with server-side validation.
  • Critical values cannot be released until the notification to a clinician has been logged.
  • A passing QC run is required before results can be submitted, and PCR batch controls must pass before result entry.
  • Reflex suggestions are advisory and never place orders on their own.

Verification & reporting

release

  • Microbiology staged release: Gram stain → interim → final culture, with antibiotic panels.
  • Pathology addenda that keep the original report.
  • Verification per analyte and in batches, with return-to-technician.
  • Immutable report versions (interim / final / amended / addendum, each watermarked) and signed PDFs.
  • Delivery by email, SMS, WhatsApp and Telegram, which can be held until the bill reaches a set paid percentage.

Lab network

a business unit of its own

  • Lab branches and lab-to-lab transfers.
  • Partner-lab referrals with inter-lab balance settlement.
  • Own cashier and books: lab checkout posts to the ledger as cash, insurance or patient receivable (see Accounting).

03 analyser integration

HL7 gateway: lis-mllp

separate Go service

  • An MLLP listener that accepts HL7 v2 ORU^R01 results from lab analysers.
  • Parses MSH/PID/OBR/OBX, matches each result to its order and replies with an HL7 ACK.
  • Writes through the REST API rather than straight to the database, so every analyser result passes the same permission checks and audit trail as a human entry.
  • A message-id table prevents duplicate processing.

Analyser simulator: lis-simulator

separate Go service

  • Reads pending orders and generates realistic values fitted to each test's reference range and result type.
  • Sends HL7 v2.5.1 messages to the gateway over MLLP.
  • Tests the whole path from analyser to report without any lab hardware.

04 engineering notes

Roadmap

— the nexus suite