An AI-powered Electronic Medical Records (EMR) system designed for modern healthcare professionals. This platform combines real-time clinical documentation, intelligent diagnostics, and safety verification to help doctors spend less time on paperwork and more time caring for patients.
- Real-Time SOAP Note Generation: AI automatically extracts Chief Complaint, History, Vitals, Assessment, and Plan as doctors speak or type during consultations
- Clinical Red-Flag Alert Engine: Scans transcripts for danger keywords and triggers immediate alerts for critical conditions
- Explainable ICD-10 Code Mapping: Automatically matches diagnoses to ICD-10 codes with confidence scores and evidence highlighting
- Patient Plain-Language Summary: Generates simplified summaries in English/Hindi, ready to share via WhatsApp with QR codes
- AI Hallucination Guard: Cross-checks generated notes against original transcripts to verify accuracy and flag uncertain extractions
- Smart Triage Assistant: Pre-consultation chatbot that assigns urgency levels (Emergency/Urgent/Routine) and suggests initial tests
- Multi-Modal Input: Upload lab reports and PDFs with OCR support to extract values and highlight abnormal results
- Consent & Audit Trail Logger: Complete compliance tracking with timestamps for all actions
- Hinglish / Multilingual Medical Voice: Native code-switching support for Hindi-English mixed input
- ABDM / ABHA Integration: Links patient ABHA IDs to pull existing health records from the national health stack
- Framework: Next.js 16.1.2 with React 19
- Authentication: Clerk
- Database: Convex (real-time backend)
- Styling: Tailwind CSS 4
- UI Components: Radix UI, Framer Motion
- Icons: Lucide React
- Python: AI/ML processing
- CrewAI: Multi-agent orchestration
- LangGraph: Workflow management
- LiteLLM: Model routing and API abstraction
- Groq API: LLM inference
- Whisper API: Speech-to-text transcription
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ │ ├── save-audio/ # Audio recording endpoints
│ │ ├── save-soap/ # SOAP note endpoints
│ │ └── save-transcript/ # Transcription endpoints
│ ├── components/ # Landing page components
│ ├── consultation/ # Video consultation pages
│ ├── dashboard/ # Doctor/patient dashboards
│ ├── documents/ # Document management
│ ├── review/ # Note review interface
│ └── triage/ # Triage assistant
├── backend/ # Python backend services
│ ├── flag/ # Red-flag detection engine
│ ├── icd/ # ICD-10 mapping agent
│ └── soap/ # SOAP note generation
├── components/ # Shared React components
│ ├── dashboard/ # Dashboard components
│ └── ui/ # UI primitives
├── convex/ # Convex backend
│ ├── appointments.ts # Appointment management
│ ├── consultations.ts # Consultation logic
│ ├── schema.ts # Database schema
│ └── users.ts # User management
└── hooks/ # Custom React hooks
├── useAudioRecorder.ts # Audio recording
├── useTranscription.ts # Speech-to-text
└── useVideoCall.ts # WebRTC video calls
- Node.js 20+
- Python 3.9+
- npm or yarn
- Groq API key
- Clerk account
- Convex account
- Clone the repository:
git clone <repository-url>
cd <project-directory>- Install frontend dependencies:
npm install- Install backend dependencies:
cd backend/icd
pip install -r requirements.txt- Set up environment variables:
Create .env.local in the root directory:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_key
CLERK_SECRET_KEY=your_clerk_secret
# Convex
NEXT_PUBLIC_CONVEX_URL=your_convex_url
CONVEX_DEPLOYMENT=your_deployment
# Vercel Blob Storage
BLOB_READ_WRITE_TOKEN=your_blob_tokenCreate backend/icd/.env:
GROQ_API_KEY=your_groq_api_key
LLM_MODEL=groq/llama-3.3-70b-versatile
USE_LITELLM_PROXY=false- Run the development servers:
Frontend:
npm run devBackend (ICD mapping service):
cd backend/icd
python main.pyThe application will be available at http://localhost:3000
The application uses Convex with the following main tables:
- users: User profiles with roles (doctor/patient)
- appointments: Scheduled consultations
- transcripts: Consultation transcripts
- soap_notes: Generated SOAP notes with red-flag alerts
- signaling: WebRTC signaling for video calls
- Patient fills out pre-consultation form
- AI assigns urgency level
- Suggests initial tests
- Queues patient for doctor
- WebRTC-based video call
- Real-time audio recording
- Live transcription with Whisper API
- Automatic SOAP note generation
- AI extracts structured data from conversation
- Generates SOAP notes
- Maps diagnoses to ICD-10 codes
- Flags potential red flags
- Verifies accuracy with hallucination guard
- Generates plain-language summary
- Creates shareable QR code
- Supports English and Hindi
The ICD mapping service uses a multi-agent architecture:
- Disease Extraction Agent: Identifies medical conditions from SOAP notes
- ICD Mapping Agent: Matches diseases to ICD-10 codes
- Verification Agent: Validates mappings and confidence scores
See backend/icd/README.md for detailed documentation.
npm run dev: Start development server (Next.js + Convex)npm run build: Build for productionnpm start: Start production server
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
See LICENSE file for details.
For issues and questions:
- Open an issue on GitHub
- Contact the development team
- Built with Next.js, React, and Convex
- AI powered by Groq and OpenAI
- UI components from Radix UI and Shadcn
- Icons from Lucide React
Note: This is a healthcare application. Ensure compliance with local regulations (HIPAA, DPDP, ABDM) before deploying to production.