ConformSight Enterprise v3.0

Healthcare Inspection Processing System - Production Dashboard

Processing Status

COMPLETED

Files Progress

6513 / 6509

100.1%
Violations Found

0

Vectors Created

0

Recent Processed Files
Milestone3 Embeddings
00192f8460c5_WELLESLEY_CENTRAL_PLACE_Inspection_Jul_30_2024_-_PDF_m3_embeddings.json
2025-09-01 16:26:43
Milestone1 Ocr
7cfb477c62e1_THE_WILLOWS_ESTATE_NURSING_HOME_Inspection_Dec_20_2024_-_PDF_m1_ocr.json
2025-09-01 12:02:45
Milestone4 Qdrant
bb57761ce8b1_THE_VILLAGE_AT_ST_CLAIR_Inspection_Sep_05_2023_-_PDF_m4_qdrant.json
2025-09-01 10:38:36
Milestone2 Extraction
ebdfea5e40de_STREETSVILLE_COMMUNITY_Inspection_Jul_31_2024_-_PDF(1)_m2_extraction.json
2025-09-01 05:10:28
Milestone3 Embeddings
7845e9656d4a_SPRINGDALE_COUNTRY_MANOR_Inspection_Aug_08_2024_-_PDF(1)_m3_embeddings.json
2025-09-01 03:45:12
Milestone3 Embeddings
ac83afa87d6b_SOUTHBRIDGE_KEMPTVILLE_Inspection_Jan_29_2024_-_PDF_m3_embeddings.json
2025-09-01 02:43:50
Milestone4 Qdrant
4ee5ce8abf24_PARKVIEW_HOME_LONGTERM_CARE_Inspection_May_23_2024_-_PDF_m4_qdrant.json
2025-08-31 19:57:20
Milestone2 Extraction
6c21ee7e584e_NORFINCH_COMMUNITY_Inspection_Feb_26_2025_-_PDF_m2_extraction.json
2025-08-31 18:47:04
Milestone1 Ocr
2a027925ac3a_MILL_CREEK_CARE_CENTRE_Inspection_Oct_18_2024_-_PDF_m1_ocr.json
2025-08-31 17:21:55
Milestone4 Qdrant
cb25f14e0636_MIDLAND_GARDENS_COMMUNITY_Inspection_Aug_21_2023_-_PDF_m4_qdrant.json
2025-08-31 16:33:59
System Logs

System logs will appear here

