help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
healthcare-assistant-bot
RSK World
healthcare-assistant-bot
Healthcare Assistant Bot - Python + Flask + SQLite + PHP Dashboard + NLP + Medical Features
healthcare-assistant-bot
  • static
  • templates
  • .dockerignore83 B
  • .gitignore114 B
  • Dockerfile510 B
  • LICENSE1.1 KB
  • README.md4.1 KB
  • RELEASE_NOTES.md814 B
  • app.py4.8 KB
  • appointments.py456 B
  • database.py2.5 KB
  • image_prompts.txt1.7 KB
  • reminders.py409 B
  • requirements.txt54 B
  • symptoms.py897 B
database.py
database.py
Raw Download
Find: Go to:
#
# Project: Healthcare Assistant Bot
# Author: Molla Samser
# Author's Email: info@rskworld.com
# Author's Phone: +91 93305 39277
# Author's Website: https://rskworld.in
# Year: 2026
#

import sqlite3

def init_db():
    conn = sqlite3.connect('healthcare.db')
    c = conn.cursor()
    
    # Create appointments table
    c.execute('''
        CREATE TABLE IF NOT EXISTS appointments (
            id INTEGER PRIMARY KEY AUTOINCREMENT,
            date TEXT NOT NULL,
            time TEXT NOT NULL,
            description TEXT
        )
    ''')
    
    # Create reminders table
    c.execute('''
        CREATE TABLE IF NOT EXISTS reminders (
            id INTEGER PRIMARY KEY AUTOINCREMENT,
            medication TEXT NOT NULL,
            time TEXT NOT NULL
        )
    ''')
    
    # Create users table
    c.execute('''
        CREATE TABLE IF NOT EXISTS users (
            id INTEGER PRIMARY KEY AUTOINCREMENT,
            username TEXT NOT NULL UNIQUE,
            email TEXT NOT NULL UNIQUE,
            password TEXT NOT NULL,
            role TEXT DEFAULT 'user'
        )
    ''')
    
    conn.commit()
    conn.close()

def add_appointment(date, time, description):
    conn = sqlite3.connect('healthcare.db')
    c = conn.cursor()
    c.execute("INSERT INTO appointments (date, time, description) VALUES (?, ?, ?)", (date, time, description))
    conn.commit()
    conn.close()

def get_all_appointments():
    conn = sqlite3.connect('healthcare.db')
    c = conn.cursor()
    c.execute("SELECT * FROM appointments")
    appointments = c.fetchall()
    conn.close()
    return appointments

def add_reminder(medication, time):
    conn = sqlite3.connect('healthcare.db')
    c = conn.cursor()
    c.execute("INSERT INTO reminders (medication, time) VALUES (?, ?)", (medication, time))
    conn.commit()
    conn.close()

def get_all_reminders():
    conn = sqlite3.connect('healthcare.db')
    c = conn.cursor()
    c.execute("SELECT * FROM reminders")
    reminders = c.fetchall()
    conn.close()
    return reminders

def add_user(username, email, password, role='user'):
    conn = sqlite3.connect('healthcare.db')
    c = conn.cursor()
    c.execute("INSERT INTO users (username, email, password, role) VALUES (?, ?, ?, ?)", (username, email, password, role))
    conn.commit()
    conn.close()

def get_user_by_username(username):
    conn = sqlite3.connect('healthcare.db')
    c = conn.cursor()
    c.execute("SELECT * FROM users WHERE username = ?", (username,))
    user = c.fetchone()
    conn.close()
    return user


95 lines•2.5 KB
python

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer