0% found this document useful (0 votes)
12 views34 pages

Medical Management System Project

Uploaded by

pagaredeepraj05
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views34 pages

Medical Management System Project

Uploaded by

pagaredeepraj05
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

‭COMPUTER SCIENCE PROJECT‬

‭2024-25‬

‭MEDICAL MANAGEMENT SYSTEM‬


‭NAME-‬‭JIGNESH PAGARE‬
‭CLASS-‬‭XII‬
‭STREAM-‬‭SCIENCE‬
‭SUBJECT-‬‭COMPUTER SCIENCE(083)‬
‭REGISTRATION NO.-‬
‭BOARD ROLL NO.-‬
‭TOPIC-‬‭MEDICAL MANAGEMENT‬
‭SYSTEM‬
‭NERUL, NAVI MUMBAI‬

‭CERTIFICATE‬
‭This‬ ‭is‬ ‭to‬ ‭certify‬ ‭that‬ ‭this‬ ‭computer‬ ‭project‬ ‭”Medical‬ ‭Management‬ ‭System”‬ ‭has‬
‭been‬ ‭completed‬ ‭by‬ ‭‘Mr‬ ‭Jignesh‬‭Pagare’‬‭of‬‭class‬‭XII‬‭Science‬‭in‬‭partial‬‭fulfillment‬
‭of‬ ‭the‬ ‭curriculum‬ ‭of‬ ‭the‬ ‭Central‬ ‭Board‬ ‭of‬ ‭Secondary‬ ‭Education‬ ‭leading‬ ‭to‬ ‭the‬
‭award of All India Senior School Certificate for the year 2020-21.‬

‭Registration No. :‬
‭Board Roll No:‬

‭_____________________ _____________________‬
‭External Examiner Internal Examiner‬
‭Date: Date:‬

‭_____________________ _____________________‬
‭School Seal Principal‬
‭DECLARATION‬

‭I‬ ‭hereby‬ ‭declare‬ ‭that‬ ‭the‬ ‭project‬ ‭entitled‬ ‭“Medical‬ ‭Management‬ ‭System”‬ ‭has‬ ‭been‬
‭submitted‬ ‭to‬ ‭“Tilak‬ ‭Public‬ ‭School”‬ ‭for‬ ‭subject‬ ‭computer‬ ‭science‬ ‭under‬ ‭the‬‭guidance‬‭of‬
‭Mrs.‬‭Reshmi‬‭Krishnan‬‭is‬‭a‬‭record‬‭of‬‭original‬‭done‬‭by‬‭us‬‭and‬‭there‬‭is‬‭no‬‭copy‬‭or‬‭project‬
‭related to it has been submitted to any other school or educational institute by us.‬
‭ACKNOWLEDGEMENT‬

‭I‬ ‭would‬ ‭like‬ ‭to‬ ‭express‬ ‭my‬ ‭heartfelt‬‭gratitude‬‭to‬‭my‬‭teacher,‬‭Mrs.‬‭Reshmi‬‭Krishnan,‬‭for‬


‭her‬ ‭invaluable‬ ‭guidance,‬ ‭encouragement,‬ ‭and‬ ‭support‬ ‭throughout‬ ‭the‬ ‭course‬ ‭of‬ ‭this‬
‭project.‬ ‭Her‬ ‭insights‬ ‭and‬ ‭motivation‬ ‭have‬ ‭been‬ ‭pivotal‬ ‭in‬ ‭bringing‬ ‭this‬ ‭project‬ ‭to‬
‭completion.‬

‭My‬‭sincere‬‭thanks‬‭also‬‭go‬‭to‬‭our‬‭esteemed‬‭principal,‬‭Mrs.‬‭Prabhavathy‬‭Ajith‬‭Kumar,‬‭for‬
‭providing the opportunity and resources necessary to undertake this meaningful project.‬

‭I‬‭extend‬‭my‬‭deepest‬‭appreciation‬‭to‬‭my‬‭parents‬‭for‬‭their‬‭unwavering‬‭support‬‭and‬‭to‬‭my‬
‭project‬‭partner,‬‭Aryan‬‭Salunke,‬‭for‬‭her‬‭dedication,‬‭cooperation,‬‭and‬‭collaborative‬‭efforts,‬
‭which were instrumental in finalizing this project within the given time frame.‬

‭Lastly,‬ ‭I‬ ‭am‬ ‭grateful‬ ‭to‬ ‭CBSE‬ ‭for‬ ‭incorporating‬ ‭such‬ ‭enriching‬ ‭opportunities‬ ‭into‬ ‭our‬
‭academic‬‭curriculum‬‭and‬‭to‬‭my‬‭teacher‬‭for‬‭pairing‬‭me‬‭with‬‭such‬‭an‬‭excellent‬‭partner‬‭for‬
‭this endeavor.‬
‭INDEX‬

‭[Link]‬ ‭Topic‬ ‭Page no.‬

‭1‬ ‭Hardware and Software Used‬ ‭7‬

‭2‬ ‭Introduction to Python and MySQL‬ ‭8‬

‭3‬ ‭Introduction‬ ‭12‬

‭4‬ ‭Flowchart‬ ‭14‬

‭5‬ ‭File Structure‬ ‭15‬

‭7‬ ‭List of Functions‬ ‭16‬

‭8‬ ‭Source Code‬ ‭17‬

‭9‬ ‭Output‬ ‭24‬

‭10‬ ‭Limitations and Improvements‬ ‭32‬

‭11‬ ‭Conclusion‬ ‭33‬

‭12‬ ‭Bibliography‬ ‭34‬


‭HARDWARE AND SOFTWARE USED‬

‭Hardware:-‬
‭●‬ ‭Asus Rog G15‬
‭●‬ ‭Ram- 8GB‬
‭●‬ ‭Processor- Ryzen 7 (8 cores)‬

