Date post: | 15-Feb-2016 |
Category: |
Documents |
Upload: | ashutoshsharma |
View: | 18 times |
Download: | 0 times |
INTRODUCTION
HOSPITAL MANAGEMENT SYSTEM 1
INTRODUCTION
Our project Hospital Management system includes registration of patients,
storing their details into the system, and also computerized billing in the pharmacy,
and labs. Our software has the facility to give a unique id for every patient and stores
the details of every patient and the staff automatically. It includes a search facility to
know the current status of each room. User can search availability of a doctor and the
details of a patient using the id.
The Hospital Management System can be entered using a username
and password. It is accessible either by an administrator or receptionist. Only they can
add data into the database. The data can be retrieved easily. The interface is very
user-friendly. The data are well protected for personal use and makes the data
processing very fast.
HOSPITAL MANAGEMENT SYSTEM 2
OBJECTIVE
HOSPITAL MANAGEMENT SYSTEM 3
OBJECTIVE
The purpose of the project entitled as “HOSPITAL MANAGEMENT
SYSTEM” is to computerize the Front Office Management of Hospital to develop
software which is user friendly, simple, fast, and cost – effective. It deals with the
collection of patient’s information, diagnosis details, etc. Traditionally, it was done
manually.
This Hospital Management System is designed for hospitals, to cover a wide
range of hospital administration and management processes. It is an integrated end-to-
end Hospital Management System that provides relevant information across the
hospital to support effective decision making for patient care, hospital administration
and critical financial accounting, in a seamless flow.
HOSPITAL MANAGEMENT SYSTEM 4
PROBLEM DEFINATION
HOSPITAL MANAGEMENT SYSTEM 5
PROBLEM DEFINATION
The main function of the system is to register and store patient details and
doctor details and retrieve these details as and when required, and also to manipulate
these details meaningfully System input contains patient details, diagnosis details;
while system output is to get these details on to the CRT screen.
NEED:-
1. Efficiently maintains the details about the patient
2. Simultaneously updates changes made to any data, item in the entire data base.
3. It is faster than manual system
HOSPITAL MANAGEMENT SYSTEM 6
SYSTEM STUDY
HOSPITAL MANAGEMENT SYSTEM 7
SYSTEM STUDY
INTRODUCTION
The goal of any system development is to develop and implement the system
cost effectively; user-friendly and most suited to the user’s analysis is the heart of the
process. Analysis is the study of the various operations performed by the system and
their relationship within and outside of the system. During analysis, data collected on
the files, decision points and transactions handled by the present system. Different
kinds of tools are used in analysis of which interview is a common one.
INITIAL INVESTIGATION
The first step in system development life cycle is the identification of need of
change to improve or enhance an existing system. An initial investigation on existing
system was carried out. The present system of hospital is completely manual. Many
problems were identified during the initial study of the existing system.
HOSPITAL MANAGEMENT SYSTEM 8
EXISTING SYSTEM
System analysis is a detailed study of the various operations performed by a
system and their relationships within and outside of the system. Here the key question
is – What all problems exist in the present system? What must be done to solve the
problem? Analysis begins when a user or manager begins a study of the program
using existing system.
During analysis, data collected on the various files, decision points and
transactions handled by the present system. The commonly used tools in the system
are Data Flow Diagram, interviews, etc. training, experience and common sense are
required for collection of relevant information needed to develop the system. The
success of the system depends largely on how clearly the problem is defined,
thoroughly investigated and properly carried out through the choice of solution. A
good analysis model should provide not only the mechanisms of problem
understanding but also the framework of the solution. Then the proposed system
should be analyzed thoroughly in accordance with the needs.
System analysis can be categorized into four parts.
System planning and initial investigation
Information gathering
Applying analysis tools for structured analysis
Feasibility study
Cost/benefit analysis
HOSPITAL MANAGEMENT SYSTEM 9
PROPOSED SYSTEM
The drawback of the existing system is that it is very difficult to retrieve data from
case files. It is difficult to handle the whole system manually and it is less accurate
and to keep the data in case files for future reference because it may get destroyed.
Moreover it is very difficult to retrieve data. Redundancy of data may occur and this
may lead to the inconsistency. The manual system is so time-consuming.
The proposed system is very easy to operate. Speed and accuracy are the main
advantages of proposed system. There is no redundancy of data. The data are stored in
the computer’s secondary memories like hard disk, etc. it can be easily receive and
used at any time. The proposed system will easily handle all the data and the work
done by the existing systems. The proposed systems eliminate the drawbacks of the
existing system to a great extent and it provides tight security to data.
HOSPITAL MANAGEMENT SYSTEM 10
ABOUT OPERATING SYSTEM
Windows XP is a line of operating systems developed by Microsoft for use on
general purpose computer systems, including home and business desktops, notebook
computers and media centers. The letters ‘XP’ stand for experience. Windows XP is
the successor to both Windows 2000 and Windows Me and is first consumer oriented
operating system produced by Microsoft to be built on the Windows NT kernel and
architecture.
The most common editions of operating systems are Windows XP home
edition, which is targeted at home users, and Windows XP professional, which has
additional features such as, support for Windows server domain and two physical
processors and is targeted at power users and business clients. Windows XP Tablet
PC edition is designed to run the ink-aware Tablet PC platform. Two separate 64 bit
versions of Windows XP were also released, Windows XP 64 bit edition for IA-
64(Itanium) processors and Windows XP Professional x64 edition for x86-64
processors.
HOSPITAL MANAGEMENT SYSTEM 11
FRONT END (VB 6.0)
HOSPITAL MANAGEMENT SYSTEM 12
FRONT END (VB 6.0)
MICROSOFT VISUAL BASIC 6.0
Visual Basic 6.0 is Microsoft’s latest version of the Visual Basic Programming
language.Although writing programs can be a tedious chore at time. Visual Basic
reduces the effort required on your part, and makes programming enjoyable. Visual
Basic makes many aspects of programming as simple as dragging graphics objects on
to screen with your mouse.
Visual Basic 6.0 is more than just a programming language; the secret to
Visual Basic is in its name” Visual”. With to days Windows Operating System, a
program must be able to interact with the screen. Keyboard, mouse and printer
graphically.
The environment provided by Visual Basic is suitable for any type of
application. Using this environment, the user can visually design the objects that your
application uses. Visual Basic is not just a languages, it’s an integrated development
environment in which you can develop, run, test and debug your applications.The
impressive array of programming resources provided by Visual Basic enables to
create the objects extemporaneously which can range from pop-up menu to a message
box.
A form is a major part of Visual Basic application, which allows the user to
enter the data as well as view the result. A control is an object that we draw on a form
to enable or enhance user interaction with an application. Hence a Visual Basic
HOSPITAL MANAGEMENT SYSTEM 13
Title Bar Main Menu Toolbar
application is a combination of object like forms and controls, procedures that can
respond to Events and other general-purpose procedures.
STARTING VISUAL BASIC
To start Visual Basic:
Click on the Start button on the Windows task bar.
Select Programs, then Microsoft Visual Basic # (where # is your
version of Visual Basic).
Click on Visual Basic # (where again # is your version).
HOSPITAL MANAGEMENT SYSTEM 14
Control
Control
Control
Control
Project
Form
At the top of the screen is the Visual Basic Main Window. At the top of the
main window is the Title Bar. The title bar gives us information about what program
we’re using and what Visual Basic program we are working with. Under the main
menu is the Toolbar. Here little buttons with pictures also allow us to control Visual
Basic, much like the main menu. If you put the mouse cursor over one of these
buttons for a second or so, a little ‘tool tip’ will pop up and tell you what that
particular button does.
PARTS OF A VISUAL BASIC PROJECT
There are three major components in a Visual Basic project: the project itself,
the form, and the controls. Project is the word used to encompass everything in a
Visual Basic project. Other words used to describe a project are application or
program. The Form is the window where you create the interface between the user
and the computer. Controls are graphical features or tools that are placed on forms to
allow user interaction (text boxes, labels, scroll bars, command buttons). Recall the
form itself is a control. Controls are also referred to as objects. Pictorially, a project
is:
HOSPITAL MANAGEMENT SYSTEM 15
Event processor
EventProcedure
EventProcedure
EventProcedure
Project consists of a form containing several controls. In looking around your
computer’s file directory, you may find some files associated with a Visual Basic
project. Two primary files are used to save a Visual Basic project. The project file
will have an extension of vbp (in addition, there is sometimes a file with a vbw
extension). The form file has an extension of frm (in addition, there is sometimes a
form file with an frx extension).
An important concept concerning a Visual Basic project is that of a property.
Every characteristic of a control (including the form itself) is specified by a property.
Example properties include names, captions, sizes, colors, position on the form, and
contents.
Visual Basic is an event-driven language. Visual Basic is governed by an
event processor. That means that nothing happens in a Visual Basic project until
some event occurs. Once an event is detected, the project finds a series of instructions
related to that event, called an event procedure. That procedure is executed, and
then program control is returned to the event:
EVENT
HOSPITAL MANAGEMENT SYSTEM 16
Event procedures are where we do the actual computer programming and are
saved with the form in the file with the frm extension. These procedures are where
we write BASIC language statements. You will learn a lot of programming and
BASIC language in this course. The BASIC you will learn is very similar to the
original BASIC used by Bill Gates and Paul Allen when starting Microsoft.
PARTS OF A VISUAL BASIC PROGRAM
Visual Basic is more than just a computer language. It is a project building
environment. Within this one environment, we can begin and build our project, run
and test our project, eliminate errors (if any) in our project, and save our project for
future use. With other computer languages, many times you need a separate text
editor to write your program, something called a compiler to create the program, and
then a different area to test your program. Visual Basic integrates each step of the
project building process into one environment. Let’s look at the parts of the Visual
Basic environment.
MAIN WINDOW
Start Visual Basic using the procedure learned in Class 1. Notice that several
windows appear. The Main Window is used to control most aspects of the Visual
Basic project building and running process.
HOSPITAL MANAGEMENT SYSTEM 17
The main window consists of the title bar, menu bar, and toolbar. The title bar
indicates the project name and the current Visual Basic operating mode (design,
break, run). The menu bar has drop-down menus from which you control the
operation of the Visual Basic environment.
FORM WINDOW
The Form Window is central to developing Visual Basic applications. It is
where you develop your application.
If the form window is not present on the screen:
HOSPITAL MANAGEMENT SYSTEM 18
PROPERTIES
Like all controls, the form has many (over 40) properties. Fortunately, we
only have to know about some of them. The properties we will be concerned with
are:
Property Description
Name Name used to identify form. Three letter prefix for
form names is frm.
Caption Text that appears in the title bar of form.
Icon Reference to icon that appears in title bar of form.
Left Distance from left side of computer screen to left
side of form.
Top Distance from top side of computer screen to top
side of form.
Width Width of the form in twips.
Height Height of form in twips.
Back Color Background color of form.
Border Style Form can either be sizable (can resize using the
mouse) or fixed size.
HOSPITAL MANAGEMENT SYSTEM 19
FORM EVENTS
The form primarily acts as a ‘container’ for other controls, but it does support
events. That is, it can respond to some user interactions. We will only be concerned
with two form events in this course:
Event Description
Click Event executed when user clicks on the form with
the mouse.
Load Event executed when the form first loads into the
computer’s memory. This is a good place to set
initial values for various properties and other project
values.
TOOLBOX WINDOW
The Toolbox Window is the selection menu for controls used in your
application.
HOSPITAL MANAGEMENT SYSTEM 20
Picture Box
Text Box
Command Button
Option Button
List Box
Vertical Scroll Bar
Drive
Files
Line
Data Control
Pointer
Label
Frame
Check Box
Combo Box
Horizontal Scroll Bar
Timer
Directory
Shape
Image
OLE
VB6:-
If the toolbox window is not present on the screen, click View on the main menu, then
Toolbox.
FEATURES OF VISUAL BASIC 6.0:-
1. Good User Interface.
2. OLE Features.
3. Windows API Features.
4. 32 bit Programming Languages.
5. Data Management
6. Online Help
7. Data Access.
HOSPITAL MANAGEMENT SYSTEM 21
AREAS OF APPLICATION
The term "Personal Programming" refers to the idea that, wherever you work,
whatever you do, you can expand your computer's usefulness by writing applications
to use in your own job. Personal Programming is what Visual Basic is all about.
Using Visual Basic's tools, you quickly translate an abstract idea into a program
design you can actually see on the screen. VB encourages you to experiment, revise,
correct, and network your design until the new project meets your requirements.
However, most of all, it inspires your imagination and creativity.
Visual Basic is ideal for developing applications that run in the new Windows 95
operating system. VB presents a 3-step approach for creating programs:
1. Design the appearance of your application.
2. Assign property settings to the objects of your program.
3. Write the code to direct specific tasks at runtime.
HOSPITAL MANAGEMENT SYSTEM 22
Visual Basic can and is used in a number of different areas, for example:
Education
Research
Medicine
Business
Commerce
Marketing and Sales
Accounting
Consulting
Law
Science
HOSPITAL MANAGEMENT SYSTEM 23
BACK END (MS ACCESS)
HOSPITAL MANAGEMENT SYSTEM 24
MICROSOFT ACCESS
Microsoft Access is the default database of Microsoft Visual Basic. Microsoft
Access 2003 provides many new features that make working with data and designing
a database even easier. Microsoft Access Database is a collection of data and objects
related to particular topic or purpose. Microsoft Access Database may contain tables;
queries, forms, reports, macros modules and shortcuts top data access pages.
Microsoft Access is a Relational Database Management System. Using Access
we can organize our data according to subject and can store information about how
different subject are related. In general MS-Access database can have several small
tables.
Microsoft Office Access, previously known as Microsoft Access, is a relational
database management system from Microsoft that combines the relational Microsoft
Jet Database Engine with a graphical user interface and software development tools. It
is a member of the 2007 Microsoft Office system.
Access can use data stored in Access/Jet, Microsoft SQL Server, Oracle, or any
ODBC-compliant data container (including MySQL and PostgreSQL). Skilled
software developers and data architects use it to develop application software.
Relatively unskilled programmers and non-programmer "power users" can use it to
build simple applications. It supports some object-oriented techniques but falls short
of being a fully object-oriented development tool.
Access was also the name of a communications program from Microsoft, meant to
compete with ProComm and other programs. This proved a failure and was dropped.
Years later Microsoft reused the name for its database software.
HOSPITAL MANAGEMENT SYSTEM 25
Access is used by small businesses, within departments of large corporations, and by
hobby programmers to create ad hoc customized desktop systems for handling the
creation and manipulation of data. Access can be used as a database for basic web
based applications hosted on Microsoft's Internet Information Services and utilizing
Microsoft Active Server Pages ASP. Most typical web applications should use tools
like ASP/Microsoft SQL Server or the LAMP stack.
Some professional application developers use Access for rapid application
development, especially for the creation of prototypes and standalone applications
that serve as tools for on-the-road salesmen. Access does not scale well if data access
is via a network, so applications that are used by more than a handful of people tend
to rely on Client-Server based solutions. However, an Access "front end" (the forms,
reports, queries and VB code) can be used against a host of database back ends,
including JET (file-based database engine, used in Access by default), Microsoft SQL
Server, Oracle, and any other ODBC-compliant product.
Features
One of the benefits of Access from a programmer's perspective is its relative
compatibility with SQL (structured query language) —queries may be viewed and
edited as SQL statements, and SQL statements can be used directly in Macros and
VBA Modules to manipulate Access tables. Users may mix and use both VBA and
"Macros" for programming forms and logic and offers object-oriented possibilities.
MSDE (Microsoft SQL Server Desktop Engine) 2000, a mini-version of MS SQL
Server 2000, is included with the developer edition of Office XP and may be used
with Access as an alternative to the Jet Database Engine.
Unlike a modern RDBMS, the Access and the Jet Engine implements database
triggers and stored procedures in a non-standard way. Stored Procedures are
HOSPITAL MANAGEMENT SYSTEM 26
implemented in VBA, and Triggers are only available from embedded Forms. Both
Triggers and Stored procedures are only available to applications built completely
within the Access database management system. Client applications built with VB or
C++ are not able to access these features. Starting in MS Access 2003 (Jet 4.0), there
is a new syntax for creating queries with parameters, in a way that looks like creating
stored procedures, but these procedures are still limited to one statement per
procedure. Microsoft Access does allow forms to contain code that is triggered as
changes are made to the underlying table (as long as the modifications are done only
with that form), and it is common to use pass-through queries and other techniques in
Access to run stored procedures in RDBMSs that support these.
In ADP files (supported in MS Access 2003 and later), the database-related features
are entirely different, because this type of file connects to a MSDE or Microsoft SQL
Server, instead of using the Jet Engine. Thus, it supports the creation of nearly all
objects in the underlying server (tables with constraints and triggers, views, stored
procedures and UDF-s). However, only forms, reports, macros and modules are stored
in the ADP file (the other objects are stored in the back-end database).
HOSPITAL MANAGEMENT SYSTEM 27
PLATFORM SPECIFICATION
HOSPITAL MANAGEMENT SYSTEM 28
PLATFORM SPECIFICATION
Processor : Intel Pentium IV 2.4 GHZ or above
Clock speed : 500 MHZ
System bus : 32 bits
RAM : 256MB of RAM
HDD : 40 GB or higher
Monitor : SVGA COLOR
Keyboard : 108 keys
Mouse : 2 button mouse
OS : MS WINDOWS XP SP2
HOSPITAL MANAGEMENT SYSTEM 29
DATA FLOW DIAGRAMS
HOSPITAL MANAGEMENT SYSTEM 30
Login File
Stock File
File
DATA FLOW DIAGRAMS
DFD for Login Module
DFD for Billing process
HOSPITAL MANAGEMENT SYSTEM 31
Ok
Rejected
User
PasswordVerifying User Name
and PasswordAdministrator
Enter Administrator/User
User Password
DetailsItem
Sales processUser
Billing process
Updating process
Customer
Item
Bill
Quotation Details
Item Code
E-R DIAGRAMS
HOSPITAL MANAGEMENT SYSTEM 32
ENTITY RELATIONSHIP DIAGRAMS
HOSPITAL MANAGEMENT SYSTEM 33
Works On
Employee Department
Date-Started
Dept numberDept Name
Emp- Number
Name
Address
Controls
Administrator
HOD
Doctor
Dr-ID
Name
Address
Works On
Name
Treated byPatient
Patient ID
Name
Address
SNAPSHOTS
LOGIN WINDOW
HOSPITAL MANAGEMENT SYSTEM 34
MAIN WINDOW
HOSPITAL MANAGEMENT SYSTEM 35
ADMIN REGISTRATION
HOSPITAL MANAGEMENT SYSTEM 36
USER REGISTRATION
DOCTOR REGISTRATION
HOSPITAL MANAGEMENT SYSTEM 37
CHANGE PASSWORD
HOSPITAL MANAGEMENT SYSTEM 38
ADD DEPARTMENT
ADD NEW ROOM
HOSPITAL MANAGEMENT SYSTEM 39
ADD NEW MEDICINE
PATIENT REGISTRATION
HOSPITAL MANAGEMENT SYSTEM 40
LAB UPDATE
HOSPITAL MANAGEMENT SYSTEM 41
PATIENT SEARCH
DOCTER SEARCH
HOSPITAL MANAGEMENT SYSTEM 42
IN PATIENT BILL
HOSPITAL MANAGEMENT SYSTEM 43
HOSPITAL MANAGEMENT SYSTEM 44
OUT PATIENT BILL
LAB BILL
HOSPITAL MANAGEMENT SYSTEM 45
PHARMACY BILL
HOSPITAL MANAGEMENT SYSTEM 46
HOSPITAL MANAGEMENT SYSTEM 47
DATABASE DESIGN
HOSPITAL MANAGEMENT SYSTEM 48
DATABASE DESIGN
TABLE NAME:- ADMINLOGIN
Field Name Description Data Type Width
User Name User Name Text 50
Password User Name Text 50
TABLE NAME:- DOCREG
Field Name Description Data Type Width
Dr name Doctor Name Text 50
Sex Sex Text 50
Dept Department Text 50
Consultation time Consultation Time Text 50
Address Address Text 50
Contact no Contact Number Number Long
Emergency no Emergency Number Number Long
Consult fee Consultation fees Number Long
Date Date Date/Time Date/Time
Consultation day Consultation Day Text 50
Tot pat Total Patient Number Double
HOSPITAL MANAGEMENT SYSTEM 49
TABLE NAME:- PATIENTDETAILS
Field Name Description Data Type Width
Name Name Text 50
Age Age Number Integer
Sex Sex Text 50
Address Address Text 50
Doctor Doctor Text 50
Patient id Patient id Text 50
Reg fee Registration fees Number Double
Admin Date Admitted Date Date/Time Date/Time
Room no Room Number Number Integer
TABLE NAME:- MEDICINE
Field Name Description Data Type Width
Medname Medicine Name Text 50
Medtype Medicine Type Text Double
Amt Amount Number 50
Expdate Expiry Date Date/Time 50
Stock Stock Number Double
HOSPITAL MANAGEMENT SYSTEM 50
TABLE NAME:- DISCHARGESHEET
Field Name Description Data Type Width
Patient id Patient id Number Double
Name Name Text 50
Doctor Doctor Text 50
Remark Remark Text 50
Totbill Total Bill Number Double
Date Date Date/Time Date/Time
TABLE NAME:- LABUPDATE
Field Name Description Data Type Width
Testname Test name Text 50
Amt Amount Number Double
HOSPITAL MANAGEMENT SYSTEM 51
SAMPLE COADING
HOSPITAL MANAGEMENT SYSTEM 52
SAMPLE COADING
LOGIN WIDOW(frmLOG):-
Private Sub Command1_Click()db.Open Set rs = db.Execute("SELECT * FROM ADMINLOGIN where username='" & txt_username.Text & "'") If (txt_password = "" And txt_username = "") Then MsgBox "Login not possible" Else If Not rs.EOF() Then If (rs(1) = txt_password.Text) Then Unload Me frmmenu.Show frmlog_ADMIN.Show Else LOG_N_POSS.Show End If Else MsgBox "EOF Reached" End IfEnd If db.CloseEnd Sub
Private Sub Command2_Click()txt_username = ""txt_password = ""End Sub
Private Sub Command3_Click()Unload MeEnd Sub
Private Sub Command4_Click()db.Open Set rs = db.Execute("SELECT * FROM STAFFLOGIN where username='" & txt_username.Text & "'") If Not rs.EOF() Then If (rs(1) = txt_password.Text) Then frmmenu.Show frmlog_USER.Show frmmenu.LOG_OFF.Enabled = True frmmenu.Admin.Enabled = False Unload Me
HOSPITAL MANAGEMENT SYSTEM 53
Else LOG_N_POSS.Show End If Else MsgBox "Invalid Username or Password" End If db.CloseEnd Sub
Private Sub Form_Load()connectdbEnd Sub
ADD NEW DEPARTMENT(AddDep):-
Dim m_MissingFields As StringPrivate Sub Command1_Click()If ValidateForm() = True Then
HOSPITAL MANAGEMENT SYSTEM 54
db.Open db.Execute ("INSERT INTO DEPARTMENT VALUES('" & txt_dept.Text & " ', '" & cmb_hod.Text & "'," & txt_floor & ")") MsgBox "Record added successfully"Else m_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" m_MissingFields = ""End IfEnd Sub
Private Sub Command2_Click()Unload MeEnd Sub
Private Sub Form_Load()connectdbdb.Openrs.Open "SELECT * FROM DOCREG", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOF()cmb_hod.AddItem rs!Drnamers.MoveNextWenddb.CloseEnd SubPrivate Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_dept.Text = "" Then m_MissingFields = m_MissingFields & "Dept Name," m_valid = False End If If txt_floor.Text = "" Then m_MissingFields = m_MissingFields & "Floor," m_valid = False End If ValidateForm = m_validEnd Function
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd SubADD NEW ROOM(Addroom):-
Dim m_MissingFields As StringPrivate Sub Cmd_add_Click()
HOSPITAL MANAGEMENT SYSTEM 55
If ValidateForm = True Then db.Open db.Execute ("INSERT INTO ADDROOM VALUES(" & txt_romno.Text & ",'" & combo_rtype.Text & "'," & txt_amt.Text & ",'N')") MsgBox ("Record added successfully") txt_amt.Text = "" txt_romno.Text = "" combo_rtype.ListIndex = 0 'db.CloseElse m_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" m_MissingFields = ""End IfEnd Sub
Private Sub cmd_cancel_Click()Unload MeEnd Sub
Private Sub Form_Load()connectdbcombo_rtype.ListIndex = 0End SubPrivate Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_romno.Text = "" Then m_MissingFields = m_MissingFields & "Room No," m_valid = False End If If txt_amt.Text = "" Then m_MissingFields = m_MissingFields & "Amount," m_valid = False End If ValidateForm = m_validEnd Function
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
ADMIN REGISTRATION(AdminReg):-
Private Sub cmd_save_Click()db.Open
HOSPITAL MANAGEMENT SYSTEM 56
db.Execute ("INSERT INTO ADMINLOGIN VALUES('" & txt_username.Text & "','" & txt_password.Text & "')")MsgBox "NEW USER SAVED IN RECORD"End Sub
Private Sub cmd_cancel_Click()Unload MeEnd Sub
Private Sub Form_Load()connectdbEnd SubPrivate Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
CHANGE ADMIN PASSWORD(cng_admin_pass):-
Dim m_pwd As StringDim sql As StringPrivate Sub Command1_Click()
HOSPITAL MANAGEMENT SYSTEM 57
db.Opensql = " SELECT * FROM ADMINLOGIN where username='" & txt_usrname.Text & "'"rs.Open sql, db, 3, 3If Not rs.EOF() Then If (rs(1) = txt_oldpw.Text) Then If (txt_newpw.Text = txt_confirm.Text) Then m_pwd = txt_newpw.Text rs.Fields("password") = m_pwd rs.Update MsgBox "Successful" Else MsgBox "Password missmatch" End If Else MsgBox "Error" End IfElseMsgBox "EOF Reached"End If'db.CloseEnd Sub
Private Sub Command2_Click()Unload MeEnd Sub
Private Sub Form_Load()connectdbEnd Sub
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
DISCHARGE SHEET(DISCHARGEsheet):-
Dim m_MissingFields As StringDim w As Double
HOSPITAL MANAGEMENT SYSTEM 58
Private Sub cmd_cancel_Click()Unload MeEnd Sub
Private Sub cmd_save_Click()Dim roomno As IntegerIf ValidateForm = True Then db.Execute ("INSERT INTO DISCHARGESHEET VALUES('" & txtPatID.Text & " ','" & txt_name.Text & "','" & txt_dr.Text & "', '" & txt_remarks.Text & "'," & txt_totbill.Text & ",'" & DTP.Value & "')") rs.Open "SELECT RoomNo FROM PATIENTDETAILS WHERE patientid='" & Val(txtPatID.Text) & "'", db, adOpenDynamic, adLockOptimistic If Not rs.EOF Then roomno = rs!roomno End If rs.Close db.Execute ("UPDATE ADDROOM SET Allocated='N' WHERE roomno=" & roomno) MsgBox "Recorded added successfully" Else m_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" m_MissingFields = ""End IfEnd Sub
Private Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_remarks.Text = "" Then m_MissingFields = m_MissingFields & "Remarks ," m_valid = False End If If txt_totbill.Text = "" Then m_MissingFields = m_MissingFields & "Bill Amount," m_valid = False End If ValidateForm = m_validEnd Function
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
HOSPITAL MANAGEMENT SYSTEM 59
DOCTOR REGISTRATION(Docreg):-
Dim m_time As StringDim m_MissingFields As String
HOSPITAL MANAGEMENT SYSTEM 60
Private Sub Command1_Click()If ValidateForm = True Then db.Open m_time = txt_timefrom.Text & " to " & txt_timeto.Text rs.Open "DOCREG", db, adOpenDynamic, adLockOptimistic rs.AddNew rs!Drname = txt_name.Text If opt_male.Value = True Then rs!sex = "Male" Else rs!sex = "Female" End If rs!dept = cmb_dept.Text rs!consultationtime = m_time rs!address = txt_address.Text rs!contactno = txt_contactno.Text rs!emergencyno = txt_emergency.Text rs!Date = DTP.Value rs!consultationday = comb_day.Text rs!totpat = txt_totpat.Text rs!consultfee = txt_fee.Text rs.Update MsgBox "One Doctor Registered", vbInformation, "Doctor ADDED" rs.Close rs.Open "PATCOUNT", db, adOpenDynamic, adLockOptimistic rs.AddNew rs!Drname = txt_name.Text rs!patcount = txt_totpat.Text rs!Date = DTP.Value rs.Update Else m_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" m_MissingFields = ""End IfEnd Sub
Private Sub Command2_Click()Unload MeEnd Sub
Private Sub Form_Load()connectdbdb.Openrs.Open "SELECT * FROM DEPARTMENT", db, adOpenDynamic, adLockOptimistic
HOSPITAL MANAGEMENT SYSTEM 61
While Not rs.EOF()cmb_dept.AddItem rs!deptrs.MoveNextWenddb.Closecomb_day.AddItem "Monday"comb_day.AddItem "Tuesday"comb_day.AddItem "Wednesday"comb_day.AddItem "Thursday"comb_day.AddItem "Friday"comb_day.AddItem "Saturday"comb_day.AddItem "Sunday"End SubPrivate Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_name.Text = "" Then m_MissingFields = m_MissingFields & "Name," m_valid = False End If If cmb_dept.Text = "" Then m_MissingFields = m_MissingFields & "Dept Name," m_valid = False End If If txt_timefrom.Text = "" Then m_MissingFields = m_MissingFields & "Time From," m_valid = False End If If txt_timeto.Text = "" Then m_MissingFields = m_MissingFields & "Time To," m_valid = False End If If txt_address.Text = "" Then m_MissingFields = m_MissingFields & "Address," m_valid = False End If If txt_contactno.Text = "" Then m_MissingFields = m_MissingFields & "Contact no," m_valid = False End If If txt_emergency.Text = "" Then m_MissingFields = m_MissingFields & "Emergency no," m_valid = False End If If txt_fee.Text = "" Then m_MissingFields = m_MissingFields & "Fees," m_valid = False End If ValidateForm = m_valid
HOSPITAL MANAGEMENT SYSTEM 62
End Function
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
DOCTOR SEARCH(DoctarSearch):-
Private Sub Combo1_Click()db.Open
HOSPITAL MANAGEMENT SYSTEM 63
rs.Open "select * from DOCREG where drname='" + Combo1.Text + "' ", db, adOpenDynamic, adLockOptimisticLabel6.Caption = rs!deptLabel8.Caption = rs!consultationtimeLabel11.Caption = rs!addressLabel12.Caption = rs!contactnoLabel13.Caption = rs!emergencynodb.CloseEnd Sub
Private Sub Command1_Click()Unload MeEnd Sub
Private Sub Form_Load()connectdbdb.Openrs.Open "DOCREG", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOFCombo1.AddItem rs!Drnamers.MoveNextWenddb.CloseEnd Sub
IN PATIENT BILL (In_Bill):-
Dim billno As IntegerDim w As IntegerDim addt As Date
HOSPITAL MANAGEMENT SYSTEM 64
Dim diff As IntegerPrivate Sub cm_close_Click()
Unload MeEnd Sub
Private Sub cmd_dis_Click()
w = 0
rs.Open "select * from LABBILL where patientid=" + Combo_PATID.Text + " ", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Thenw = w + rs("total")Else
w = wEnd Ifrs.Closers.Open "select * from PHARBILL where patientid=" + Combo_PATID.Text + " ", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Thenw = w + rs("tot")Else
w = wEnd Ifrs.Closers.Open "select * from PATIENTBILL where patientid=" + Combo_PATID.Text + " ", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Thenw = w + rs("tot")Else
w = wEnd Ifrs.Close
Load DISCHARGEsheetDISCHARGEsheet.txt_totbill.Text = wDISCHARGEsheet.txtPatID.Text = Combo_PATID.TextDISCHARGEsheet.txt_dr.Text = Combo_dr.TextDISCHARGEsheet.txt_name.Text = txt_name.TextDISCHARGEsheet.ShowUnload MeEnd Sub
Private Sub cmd_save_Click()If ValidateForm = True Then
HOSPITAL MANAGEMENT SYSTEM 65
db.Open
rs.Open "PATIENTBILL", db, adOpenDynamic, adLockOptimisticrs.AddNewrs!Name = txt_name.Textrs!regdate = txt_regdate.Textrs!patientid = Combo_PATID.Textrs!doctor = Combo_dr.Textrs!regdate = txt_regdate.Textrs!billno = txt_billno.Textrs!room = txt_room.Textrs!amt = txt_amt.Textrs!tot = diffrs.Updaters.CloseMsgBox "Recorded added sucessfully"Else m_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" m_MissingFields = ""End Ifcmd_dis.Enabled = Truecmd_save.Enabled = Falsebillno = billno + 1 txt_billno.Text = billno
End Sub
Private Sub Combo_patid_Click()db.Openrs.Open "SELECT * FROM PATIENTDETAILS WHERE patientid='" + Combo_PATID.Text + "'", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Then txt_regdate.Text = rs!admindate txt_name.Text = rs!Name txt_regdate.Text = rs!admindate addt = rs!admindate Combo_dr.Text = rs!doctor txt_room.Text = rs!roomno rs.Close rs.Open "SELECT amt from ADDROOM WHERE roomno=" & Val(txt_room.Text) If Not rs.EOF Then txt_amt.Text = rs!amt End If
HOSPITAL MANAGEMENT SYSTEM 66
Else MsgBox "No Rooms allotted"End If
db.Closediff = DateDiff("d", addt, Now)diff = diff * Val(txt_amt.Text)txt_tot.Text = diff
End Sub
Private Sub Form_Load()connectdbdb.Openrs.Open "SELECT patientid FROM PATIENTDETAILS WHERE Type='IP'", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOFCombo_PATID.AddItem rs!patientidrs.MoveNextWenddb.Closedb.Openrs.Open "DOCREG", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOFCombo_dr.AddItem rs!Drnamers.MoveNextWenddb.Close'db.Opendb.Openrs.Open "SELECT COUNT(*) FROM PATIENTBILL", db, adOpenDynamic, adLockOptimisticIf (rs(0) = 0) Then txt_billno.Text = 1Else txt_billno.Text = rs(0)End Ifdb.CloseEnd Sub
Private Sub Label11_Click()
End SubPrivate Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_name.Text = "" Then m_MissingFields = m_MissingFields & "Name," m_valid = False
HOSPITAL MANAGEMENT SYSTEM 67
End If If txt_amt.Text = "" Then m_MissingFields = m_MissingFields & "Amount," m_valid = False End If ValidateForm = m_validEnd Function
LAB BILL(LAB_BILL):-
Dim billno As IntegerDim i As IntegerDim k As Integer
HOSPITAL MANAGEMENT SYSTEM 68
Dim m_MissingFields As String
Private Sub combo_labtests_Click()If (combo_labtests.ListIndex = 0) ThenCommand4.Enabled = FalseElseCommand4.Enabled = TrueEnd Ifrs.Open "SELECT * FROM LABUPDATE WHERE testname='" & combo_labtests.Text & "'", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Thenlblamt.Caption = rs!amtEnd Ifrs.CloseEnd Sub
Private Sub Command2_Click()
For k = 1 To MSF.Rows - 2db.Execute ("INSERT INTO LABBILL VALUES( " & txt_billno.Text & ",'" & Combo_PATID.Text & _ "','" & MSF.TextMatrix(k, 1) & "'," & MSF.TextMatrix(k, 2) & _ "," & lbl_tot.Caption & ")")NextMsgBox "Recorded added successfully"
For k = 1 To MSF.Rows - 2 MSF.TextMatrix(k, 0) = "" MSF.TextMatrix(k, 1) = "" MSF.TextMatrix(k, 2) = ""NextMSF.Rows = 2i = 1
txt_billno.Text = billno + 1Command2.Enabled = False
lbl_tot.Caption = ""End Sub
Private Sub Command3_Click()billno = billno - 1db.CloseUnload MeEnd Sub
Private Sub Command4_Click()MSF.TextMatrix(i, 0) = i
HOSPITAL MANAGEMENT SYSTEM 69
MSF.TextMatrix(i, 1) = combo_labtests.TextMSF.TextMatrix(i, 2) = lblamt.Captionlbl_tot.Caption = Val(lbl_tot.Caption) + MSF.TextMatrix(i, 2)MSF.Rows = MSF.Rows + 1i = i + 1combo_labtests.ListIndex = 0lblamt.Caption = ""Command2.Enabled = TrueEnd Sub
Private Sub Form_Load()
If (combo_labtests.Text = "") ThenCommand4.Enabled = FalseElseCommand4.Enabled = TrueEnd If
i = 1connectdbdb.Opencombo_labtests.AddItem ""rs.Open "SELECT * FROM LABUPDATE", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOF() combo_labtests.AddItem rs!testname rs.MoveNextWendrs.Closers.Open "SELECT * FROM PATIENTDETAILS", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOF() Combo_PATID.AddItem rs!patientid rs.MoveNextWendrs.Closelbl_tot.Caption = 0rs.Open "SELECT COUNT(*) FROM LABBILL", db, adOpenDynamic, adLockOptimisticbillno = rs(0)If (billno = 0) Then txt_billno.Text = 1Else billno = billno txt_billno.Text = billnoEnd Ifrs.CloseEnd Sub
HOSPITAL MANAGEMENT SYSTEM 70
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
LAB UPDATE(LABUPDATE):-
Private Sub Command1_Click()db.Open
HOSPITAL MANAGEMENT SYSTEM 71
db.Execute ("INSERT INTO LABUPDATE VALUES('" & txt_tname.Text & "'," & txt_amt.Text & ")")MsgBox "Record added sucessfully"End Sub
Private Sub Command2_Click()Unload MeEnd Sub
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
ADD NEW MEDICINE(Medi):-
Private Sub Command1_Click()db.Open
HOSPITAL MANAGEMENT SYSTEM 72
db.Execute ("INSERT INTO MEDICINE VALUES('" & txt_mname.Text & "','" & Combo_medtype.Text & "'," & txt_amt.Text & ",'" & DTP.Value & "'," & txt_stock.Text & ")")MsgBox "Record Successfully added"'db.CloseEnd Sub
Private Sub Command2_Click()Unload MeEnd Sub
Private Sub Form_Load()connectdbCombo_medtype.Text = "Capsule"Combo_medtype.AddItem "Capsule"Combo_medtype.AddItem "Syrup"
End Sub
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
OUT PATIENT BILL(OP_bill):-
Dim m_count As IntegerDim total As Integer
HOSPITAL MANAGEMENT SYSTEM 73
Dim m_MissingFields As String
Private Sub Command1_Click()db.Openrs.Open "OPPHARMACY", db, adOpenDynamic, adLockOptimisticrs.AddNewrs!Name = txt_name.Textrs!Amount = txt_amt.Textrs!billno = txt_billno.Textrs!Date = DTP.Valuers!pamt = txt_pamt.Textrs!labamt = txt_lamt.Textrs!tot = txt_tot.Textrs!patientid = Combo_PATID.Textrs!doctor = Combo_dr.Textrs.Update'MsgBox "You are registered", vbInformation, "UserAdded"rs.Closedb.CloseEnd SubPrivate Sub cmd_save_Click()If ValidateForm = True Thendb.Opendb.Execute "INSERT INTO OPBILL VALUES(" & txt_billno.Text & "," & Combo_PATID.Text & ",'" & txt_name.Text & _ "','" & Combo_dr.Text & "','" & DTP.Value & "'," & txt_amt.Text & _ "," & txt_pamt.Text & "," & txt_lamt.Text & "," & txt_tot.Text & " )"MsgBox "Record added successfully"'db.CloseElse m_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" m_MissingFields = ""End If
End Sub
Private Sub Combo_patid_Click()db.Openrs.Open "SELECT * FROM PATIENTDETAILS WHERE patientid='" + Combo_PATID.Text + "'", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Then txt_name.Text = rs!NameElse MsgBox "Record not found"End If
HOSPITAL MANAGEMENT SYSTEM 74
rs.Closers.Open "SELECT * FROM PHARBILL WHERE patientid=" + Combo_PATID.Text + " ", db, adOpenDynamic, adLockOptimistic If Not rs.EOF() Then txt_pamt.Text = rs!tot rs.Close Else txt_pamt.Text = 0 'MsgBox "Not Found"End Ifrs.Closers.Open "SELECT * FROM LABBILL WHERE patientid=" + Combo_PATID.Text + " ", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Thentxt_lamt.Text = rs!totalrs.CloseElse txt_lamt.Text = 0 'MsgBox "Amount field is empty"End Ifdb.CloseEnd Sub
Private Sub Command2_Click()
Unload MeEnd Sub
Private Sub Form_Load()'db.Closeconnectdbdb.Openrs.Open "DOCREG", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOFCombo_dr.AddItem rs!Drnamers.MoveNextWenddb.Closedb.Openrs.Open "PATIENTDETAILS", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOFCombo_PATID.AddItem rs!patientidrs.MoveNextWenddb.Closedb.Openrs.Open "SELECT COUNT(*) FROM OPBILL", db, adOpenDynamic, adLockOptimisticm_count = rs(0)
HOSPITAL MANAGEMENT SYSTEM 75
If (m_count = 0) Then m_count = 1 txt_billno.Text = m_countElse m_count = m_count + 1 txt_billno.Text = m_countEnd Ifdb.CloseEnd Sub
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
Private Sub txt_amt_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then total = Val(txt_amt.Text) + Val(txt_lamt.Text) + Val(txt_pamt.Text) txt_tot.Text = total cmd_save.SetFocus End IfEnd Sub
Private Sub txt_lamt_KeyPress(KeyAscii As Integer)' If KeyAscii = 13 Then' total = Val(txt_amt.Text) + Val(txt_lamt.Text) + Val(txt_pamt.Text)' txt_tot.Text = total' cmd_save.SetFocus' 'Else' 'MsgBox "Please press enter key"' 'txt_lamt.SetFocus' End IfEnd SubPrivate Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_name.Text = "" Then m_MissingFields = m_MissingFields & "Name," m_valid = False End If If txt_amt.Text = "" Then m_MissingFields = m_MissingFields & "Amount," m_valid = False End If If txt_lamt.Text = "" Then m_MissingFields = m_MissingFields & "Lab Amount," m_valid = False End If If txt_pamt.Text = "" Then
HOSPITAL MANAGEMENT SYSTEM 76
m_MissingFields = m_MissingFields & "Pharmacy Amount," m_valid = False End If If txt_tot.Text = "" Then m_MissingFields = m_MissingFields & "Total," m_valid = False End If ValidateForm = m_validEnd Function
PATEINT REGISTRATION (PateintReg):-
Dim m_sx As StringDim m_patid As Integer
HOSPITAL MANAGEMENT SYSTEM 77
Dim m_patcount As IntegerDim m_totpat As IntegerDim m_MissingFields As String
Private Sub cmd_del_Click()'MsgBox ("DELETE FROM PATIENTDETAILS WHERE timestampdiff(SQL_TSI_MONTH," & Date & ",ts admindate))")End Sub
Private Sub Combo_drpref_Click()db.Openrs.Open "SELECT * FROM DOCREG WHERE drname='" & Combo_drpref.Text & "' ", db, adOpenDynamic, adLockOptimistic If Not rs.EOF() Then m_totpat = rs!totpat 'Else 'MsgBox "Not found" 'End If'rs.Close'rs.Open "SELECT * FROM DrREGISTRATION WHERE drname='" & Combo_drpref.Text & "' ", db, adOpenDynamic, adLockOptimistic'If Not rs.EOF() Then txt_regfee.Text = rs!consultfeeElse MsgBox "Record not found"End Ifrs.Closers.Open "SELECT * FROM PATCOUNT WHERE drname='" & Combo_drpref.Text & "'", db, adOpenDynamic, adLockOptimistic If Not rs.EOF() Then m_patcount = rs!patcount If (m_patcount > m_totpat) Then MsgBox "Patient Count Exceeds please assign to another Doctor" End If Else MsgBox "Record not Found" End If rs.Close
'End Ifdb.CloseEnd Sub
Private Sub Combo_patid_Click()db.Openrs.Open "SELECT * FROM PATIENTDETAILS WHERE patientid='" & Combo_PATID.Text & "'", db, adOpenDynamic, adLockOptimisticlst_names.AddItem rs!Namelst_age.AddItem rs!age
HOSPITAL MANAGEMENT SYSTEM 78
lst_add.AddItem rs!addressdb.CloseCommand3.Enabled = FalseEnd Sub
Private Sub Command1_Click()Dim pattype As StringDim rno As IntegerIf Opt_male = True Thenm_sx = "male"Elsem_sx = "female"End Ifdb.Openrs.Open "SELECT * FROM PATIENTDETAILS where patientid='" & txt_patientid.Text & "' ", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Then MsgBox "Patient ID allready exist"Else If ValidateForm = True Then If rdoIP.Value = True Then pattype = rdoIP.Caption rno = Val(cmbRoomNo.Text) Else pattype = rdoOP.Caption rno = -1 End If db.Execute ("INSERT INTO PATIENTDETAILS VALUES('" & txt_name.Text & "'," & _ txt_age.Text & ",'" & m_sx & "','" & txt_address.Text & "','" & _ Combo_drpref.Text & "','" & txt_patientid & "'," & txt_regfee & ",' " & _ DTP.Value & "','" & pattype & "'," & rno & ")") db.Execute ("UPDATE ADDROOM SET Allocated='Y' WHERE roomno=" & Val(cmbRoomNo.Text)) MsgBox "Record added successfully" m_patid = m_patid + 1 Else m_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" m_MissingFields = "" End IfEnd Ifdb.Close'm_patid = m_patid + 1txt_address.Text = ""txt_age.Text = ""txt_name.Text = ""txt_regfee.Text = ""
HOSPITAL MANAGEMENT SYSTEM 79
txt_patientid.Text = m_patiddb.Openm_patcount = m_patcount + 1rs.Open "SELECT * FROM PATCOUNT WHERE drname='" & Combo_drpref.Text & "'", db, adOpenDynamic, adLockOptimistic'db.Execute ("UPDATE PATCOUNT SET patcount= " & m_patcount & " WHERE drname=' " & Combo_drpref.Text & "' ")If Not rs.EOF() Thenrs!patcount = m_patcountrs.UpdateElseMsgBox "Please fill all the fields"End Ifdb.CloseEnd Sub
Private Sub DTPicker1_Change()
End Sub
Private Sub Command2_Click()Unload MeEnd Sub
Private Sub Command3_Click()
If (txt_dt.Text = "") Then MsgBox "Please enter the date", vbCritical, "Warning"Elsedb.Openrs.Open "SELECT * FROM PATIENTDETAILS WHERE admindate= #" & txt_dt.Text & "# ", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOF() lst_names.AddItem rs!Name lst_age.AddItem rs!age lst_add.AddItem rs!address rs.MoveNextWenddb.CloseEnd IfEnd Sub
Private Sub Command4_Click()Unload MeEnd Sub
Private Sub Command5_Click()Combo_PATID.Text = ""
HOSPITAL MANAGEMENT SYSTEM 80
txt_dt.Text = ""lst_age.Clearlst_names.Clearlst_add.ClearEnd Sub
Private Sub Command6_Click()
End Sub
Private Sub Form_Load()connectdbdb.Openrs.Open "SELECT * FROM DOCREG", db, adOpenDynamic, adLockOptimistic
While Not rs.EOF() Combo_drpref.AddItem rs!Drname rs.MoveNextWendrs.Closers.Open "SELECT COUNT(*) FROM PATIENTDETAILS", db, adOpenDynamic, adLockOptimisticIf (rs(0) = 0) Then m_patid = 1 txt_patientid.Text = m_patidElse m_patid = rs(0) + 1 txt_patientid.Text = rs(0) + 1End Ifdb.CloserdoOP.Value = TrueloadRoomscmbRoomNo.Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.Close
End Sub
Private Sub rdoIP_Click() If rdoIP.Value = True Then cmbRoomNo.Enabled = True End IfEnd Sub
Private Sub rdoOP_Click()
HOSPITAL MANAGEMENT SYSTEM 81
If rdoOP.Value = True Then cmbRoomNo.Enabled = False End IfEnd Sub
Private Sub SSTab1_Click(PreviousTab As Integer)db.Openrs.Open "PATIENTDETAILS", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOFCombo_PATID.AddItem rs!patientidrs.MoveNextWenddb.CloseEnd Sub
Private Sub txt_dt_GotFocus()Command3.Enabled = TrueEnd Sub
Private Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_name.Text = "" Then m_MissingFields = m_MissingFields & "Name," m_valid = False End If If txt_age.Text = "" Then m_MissingFields = m_MissingFields & "Age," m_valid = False End If If txt_address.Text = "" Then m_MissingFields = m_MissingFields & "Address," m_valid = False End If If txt_regfee.Text = "" Then m_MissingFields = m_MissingFields & "Registration Fee," m_valid = False End If ValidateForm = m_validEnd FunctionPublic Sub loadRooms() db.Open rs.Open "SELECT roomno FROM ADDROOM WHERE Allocated='N'", db, adOpenDynamic, adLockOptimistic cmbRoomNo.Clear While Not rs.EOF cmbRoomNo.AddItem rs.Fields(0)
HOSPITAL MANAGEMENT SYSTEM 82
rs.MoveNext Wend If (cmbRoomNo.ListCount > 0) Then cmbRoomNo.ListIndex = 0 End If db.CloseEnd Sub
PATEINT SEARCH (PateintSearch):-
Private Sub cmd_close_Click()Unload Me
HOSPITAL MANAGEMENT SYSTEM 83
End Sub
Private Sub Combo_patid_Click()db.Openrs.Open "SELECT * FROM PATIENTDETAILS WHERE patientid= '" + Combo_PATID.Text + "'", db, adOpenDynamic, adLockOptimisticIf Not rs.EOF() Then txt_name.Text = rs!Name txt_address.Text = rs!address Else MsgBox "Record not found"End Ifrs.Close
rs.Open "SELECT * FROM PATIENTDETAILS WHERE patientid= '" & Combo_PATID.Text & "' and type='IP'" If Not rs.EOF() Then txt_roomno.Text = rs!roomno Else MsgBox "Record not found" End Ifdb.CloseEnd Sub
Private Sub Command1_Click()
End SubPrivate Sub Form_Load()connectdbdb.Openrs.Open "SELECT * FROM PATIENTDETAILS WHERE type='IP'", db, adOpenDynamic, adLockOptimisticWhile Not rs.EOF()Combo_PATID.AddItem rs!patientidrs.MoveNextWenddb.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd SubPHARMACY BILL(PHAR_bill):-
Dim i As IntegerDim j As Integer
HOSPITAL MANAGEMENT SYSTEM 84
Dim amt As DoubleDim billno As IntegerDim m_MissingFields As StringPrivate Sub cmd_save_Click()'If ValidateForm = True ThenFor k = 1 To MSF.Rows - 2db.Execute ("INSERT INTO PHARBILL VALUES( " & txt_billno.Text & ",'" & DTP.Value & _"','" & Combo_PATID.Text & "','" & MSF.TextMatrix(k, 1) & "','" & MSF.TextMatrix(k, 2) & _"'," & MSF.TextMatrix(k, 3) & "," & lblTotal.Caption & ")")NextMsgBox "Recorded added successfully"i = 1'Else 'm_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) ' MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" ' m_MissingFields = ""cmd_save.Enabled = FalseMSF.Rows = 2MSF.ClearMSF.FormatString = "Sl No | Medicine | Qty | Amount "lblTotal.Caption = ""
End Sub
Private Sub Combo_med_Click()rs.Open "SELECT * FROM MEDICINE WHERE medname='" + Combo_med.Text + "'", db, adOpenDynamic, adLockOptimistic
If Not rs.EOF() Then lblprice.Caption = rs!amtEnd Ifrs.Closetxt_qty.SetFocusEnd Sub
Private Sub Command3_Click()Unload Me
End Sub
Private Sub Form_Load() i = 1 connectdb db.Open rs.Open "SELECT * FROM MEDICINE", db, adOpenDynamic, adLockOptimistic Combo_med.AddItem ""
HOSPITAL MANAGEMENT SYSTEM 85
While Not rs.EOF() Combo_med.AddItem rs!medname rs.MoveNext Wend rs.Close rs.Open "SELECT COUNT(*) FROM PHARBILL", db, adOpenDynamic, adLockOptimistic billno = rs(0) If (billno = 0) Then txt_billno.Text = 1 Else billno = billno + 1 txt_billno.Text = billno End If rs.Close rs.Open "SELECT * FROM PATIENTDETAILS", db, adOpenDynamic, adLockOptimistic While Not rs.EOF() Combo_PATID.AddItem rs!patientid rs.MoveNext Wend rs.CloseEnd Sub
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
Private Sub txt_qty_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then MSF.TextMatrix(i, 0) = i MSF.TextMatrix(i, 1) = Combo_med.Text MSF.TextMatrix(i, 2) = txt_qty.Text MSF.TextMatrix(i, 3) = CDbl(Val(txt_qty.Text) * Val(lblprice.Caption)) lblTotal.Caption = Val(lblTotal.Caption) + MSF.TextMatrix(i, 3) MSF.Rows = MSF.Rows + 1 i = i + 1 txt_qty.Text = "" lblprice.Caption = "" Combo_med.ListIndex = 0 cmd_save.Enabled = True End If End SubUSER REGISTRATION(UserReg):-
Dim m_sx As StringDim m_MissingFields As String
HOSPITAL MANAGEMENT SYSTEM 86
Private Sub cmd_save_Click() If ValidateForm = True Then If (txt_password.Text = txt_confirmpassword.Text) Then db.Open If Opt_male.Value = True Then m_sx = "male" Else m_sx = "female" End If
db.Execute "INSERT INTO USER_REGISTRATION VALUES('" & txt_name.Text & "'," & txt_age.Text & ",'" & _ m_sx & "','" & txt_address.Text & "'," & _ txt_phno.Text & ",'" & txt_username.Text & "','" & txt_password.Text & "')"db.Execute "INSERT INTO STAFFLOGIN VALUES('" & txt_username.Text & "','" & txt_password.Text & "')"MsgBox "You are registered", vbInformation, "UserAdded"'db.CloseElse MsgBox "Password Mismatch"End IfElse m_MissingFields = Left(m_MissingFields, Len(m_MissingFields) - 1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing, please fill the fields and try again", vbCritical + vbOKOnly, "Missing fields" m_MissingFields = ""End If
End Sub
Private Sub cmd_cancel_Click()Unload MeEnd Sub
Private Sub Form_Load()connectdbEnd SubPrivate Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_name.Text = "" Then m_MissingFields = m_MissingFields & "Name," m_valid = False End If If txt_age.Text = "" Then m_MissingFields = m_MissingFields & "Age," m_valid = False
HOSPITAL MANAGEMENT SYSTEM 87
End If If txt_address.Text = "" Then m_MissingFields = m_MissingFields & "Address," m_valid = False End If If txt_phno.Text = "" Then m_MissingFields = m_MissingFields & "Phonenumber," m_valid = False End If If txt_username.Text = "" Then m_MissingFields = m_MissingFields & "Username," m_valid = False End If If txt_password.Text = "" Then m_MissingFields = m_MissingFields & "Password," m_valid = False End If ValidateForm = m_validEnd Function
Private Sub Form_Unload(Cancel As Integer)On Error Resume Nextdb.CloseEnd Sub
HOSPITAL MANAGEMENT SYSTEM 88
PROJECT REPORTS
PROJECT REPORTS
HOSPITAL MANAGEMENT SYSTEM 89
MEDICINE REPORT:-
USERS REPORT:-
HOSPITAL MANAGEMENT SYSTEM 90
HOSPITAL MANAGEMENT SYSTEM 91
FUTURE ENHANCEMENT
FUTURE ENHANCEMENT
HOSPITAL MANAGEMENT SYSTEM 92
The purpose of the project entitled as “HOSPITAL MANAGEMENT SYSTEM” is to
computerize the Front Office Management of Hospital to develop software which is
user friendly, simple, fast, and cost – effective. It deals with the collection of patient’s
information, diagnosis details, etc. Traditionally, it was done manually
The proposed system is Hospital Management System. We can enhance this
system by including more facilities like billing system, inpatient room allotment for
the admitted patients and the stock details of medicines in the pharmacy.
Providing such features enable the users to include more comments into the system.
HOSPITAL MANAGEMENT SYSTEM 93
CONCLUSION
CONCLUSION
The HOSPITAL MANAGEMENT SYSTEM is a great improvement over the manual
system using case fields and paper. The computerization of the system has sped up the
HOSPITAL MANAGEMENT SYSTEM 94
process. In the current system, the front office managing is very slow. The hospital
managing system was thoroughly checked and tested with dummy data and thus is
found to be very reliable.
ADVANTAGES
It is fast, efficient and reliable
Avoids data redundancy and inconsistency
Very user-friendly
Easy accessibility of data
Number of personnel required is considerably less
Provides more security and integrity to data
HOSPITAL MANAGEMENT SYSTEM 95
BIBLIOGRAPHY
BIBLIOGRAPHY
Books
A Complete Guide to Programming in Visual Basic .Net
HOSPITAL MANAGEMENT SYSTEM 96
-Michael McMillian
A Complete Visual Basic 6 Training Course: How to Programme:
Package
-Harvey M deitel,Paul j deitel,Tem R Neito
Advanced Programming Using Visual Basic: Version 6.0
-Julia Case Bradley
Access 2003 Power Programming with VBA
-Allen G Taylor
Advanced MS Visual Basic
-Peter Morris
Site Address
www.associatedcontent.com
www.members.tripod.com
www.vbcodesource.com
HOSPITAL MANAGEMENT SYSTEM 97