Skip to main content

Overview

The RCA (Root Cause Analysis) module provides structured investigation tools including 5 Whys, Logic Tree, and Fishbone (Ishikawa) diagram templates. All RCA data is stored in browser localStorage.
The RCA module stores data locally in the browser, not via the backend API. This means RCA records are device-specific and not synchronized across users.

RcaRecord

Main type representing a complete Root Cause Analysis investigation.
export interface RcaRecord {
  id: string;
  rcaId?: string;
  title: string;
  template?: RcaTemplateType;
  problemStatement?: string;
  nodes: RcaChartNode[];
  edges: RcaChartEdge[];
  status?: RcaStatus;
  statusHistory?: RcaStatusHistoryItem[];
  
  // Header fields
  assetId?: string;
  assetName?: string;
  departmentId?: string;
  departmentName?: string;
  eventDate?: string;
  initiatedAt?: string;
  initiatedById?: string;
  initiatedByName?: string;
  rcaLeaderId?: string;
  rcaLeaderName?: string;
  severityLevel?: RcaActionPriority;
  productionImpactHours?: number;
  estimatedCostImpact?: number;
  
  // Failure modes and root causes
  failureModeIds?: string[];
  failureModes?: RcaFailureModeRef[];
  rootCauseIds?: string[];
  rootCauses?: RcaRootCauseRef[];
  
  // Template-specific data
  rca5WhysEntries?: Rca5WhysEntry[];
  fishboneEntries?: RcaFishboneEntry[];
  
  // Actions and solutions
  actions?: RcaAction[];
  solutions?: RcaSolutionItem[];
  
  // Additional details
  evidence?: RcaEvidenceItem[];
  problemStatementDetails?: RcaProblemStatement;
  finalReport?: RcaFinalReport;
  
  // Legacy fields
  mapLocation?: string;
  severity?: string;
  groups?: string;
  notes?: string;
  types?: string;
  tags?: string;
  owner?: string;
  facilitator?: string;
  teamMembers?: string[];
  
  createdAt: string;
  updatedAt: string;
}

Core Fields

id
string
required
Unique identifier for the RCA record
rcaId
string
Display ID in format RCA-YYYY-XXXX (e.g., “RCA-2024-0001”)
title
string
required
Title of the investigation
template
RcaTemplateType
Investigation method: "5whys", "logic-tree", or "fishbone"
problemStatement
string
Brief problem statement
nodes
RcaChartNode[]
required
Array of nodes in the RCA diagram (see RcaChartNode type below)
edges
RcaChartEdge[]
required
Array of edges connecting nodes (see RcaChartEdge type below)
status
RcaStatus
Current status: "Draft", "Investigation", "Review", "Actions Open", "Verification", or "Closed"
actions
RcaAction[]
Array of corrective/preventive actions (see RcaAction type below)

RcaTemplateType

Investigation methodology used for the RCA.
export type RcaTemplateType = "5whys" | "logic-tree" | "fishbone" | "sologic";
5 Whys MethodIteratively ask “Why?” to drill down to root causes:
  1. Why did the problem occur?
  2. Why did that happen?
  3. Why did that happen?
  4. Why did that happen?
  5. Why did that happen?
Typically reaches root cause within 5 iterations.

RcaStatus

Lifecycle status of an RCA investigation.
export type RcaStatus =
  | "Draft"
  | "Investigation"
  | "Review"
  | "Actions Open"
  | "Verification"
  | "Closed";

Status Workflow

1

Draft

Initial creation, problem statement being defined
2

Investigation

Active investigation, building cause-and-effect diagram
3

Review

Investigation complete, findings under review
4

Actions Open

Corrective actions identified and assigned
5

Verification

Actions completed, effectiveness being verified
6

Closed

RCA complete, actions verified, lessons learned documented

RcaChartNode

Represents a node (cause, effect, or problem) in the RCA diagram.
export interface RcaChartNode {
  id: string;
  type?: string;
  position: { x: number; y: number };
  data: RcaNodeData;
}
id
string
required
Unique node identifier
type
string
Node type for rendering (implementation-specific)
position
object
required
X/Y coordinates for diagram layout
data
RcaNodeData
required
Node content and metadata (see RcaNodeData below)