‭Software:-‬
‭●‬ ‭Python‬
‭●‬ ‭Windows 11‬
‭●‬ ‭MySQL‬
‭●‬ ‭Streamlit‬
‭INTRODUCTION TO PYTHON‬
‭ ython‬ ‭is‬ ‭a‬ ‭high-level,‬ ‭interpreted,‬ ‭and‬ ‭general-purpose‬ ‭programming‬ ‭language‬ ‭that‬
P
‭emphasizes‬‭readability‬‭and‬‭simplicity.‬‭It‬‭was‬‭developed‬‭by‬‭Guido‬‭van‬‭Rossum‬‭and‬‭first‬
‭released‬ ‭in‬ ‭1991.‬ ‭Python’s‬ ‭design‬ ‭philosophy‬ ‭focuses‬ ‭on‬ ‭code‬ ‭readability,‬ ‭using‬
‭significant‬ ‭indentation‬ ‭and‬ ‭a‬ ‭straightforward‬ ‭syntax‬ ‭that‬ ‭reduces‬ ‭the‬ ‭cost‬ ‭of‬ ‭program‬
‭maintenance.‬

‭ ython‬ ‭is‬ ‭often‬ ‭described‬ ‭as‬ ‭a‬ ‭"batteries-included"‬ ‭language‬ ‭because‬ ‭of‬ ‭its‬
P
‭comprehensive‬ ‭standard‬ ‭library,‬ ‭which‬ ‭provides‬‭tools‬‭suited‬‭for‬‭a‬‭variety‬‭of‬‭tasks,‬‭from‬
‭web‬‭development‬‭to‬‭data‬‭science.‬‭It‬‭is‬‭an‬‭ideal‬‭choice‬‭for‬‭beginners‬‭due‬‭to‬‭its‬‭simplicity‬
‭and a rich set of features, while still being powerful enough for professional developers.‬

‭Key Features of Python‬

‭●‬ R‭ eadable:‬ ‭Python's‬ ‭syntax‬ ‭is‬ ‭easy‬ ‭for‬ ‭both‬ ‭programmers‬ ‭and‬ ‭machines‬ ‭to‬
‭understand.‬
‭●‬ E‭ asy‬ ‭to‬ ‭Learn:‬ ‭Being‬ ‭a‬ ‭high-level‬ ‭language,‬‭it‬‭simplifies‬‭complex‬‭programming‬
‭tasks.‬
‭●‬ C‭ ross-Platform‬‭Compatibility‬‭:‬‭Python‬‭can‬‭run‬‭seamlessly‬‭on‬‭various‬‭operating‬
‭systems like macOS, Linux, and Windows.‬
‭●‬ O‭ pen‬ ‭Source:‬ ‭Its‬ ‭source‬ ‭code‬ ‭is‬ ‭freely‬ ‭available,‬ ‭making‬ ‭it‬ ‭accessible‬ ‭to‬
‭everyone.‬
‭●‬ E‭ xtensive‬ ‭Standard‬ ‭Library:‬ ‭Comes‬ ‭with‬ ‭a‬‭vast‬‭collection‬‭of‬‭pre-built‬‭modules‬
‭and libraries.‬
‭●‬ ‭Free of Cost:‬‭Python is completely free to use and distribute.‬
‭●‬ ‭Supports Exception Handling:‬‭Enables robust error handling in applications.‬
‭●‬ ‭Advanced Features:‬‭Includes powerful tools such as generators and decorators.‬
‭●‬ A‭ utomatic‬ ‭Memory‬ ‭Management:‬ ‭Python‬ ‭handles‬ ‭memory‬ ‭allocation‬ ‭and‬
‭garbage collection automatically.‬

‭Applications of Python‬

‭●‬ W‭ eb‬ ‭Development:‬ ‭Frameworks‬ ‭like‬ ‭Django‬ ‭and‬ ‭Flask‬ ‭simplify‬ ‭building‬ ‭web‬
‭applications.‬
‭●‬ ‭Machine Learning:‬‭Widely used in creating intelligent systems and models.‬
‭●‬ ‭Data Analysis:‬‭A favorite for data processing and visualization.‬
‭●‬ ‭Scripting:‬‭Ideal for automating repetitive tasks.‬
‭●‬ ‭Game Development:‬‭Used in designing and developing games.‬
‭●‬ ‭Embedded Applications:‬‭Python can power applications in embedded systems.‬
‭●‬ ‭Desktop Applications:‬‭Suitable for creating GUI-based desktop software.‬
‭INTRODUCTION TO MYSQL‬
‭ ySQL‬‭is‬‭a‬‭popular,‬‭open-source‬‭Relational‬‭Database‬‭Management‬‭System‬‭(RDBMS).‬
M
‭It‬ ‭is‬ ‭widely‬ ‭used‬ ‭for‬ ‭storing,‬ ‭managing,‬ ‭and‬ ‭retrieving‬ ‭data‬ ‭in‬ ‭structured‬ ‭formats.‬
‭Originally‬ ‭developed‬ ‭by‬ ‭MySQL‬ ‭AB‬ ‭in‬ ‭1995‬ ‭and‬ ‭later‬ ‭acquired‬ ‭by‬‭Oracle‬‭Corporation,‬
‭MySQL is known for its speed, reliability, and ease of use.‬

‭ ySQL‬ ‭is‬ ‭based‬ ‭on‬ ‭the‬ ‭Structured‬ ‭Query‬ ‭Language‬ ‭(SQL),‬ ‭which‬ ‭is‬ ‭the‬ ‭standard‬
M
‭language‬‭for‬‭interacting‬‭with‬‭relational‬‭databases.‬‭It‬‭supports‬‭a‬‭wide‬‭range‬‭of‬‭operating‬
‭systems,‬ ‭including‬ ‭Windows,‬ ‭macOS,‬ ‭and‬ ‭Linux,‬ ‭making‬ ‭it‬ ‭a‬ ‭versatile‬ ‭choice‬ ‭for‬
‭developers.‬

‭Key Features of Python‬

‭●‬ O‭ pen-Source:‬‭Freely‬‭available‬‭under‬‭the‬‭GNU‬‭General‬‭Public‬‭License,‬‭with‬‭paid‬
‭versions offering additional features.‬
‭●‬ H‭ igh‬ ‭Performance:‬ ‭Optimized‬ ‭for‬ ‭quick‬ ‭data‬ ‭retrieval,‬ ‭making‬ ‭it‬ ‭ideal‬ ‭for‬
‭high-traffic applications.‬
‭●‬ C‭ ross-Platform:‬ ‭Compatible‬ ‭with‬ ‭multiple‬ ‭operating‬ ‭systems‬ ‭and‬ ‭programming‬
‭languages like Python, PHP, Java, and more.‬
‭●‬ S‭ ecurity:‬ ‭Provides‬ ‭robust‬ ‭data‬ ‭protection‬ ‭through‬ ‭user‬ ‭authentication,‬
‭encryption, and access control.‬
‭●‬ S‭ calability:‬ ‭Supports‬ ‭small-scale‬ ‭applications‬ ‭as‬ ‭well‬ ‭as‬ ‭large-scale‬ ‭enterprise‬
‭systems.‬
‭●‬ ‭Data‬ ‭Integrity:‬ ‭Implements‬ ‭ACID‬ ‭(Atomicity,‬ ‭Consistency,‬ ‭Isolation,‬ ‭Durability)‬
‭compliance to ensure reliable transactions.‬
‭●‬ R‭ eplication‬ ‭and‬ ‭Clustering:‬ ‭Enables‬ ‭data‬ ‭distribution‬ ‭across‬ ‭multiple‬ ‭systems‬
‭for backup, performance, and disaster recovery.‬
‭●‬ S‭ upport‬ ‭for‬ ‭Multiple‬ ‭Storage‬ ‭Engines:‬ ‭Offers‬ ‭flexibility‬ ‭with‬ ‭storage‬ ‭engines‬
‭like InnoDB, MyISAM, etc.‬

‭Applications of Python‬

‭●‬ W‭ eb‬ ‭Development:‬ ‭Often‬ ‭used‬ ‭with‬ ‭PHP‬ ‭and‬ ‭frameworks‬ ‭like‬ ‭WordPress,‬
‭Joomla, and Drupal to power dynamic websites.‬
‭●‬ D‭ ata‬ ‭Warehousing:‬ ‭Handles‬ ‭large‬ ‭volumes‬ ‭of‬‭structured‬‭data‬‭for‬‭reporting‬‭and‬
‭analysis.‬
‭●‬ E‭ -commerce:‬ ‭Manages‬ ‭product‬ ‭catalogs,‬ ‭transactions,‬ ‭and‬ ‭user‬ ‭information‬ ‭in‬
‭online stores.‬
‭●‬ E‭ nterprise‬‭Applications:‬‭Powers‬‭CRM‬‭systems,‬‭ERP‬‭tools,‬‭and‬‭other‬‭business‬
‭software.‬
‭●‬ C‭ loud‬ ‭Computing:‬ ‭Frequently‬ ‭integrated‬ ‭into‬ ‭cloud-based‬ ‭services‬ ‭like‬ ‭AWS,‬
‭Azure, and Google Cloud.‬
‭●‬ D‭ ata-Driven‬ ‭Applications:‬ ‭Used‬ ‭in‬ ‭analytics,‬ ‭financial‬ ‭systems,‬ ‭and‬ ‭big‬ ‭data‬
‭platforms.‬
‭INTRODUCTION TO PROJECT‬
‭ he‬ ‭Online‬ ‭Medical‬ ‭Management‬ ‭System‬ ‭is‬ ‭a‬ ‭comprehensive‬ ‭web‬ ‭application‬
T
‭developed‬‭using‬‭Python,‬‭MySQL,‬‭and‬‭Streamlit.‬‭It‬‭is‬‭designed‬‭to‬‭streamline‬‭the‬‭process‬
‭of‬ ‭purchasing‬ ‭medicines‬ ‭online‬ ‭while‬ ‭offering‬ ‭robust‬ ‭inventory‬ ‭management‬ ‭for‬
‭administrators.‬ ‭This‬ ‭system‬ ‭aims‬ ‭to‬ ‭provide‬ ‭an‬ ‭efficient‬ ‭and‬ ‭user-friendly‬ ‭platform‬ ‭for‬
‭both‬ ‭users‬ ‭and‬ ‭admins,‬ ‭enabling‬ ‭seamless‬ ‭transactions‬ ‭and‬ ‭management‬ ‭of‬
‭medicine-related activities.‬

‭ or‬‭users,‬‭the‬‭system‬‭provides‬‭an‬‭easy‬‭registration‬‭and‬‭login‬‭process.‬‭Registered‬‭users‬
F
‭can‬ ‭browse‬ ‭a‬ ‭wide‬ ‭range‬ ‭of‬ ‭medicines,‬ ‭search‬ ‭for‬ ‭specific‬ ‭items,‬ ‭and‬ ‭place‬ ‭orders.‬
‭Once‬ ‭an‬ ‭order‬ ‭is‬ ‭placed,‬‭users‬‭are‬‭guided‬‭through‬‭a‬‭secure‬‭online‬‭payment‬‭system‬‭to‬
‭complete‬ ‭their‬ ‭purchase.‬ ‭After‬ ‭successful‬ ‭payment,‬‭the‬‭system‬‭displays‬‭a‬‭confirmation‬
‭message‬ ‭and‬ ‭sends‬ ‭order‬ ‭details‬‭to‬‭the‬‭user‬‭via‬‭email‬‭or‬‭SMS.‬‭Additionally,‬‭users‬‭can‬
‭view‬ ‭their‬ ‭order‬ ‭history‬ ‭for‬ ‭future‬ ‭reference‬ ‭and‬ ‭can‬ ‭cancel‬ ‭orders‬ ‭if‬ ‭needed,‬ ‭with‬ ‭a‬
‭refund‬ ‭processed‬ ‭accordingly.‬ ‭The‬ ‭system‬ ‭ensures‬ ‭convenience‬ ‭and‬ ‭accessibility,‬
‭allowing users to buy medicines anytime and anywhere.‬

‭ rom‬‭the‬‭admin's‬‭perspective,‬‭the‬‭system‬‭offers‬‭a‬‭dedicated‬‭interface‬‭for‬‭managing‬‭the‬
F
‭medicine‬ ‭inventory.‬ ‭Admins‬ ‭can‬ ‭add‬ ‭new‬ ‭medicines‬ ‭to‬ ‭the‬ ‭system,‬ ‭update‬ ‭prices‬ ‭and‬
‭stock‬ ‭availability,‬ ‭or‬ ‭remove‬ ‭outdated‬ ‭or‬ ‭unavailable‬ ‭items.‬ ‭This‬ ‭functionality‬ ‭ensures‬
‭that‬‭the‬‭inventory‬‭remains‬‭accurate‬‭and‬‭up-to-date.‬‭Admins‬‭can‬‭also‬‭view‬‭and‬‭manage‬
‭user‬ ‭orders,‬ ‭providing‬ ‭efficient‬ ‭processing‬ ‭and‬ ‭handling‬ ‭of‬ ‭purchase‬ ‭requests.‬ ‭The‬
‭system's‬ ‭integration‬ ‭with‬ ‭MySQL‬ ‭ensures‬ ‭data‬ ‭consistency‬ ‭and‬ ‭reliability,‬ ‭while‬
‭Streamlit’s interactive interface makes inventory management intuitive.‬

‭ ne‬‭of‬‭the‬‭standout‬‭features‬‭of‬‭the‬‭system‬‭is‬‭its‬‭notification‬‭functionality.‬‭Users‬‭are‬‭kept‬
O
‭informed‬‭about‬‭their‬‭orders‬‭through‬‭notifications‬‭sent‬‭to‬‭their‬‭registered‬‭email‬‭addresses‬
‭or‬ ‭phone‬ ‭numbers.‬ ‭This‬ ‭adds‬ ‭a‬ ‭layer‬ ‭of‬ ‭transparency‬ ‭and‬ ‭trust,‬ ‭ensuring‬ ‭users‬ ‭have‬
‭real-time‬ ‭updates‬ ‭about‬ ‭their‬ ‭purchase‬ ‭status.‬ ‭The‬ ‭system‬ ‭also‬ ‭emphasizes‬ ‭secure‬
‭transactions, with payment information handled carefully to protect user data.‬

‭Advantages‬

‭1. User Convenience:‬

‭●‬ ‭Users can browse and buy medicines anytime and anywhere.‬

‭2. Streamlined Inventory Management:‬

‭●‬ ‭Admins can easily manage the stock and ensure availability of medicines.‬

‭3. Ease of Access:‬


‭●‬ ‭The system provides a simple and intuitive interface for both users and admins.‬

‭4. Order Management:‬

‭●‬ ‭Users can track and cancel their orders, ensuring flexibility and trust.‬
‭FLOWCHART‬
‭FILE STRUCTURE‬

‭Modules Used:‬
‭●‬ S
‭ treamlit:‬‭Streamlit is an open-source Python library that makes it easy to build‬
‭and share beautiful, custom web apps for machine learning and data science.‬
‭With Streamlit, you can create interactive web-based user interfaces quickly‬
‭without needing extensive frontend knowledge.‬

‭●‬ S
‭ QLite:‬‭SQLite is a lightweight and self-contained database engine that is built‬
‭into Python. It is used as the backend in this project to store and manage data‬
‭such as user credentials, drug information, and order details. SQLite is ideal for‬
‭small-scale applications as it requires no setup and provides efficient data‬
‭handling.‬

‭●‬ P
‭ illow (PIL):‬‭Pillow is a Python Imaging Library (PIL) fork that is free and open‬
‭source. It adds support for opening, manipulating, and saving various image file‬
‭formats. In this project, Pillow is used to display and process images of medicines‬
‭and other relevant visuals.‬
‭LIST OF FUNCTIONS‬

‭get_authenticate()‬ ‭ o validate the username and password‬


T
‭for user login.‬

‭customer_add_data()‬ ‭ dds details of a new user to the‬


A
‭database during signup.‬

‭customer()‬ ‭ andles the functionality for logged-in‬


H
‭users, including viewing and purchasing‬
‭medicines.‬

‭admin()‬ ‭ llows the admin to manage the‬


A
‭database, including adding, updating, and‬
‭deleting medicines, as well as viewing‬
‭customer orders.‬

‭cust_create_table()‬ ‭ reates the Customers table in the‬


C
‭database to store user information such‬
‭as name, password, email, state, and‬
‭phone number.‬

‭order_add_data()‬ ‭ dds order details to the Orders table‬


A
‭after the user places an order.‬

‭drug_create_table()‬ ‭ reates the Drugs table in the database‬


C
‭to store medicine information, such as‬
‭name, expiry date, usage, quantity, and‬
‭ID.‬

‭drug_add_data()‬ ‭ llows the admin to add new medicines to‬


A
‭the inventory.‬

‭drug_update()‬ ‭ pdates details of a specific medicine in‬


U
‭the inventory, such as usage or stock.‬

‭drug_delete()‬ ‭ eletes a specific medicine from the‬


D
‭inventory.‬

‭order_view_data()‬ ‭ isplays all orders placed by a specific‬


D
‭user.‬

‭order_view_all_data()‬ ‭ isplays all orders in the system (admin‬


D
‭functionality).‬
‭SOURCE CODE‬
i‭mport streamlit as st‬
‭import pandas as pd‬
‭from PIL import Image‬
‭#from drug_db import *‬
‭import random‬

‭ # SQL DATABASE CODE‬


#
‭import sqlite3‬

‭ onn = [Link]("drug_data.db",check_same_thread=False)‬
c
‭c = [Link]()‬