SSL Status:
Secure
Last Update:
2025-09-17T18:06:52.756035
Version:
Enterprise v3.0
from flask import Flask, render_template, request, jsonify, send_file, redirect, url_for import os import subprocess import json import time from datetime import datetime from pathlib import Path app = Flask(__name__) # Configuration ENTERPRISE_OUTPUT_DIR = '/home/ubuntu/conformsight-processor/enterprise_output' PDF_INPUT_DIR = '/home/ubuntu/conformsight-processor/test_pdfs' LOG_DIR = f'{ENTERPRISE_OUTPUT_DIR}/logs' @app.route('/') def dashboard(): """ConformSight Enterprise Dashboard""" stats = get_processing_stats() recent_files = get_recent_processed_files() return render_template('dashboard.html', stats=stats, recent_files=recent_files) @app.route('/api/start-processing', methods=['POST']) def start_processing(): """Start ConformSight Enterprise processing""" try: config = request.json or {} # Check if already running if is_processing_running(): return jsonify({ 'status': 'error', 'message': 'ConformSight processing is already running' }) # Start processing in background cmd = ['python3', 'conformsight-enterprise-v3-FIXED.py'] subprocess.Popen(cmd, cwd='/home/ubuntu/conformsight-processor') return jsonify({ 'status': 'started', 'message': 'ConformSight Enterprise processing started successfully' }) except Exception as e: return jsonify({'status': 'error', 'message': str(e)}) @app.route('/api/status') def processing_status(): """Get current processing status""" stats = get_processing_stats() return jsonify(stats) @app.route('/api/files') def list_files(): """List processed files""" files = [] if os.path.exists(ENTERPRISE_OUTPUT_DIR): for milestone_dir in ['milestone1_ocr', 'milestone2_extraction', 'milestone3_embeddings', 'milestone4_qdrant', 'milestone5_discord']: milestone_path = os.path.join(ENTERPRISE_OUTPUT_DIR, milestone_dir) if os.path.exists(milestone_path): for file in os.listdir(milestone_path): if file.endswith('.json'): file_path = os.path.join(milestone_path, file) stat = os.stat(file_path) files.append({ 'name': file, 'milestone': milestone_dir, 'size': stat.st_size, 'modified': datetime.fromtimestamp(stat.st_mtime).isoformat(), 'download_url': f'/download/{milestone_dir}/{file}' }) return jsonify(files) @app.route('/download/') def download_file(filename): """Download processed files""" file_path = os.path.join(ENTERPRISE_OUTPUT_DIR, filename) if os.path.exists(file_path): return send_file(file_path, as_attachment=True) return "File not found", 404 def get_processing_stats(): """Get current processing statistics""" stats = { 'status': 'idle', 'files_processed': 0, 'total_files': 0, 'success_rate': 0, 'violations_found': 0, 'vectors_created': 0, 'last_update': datetime.now().isoformat(), 'processing_time': 0 } try: # Count PDF files if os.path.exists(PDF_INPUT_DIR): stats['total_files'] = len([f for f in os.listdir(PDF_INPUT_DIR) if f.endswith('.pdf')]) # Count processed files if os.path.exists(f'{ENTERPRISE_OUTPUT_DIR}/milestone1_ocr'): stats['files_processed'] = len([f for f in os.listdir(f'{ENTERPRISE_OUTPUT_DIR}/milestone1_ocr') if f.endswith('.json')]) # Calculate success rate if stats['total_files'] > 0: stats['success_rate'] = (stats['files_processed'] / stats['total_files']) * 100 # Check if processing is running if is_processing_running(): stats['status'] = 'running' elif stats['files_processed'] > 0: stats['status'] = 'completed' # Get latest log info if os.path.exists(LOG_DIR): log_files = [f for f in os.listdir(LOG_DIR) if f.endswith('.log')] if log_files: latest_log = max(log_files, key=lambda x: os.path.getmtime(os.path.join(LOG_DIR, x))) stats['last_update'] = datetime.fromtimestamp( os.path.getmtime(os.path.join(LOG_DIR, latest_log)) ).isoformat() except Exception as e: print(f"Error getting stats: {e}") return stats def get_recent_processed_files(): """Get recently processed files""" files = [] try: milestone_dirs = ['milestone1_ocr', 'milestone2_extraction', 'milestone3_embeddings', 'milestone4_qdrant', 'milestone5_discord'] for milestone_dir in milestone_dirs: milestone_path = os.path.join(ENTERPRISE_OUTPUT_DIR, milestone_dir) if os.path.exists(milestone_path): for file in os.listdir(milestone_path)[:5]: # Latest 5 files if file.endswith('.json'): files.append({ 'name': file, 'milestone': milestone_dir.replace('_', ' ').title(), 'time': datetime.fromtimestamp( os.path.getmtime(os.path.join(milestone_path, file)) ).strftime('%Y-%m-%d %H:%M:%S') }) files.sort(key=lambda x: x['time'], reverse=True) return files[:10] # Return latest 10 files except Exception as e: print(f"Error getting recent files: {e}") return [] def is_processing_running(): """Check if ConformSight processing is currently running""" try: result = subprocess.run(['pgrep', '-f', 'conformsight-enterprise'], capture_output=True, text=True) return len(result.stdout.strip()) > 0 except: return False if __name__ == '__main__': app.run(host='127.0.0.1', port=5000, debug=False)