Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Root Cause Analysis Tool

Record deviations, categorise causes with a fishbone (6M) classifier, drive the 5 Whys to a root cause and generate a quality deviation report

The tool a pharmaceutical or process-plant quality unit uses to close a deviation properly — not to name-and-blame, but to find the systemic cause and write CAPA against it.

Python No deps Stack Tests License Live demo


Dashboard preview

Why this exists

A deviation that is "fixed" by re-running the batch is not fixed — the cause is still in the process. Structured investigation (the 6M fishbone and the 5 Whys) is how GMP plants decide who must do what so the event does not recur. This tool packages that workflow into a small web app, a Python library and a one-command report generator.

The method

  1. Record the deviation — number, date, severity (minor / major / critical) and a factual problem statement.

  2. Brainstorm causes — every cause statement is classified into one of the six I-Know fishbone branches:

    Category Typical causes
    Man training, supervision, adherence, fatigue
    Machine calibration, wear, set-up, breakdown
    Method SOP, parameters, order of steps, rework
    Material incoming quality, moisture, grade, contamination
    Measurement gauge, test, reference, sampling
    Environment temperature, humidity, cleanliness, utilities

    Classification is keyword-based with tie-breaks toward the more specific branch (so "humidity" lands in Environment, not Method).

  3. Drive the 5 Whys — up to five chained "why" answers that terminate in a root cause.

  4. Write CAPA — corrective actions for the event, preventive actions for the system.

  5. Generate the report — a clean text report ready for the batch/lot review or the CAPA tracker.

What's in the repo

  • rca.py — dependency-free library + CLI. classify_cause(), fishbone_breakdown(), whys_chain(), severity(), generate_report() and a full demo investigation (moisture-failure deviation).
  • test_rca.py — 15 unit tests covering classification, grouping, chain validation and report content.
  • index.html — standalone web app: deviation form, live fishbone chart, editable 5-Whys and CAPA lists, live report preview and a download-as-.txt button. No build step, works offline.

Quick start

# web app
open index.html

# CLI — prints the full demo deviation report
python3 rca.py

# library
python3 -c "
import rca
print(rca.classify_cause('LOD balance not within calibrated range'))   # Measurement
print(rca.fishbone_breakdown(['Operator skipped a QC step', 'Old colour batch']))"

# tests
python3 -m unittest test_rca -v

Example report (abridged)

QUALITY DEVIATION REPORT
========================================
Deviation : DEV/D-2418
Severity  : CRITICAL

Problem statement
----------------------------------------
Batch QCIL-2418 failed residue moisture (LOD 4.8% vs limit 3.5%)...

FISHBONE CAUSE ANALYSIS (6M)
----------------------------------------
Method (2)
  - Drying time set by old step count instead of actual LOD check
  - Granulation mixer discharge chute worn (uneven wetting)
Material (2)
  - Operator loaded wet granule trays above the marked depth
  ...

5 WHYS
----------------------------------------
Why 1: Trays were loaded above the marked depth before drying
...
Why 5: The recipe was not updated after the equipment change-over

Root cause: The recipe was not updated after the equipment change-over

CORRECTIVE & PREVENTIVE ACTIONS (CAPA)
----------------------------------------
1. Revise BMR drying step to verify tray load against dryer design capacity

Repository layout

root-cause-analysis-tool/
├── index.html   # web app (open this)
├── rca.py       # RCA library + CLI
├── test_rca.py  # unit tests
├── docs/        # README preview screenshot
└── README.md

License

MIT.

About

Fishbone 6M classifier, 5 Whys and CAPA report generator for deviation and root cause analysis.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages