Report
on
[QUIZ APP]
Datta Meghe College of Engineering, Airoli
Sr.No. Name Roll
No.
1. ROSHNI YADAV 49
2. SUJAL BIST 71
3. SAI KONDA 61
Mrs.Irin Solomon
(Practical guide)
2024-2025
Department of Artificial Intelligence and Data Science Engineering
Datta Meghe College of Engineering
(Affiliated to the University of Mumbai)
Aim:-
The aim of pharmacy management is to ensure the efficient,
safe, and cost-effective delivery of pharmaceutical services
while maintaining high-quality patient care. It involves
organizing, controlling, and overseeing all aspects of a
pharmacy's operations, including inventory management, staff
supervision, financial management, regulatory compliance, and
customer service.
Introduction:-
● Pharmacy management is the process of overseeing and
optimizing the operations of a pharmacy to ensure the
safe, efficient, and cost-effective distribution of
medications. It plays a vital role in healthcare by
ensuring that patients receive the right medications on
time while maintaining high standards of safety and
service.
● Effective pharmacy management involves various
aspects, including inventory control, regulatory
compliance, financial management, staff supervision,
and customer service. Proper management helps
prevent medication shortages, reduces errors, and
enhances overall efficiency.
● With advancements in technology, modern pharmacy
management systems integrate automation, digital
record-keeping, and artificial intelligence to streamline
operations and improve patient safety. Whether in a
hospital, retail, or online pharmacy, strong management
is essential for ensuring smooth operations and positive
health outcomes.
Software Used:- VS CODE
language Used:- PYTHON
Implementation:-
import tkinter as tk
from tkinter import ttk, messagebox
import mysql.connector
# Database connection
def connect_db():
try:
conn = mysql.connector.connect(
host="localhost",
user="root",
password="harekrishna",
database="pharmacy_db"
)
return conn
except mysql.connector.Error as e:
messagebox.showerror("Database Error", f"Error connecting to database: {e}")
return None
# Function to add a new medicine record
def add_medicine():
conn = connect_db()
if conn is None:
return
try:
cursor = conn.cursor()
cursor.execute("""
INSERT INTO medicines (reference_no, company_name, type_of_medicine, medicine_name,
lot_no, issue_date, exp_date, uses, side_effect, precaution_warning, price, quantity)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
""", (
ref_no.get(), company_name.get(), type_medicine.get(), med_name.get(), lot_no.get(),
issue_date.get(), exp_date.get(), uses.get(), side_effect.get(),
precaution.get(), price.get(), quantity.get()
))
conn.commit()
messagebox.showinfo("Success", "Medicine added successfully!")
show_all()
except mysql.connector.Error as e:
messagebox.showerror("Error", f"Failed to add record: {e}")
finally:
conn.close()
# Function to update an existing medicine record
def update_medicine():
conn = connect_db()
if conn is None:
return
try:
cursor = conn.cursor()
cursor.execute("""
UPDATE medicines
SET company_name=%s, type_of_medicine=%s, medicine_name=%s, lot_no=%s, issue_date=%s,
exp_date=%s, uses=%s, side_effect=%s, precaution_warning=%s, price=%s, quantity=%s
WHERE reference_no=%s
""", (
company_name.get(), type_medicine.get(), med_name.get(), lot_no.get(),
issue_date.get(), exp_date.get(), uses.get(), side_effect.get(),
precaution.get(), price.get(), quantity.get(), ref_no.get()
))
conn.commit()
messagebox.showinfo("Success", "Medicine updated successfully!")
show_all()
except mysql.connector.Error as e:
messagebox.showerror("Error", f"Failed to update record: {e}")
finally:
conn.close()
# Function to delete a medicine record
def delete_medicine():
conn = connect_db()
if conn is None:
return
try:
cursor = conn.cursor()
cursor.execute("DELETE FROM medicines WHERE reference_no=%s", (ref_no.get(),))
conn.commit()
messagebox.showinfo("Success", "Medicine deleted successfully!")
show_all()
except mysql.connector.Error as e:
messagebox.showerror("Error", f"Failed to delete record: {e}")
finally:
conn.close()
# Function to fetch and display all records
def show_all():
conn = connect_db()
if conn is None:
return
try:
cursor = conn.cursor()
cursor.execute("SELECT * FROM medicines")
rows = cursor.fetchall()
update_table(rows)
except mysql.connector.Error as e:
messagebox.showerror("Error", f"Failed to retrieve records: {e}")
finally:
conn.close()
# Function to update the treeview with data
def update_table(rows):
medicine_table.delete(*medicine_table.get_children())
for row in rows:
medicine_table.insert("", "end", values=row)
# GUI Setup
root = tk.Tk()
root.title("Pharmacy Management System")
root.geometry("1200x600")
# Variables
ref_no = tk.StringVar()
company_name = tk.StringVar()
type_medicine = tk.StringVar()
med_name = tk.StringVar()
lot_no = tk.StringVar()
issue_date = tk.StringVar()
exp_date = tk.StringVar()
uses = tk.StringVar()
side_effect = tk.StringVar()
precaution = tk.StringVar()
price = tk.StringVar()
quantity = tk.StringVar()
# Medicine Information Frame
frame1 = tk.LabelFrame(root, text="Medicine Information", font=("Arial", 12, "bold"))
frame1.place(x=20, y=20, width=750, height=300)
fields = [
("Reference No", ref_no), ("Company Name", company_name),
("Type of Medicine", type_medicine), ("Medicine Name", med_name),
("Lot No", lot_no), ("Issue Date", issue_date),
("Expiry Date", exp_date), ("Uses", uses),
("Side Effects", side_effect), ("Precaution Warning", precaution),
("Price", price), ("Quantity", quantity),
]
for i, (label, var) in enumerate(fields):
tk.Label(frame1, text=label + ":", font=("Arial", 10)).grid(row=i//2, column=(i%2)*2, padx=5, pady=5,
sticky='w')
tk.Entry(frame1, textvariable=var).grid(row=i//2, column=(i%2)*2 + 1, padx=5, pady=5)
# Buttons
frame2 = tk.Frame(root)
frame2.place(x=20, y=330, width=750, height=50)
tk.Button(frame2, text="Add", command=add_medicine, bg="green", fg="white", width=10).grid(row=0,
column=0, padx=5)
tk.Button(frame2, text="Update", command=update_medicine, bg="blue", fg="white",
width=10).grid(row=0, column=1, padx=5)
tk.Button(frame2, text="Delete", command=delete_medicine, bg="red", fg="white",
width=10).grid(row=0, column=2, padx=5)
tk.Button(frame2, text="Show All", command=show_all, bg="black", fg="white", width=10).grid(row=0,
column=3, padx=5)
# Table
columns = ("Ref No", "Company", "Type", "Name", "Lot No", "Issue Date", "Exp Date", "Uses", "Side
Effect", "Precaution", "Price", "Qty")
medicine_table = ttk.Treeview(root, columns=columns, show="headings")
medicine_table.place(x=20, y=400, width=1150, height=180)
for col in columns:
medicine_table.heading(col, text=col)
medicine_table.column(col, width=90)
# Initialize with existing data
show_all()
root.mainloop()
Output:-
Conclusion:-
● Pharmacy management is a crucial aspect of the
healthcare system, ensuring the safe, efficient, and
cost-effective delivery of medications. It involves
various functions, such as inventory control,
regulatory compliance, financial planning, and
patient care, all of which contribute to a well-
organized and effective pharmacy.
● With advancements in technology and evolving
healthcare needs, pharmacy management
continues to adapt, incorporating digital
systems and automation to enhance efficiency
and reduce errors. A well-managed pharmacy
not only improves business operations but also
plays a significant role in promoting better
health outcomes for patients.
● By focusing on efficiency, compliance, and
patient-centered care, pharmacy management
helps maintain a balance between providing
quality services and achieving financial
sustainability, making it a vital component of
modern healthcare.
R1 R2 R3 Total Signature
(4 marks) (4 marks) (2 mark) (10 marks)