diff --git a/ipdmodule/.gitignore b/ipdmodule/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f650315f30180800d0fed8ed1e7ceade266e9e71 --- /dev/null +++ b/ipdmodule/.gitignore @@ -0,0 +1,27 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules + +# next.js +/.next/ +/out/ + +# production +/build + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts \ No newline at end of file diff --git a/ipdmodule/app/components/sidebar.tsx b/ipdmodule/app/components/sidebar.tsx new file mode 100644 index 0000000000000000000000000000000000000000..bd3884c5d48cad7c49f47b0fa21dab918a4ff23f --- /dev/null +++ b/ipdmodule/app/components/sidebar.tsx @@ -0,0 +1,90 @@ +"use client" + +import { useState } from "react" +import { Button } from "@/components/ui/button" +import { ScrollArea } from "@/components/ui/scroll-area" +import { Hospital, FileText, Menu, X, Stethoscope, Bed } from "lucide-react" + +interface SidebarProps { + activeModule: string + onModuleSelect: (module: string) => void +} + +export function Sidebar({ activeModule, onModuleSelect }: SidebarProps) { + const [isCollapsed, setIsCollapsed] = useState(false) + + const modules = [ + { id: "ipd", label: "IPD", icon: Bed }, + { id: "opd", label: "OPD", icon: Stethoscope }, + { id: "emergency", label: "Emergency", icon: Hospital }, + { id: "pharmacy", label: "Pharmacy", icon: FileText }, + { id: "lab", label: "Laboratory", icon: FileText }, + { id: "radiology", label: "Radiology", icon: FileText }, + ] + + return ( + <> + {/* Mobile overlay */} + {!isCollapsed && ( +
setIsCollapsed(true)} /> + )} + + {/* Sidebar */} +
+ {/* Header */} +
+ {!isCollapsed && ( +
+ + TatvaCare +
+ )} + +
+ + {/* Navigation */} + +
+ {modules.map((module) => { + const Icon = module.icon + return ( + + ) + })} +
+
+
+ + {/* Mobile menu button */} + + + ) +} diff --git a/ipdmodule/app/globals.css b/ipdmodule/app/globals.css new file mode 100644 index 0000000000000000000000000000000000000000..ac6844236cb8a3195672afa1ea2867e0853a9618 --- /dev/null +++ b/ipdmodule/app/globals.css @@ -0,0 +1,94 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +body { + font-family: Arial, Helvetica, sans-serif; +} + +@layer utilities { + .text-balance { + text-wrap: balance; + } +} + +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 0 0% 3.9%; + --card: 0 0% 100%; + --card-foreground: 0 0% 3.9%; + --popover: 0 0% 100%; + --popover-foreground: 0 0% 3.9%; + --primary: 0 0% 9%; + --primary-foreground: 0 0% 98%; + --secondary: 0 0% 96.1%; + --secondary-foreground: 0 0% 9%; + --muted: 0 0% 96.1%; + --muted-foreground: 0 0% 45.1%; + --accent: 0 0% 96.1%; + --accent-foreground: 0 0% 9%; + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 0 0% 98%; + --border: 0 0% 89.8%; + --input: 0 0% 89.8%; + --ring: 0 0% 3.9%; + --chart-1: 12 76% 61%; + --chart-2: 173 58% 39%; + --chart-3: 197 37% 24%; + --chart-4: 43 74% 66%; + --chart-5: 27 87% 67%; + --radius: 0.5rem; + --sidebar-background: 0 0% 98%; + --sidebar-foreground: 240 5.3% 26.1%; + --sidebar-primary: 240 5.9% 10%; + --sidebar-primary-foreground: 0 0% 98%; + --sidebar-accent: 240 4.8% 95.9%; + --sidebar-accent-foreground: 240 5.9% 10%; + --sidebar-border: 220 13% 91%; + --sidebar-ring: 217.2 91.2% 59.8%; + } + .dark { + --background: 0 0% 3.9%; + --foreground: 0 0% 98%; + --card: 0 0% 3.9%; + --card-foreground: 0 0% 98%; + --popover: 0 0% 3.9%; + --popover-foreground: 0 0% 98%; + --primary: 0 0% 98%; + --primary-foreground: 0 0% 9%; + --secondary: 0 0% 14.9%; + --secondary-foreground: 0 0% 98%; + --muted: 0 0% 14.9%; + --muted-foreground: 0 0% 63.9%; + --accent: 0 0% 14.9%; + --accent-foreground: 0 0% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + --border: 0 0% 14.9%; + --input: 0 0% 14.9%; + --ring: 0 0% 83.1%; + --chart-1: 220 70% 50%; + --chart-2: 160 60% 45%; + --chart-3: 30 80% 55%; + --chart-4: 280 65% 60%; + --chart-5: 340 75% 55%; + --sidebar-background: 240 5.9% 10%; + --sidebar-foreground: 240 4.8% 95.9%; + --sidebar-primary: 224.3 76.3% 48%; + --sidebar-primary-foreground: 0 0% 100%; + --sidebar-accent: 240 3.7% 15.9%; + --sidebar-accent-foreground: 240 4.8% 95.9%; + --sidebar-border: 240 3.7% 15.9%; + --sidebar-ring: 217.2 91.2% 59.8%; + } +} + +@layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + } +} diff --git a/ipdmodule/app/layout.tsx b/ipdmodule/app/layout.tsx new file mode 100644 index 0000000000000000000000000000000000000000..17b2ce8c15ec2aa81f0956f3c57e0b16407fa298 --- /dev/null +++ b/ipdmodule/app/layout.tsx @@ -0,0 +1,20 @@ +import type { Metadata } from 'next' +import './globals.css' + +export const metadata: Metadata = { + title: 'v0 App', + description: 'Created with v0', + generator: 'v0.dev', +} + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode +}>) { + return ( + + {children} + + ) +} diff --git a/ipdmodule/app/page.tsx b/ipdmodule/app/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..2c8087c52d46f288daf2eecd2b1679185d101101 --- /dev/null +++ b/ipdmodule/app/page.tsx @@ -0,0 +1,101 @@ +"use client" + +import { useState } from "react" +import { AppHeader } from "@/components/app-header" +import { AppSidebar } from "@/components/app-sidebar" +import { AppointmentPage } from "@/components/appointment-page" +import { IPDPage } from "@/components/ipd-page" +import { IPDPatientModule } from "@/components/ipd-patient-module" + +interface Patient { + id: string + name: string + patientId: string + age: number + gender: string + ward: string + room: string + contact: string + admittingDoctor: string + admittedOn: string + mrn: string + bed: string +} + +export default function HomePage() { + const [activeView, setActiveView] = useState("appointment") + const [selectedPatient, setSelectedPatient] = useState(null) + const [isTransitioning, setIsTransitioning] = useState(false) + + const handleNavigation = (item: string) => { + if (item === activeView) return + + setIsTransitioning(true) + setTimeout(() => { + setActiveView(item) + setSelectedPatient(null) // Reset patient selection when navigating + setIsTransitioning(false) + }, 150) + } + + const handlePatientSelect = (patient: Patient) => { + setIsTransitioning(true) + setTimeout(() => { + setSelectedPatient(patient) + setIsTransitioning(false) + }, 150) + } + + const handleBackToIPD = () => { + setIsTransitioning(true) + setTimeout(() => { + setSelectedPatient(null) + setIsTransitioning(false) + }, 150) + } + + const handleBackToAppointment = () => { + setIsTransitioning(true) + setTimeout(() => { + setActiveView("appointment") + setSelectedPatient(null) + setIsTransitioning(false) + }, 150) + } + + return ( +
+ {/* Only show header and sidebar for appointment view */} + {activeView === "appointment" && ( + <> + +
+ +
+ +
+
+ + )} + + {/* IPD views take full screen */} + {activeView === "ipd" && ( +
+ {selectedPatient ? ( + + ) : ( + + )} +
+ )} +
+ ) +} diff --git a/ipdmodule/components.json b/ipdmodule/components.json new file mode 100644 index 0000000000000000000000000000000000000000..13f24bf4a7199593d611210596d3f953930a5768 --- /dev/null +++ b/ipdmodule/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} diff --git a/ipdmodule/components/activity-logs-tab.tsx b/ipdmodule/components/activity-logs-tab.tsx new file mode 100644 index 0000000000000000000000000000000000000000..b2b7327da839ac67d3f950f7f199decb3f5d7147 --- /dev/null +++ b/ipdmodule/components/activity-logs-tab.tsx @@ -0,0 +1,434 @@ +"use client" + +import { useState } from "react" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Badge } from "@/components/ui/badge" +import { Button } from "@/components/ui/button" +import { Input } from "@/components/ui/input" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" +import { Separator } from "@/components/ui/separator" +import { ScrollArea } from "@/components/ui/scroll-area" +import { Search, Filter, Clock, User, AlertTriangle, Activity, RefreshCw } from "lucide-react" + +interface ActivityLogsTabProps { + patient: any +} + +interface ActivityLog { + id: string + timestamp: string + user: string + role: string + action: string + section: string + field?: string + oldValue?: string + newValue?: string + changeType: "create" | "update" | "delete" | "load" | "view" | "print" | "export" + priority: "low" | "medium" | "high" | "critical" + ipAddress: string + device: string + description: string +} + +export function ActivityLogsTab({ patient }: ActivityLogsTabProps) { + const [searchTerm, setSearchTerm] = useState("") + const [filterModule, setFilterModule] = useState("all") + const [filterChangeType, setFilterChangeType] = useState("all") + const [filterPriority, setFilterPriority] = useState("all") + const [filterUser, setFilterUser] = useState("all") + + // Mock activity logs data + const [activityLogs, setActivityLogs] = useState([ + { + id: "1", + timestamp: "2024-01-15 14:30:25", + user: "Dr. Sarah Johnson", + role: "Consultant", + action: "Updated Final Diagnosis", + section: "Discharge Summary", + field: "Final Diagnosis", + oldValue: "Acute Appendicitis", + newValue: "Acute Appendicitis with Peritonitis", + changeType: "update", + priority: "high", + ipAddress: "192.168.1.45", + device: "Chrome/Windows", + description: "Modified final diagnosis to include peritonitis complication", + }, + { + id: "2", + timestamp: "2024-01-15 14:25:10", + user: "Nurse Maria Garcia", + role: "Staff Nurse", + action: "Added Progress Note", + section: "Progress Notes", + field: "Daily Progress", + oldValue: "", + newValue: "Patient stable, pain reduced, ambulating well", + changeType: "create", + priority: "medium", + ipAddress: "192.168.1.67", + device: "Safari/iPad", + description: "Added daily progress note for post-operative care", + }, + { + id: "3", + timestamp: "2024-01-15 14:20:45", + user: "System", + role: "Auto-populate", + action: "Loaded OPD History", + section: "OPD History", + field: "Previous Consultations", + oldValue: "", + newValue: "3 previous consultations loaded", + changeType: "load", + priority: "low", + ipAddress: "127.0.0.1", + device: "System/Server", + description: "Automatically loaded patient's OPD consultation history", + }, + { + id: "4", + timestamp: "2024-01-15 14:15:30", + user: "Dr. Michael Chen", + role: "Medical Officer", + action: "Updated OT Details", + section: "OT Details", + field: "Procedure Notes", + oldValue: "Laparoscopic appendectomy completed", + newValue: "Laparoscopic appendectomy completed. Minimal bleeding. Good hemostasis achieved.", + changeType: "update", + priority: "high", + ipAddress: "192.168.1.23", + device: "Firefox/Windows", + description: "Added detailed procedure notes post-surgery", + }, + { + id: "5", + timestamp: "2024-01-15 14:10:15", + user: "Dr. Sarah Johnson", + role: "Consultant", + action: "Viewed Discharge Summary", + section: "Discharge Summary", + changeType: "view", + priority: "low", + ipAddress: "192.168.1.45", + device: "Chrome/Windows", + description: "Accessed discharge summary for review", + }, + { + id: "6", + timestamp: "2024-01-15 14:05:00", + user: "Admin User", + role: "Administrator", + action: "Exported Patient Data", + section: "All Modules", + changeType: "export", + priority: "medium", + ipAddress: "192.168.1.10", + device: "Edge/Windows", + description: "Exported complete patient data for backup", + }, + { + id: "7", + timestamp: "2024-01-15 13:55:20", + user: "Dr. Sarah Johnson", + role: "Consultant", + action: "Critical Alert - Allergy Updated", + section: "Assessment", + field: "Allergies", + oldValue: "NKDA", + newValue: "Penicillin - Rash", + changeType: "update", + priority: "critical", + ipAddress: "192.168.1.45", + device: "Chrome/Windows", + description: "CRITICAL: Patient allergy information updated - immediate medication review required", + }, + ]) + + // Filter logs based on search and filters + const filteredLogs = activityLogs.filter((log) => { + const matchesSearch = + searchTerm === "" || + log.action.toLowerCase().includes(searchTerm.toLowerCase()) || + log.user.toLowerCase().includes(searchTerm.toLowerCase()) || + log.section.toLowerCase().includes(searchTerm.toLowerCase()) || + log.description.toLowerCase().includes(searchTerm.toLowerCase()) + + const matchesModule = filterModule === "all" || log.section.toLowerCase().includes(filterModule.toLowerCase()) + const matchesChangeType = filterChangeType === "all" || log.changeType === filterChangeType + const matchesPriority = filterPriority === "all" || log.priority === filterPriority + const matchesUser = filterUser === "all" || log.user === filterUser + + return matchesSearch && matchesModule && matchesChangeType && matchesPriority && matchesUser + }) + + // Get statistics + const stats = { + total: activityLogs.length, + created: activityLogs.filter((log) => log.changeType === "create").length, + updated: activityLogs.filter((log) => log.changeType === "update").length, + loaded: activityLogs.filter((log) => log.changeType === "load").length, + viewed: activityLogs.filter((log) => log.changeType === "view").length, + critical: activityLogs.filter((log) => log.priority === "critical").length, + } + + const getChangeTypeBadge = (type: string) => { + const variants = { + create: "bg-green-100 text-green-800", + update: "bg-blue-100 text-blue-800", + delete: "bg-red-100 text-red-800", + load: "bg-purple-100 text-purple-800", + view: "bg-gray-100 text-gray-800", + print: "bg-orange-100 text-orange-800", + export: "bg-indigo-100 text-indigo-800", + } + return variants[type as keyof typeof variants] || "bg-gray-100 text-gray-800" + } + + const getPriorityBadge = (priority: string) => { + const variants = { + low: "bg-gray-100 text-gray-800", + medium: "bg-yellow-100 text-yellow-800", + high: "bg-orange-100 text-orange-800", + critical: "bg-red-100 text-red-800", + } + return variants[priority as keyof typeof variants] || "bg-gray-100 text-gray-800" + } + + const clearFilters = () => { + setSearchTerm("") + setFilterModule("all") + setFilterChangeType("all") + setFilterPriority("all") + setFilterUser("all") + } + + return ( +
+ {/* Header */} +
+
+