‭def cust_create_table():‬
‭[Link]('''CREATE TABLE IF NOT EXISTS Customers(‬
‭C_Name VARCHAR(50) NOT NULL,‬
‭C_Password VARCHAR(50) NOT NULL,‬
‭C_Email VARCHAR(50) PRIMARY KEY NOT NULL,‬
‭C_State VARCHAR(50) NOT NULL,‬
‭C_Number VARCHAR(50) NOT NULL‬
‭)''')‬
‭print('Customer Table create Successfully')‬

‭def customer_add_data(Cname,Cpass, Cemail, Cstate,Cnumber):‬


‭[Link]('''INSERT INTO Customers (C_Name,C_Password,C_Email, C_State,‬
‭C_Number) VALUES(?,?,?,?,?)''', (Cname,Cpass, Cemail, Cstate,Cnumber))‬
‭[Link]()‬

‭def customer_view_all_data():‬
‭[Link]('SELECT * FROM Customers')‬
‭customer_data = [Link]()‬
‭return customer_data‬
‭def customer_update(Cemail,Cnumber):‬
‭[Link](''' UPDATE Customers SET C_Number = ? WHERE C_Email = ?''',‬
‭(Cnumber,Cemail,))‬
‭[Link]()‬
‭print("Updating")‬
‭def customer_delete(Cemail):‬
‭[Link](''' DELETE FROM Customers WHERE C_Email = ?''', (Cemail,))‬
‭[Link]()‬

‭def drug_update(Duse, Did):‬


‭[Link](''' UPDATE Drugs SET D_Use = ? WHERE D_id = ?''', (Duse,Did))‬
‭[Link]()‬
‭def drug_delete(Did):‬
‭ .execute(''' DELETE FROM Drugs WHERE D_id = ?''', (Did,))‬
c
‭[Link]()‬

‭def drug_create_table():‬
‭[Link]('''CREATE TABLE IF NOT EXISTS Drugs(‬
‭D_Name VARCHAR(50) NOT NULL,‬
‭D_ExpDate DATE NOT NULL,‬
‭D_Use VARCHAR(50) NOT NULL,‬
‭D_Qty INT NOT NULL,‬
‭D_id INT PRIMARY KEY NOT NULL)‬
‭''')‬
‭print('DRUG Table create Successfully')‬

‭def drug_add_data(Dname, Dexpdate, Duse, Dqty, Did):‬


‭[Link]('''INSERT INTO Drugs (D_Name, D_Expdate, D_Use, D_Qty, D_id)‬
‭VALUES(?,?,?,?,?)''', (Dname, Dexpdate, Duse, Dqty, Did))‬
‭[Link]()‬

‭def drug_view_all_data():‬
‭[Link]('SELECT * FROM Drugs')‬
‭drug_data = [Link]()‬
‭return drug_data‬

‭def order_create_table():‬
‭[Link]('''‬
‭CREATE TABLE IF NOT EXISTS Orders(‬
‭O_Name VARCHAR(100) NOT NULL,‬
‭O_Items VARCHAR(100) NOT NULL,‬
‭O_Qty VARCHAR(100) NOT NULL,‬
‭O_id VARCHAR(100) PRIMARY KEY NOT NULL)‬
‭''')‬

‭def order_delete(Oid):‬
‭[Link](''' DELETE FROM Orders WHERE O_id = ?''', (Oid,))‬

‭def order_add_data(O_Name,O_Items,O_Qty,O_id):‬
‭[Link]('''INSERT INTO Orders (O_Name, O_Items,O_Qty, O_id)‬
‭VALUES(?,?,?,?)''',‬
‭(O_Name,O_Items,O_Qty,O_id))‬
‭[Link]()‬

‭def order_view_data(customername):‬
‭[Link]('SELECT * FROM ORDERS Where O_Name == ?',(customername,))‬
‭order_data = [Link]()‬
‭return order_data‬

‭def order_view_all_data():‬
‭[Link]('SELECT * FROM ORDERS')‬
‭order_all_data = [Link]()‬
‭return order_all_data‬
‭def admin():‬

‭ [Link]("Pharmacy Database Dashboard")‬


s
‭menu = ["Drugs", "Customers", "Orders", "About"]‬
‭choice = [Link]("Menu", menu)‬

‭ # DRUGS‬
#
‭if choice == "Drugs":‬

‭ enu = ["Add", "View", "Update", "Delete"]‬


m
‭choice = [Link]("Menu", menu)‬
‭if choice == "Add":‬

‭[Link]("Add Drugs")‬

‭col1, col2 = [Link](2)‬

‭with col1:‬
‭drug_name = st.text_area("Enter the Drug Name")‬
‭drug_expiry = st.date_input("Expiry Date of Drug (YYYY-MM-DD)")‬
‭drug_mainuse = st.text_area("When to Use")‬
‭with col2:‬
‭drug_quantity = st.text_area("Enter the quantity")‬
‭drug_id = st.text_area("Enter the Drug id (example:#D1)")‬

‭if [Link]("Add Drug"):‬


‭drug_add_data(drug_name,drug_expiry,drug_mainuse,drug_quantity,drug_id)‬
‭[Link]("Successfully Added Data")‬
‭if choice == "View":‬
‭[Link]("Drug Details")‬
‭drug_result = drug_view_all_data()‬
‭#[Link](drug_result)‬
‭with [Link]("View All Drug Data"):‬
‭drug_clean_df = [Link](drug_result, columns=["Name", "Expiry Date",‬
‭"Use", "Quantity", "ID"])‬
‭[Link](drug_clean_df)‬
‭with [Link]("View Drug Quantity"):‬
‭drug_name_quantity_df = drug_clean_df[['Name','Quantity']]‬
‭#drug_name_quantity_df = drug_name_quantity_df.reset_index()‬
‭[Link](drug_name_quantity_df)‬
‭if choice == 'Update':‬
‭[Link]("Update Drug Details")‬
‭d_id = st.text_area("Drug ID")‬
‭d_use = st.text_area("Drug Use")‬
‭if [Link](label='Update'):‬
‭drug_update(d_use,d_id)‬

‭if choice == 'Delete':‬


‭[Link]("Delete Drugs")‬
‭did = st.text_area("Drug ID")‬
‭if [Link](label="Delete"):‬
‭drug_delete(did)‬

‭ # CUSTOMERS‬
#
‭elif choice == "Customers":‬

‭ enu = ["View", "Update", "Delete"]‬


m
‭choice = [Link]("Menu", menu)‬
‭if choice == "View":‬
‭[Link]("Customer Details")‬
‭cust_result = customer_view_all_data()‬
‭#[Link](cust_result)‬
‭with [Link]("View All Customer Data"):‬
‭cust_clean_df = [Link](cust_result, columns=["Name",‬
‭"Password","Email-ID" ,"Area", "Number"])‬
‭[Link](cust_clean_df)‬

‭if choice == 'Update':‬


‭[Link]("Update Customer Details")‬
‭cust_email = st.text_area("Email")‬
‭cust_number = st.text_area("Phone Number")‬
‭if [Link](label='Update'):‬
‭customer_update(cust_email,cust_number)‬

‭if choice == 'Delete':‬


‭[Link]("Delete Customer")‬
‭cust_email = st.text_area("Email")‬
‭if [Link](label="Delete"):‬
‭customer_delete(cust_email)‬

‭elif choice == "Orders":‬

‭ enu = ["View"]‬
m
‭choice = [Link]("Menu", menu)‬
‭if choice == "View":‬
‭[Link]("Order Details")‬
‭order_result = order_view_all_data()‬
‭#[Link](cust_result)‬
‭with [Link]("View All Order Data"):‬
‭order_clean_df = [Link](order_result, columns=["Name", "Items","Qty"‬
‭,"ID"])‬
‭[Link](order_clean_df)‬
‭elif choice == "About":‬
‭[Link]("DBMS Mini Project")‬
‭[Link]("By Aditi (226), Anweasha (235) & Vijay (239)")‬

‭def getauthenicate(username, password):‬


‭#print("Auth")‬
‭[Link]('SELECT C_Password FROM Customers WHERE C_Name = ?',‬
‭(username,))‬
‭ ust_password = [Link]()‬
c
‭#print(cust_password[0][0], "Outside password")‬
‭#print(password, "Parameter password")‬
‭if cust_password[0][0] == password:‬
‭#print("Inside password")‬
‭return True‬
‭else:‬
‭return False‬

‭def customer(username, password):‬


‭if getauthenicate(username, password):‬
‭# Add background image using custom CSS‬
‭background_image_url = ""‬

‭[Link](‬
‭f"""‬
‭<style>‬
‭.stApp {{‬
‭background-image: url("{background_image_url}");‬
‭background-size: cover;‬
‭background-position: center;‬
‭background-repeat: no-repeat;‬
‭}}‬
‭</style>‬
‭""",‬
‭unsafe_allow_html=True‬
‭)‬
‭print("In Customer")‬
‭[Link]("Welcome to Pharmacy Store")‬

‭ [Link]("Your Order Details")‬


s
‭order_result = order_view_data(username)‬
‭# [Link](cust_result)‬
‭with [Link]("View All Order Data"):‬
‭order_clean_df = [Link](order_result, columns=["Name", "Items", "Qty",‬
‭"ID"])‬
‭[Link](order_clean_df)‬

‭ rug_result = drug_view_all_data()‬
d
‭print(drug_result)‬

‭ [Link]("Drug: "+drug_result[0][0])‬
s
‭img = [Link]('images/[Link]')‬
‭[Link](img, width=100, caption="Rs. 15/-")‬
‭dolo650 = [Link](label="Quantity",min_value=0, max_value=5, key= 1)‬
‭[Link]("When to USE: " + str(drug_result[0][2]))‬

‭[Link]("Drug: " + drug_result[1][0])‬


i‭mg = [Link]('images/[Link]')‬
‭[Link](img, width=100 , caption="Rs. 10/-")‬
‭strepsils = [Link](label="Quantity",min_value=0, max_value=5, key= 2)‬
‭[Link]("When to USE: " + str(drug_result[1][2]))‬

‭ [Link]("Drug: " + drug_result[2][0])‬


s
‭img = [Link]('images/[Link]')‬
‭[Link](img, width=100, caption="Rs. 65/-")‬
‭vicks = [Link](label="Quantity",min_value=0, max_value=5, key=3)‬
‭[Link]("When to USE: " + str(drug_result[2][2]))‬

‭if [Link](label="Buy now"):‬


‭O_items = ""‬

‭if int(dolo650) > 0:‬


‭O_items += "Dolo-650,"‬
‭if int(strepsils) > 0:‬
‭O_items += "Strepsils,"‬
‭if int(vicks) > 0:‬
‭O_items += "Vicks"‬
‭O_Qty = str(dolo650)+str(',') + str(strepsils) + str(",") + str(vicks)‬

‭ _id = username + "#O" + str([Link](0,1000000))‬


O
‭#order_add_data(O_Name, O_Items,O_Qty, O_id):‬
‭order_add_data(username, O_items, O_Qty, O_id)‬

‭if __name__ == '__main__':‬


‭drug_create_table()‬
‭cust_create_table()‬
‭order_create_table()‬

‭ enu = ["Login", "SignUp","Admin"]‬


m
‭choice = [Link]("Menu", menu)‬
‭if choice == "Login":‬
‭# Add background image using custom CSS‬
‭background_image_url = "[Link]

‭[Link](‬
‭f"""‬
‭<style>‬
‭.stApp {{‬
‭background-image: url("{background_image_url}");‬
‭background-size: cover;‬
‭background-position: center;‬
‭background-repeat: no-repeat;‬
‭}}‬
‭</style>‬
‭""",‬
‭unsafe_allow_html=True‬
)‭ ‬
‭username = [Link].text_input("User Name")‬
‭password = [Link].text_input("Password", type='password')‬
‭if [Link](label="Login"):‬
‭customer(username, password)‬

‭elif choice == "SignUp":‬


‭[Link]("Create New Account")‬
‭cust_name = st.text_input("Name")‬
‭cust_password = st.text_input("Password", type='password', key=1000)‬
‭cust_password1 = st.text_input("Confirm Password", type='password', key=1001)‬
‭col1, col2, col3 = [Link](3)‬

‭with col1:‬
‭cust_email = st.text_area("Email ID")‬
‭with col2:‬
‭cust_area = st.text_area("State")‬
‭with col3:‬
‭cust_number = st.text_area("Phone Number")‬

‭if [Link]("Signup"):‬
‭if (cust_password == cust_password1):‬
‭customer_add_data(cust_name,cust_password,cust_email, cust_area,‬
‭cust_number,)‬
‭[Link]("Account Created!")‬
‭[Link]("Go to Login Menu to login")‬
‭else:‬
‭[Link]('Password dont match')‬
‭elif choice == "Admin":‬
‭# Add background image using custom CSS‬
‭background_image_url = "[Link]

‭[Link](‬
‭f"""‬
‭<style>‬
‭.stApp {{‬
‭background-image: url("{background_image_url}");‬
‭background-size: cover;‬
‭background-position: center;‬
‭background-repeat: no-repeat;‬
‭}}‬
‭</style>‬
‭""",‬
‭unsafe_allow_html=True‬
‭)‬
‭username = [Link].text_input("User Name")‬
‭password = [Link].text_input("Password", type='password')‬
‭# if [Link]("Login"):‬
‭if username == 'admin' and password == 'admin':‬
‭admin()‬
‭OUTPUT‬
‭1. User Login‬

‭2. User Register‬


‭3. Admin Login‬

‭4. Main Page‬


‭5. Order Details‬
‭6. Admin Dashboard‬

‭7. Add Drugs‬


‭8. View Drugs‬

‭9. Update Drug‬


‭10. Delete Drug‬

‭11. View/Update/Delete Customer Details‬


‭12. View Order Details‬

‭13. About Page‬


‭LIMITATIONS AND IMPROVEMENTS‬

‭Limitations:‬
‭●‬ ‭Limited scalability with SQLite for large datasets and high traffic.‬
‭●‬ ‭Basic UI design lacks advanced styling and user-friendliness.‬
‭●‬ ‭No advanced role-based access control for admin and users.‬
‭●‬ ‭Missing integration with real payment gateways.‬
‭●‬ ‭Absence of real-time notifications for users and admins.‬
‭●‬ ‭No alerts for low stock or expired medicines in inventory.‬
‭●‬ ‭Passwords stored in plain text, posing a security risk.‬
‭●‬ ‭Single-language support limits accessibility for non-English speakers.‬
‭●‬ ‭Lack of advanced search and filter options for medicines.‬
‭●‬ ‭No analytics or reporting feature for admin to track sales or inventory trends.‬

‭Improvements:‬
‭●‬ ‭Upgrade to scalable databases like MySQL or PostgreSQL.‬
‭●‬ ‭Enhance UI with CSS, HTML, or Bootstrap integration.‬
‭●‬ ‭Implement role-based access control for better permission handling.‬
‭●‬ ‭Integrate secure payment gateways like PayPal or Stripe.‬
‭●‬ ‭Add real-time notifications and alerts using WebSocket or Firebase.‬
‭●‬ ‭Introduce inventory alerts for low stock and soon-to-expire medicines.‬
‭●‬ ‭Encrypt passwords using secure hashing algorithms like bcrypt.‬
‭●‬ ‭Add multi-language support for broader accessibility.‬
‭●‬ ‭Implement advanced search and filter options for a better user experience.‬
‭●‬ ‭Develop an analytics dashboard for insights into sales, orders, and inventory.‬
‭CONCLUSION‬

‭The‬‭Online‬‭Medical‬‭Management‬‭System‬‭is‬‭a‬‭powerful‬‭and‬‭efficient‬‭tool‬‭that‬‭simplifies‬
‭the‬ ‭process‬ ‭of‬ ‭purchasing‬ ‭medicines‬ ‭and‬ ‭managing‬ ‭inventory.‬ ‭Built‬ ‭using‬ ‭Python,‬
‭Streamlit,‬ ‭and‬ ‭SQLite,‬ ‭the‬ ‭system‬ ‭effectively‬ ‭integrates‬ ‭front-end‬ ‭and‬ ‭back-end‬
‭functionalities‬ ‭to‬ ‭deliver‬‭a‬‭seamless‬‭experience‬‭for‬‭both‬‭users‬‭and‬‭administrators.‬‭With‬
‭features‬‭like‬‭user‬‭authentication,‬‭real-time‬‭order‬‭tracking,‬‭and‬‭admin-controlled‬‭inventory‬
‭management, it caters to the needs of modern healthcare applications.‬

‭While‬‭the‬‭system‬‭has‬‭certain‬‭limitations,‬‭such‬‭as‬‭basic‬‭UI‬‭design,‬‭scalability‬‭constraints,‬
‭and‬ ‭the‬ ‭absence‬ ‭of‬ ‭advanced‬ ‭analytics,‬ ‭these‬ ‭can‬ ‭be‬ ‭addressed‬ ‭through‬ ‭future‬
‭enhancements.‬‭By‬‭incorporating‬‭features‬‭like‬‭secure‬‭payment‬‭gateways,‬‭multi-language‬
‭support,‬ ‭advanced‬ ‭search‬ ‭options,‬ ‭and‬ ‭real-time‬ ‭notifications,‬ ‭the‬ ‭system‬ ‭can‬ ‭evolve‬
‭into a more comprehensive and scalable solution.‬

