Safety Inspection System for Construction
Comprehensive digital safety management system for construction sites with inspection checklists, hazard tracking, and incident reporting.
Business Case
Problem: Paper-based safety management leads to:
- Incomplete inspections (20-30% of items skipped)
- Lost documentation
- Delayed incident reporting
- Difficulty tracking corrective actions
- Compliance audit failures
Solution: Digital system that:
- Enforces complete checklist completion
- Photos attached to each finding
- Instant notifications for hazards
- Tracks corrective actions to closure
- Generates compliance reports
ROI: 40% reduction in recordable incidents, 100% audit compliance
Safety Inspection Types
┌──────────────────────────────────────────────────────────────────────┐
│ SAFETY INSPECTION TYPES │
├──────────────────────────────────────────────────────────────────────┤
│ │
│ DAILY WEEKLY SPECIAL │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Pre-Work │ │ Area Walk │ │ Pre-Pour │ │
│ │ • Housekeeping│ │ • Fire ext. │ │ • Formwork │ │
│ │ • PPE │ │ • First aid │ │ • Shoring │ │
│ │ • Equipment │ │ • Scaffolds │ │ └─────────────┘ │
│ └─────────────┘ │ • Trenches │ ┌─────────────┐ │
│ ┌─────────────┐ └─────────────┘ │ Crane Setup │ │
│ │ Toolbox Talk│ ┌─────────────┐ │ • Ground │ │
│ │ • Topic │ │ Equipment │ │ • Load chart│ │
│ │ • Attendees │ │ • Cranes │ │ • Rigging │ │
│ │ • Sign-off │ │ • Lifts │ └─────────────┘ │
│ └─────────────┘ │ • Vehicles │ ┌─────────────┐ │
│ ┌─────────────┐ └─────────────┘ │ Hot Work │ │
│ │ End of Day │ │ • Permit │ │
│ │ • Secured │ │ • Fire watch│ │
│ │ • Barricades│ └─────────────┘ │
│ └─────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────┘
Data Structure
from dataclasses import dataclass, field
from datetime import datetime, date
from enum import Enum
from typing import List, Optional
import uuid
class HazardSeverity(Enum):
CRITICAL = "Critical" # Immediate danger to life
HIGH = "High" # Serious injury potential
MEDIUM = "Medium" # Injury potential
LOW = "Low" # Minor hazard
OBSERVATION = "Observation" # Best practice
class HazardStatus(Enum):
OPEN = "Open"
IN_PROGRESS = "In Progress"
CORRECTED = "Corrected"
VERIFIED = "Verified Closed"
class InspectionType(Enum):
DAILY_PREWORK = "Daily Pre-Work"
TOOLBOX_TALK = "Toolbox Talk"
AREA_INSPECTION = "Area Inspection"
EQUIPMENT_INSPECTION = "Equipment Inspection"
HOT_WORK_PERMIT = "Hot Work Permit"
CONFINED_SPACE = "Confined Space Entry"
CRANE_LIFT = "Crane/Lift Inspection"
SCAFFOLD = "Scaffold Inspection"
EXCAVATION = "Excavation Inspection"
INCIDENT = "Incident Report"
@dataclass
class Hazard:
hazard_id: str
inspection_id: str
description: str
severity: HazardSeverity
location: str
photo_urls: List[str] = field(default_factory=list)
assigned_to: str = ""
due_date: date = None
status: HazardStatus = HazardStatus.OPEN
corrective_action: str = ""
corrected_date: date = None
corrected_by: str = ""
verification_date: date = None
verified_by: str = ""
@dataclass
class Inspection:
inspection_id: str
inspection_type: InspectionType
project_id: str
date: date
inspector: str
location: str
checklist_items: List[dict] = field(default_factory=list)
hazards_found: List[Hazard] = field(default_factory=list)
overall_rating: str = "" # Pass/Fail/Conditional
notes: str = ""
photos: List[str] = field(default_factory=list)
signatures: List[dict] = field(default_factory=list)
weather: str = ""
created_at: datetime = field(default_factory=datetime.now)
@dataclass
class Incident:
incident_id: str
project_id: str
date: datetime
type: str # Near Miss, First Aid, Recordable, Lost Time
description: str
location: str
injured_party: str = ""
witness_names: List[str] = field(default_factory=list)
immediate_actions: str = ""
root_cause: str = ""
corrective_actions: str = ""
reported_by: str = ""
photos: List[str] = field(default_factory=list)
osha_recordable: bool = False
days_away: int = 0
days_restricted: int = 0
Python Implementation
import pandas as pd
from datetime import datetime, date, timedelta
from typing import List, Dict, Optional
import json
import os
class SafetyManager:
"""Construction site safety management system"""
def __init__(self, project_id: str, storage_path: str = None):
self.project_id = project_id
self.storage_path = storage_path or f"safety_{project_id}"
self.inspections: Dict[str, Inspection] = {}
self.hazards: Dict[str, Hazard] = {}
self.incidents: Dict[str, Incident] = {}
# Load checklists
self.checklists = self._load_checklists()
def _load_checklists(self) -> Dict[str, List[dict]]:
"""Load inspection checklists"""
return {
InspectionType.DAILY_PREWORK.value: [
{"id": "DP01", "item": "Work area clean and organized", "category": "Housekeeping"},
{"id": "DP02", "item": "Walking surfaces clear of debris", "category": "Housekeeping"},
{"id": "DP03", "item": "All workers have required PPE", "category": "PPE"},
{"id": "DP04", "item": "Hard hats worn in designated areas", "category": "PPE"},
{"id": "DP05", "item": "Safety glasses worn where required", "category": "PPE"},
{"id": "DP06", "item": "High-visibility vests worn", "category": "PPE"},
{"id": "DP07", "item": "Fall protection in use above 6 feet", "category": "Fall Protection"},
{"id": "DP08", "item": "Guardrails/covers on floor openings", "category": "Fall Protection"},
{"id": "DP09", "item": "Ladders in good condition", "category": "Equipment"},
{"id": "DP10", "item": "Extension cords not damaged", "category": "Electrical"},
{"id": "DP11", "item": "GFCIs in use for power tools", "category": "Electrical"},
{"id": "DP12", "item": "Fire extinguishers accessible", "category": "Fire Safety"},
{"id": "DP13", "item": "Emergency exits clear", "category": "Emergency"},
{"id": "DP14", "item": "First aid kit stocked", "category": "Emergency"},
{"id": "DP15", "item": "SDS sheets available", "category": "Hazcom"},
],
InspectionType.SCAFFOLD.value: [
{"id": "SC01", "item": "Base plates/mudsills in place", "category": "Foundation"},
{"id": "SC02", "item": "All legs plumb and level", "category": "Structure"},
{"id": "SC03", "item": "Cross bracing complete", "category": "Structure"},
{"id": "SC04", "item": "Planking fully decked", "category": "Platform"},
{"id": "SC05", "item": "No gaps >1 inch between planks", "category": "Platform"},
{"id": "SC06", "item": "Guardrails at 42 inches", "category": "Guardrails"},
{"id": "SC07", "item": "Midrails at 21 inches", "catego