import React, { useState } from 'react'; import { Database, Stethoscope, AlertTriangle, Box, Plus, Search, ChevronRight, Edit3, Trash2, FileText, Thermometer, ShieldAlert, Save, CheckCircle2, ShieldCheck, Hospital } from 'lucide-react'; import { Card, StatCard } from '../components/Common'; import { motion, AnimatePresence } from 'framer-motion'; type MasterTab = 'SYMPTOMS' | 'INCIDENT_CATEGORIES' | 'MEDICAL_INVENTORY' | 'HOSPITAL_REFERRALS'; export const MasterDataManagement: React.FC = () => { const [activeTab, setActiveTab] = useState('SYMPTOMS'); return (

Platform Master Data

Manage the categorical DNA of TeleEMS: Symptoms, Incident Logic, and Clinical Inventories.

{activeTab === 'SYMPTOMS' && } {activeTab === 'INCIDENT_CATEGORIES' && } {activeTab === 'MEDICAL_INVENTORY' && } {activeTab === 'HOSPITAL_REFERRALS' && }
); }; // --- SUB-MODULES --- const SymptomMaster = () => { const symptoms = [ { id: 'S-001', name: 'Cardiac Arrest', category: 'Immediate (Red)', instructions: 'Begin CPR, Attach Defibrillator', lang: 'EN, TN, HI' }, { id: 'S-002', name: 'Compound Fracture', category: 'Urgent (Orange)', instructions: 'Stabilize limb, Control bleeding', lang: 'EN, TN' }, { id: 'S-003', name: 'Minor Laceration', category: 'Minor (Green)', instructions: 'Clean wound, Apply dressing', lang: 'EN' }, { id: 'S-004', name: 'Respiratory Distress', category: 'Immediate (Red)', instructions: 'Administer Oxygen, Sitting position', lang: 'EN, TN, HI' }, ]; return (
{symptoms.map(s => ( ))}
Symptom ID Clinical Name Severity Cluster First Aid Protocol Localization Actions
{s.id} {s.name} {s.category.toUpperCase()} {s.instructions}
{s.lang.split(', ').map(l => ( {l} ))}
); }; const IncidentCategoryMaster = () => { const categories = [ { name: 'Red - Immediate', desc: 'Life Threatening Emergency', color: 'var(--alert-red)', escalation: 'Immediate Pilot/EMT + Supervisor notification' }, { name: 'Orange - Urgent', desc: 'Non-life threatening but critical', color: 'var(--warning-amber)', escalation: 'Pilot/EMT notification within 2 mins' }, { name: 'Green - Minor', desc: 'Walking wounded / Low priority', color: 'var(--accent-green)', escalation: 'Standard dispatch queue' }, { name: 'Blue - IFT', desc: 'Inter-Facility Transfer', color: 'var(--accent-cyan)', escalation: 'Scheduled transport routing' }, { name: 'Black - Deceased', desc: 'Dead on Arrival / Scene', color: '#4A5568', escalation: 'Mortuary / Police notification' }, ]; return ( {categories.map((c, i) => (
Escalation Logic
{c.escalation}
))}
ADD CUSTOM CATEGORY
); }; const InventoryMaster = () => { const items = [ { name: 'Epinephrine (1mg)', category: 'Drug', unit: 'Ampule', minStock: 10, expiry: true }, { name: 'Sterile Gauze (4x4)', category: 'Disposable', unit: 'Pack', minStock: 50, expiry: false }, { name: 'Automatic Defibrillator', category: 'Medical Device', unit: 'Unit', minStock: 1, expiry: false }, { name: 'Oxygen Cylinder (Portable)', category: 'Reusable', unit: 'Cylinder', minStock: 2, expiry: false }, ]; return (

Medical Inventory Master List

{items.map((item, i) => ( ))}
Item Name Category Unit Min Alert Threshold Expiry Tracking Actions
{item.name} {item.category.toUpperCase()} {item.unit} {item.minStock} {item.expiry ? : }
); }; const HospitalReferralMaster = () => { const networks = [ { name: 'City Govt Hospital Network', type: 'Government', nodes: 12, region: 'Chennai Central' }, { name: 'Apollo Group Synergy', type: 'Private', nodes: 5, region: 'Regional North' }, { name: 'District Trauma Collective', type: 'Trust', nodes: 8, region: 'Salem/Erode' }, ]; return (
{networks.map((net, i) => (
{net.nodes} Nodes
))}

Configure specialty routing rules for Cardiac, Trauma, and Burn centers across all aggregator zones.

{[ { target: 'Cardiac Emergencies', hospital: 'Government General Hospital (Cath Lab)', protocol: 'Immediate Redirect' }, { target: 'Penetrating Trauma', hospital: 'District Trauma Center (Level 1)', protocol: 'ED Pre-alert Pulse' }, { target: 'Maternal Emergencies', hospital: 'Regional Women & Child Hub', protocol: 'Specialist Standby' }, ].map((rule, i) => (
{rule.target}
Destination: {rule.hospital}
{rule.protocol}
))}
); };