‭In‬ ‭conclusion,‬ ‭the‬ ‭Online‬ ‭Medical‬ ‭Management‬ ‭System‬ ‭serves‬ ‭as‬ ‭a‬ ‭stepping‬ ‭stone‬
‭toward‬ ‭efficient,‬ ‭user-friendly,‬ ‭and‬ ‭secure‬ ‭healthcare‬ ‭applications.‬ ‭With‬ ‭continuous‬
‭improvements,‬ ‭it‬ ‭has‬ ‭the‬ ‭potential‬ ‭to‬ ‭significantly‬ ‭improve‬ ‭the‬ ‭way‬ ‭medicines‬ ‭are‬
‭purchased‬‭and‬‭managed‬‭in‬‭a‬‭digital-first‬‭world,‬‭offering‬‭convenience‬‭and‬‭accessibility‬‭to‬
‭users while streamlining operations for administrators.‬
‭BIBLIOGRAPHY‬

‭1.‬ ‭[Link]
‭2.‬ ‭[Link]
‭3.‬ ‭OpenAI and Stack Overflow discussions.‬
‭4.‬ ‭[Link]‬
‭5.‬ ‭[Link]‬
‭6.‬ ‭[Link]‬
‭7.‬ ‭Sumita arora textbook -XI & Xll‬

Common questions

Powered by AI

Integrating Streamlit in the development of the Online Medical Management System provides several advantages. It allows for easy construction of web apps, which simplifies the creation and sharing of interactive, web-based user interfaces without requiring extensive frontend development knowledge . Streamlit's simplicity and user-friendliness enable quick prototyping and development cycles, making it suitable for rapid deployment and iterative testing in development projects . Furthermore, its compatibility with Python streamlines integration with Python-based software stacks, facilitating the use of Python libraries for machine learning and data manipulation .

The Online Medical Management System ensures data consistency and reliability primarily through its integration with MySQL, which implements ACID (Atomicity, Consistency, Isolation, Durability) compliance, ensuring reliable transactions . This level of compliance means each transaction is processed in a way that maintains consistent data states even in the event of errors or system failure, helping maintain the integrity of order and inventory records . Moreover, SQL-based systems like MySQL are robust and fault-tolerant, which further contributes to sustaining data reliability in software systems handling crucial data .

MySQL plays a critical role in the inventory management aspect of the Medical Management System by serving as the database backend that stores and manages the structured data representing the inventory . It maintains accurate records of medicines, including details like names, expiry dates, usage, and quantities. This data supports dynamic updates and retrieval, ensuring that the inventory is current and reliable . MySQL’s support for data integrity, through its ACID compliance, assures that all inventory transactions are accurately recorded, providing consistency and reliability necessary for effective inventory control . Moreover, it enables the seamless handling of user orders and stock adjustments by the admin interface, making it integral to the system's operational efficiency .

The integration of notification functionality enhances the user experience by providing real-time updates on order statuses, which builds trust and transparency for the users . Notifications sent to users' registered email or phone numbers keep them informed, ensuring they have immediate access to information about their purchases and shipment . This timely communication can improve customer satisfaction as it addresses one of the key users’ concerns in online transactions: confirmation of order processing and delivery tracking . Such functionality also supports effective communication between the system and its users, reinforcing the system's reliability and user-friendliness .

To improve the system's ability to handle secure transactions and protect user data, integrating advanced security features is essential. The system currently lacks encrypted data storage, as passwords are stored in plain text, posing a security risk . Using secure hashing algorithms like bcrypt for password encryption would prevent unauthorized access in case of data breaches. Additionally, integrating real payment gateways such as PayPal or Stripe can provide secure, compliant financial transactions, protecting sensitive financial data . Real-time notifications and alerts can also be implemented to safeguard transactions and alert users to potential fraudulent activities promptly .

The Online Medical Management System's user interface is limited by its basic styling and lack of advanced features, which may impede user experience and accessibility . The design does not incorporate sophisticated UI elements, leading to a lack of engagement and possibly leading to user dissatisfaction . To address these issues, enhancements such as integrating CSS, HTML, or Bootstrap could be used to elevate the design, making it more appealing and intuitive . Moreover, introducing multi-language support will widen accessibility, catering to users not proficient in English . Additionally, offering advanced search and filter options will improve navigability and efficiency in the user browsing experience .

Enhancing the scalability of the Online Medical Management System can be achieved through several strategic improvements. Transitioning the database from SQLite to a more robust and scalable database like MySQL or PostgreSQL would support handling larger datasets and increased user traffic effectively . Implementing a microservices architecture could further optimize resource use and improve performance under variable loads . Additionally, enhancing the system's design with cloud-based services can provide flexible scaling capabilities, distributing resources dynamically as demand changes . Further, employing load balancers and implementing caching strategies could also aid in managing high-traffic scenarios, maintaining speed and availability .

The use of SQLite in the Online Medical Management System presents challenges related to scalability and security. SQLite is limited in handling large datasets and high-traffic situations due to its nature as a lightweight database engine . Additionally, storage of passwords in plain text is a notable security concern that could compromise user data . To address these challenges, it was suggested that the system upgrade to more scalable databases like MySQL or PostgreSQL that better support larger, more complex datasets . Furthermore, implementing secure hashing algorithms like bcrypt for password encryption can enhance data security .

Addressing potential stock shortages or expired medicines in the medical management system could be effectively managed by implementing automated alert systems . By setting up notifications or alerts for low stock levels and upcoming expiry dates, administrators can be prompted to restock or remove items as needed before they run out or become unusable . Integrating these alerts with real-time inventory monitoring would facilitate proactive inventory management, preventing out-of-stock scenarios and reducing wastage due to expired goods . The addition of data analytics on inventory trends can also offer predictive insights, allowing admin to optimize purchasing decisions based on consumption patterns .

Python is suitable for developing the Online Medical Management System due to several key features. Its readability and straightforward syntax make it accessible even to beginners yet powerful enough for professional development . Python's extensive standard library, often referred to as "batteries-included," provides tools for a wide array of tasks, from web development to data analysis, which contributes to the efficiency of development . Additionally, Python supports exception handling, which is crucial for building robust applications that require reliable error management . The language's cross-platform compatibility allows the developed systems to run seamlessly on various operating systems, enhancing flexibility in deployment .

You might also like