RcaNodeData

Data stored in an RCA diagram node.
export interface RcaNodeData extends Record<string, unknown> {
  label: string;
  type?: RcaNodeType;
  color?: string;
  solutions?: RcaNodeSolution[];
  hypothesis?: string;
  evidenceStatus?: "Confirmed" | "Rejected" | "Pending";
  supportingEvidence?: string;
}
label
string
required
Node label text (the cause, effect, or problem description)
type
RcaNodeType
Node classification: "problem", "why", "cause", or "effect"
color
string
Display color for the node
solutions
RcaNodeSolution[]
Solutions attached to this cause node
hypothesis
string
Logic Tree: hypothesis statement for this branch
evidenceStatus
'Confirmed' | 'Rejected' | 'Pending'
Logic Tree: validation status of this hypothesis
supportingEvidence
string
Logic Tree: evidence supporting or refuting the hypothesis

RcaChartEdge

Represents a connection between two nodes in the RCA diagram.
export interface RcaChartEdge {
  id: string;
  source: string;
  target: string;
}
id
string
required
Unique edge identifier
source
string
required
ID of the source node
target
string
required
ID of the target node

RcaAction

Corrective, preventive, or systemic action to address root causes.
export interface RcaAction {
  id: string;
  actionType: RcaActionType;
  description: string;
  ownerId?: string;
  ownerName?: string;
  departmentId?: string;
  departmentName?: string;
  dueDate?: string;
  priority: RcaActionPriority;
  status: RcaActionStatus;
  verificationRequired: boolean;
  verifiedById?: string;
  verifiedByName?: string;
  verificationDate?: string;
  effectivenessReviewDate?: string;
  createdAt: string;
}

Fields

id
string
required
Unique action identifier
actionType
RcaActionType
required
Type of action: "Corrective", "Preventive", or "Systemic"
  • Corrective: Fixes the immediate problem
  • Preventive: Prevents recurrence
  • Systemic: Addresses underlying system/process issues
description
string
required
Detailed description of the action to be taken
ownerId
string
ID of the person responsible for completing the action
ownerName
string
Name of the action owner
departmentId
string
ID of the department responsible
departmentName
string
Name of the responsible department
dueDate
string
Target completion date (ISO 8601 format)
priority
RcaActionPriority
required
Priority level: "Low", "Medium", "High", or "Critical"
status
RcaActionStatus
required
Current status: "Open", "In Progress", "Completed", "Verified", or "Overdue"
verificationRequired
boolean
required
Whether this action requires verification after completion
verifiedById
string
ID of the person who verified the action
verificationDate
string
Date when action was verified
effectivenessReviewDate
string
Date for reviewing action effectiveness

Rca5WhysEntry

Table row entry for 5 Whys analysis.
export interface Rca5WhysEntry {
  id: string;
  level: number;
  statement: string;
  evidenceReference?: string;
}
id
string
required
Unique entry identifier
level
number
required
Which “Why” level (1-5)
statement
string
required
The answer to “Why?” at this level
evidenceReference
string
Reference to supporting evidence

RcaFishboneEntry

Entry in a Fishbone diagram categorized by 6M framework.
export interface RcaFishboneEntry {
  id: string;
  category: RcaFishboneCategory;
  causeDescription: string;
  evidence?: string;
}
id
string
required
Unique entry identifier
category
RcaFishboneCategory
required
6M category: "Man", "Machine", "Method", "Material", "Measurement", or "Environment"
causeDescription
string
required
Description of the contributing cause
evidence
string
Supporting evidence for this cause

RcaFailureModeRef

Reference to a failure mode from a master table.
export interface RcaFailureModeRef {
  id: string;
  category: string;
  name: string;
}
id
string
required
Failure mode ID
category
string
required
Category of failure (e.g., “Mechanical”, “Electrical”, “Operational”)
name
string
required
Failure mode name (e.g., “Bearing Failure”, “Seal Leak”, “Overheating”)

RcaRootCauseRef

Reference to a root cause from a master table.
export interface RcaRootCauseRef {
  id: string;
  category: string;
  description: string;
}
id
string
required
Root cause ID
category
string
required
Category (e.g., “Design”, “Maintenance”, “Operation”, “Environment”)
description
string
required
Description of the root cause