+ + Activity Logs +

+

+ Complete audit trail for {patient.name} (MRN: {patient.mrn}) +

+
+ +
+ + {/* Statistics Dashboard */} +
+ + +
{stats.total}
+
Total Activities
+
+
+ + +
{stats.created}
+
Created
+
+
+ + +
{stats.updated}
+
Updated
+
+
+ + +
{stats.loaded}
+
Auto-loaded
+
+
+ + +
{stats.viewed}
+
Viewed
+
+
+ + +
{stats.critical}
+
Critical
+
+
+
+ + {/* Filters */} + + + + + Filters & Search + + + +
+
+
+ + setSearchTerm(e.target.value)} + className="pl-10" + /> +
+
+ + + + +
+
+
+ + {/* Activity Timeline */} + + + + + + Activity Timeline ({filteredLogs.length} entries) + + + + + +
+ {filteredLogs.map((log, index) => ( +
+ {/* Header */} +
+
+
+ {log.changeType.toUpperCase()} + {log.priority.toUpperCase()} + {log.section} +
+
+
+ + {log.timestamp} +
+
+ + {/* Action Description */} +
+

{log.action}

+

{log.description}

+
+ + {/* User Info */} +
+
+ + {log.user} + ({log.role}) +
+
+ {log.device} • {log.ipAddress} +
+
+ + {/* Field Changes */} + {log.field && (log.oldValue || log.newValue) && ( +
+
Field: {log.field}
+ {log.oldValue && ( +
+ Before: + + {log.oldValue.length > 100 ? `${log.oldValue.substring(0, 100)}...` : log.oldValue} + +
+ )} + {log.newValue && ( +
+ After: + + {log.newValue.length > 100 ? `${log.newValue.substring(0, 100)}...` : log.newValue} + +
+ )} +
+ )} + + {/* Critical Alert */} + {log.priority === "critical" && ( +
+ + Critical Change - Requires Attention +
+ )} + + {index < filteredLogs.length - 1 && } +
+ ))} + + {filteredLogs.length === 0 && ( +
+ +

No activity logs found matching your filters.

+ +
+ )} +
+
+
+
+
+ ) +} diff --git a/ipdmodule/components/admission-assessment-form.tsx b/ipdmodule/components/admission-assessment-form.tsx new file mode 100644 index 0000000000000000000000000000000000000000..7fd5fa3695fcc5e605a09fc3a8134249afdcbf32 --- /dev/null +++ b/ipdmodule/components/admission-assessment-form.tsx @@ -0,0 +1,407 @@ +"use client" + +import { useState, useEffect } from "react" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" +import { Button } from "@/components/ui/button" +import { RichTextEditor } from "./rich-text-editor" +import { FormNavigation } from "./form-navigation" +import { User, Activity, Heart, FileText, Stethoscope, TestTube, ClipboardList, AlertCircle } from "lucide-react" + +export function AdmissionAssessmentForm() { + const [activeSection, setActiveSection] = useState("opd-data") + const [formData, setFormData] = useState({ + opdData: "", + vitals: "", + history: "", + examination: "", + investigations: "", + assessment: "", + plan: "", + notes: "", + }) + + const sections = [ + { id: "opd-data", label: "OPD Data", icon: }, + { id: "vitals", label: "Vitals", icon: }, + { id: "history", label: "History", icon: }, + { id: "examination", label: "Examination", icon: }, + { id: "investigations", label: "Investigations", icon: }, + { id: "assessment", label: "Assessment", icon: }, + { id: "plan", label: "Plan", icon: }, + { id: "notes", label: "Notes", icon: }, + ] + + useEffect(() => { + const handleScroll = () => { + const sectionElements = sections.map((section) => ({ + id: section.id, + element: document.getElementById(section.id), + })) + + const currentSection = sectionElements.find(({ element }) => { + if (!element) return false + const rect = element.getBoundingClientRect() + return rect.top <= 100 && rect.bottom >= 100 + }) + + if (currentSection) { + setActiveSection(currentSection.id) + } + } + + window.addEventListener("scroll", handleScroll) + return () => window.removeEventListener("scroll", handleScroll) + }, []) + + const updateFormData = (field: string, value: string) => { + setFormData((prev) => ({ ...prev, [field]: value })) + } + + return ( +
+ + +
+ {/* OPD Data Section */} + + + + + OPD Data + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ updateFormData("opdData", value)} + placeholder="Enter chief complaints and presenting symptoms..." + fieldType="chief-complaints" + label="Chief Complaints" + showAutofill={true} + autofillSource="OPD" + autofillTimestamp="2024-01-15, 10:30 AM" + /> +
+
+
+ + {/* Vitals Section */} + + + + + Vital Signs + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ updateFormData("vitals", value)} + placeholder="Additional vital signs observations..." + fieldType="general" + label="Vitals Notes" + showAutofill={true} + autofillSource="Nursing Station" + autofillTimestamp="2024-01-15, 11:00 AM" + /> +
+
+
+ + {/* History Section */} + + + + + Medical History + + + +
+ updateFormData("history", value)} + placeholder="Detailed history of present illness..." + fieldType="chief-complaints" + label="History of Present Illness" + rows={6} + showAutofill={true} + autofillSource="Previous Records" + autofillTimestamp="2024-01-10, 2:15 PM" + /> +
+
+
+ {}} + placeholder="Previous medical conditions, surgeries..." + fieldType="general" + label="Past Medical History" + rows={4} + /> +
+
+ {}} + placeholder="Relevant family medical history..." + fieldType="general" + label="Family History" + rows={4} + /> +
+
+
+
+ + {/* Physical Examination Section */} + + + + + Physical Examination + + + +
+ updateFormData("examination", value)} + placeholder="General appearance, consciousness level, orientation..." + fieldType="assessment" + label="General Examination" + rows={5} + /> +
+
+
+ {}} + placeholder="Cardiovascular, respiratory, abdominal, neurological examination..." + fieldType="assessment" + label="Systemic Examination" + rows={6} + /> +
+
+ {}} + placeholder="Specific area examination findings..." + fieldType="assessment" + label="Local Examination" + rows={6} + /> +
+
+
+
+ + {/* Investigations Section */} + + + + + Investigations + + + +
+ updateFormData("investigations", value)} + placeholder="Blood tests, urine analysis, other lab results..." + fieldType="general" + label="Laboratory Results" + rows={5} + showAutofill={true} + autofillSource="Lab System" + autofillTimestamp="2024-01-15, 9:45 AM" + /> +
+
+ {}} + placeholder="X-rays, CT scans, MRI, ultrasound findings..." + fieldType="general" + label="Imaging Studies" + rows={4} + showAutofill={true} + autofillSource="Radiology" + autofillTimestamp="2024-01-15, 8:30 AM" + /> +
+
+
+ + {/* Assessment Section */} + + + + + Clinical Assessment + + + +
+ updateFormData("assessment", value)} + placeholder="Primary and differential diagnoses..." + fieldType="assessment" + label="Provisional Diagnosis" + rows={4} + /> +
+
+ {}} + placeholder="Overall clinical impression and severity assessment..." + fieldType="assessment" + label="Clinical Impression" + rows={4} + /> +
+
+
+ + {/* Treatment Plan Section */} + + + + + Treatment Plan + + + +
+ updateFormData("plan", value)} + placeholder="Immediate treatment plan and interventions..." + fieldType="plan" + label="Immediate Management" + rows={5} + /> +
+
+
+ {}} + placeholder="Prescribed medications with dosages..." + fieldType="plan" + label="Medications" + rows={4} + /> +
+
+ {}} + placeholder="Monitoring parameters and frequency..." + fieldType="plan" + label="Monitoring Plan" + rows={4} + /> +
+
+
+
+ + {/* Additional Notes Section */} + + + + + Additional Notes + + + +
+ updateFormData("notes", value)} + placeholder="Special instructions, precautions, or additional notes..." + fieldType="general" + label="Special Instructions" + rows={4} + /> +
+
+ {}} + placeholder="Criteria for discharge planning..." + fieldType="plan" + label="Discharge Criteria" + rows={3} + /> +
+
+
+ + {/* Form Actions */} +
+ + + +
+
+
+ ) +} diff --git a/ipdmodule/components/admission-assessment.tsx b/ipdmodule/components/admission-assessment.tsx new file mode 100644 index 0000000000000000000000000000000000000000..3c893b604291736905aadcf1cd9341e01da3cda9 --- /dev/null +++ b/ipdmodule/components/admission-assessment.tsx @@ -0,0 +1,223 @@ +"use client" + +import { useState } from "react" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Button } from "@/components/ui/button" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { Textarea } from "@/components/ui/textarea" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" +import { Badge } from "@/components/ui/badge" +import { ChevronDown, ChevronUp, FileText, User, Activity, RefreshCw } from "lucide-react" + +export function AdmissionAssessment() { + const [collapsedSections, setCollapsedSections] = useState>({}) + + const toggleSection = (sectionId: string) => { + setCollapsedSections((prev) => ({ + ...prev, + [sectionId]: !prev[sectionId], + })) + } + + const AutofillBadge = ({ + status, + source, + timestamp, + }: { + status: "available" | "none" | "edited" + source?: string + timestamp?: string + }) => { + const getStatusConfig = () => { + switch (status) { + case "available": + return { color: "bg-green-100 text-green-800", text: "Autofilled" } + case "edited": + return { color: "bg-blue-100 text-blue-800", text: "Manually Edited" } + default: + return { color: "bg-gray-100 text-gray-800", text: "No Data" } + } + } + + const config = getStatusConfig() + + return ( +
+ {config.text} + {status === "available" && ( + + )} + {(source || timestamp) && ( + + {source && `Source: ${source}`} + {timestamp && ` • ${timestamp}`} + + )} +
+ ) + } + + return ( +
+ {/* Patient Information */} + + toggleSection("patient-info")} + > + + + Patient Information + + {collapsedSections["patient-info"] ? : } + + {!collapsedSections["patient-info"] && ( + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+ )} +
+ + {/* Basic Information */} + + toggleSection("basic-info")} + > +
+ + Basic Information + Autofilled +
+ {collapsedSections["basic-info"] ? : } +
+ {!collapsedSections["basic-info"] && ( + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+ )} +
+ + {/* Clinical Assessment */} + + toggleSection("clinical-assessment")} + > + + + Clinical Assessment + + {collapsedSections["clinical-assessment"] ? ( + + ) : ( + + )} + + {!collapsedSections["clinical-assessment"] && ( + +
+
+ + +