Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for Lab QC

Inspiration

I trained as a medical lab scientist. Every shift, before a lab reports patient results, it runs quality control (QC) samples on each analyser and checks them against the Westgard multirules. When a rule fires, every patient result since the last good QC run is suspect: it has to be held, the cause found and fixed, and the whole thing documented for accreditation (ISO 15189, CAP). In most labs I know this lives in a paper logbook, a spreadsheet and someone's memory. The most error-prone step is the one that matters most to patients: "which results do we hold?"

What it does

Lab QC is a Forge app for Jira and Confluence with a Rovo agent.

  • QC dashboard (Jira global page). Every test on every analyser with its latest Westgard verdict: in control, warning, or rejected, and how many runs were rejected this month.
  • Levey-Jennings chart. Both control levels on one chart in SD units, with the mean and +/-2 SD and +/-3 SD lines, so a drift is visible at a glance.
  • Westgard engine. Every run is checked against 1-2s (warning) and 1-3s, 2-2s, R-4s, 4-1s and 10x (reject), within a run, across runs and across levels. The verdict says which rule fired and why, in plain words ("last 4 L1 results all on the high side beyond 1 SD").
  • Hold window. Every rejected run shows the patient results to hold: from the last accepted run to the failure.
  • Log a run. New QC values are evaluated on the server the moment they are entered.
  • One-click corrective action. Creates, as the signed-in scientist:
    • a Jira work item with the rules, control values in SD, error type (random or systematic), hold window, likely causes for that error type and a 7-step checklist; and
    • a linked Confluence incident page in accreditation format: summary, QC data, patient impact with a look-back note, investigation and corrective-action task lists, verification, a release sign-off table and references (ISO 15189:2022 7.3.7.2, CLSI C24, Westgard 1981).
  • QC Officer (Rovo agent). Ask "Is the cobas c 311 OK for cholesterol this morning?", "Which patient results do I hold for the creatinine reject?" or "Open a corrective action for it." It also warns when the newest QC run is over 24 hours old.
  • MCP server and skill. The agent's three actions are also exposed as an MCP server (rovo:mcp) and a Rovo skill, so any agent can check QC before it trusts a lab result.

Safety line: the app holds results and never releases them. Release is a human sign-off by an authorised scientist on the incident page. The agent's verdicts come from the engine, not the language model, so it cannot be talked into a different answer.

How we built it

  • Forge app, Node 24 runtime. Modules: jira:globalPage (UI Kit, native render), rovo:agent, three action modules, rovo:mcp, rovo:skill, and a resolver function.
  • Westgard engine in TypeScript with 38 unit tests (vitest), compiled into the app. It is pure: given the QC history it returns the verdict, the hold window and the corrective-action documents. The Jira page, the agent and the MCP tools all call the same shared core, so they always agree.
  • Forge KVS stores each test's QC history and the corrective actions opened per run (a second click returns the same work item and page, no duplicates).
  • Jira REST (asUser) creates the work item with an Atlassian Document Format description and a remote link to the page. Confluence REST v2 creates the page in storage format with native task lists.
  • Demo month: 3 analysers, 6 tests, 2 control levels, 30 days, with real-world faults planted: a calibration shift on glucose (4-1s, 10x), a one-off outlier on creatinine (1-3s), levels pulling apart on cholesterol (R-4s), two high ALT runs in a row (2-2s), a lone warning on haemoglobin (1-2s) and a clean WBC month. Every rule fires. Tests check that each planted fault is caught by the right rule.

Challenges we ran into

  • Getting the hold window right: it starts at the last accepted run, but a systematic error can begin before the run that detects it (the first day of the glucose shift passes QC). The app follows the rule and adds a look-back note on every incident page.
  • Making the verdict impossible to edit from the browser or a prompt: evaluation only runs on the backend.
  • Confluence storage format and Jira ADF have to be exactly right; both builders are unit tested for balanced tags and valid node types.

Accomplishments that we're proud of

  • A rule engine a lab could actually trust, with a test for every Westgard rule and every planted fault.
  • One click turns a QC failure into the documents an accreditation assessor asks for.

What we learned

Forge UI Kit, Rovo actions, rovo:mcp and how much of a lab's quality system maps naturally onto Jira (work) and Confluence (records).

What's next for Lab QC

  • Import QC results straight from analyser middleware (LIS / ASTM) instead of typing them.
  • Sigma metrics per test to pick the right rule set automatically.
  • Monthly QC summary page for the lab manager.

Built With

Share this project:

Updates

Submission history