RcaProblemStatement

Structured problem statement following the 5W2H framework.
export interface RcaProblemStatement {
  focalPoint?: string;
  startDate?: string;
  endDate?: string;
  startTime?: string;
  endTime?: string;
  uniqueTiming?: string;
  mapLocation?: string;
  businessUnit?: string;
  location?: string;
  productClass?: string;
  resourceType?: string;
  actualImpact?: { category: string; description?: string; cost?: string }[];
  potentialImpact?: { category: string; description?: string; cost?: string }[];
  investigationCosts?: string;
  actualImpactTotal?: string;
  potentialImpactTotal?: string;
  frequency?: string;
  frequencyUnit?: string;
  frequencyNotes?: string;
}
This structured format captures:
  • What: Focal point, product/resource affected
  • When: Start/end dates and times, frequency
  • Where: Location, business unit, map location
  • Who: (Captured in main RcaRecord fields)
  • How: (Captured in investigation diagram)
  • How Much: Actual and potential impact costs

Usage Example

import type { 
  RcaRecord, 
  RcaAction, 
  Rca5WhysEntry,
  RcaChartNode 
} from '@/types';

// Create a new 5 Whys RCA
const rca: RcaRecord = {
  id: crypto.randomUUID(),
  rcaId: 'RCA-2024-0001',
  title: 'Pump Bearing Failure - Asset P-101',
  template: '5whys',
  status: 'Investigation',
  assetName: 'Centrifugal Pump P-101',
  assetId: 'asset_456',
  eventDate: '2024-03-01',
  initiatedByName: 'John Smith',
  severityLevel: 'High',
  problemStatement: 'Main bearing on pump P-101 failed after 6 months in service',
  
  // 5 Whys entries
  rca5WhysEntries: [
    {
      id: '1',
      level: 1,
      statement: 'Why did the bearing fail? - Excessive copper wear detected in oil sample',
      evidenceReference: 'Sample S-2024-001: 85 ppm Cu'
    },
    {
      id: '2',
      level: 2,
      statement: 'Why was copper wear excessive? - Bearing running hot (>80°C)',
      evidenceReference: 'Thermal inspection report'
    },
    {
      id: '3',
      level: 3,
      statement: 'Why was bearing running hot? - Insufficient lubrication flow',
      evidenceReference: 'Lubrication system pressure log'
    },
    {
      id: '4',
      level: 4,
      statement: 'Why was lubrication flow insufficient? - Wrong oil grade used',
      evidenceReference: 'Oil grade: ISO 46 (should be ISO 68)'
    },
    {
      id: '5',
      level: 5,
      statement: 'Why was wrong oil used? - Incorrect specification in maintenance procedure',
      evidenceReference: 'Maintenance SOP rev 2.1'
    }
  ],
  
  // Nodes for diagram visualization
  nodes: [
    {
      id: 'problem',
      position: { x: 100, y: 100 },
      data: {
        label: 'Bearing Failure',
        type: 'problem',
        color: '#ef4444'
      }
    },
    // ... additional nodes for each "Why"
  ],
  
  edges: [
    { id: 'e1', source: 'problem', target: 'why1' },
    // ... additional edges
  ],
  
  // Corrective actions
  actions: [
    {
      id: 'action_1',
      actionType: 'Corrective',
      description: 'Update maintenance SOP with correct oil grade (ISO 68)',
      priority: 'High',
      status: 'Open',
      verificationRequired: true,
      dueDate: '2024-03-15',
      createdAt: new Date().toISOString()
    },
    {
      id: 'action_2',
      actionType: 'Preventive',
      description: 'Implement lubrication verification checklist for all pumps',
      priority: 'Medium',
      status: 'Open',
      verificationRequired: true,
      dueDate: '2024-03-30',
      createdAt: new Date().toISOString()
    }
  ],
  
  createdAt: new Date().toISOString(),
  updatedAt: new Date().toISOString()
};

// Save to localStorage
localStorage.setItem(`rca_${rca.id}`, JSON.stringify(rca));

Recommendation Types

RCA findings generate recommendations

Inventory Types

RCA records reference specific assets

Build docs developers (and LLMs) love