Skip to content

Latest commit

 

History

History
116 lines (83 loc) · 4.38 KB

README.md

File metadata and controls

116 lines (83 loc) · 4.38 KB

AI Pre-Consultation System

A graduation project that brings AI into the clinical waiting room. A QR code is placed in the clinic — on a poster, a desk stand, or any surface in the waiting area. The patient scans it with their phone, fills a short pre-consultation form, and is done. No app to install, no account to create. On the other side, the doctor opens their dashboard and finds a structured AI-generated report ready for every patient waiting to be seen.


Screenshots

Patient Form AI Voice Assistant
Patient Form AI Assistant
Doctor Dashboard Report Details
Dashboard Report

The Idea

Traditional clinics collect patient information on paper forms filled out in the waiting room — a slow, error-prone process that gives the doctor nothing useful until they walk into the room and start asking questions from scratch.

This system replaces that paper form with a QR code. The patient scans it while waiting, answers a few questions about their symptoms and medical history, and submits. By the time the doctor calls their name, the system has already analyzed that information using AI and prepared a structured pre-consultation report — in both Arabic and English — sitting in the doctor's dashboard.

The patient never sees the report. Their journey ends at a confirmation page after submitting. The intelligence happens in the background, for the doctor.


How It Works

  1. A QR code linked to the patient form is displayed in the clinic waiting area (printed poster, desk stand, screen, etc.)
  2. The patient scans the QR code on their phone, selects their doctor, and fills the form — entering their name, national ID, age, gender, chronic diseases, and current symptoms
  3. They can fill it manually, use the microphone to dictate their symptoms, or let the AI Voice Assistant guide them through the whole form via a natural voice conversation
  4. On submission, the patient is redirected to a success page — their role is done
  5. In the background, the system sends the data to the OpenAI API, which generates a structured medical pre-analysis in both Arabic and English
  6. The doctor logs into their portal, opens their dashboard, and reviews the AI-generated report before calling the patient in

Features

  • QR Code Access — no app or account needed; patients scan and go
  • Bilingual Interface — full Arabic and English support with RTL layout
  • AI Voice Assistant — guides patients through the form via a natural voice conversation using OpenAI Realtime API
  • Voice-to-Text Input — microphone button for dictating symptoms directly into the form
  • AI Symptom Analysis — structured medical pre-analysis generated in both Arabic and English per patient
  • Doctor Portal — secure login, dashboard with new and reviewed reports, and detailed report view
  • Admin Panel — manage doctors and system data

Tech Stack

Layer Technology
Framework Next.js 16 (App Router)
Language TypeScript
UI Tailwind CSS, shadcn/ui, Radix UI
Database PostgreSQL (Neon serverless)
ORM Drizzle ORM
AI OpenAI API (GPT + Realtime API)
Auth bcryptjs

Getting Started

1. Clone the repository

git clone https://github.com/Faisal-Alnasyan/graduation.git
cd graduation

2. Install dependencies

npm install

3. Set up environment variables

Create a .env.local file in the root:

DATABASE_URL=your_neon_postgres_connection_string
NEXT_PUBLIC_OPENAI_API_KEY=your_openai_api_key
OPENAI_API_KEY=your_openai_api_key

4. Push the database schema

npm run db:push

5. Run the development server

npm run dev

Open http://localhost:3000 in your browser.


Project Structure

app/
├── page.tsx              # Portal selection (Patient / Doctor)
├── patient/              # Patient pre-consultation form
├── doctor/               # Doctor login and dashboard
├── admin/                # Admin panel
├── api/                  # REST API routes (reports, doctors)
└── db/                   # Database schema and connection

Graduation Project — Computer Science Department