Sei sulla pagina 1di 63

HOSPITAL

MANAGEMENT
SYSTEM
ACKNOWLEDGEMENT

Concentration, dedication and application are necessary but not


sufficient to achieve our goal. These must be awarded by guidance,
assistance and cooperation of person to make it tenable.

Firstly, it is great pleasure, thanking all the people who helped us to


follow the path to success for the completion of this project.

I gratefully acknowledge to Mr. K.K. Singh who has given us the


opportunity to learn at deep level to prepare this project.

I would also like to refer the various authors of Visual Basic language
book like, Master In Visual Basic, Black Book In Visual Basic and etc.
and also MSDN library of Visual Studio, An introduction to Database
system with thanks for the technical help.

Finally, my warm an indebted thanks to all the faculty staff member of


I. T . S College for their kind helps during our studies/practical.

Although we have tried to make this project error free and tested it in
the extreme conditions, but if any body found any type of error or
suggestions for this software, please report us and we promise to fix the
problem or will adopt good suggestions.
Saurabh Shishodia
Varun Jain
MCA-IV Sem.
S/N CONTENTS
1 Synopsis, Introduction
2 About the hospital

3 Problem analysis

4 Relevance

5 Description

6 E-R diagram

7 Data flow diagram

8 Data base diagram

9 Data base design

10 Coding And Testing

11 System Requirements

12 Limitations

13 Conclusion

14 Appendix

15 Bibliography
SYNOPSIS

Hospital Information System serves many purposes and provides


unique identification of patients, wards & doctors of hospital. It helps
the hospital to keep vital document related to hospital.

We have been assigned the project of Hospital Information System.


We have worked on Windows XP environment and used MS Access with
visual basic (6.0) package in the Ghaziabad(U.P).

In hospital there is number of patients who wants different type of


treatments according to disease. It is really very tidies to manage all
information of patients, doctors personal as well as wards record on
hand without any information system. This hospital Information system
is designed keeping in view for maintaining the information &
processing it to give the efficient and correct Output for the system.

This software, we brought for you is excellent for all of the hospital
needs, and it automates all kind of work. Now as the efficiency Increase
one person can work in Place of number of person. Data are stored on
secondary storage a device that saves the uses of Paper and on the other
hand on the storage device never degrade and can be stored for
centuries. Now no manual calculation, mean No more calculating
mistake, no errors in records no wrong information No slow process.

This is designed in such a way that even if anyone is not aware of the
computer or an application, one can collect the desired information.
INTRODUCTION

1. INTRODUCTION TO SOFTWARE DESIGN

The design activity begins when the requirements document for the software
to be developed is available .This may be the SRS for the complete system,
as in the case if the waterfall model is being followed or the requirements for
the next iteration if the iterative enhancement is being followed or the
requirements for the prototype if the prototyping is being followed .While
the requirements specification activity is entirely in the problem domain
,design is the first step in moving from the problem domain toward the
solution domain. Design is essentially the bridge between requirements
specification and the final solution for satisfying the requirements.

The term design is used in two ways .Used as a verb, it represents the
process of design. Used as a noun, it represents the result of the design
process, which is the design of the system. The goal of the design process is
to produce a model or representation of a system, which can be used later to
build that system. The produced model is called the design of the system.

The design of a system is essentially a blueprint or a plan for a solution for


the system. Here we consider a system to be a set of components with
clearly defined behavior that interacts with each other in a fixed defined
manner to produce some behavior or services for its environment. A
component of a system can be considered a system, with its own
components. In a software system, a component is a software module.

The design process for software systems often has two levels. At the first
level the focus is on deciding which modules are needed for the system, the
specifications of these modules, and how the modules should be
interconnected. This is what is called the system design or top-level design.
In the second level, the internal design of the modules, or how the
specifications of the module can be satisfied, is decided. This design level is
often called detailed design or logic design. Detailed design essentially
expands the system design to contain a more detailed description of the
processing logic and data structures so that the design is sufficiently
complete for coding.

Because the detailed design is an extension of system design the system

design controls the major structural characteristics of the system. The

system design has a major impact on the testability and modifiability of a

system, and it impacts its efficiency. Most of the design effort for designing

software is spent creating the system design. .

A design methodology is a systematic approach to creating a design by


applying of a set of techniques and guidelines.
ABOUT THE HOSPITAL

OUR HMS: -
Metro Hospital is the leading medical center of Noida committed to provide
the best care by specialist alike. A 60-bedded compact hospital unit harbors
world class ICCU and a busy casualty backed up by ultra modern operation
theatres and 24 hours laboratory Services.

GUIDING SOURCE BEHIND METRO HOSPITAL NOIDA

Recognizing the need for intensive exchange of Information and the need of
active interaction between corporate and hospital, as well as management
and young doctors, THE METRO HOSPITAL.

The primary objective of HMS is to provide platforms of interaction


with a professional orientation, thereby optimizing time and other resources,
as well as providing comprehensive value-additions to the lives of
established managers, future managers and the trainers of future manager.

HMS will not only contribute to the management development &


better patient handling. It will also impact HMS in a positive way with the
programs and initiatives it will organize and implement.
Vision
To remain in the forefront of the management education by imparting
quality education.
To prepare agile, transformational leaders with global outlook in the
ever evolving world of Hospital Management System (educational
management).
To be counted among the top hospital globally offering the best
facility of patient, seminars and workshops in the management
system.
Mission

To partner with corporate in exploration of quality management


system.
To prepare doctors to be innovative leaders (MEDICAL).
To nurture and promote innovation and healthy practices in
medical practices.
The center also plans to develop a well-equipped information
resource center for research and psychometric lab for the
counseling of young doctor.

The center proposes to

Organize international and national level conferences and


seminars.
Conduct short duration development workshops and programs
for senior and middle level executives.
To organize faculty development workshops to improve quality
and doctors education.
Inviting management members to share their views and interact
with the young doctors weekly.
To organize industrial visit for the young doctors to get the
exposure of running organization.
To arrange training for the young doctors with an objective of
providing them a practical exposure in the hospital system.
PROBLEM

In general the most of the database of Patient Department in Metro Hospital


is maintained manually so that system does not have much flexibility and
does not give results as required. Because of these reasons there is need of
developing a new more efficient system.

A lot of information related to the patient & any department has to be kept in
any management department. Manual or work in any other package requires
lot of labour and time.
SYSTEM ANALYSIS

System analysis is related with the information gathering i.e. analyzing the
system, deciding which information is to be stored in the database, and in
which manner. Here we had analyzed the Hospital Information System. In
analyzing the system, we have to decide the entities about which we have to
store the information, the attribute of these entities and relation between
these entities.

The system consists of the following entities:

1 PATIENT
2 REGISTRATION
3 ADMISSION
4 WARD
5 DOCTOR
6 TEST RESULT
7 INVOICE
FEASIBILITY ANALYSIS

The objective of a feasibility study is not to solve the problem but To predict
(on the basis of system analysis & problem definition) that if it does the kind
Of work expected on it, in a reasonable period of elapsed time, & consistent
with the financial and processing objective and needs of the organization.
During this study, data is being gathered to obtain sufficient information
about existing system to make compression with possible computer systems.
Here the system Hospital Information System is manual. It is not possible
for this application to store such a huge database of hospital account.
Feasibility analysis is done in respect of the following:

1. Hardware
2. Economical (h/w, software)

1. Hardware
Feasibility analysis in case of hardware is too seeing whether the required
hardware for the proposed method is available or not. If yes then
installation is feasible.
Generally Ms Access installation requires:
1. Computer based on Pentium processor

2. Hard disk space


3. 128MB (or higher) on WIN NT

4. Mouse
5. Printer
All this required hardware is easily available in the market & is not very
expensive therefore, the proposed system (according to problem
definition & system analysis) is feasible as for as hardware requirement
is concerned.
2. Economical

All the required hardware and software is easily available in the market
therefore, this package is very economical for it. Also here is no need for
Special training for staff. Just two or three hours are sufficient for the
explanation of method of using this package, since the proposed method
is to develop the package using visual basic which is very interactive. An
ignorant user can use it very efficiently without much training.
Since we have decided to develop the package in Ms Access and visual
basic 6.0, this will not require very long time. Since database is created
using Ms Access in which we have to specify only what to be done and
not how to be done. Simple commands are there in Ms Access to create
and manipulate data. Reports are created using report writer which uses
data from tables, views etc.
Therefore, consumption of time in developing this project will be very
less or in other words time available is sufficient for developing this
project. Thus we can say this proposed system is feasible with respect to
time.

3. Software

There is no special system software requirement for the package


(Hospital Information System) but to run this we need this software:

a) WINDOWS 98 & win-XP.


b) Visual Basic language.
c) Ms Access
RELEVANCE

WHY WE CHOOSE PARTICULAR TOPIC:

In general the most of the database of Patient is maintain manually so that


system does not have much flexibility and does not give results as required.
Because of these reasons there is need of developing a new more efficient
system. So we choose this topic for making this project.

WHY WE CHOOSE PARTICULAR FRONTEND (VB 6.0) & BACKEND


(Ms Access) LANGUAGE:

ABOUT MS ACCESS

Between the physical databases itself (i.e. the data as actually


stored) and the user of the system is a layer of software called MS Access.
All requests from the users for access to the database are handled by the Ms
Access. It also provides the shielding of database user from hardware-level
details. All data base allow users to create containers (i.e. relations or tables)
for data storage and management.
Choice of language:

Database is an organization of interrelated collection of information


(data) stored together with controlled redundancy to serve one or more
application in an optimal fashion. The data in database is both integrated
and shared. The database is a system that organizes the storage of data in
such a way as to facilitate its retrieval for many different applications. In
brief database is a collection of software that organizes and structuring
data into record and files with the ability to-

Define and add new data to database.


Add new data files.
Easy retrieval of data interacting in various ways.
Generate the code and report based on data in the database.
Maintain the integrity and consistency of data.

Visual Basic:

We use Visual Basic as a front end for developing the project


HOSPITAL MANAGEMENT INFORMATION We use Visual SYSTEM
because visual programming provide the user with a better interface i.e.
intuitive and easy to use in developing the interface visual basic provide
many user friendly features such as windows, menus, buttons & list boxes.
Visual programming environments provide all features that are required to
develop a graphical user interface as ready to use.

The visual programming environments provide many readymade tools, and


not needed to write a code. The programmer can select the appropriate
Visual Basic Capabilities & Advantages

Visual Basic provide graphical user interface, which are easy to use
and easy to learn.
A programmer need not write code to display the required component.
Visual Basic provides the facility of readymade components.
The components can be moved, reside, rename and even deleted, if so
required.
There is no restriction on the number of controls that can be placed on
a form.
The interface components provided by the visual programming
environment have some code built into them.

The relevance of this project itself arises with the requirement placed by the
SOFT SOLUTION group, the actual problem they were facing and the
overall result they were trying to achieve. Hence a part of the
PUSHPANJALI-automation, which was our mission to completely
automate, so we took it as a challenge and accepted it with full enthusiasm.
DESCRIPTION

Being the METRO HOSPITAL comes as a golden opportunity.


HOSPITAL automation has various modules in it: -

1) SOFT SOLUTION: Providing the database of patient handling and


record by the METRO HOSPITAL, NOIDA.

2) PATIENT RECORD: Maintaining the database of


each patient.

3) TIME TABLE: Generating Time Table of whole Metro hospital

4) DISPATCH CARD: Generating the dispatch card as per Metro format of


each patient.

Patient Information
Patient History
Patient Visiting Date

Maintaining Patient Record

Entering Records
This is the first stage of our module where we are taking entries
regarding the patient record. Here we are taking care that the name of the
patient &ID is mandatory rest other fields are optional. That means we are
making a compulsion that you must know the patient name and must fill it
properly. After completion of patient details. The mandatory fields at this
stage is
=>Patient Name
=> Patient Address
=>City and,
=>Phone Number
Other fields are optional
The most important point here is that related to each new entry we are
assigning a particular identification number which is generated
automatically, having no user interaction directly.

Modifying Record
Here we are first taking the Patient ID as the searching criteria. This is the
mandatory field. Based on a particular name there may be more than one
record exists. We are displaying all the records, one at time. A person can
select any one record to modify at a single instance of time. Here also, we
are maintaining the same sequence as in the case of entering the records, that
is, after modifying the Patient details the related hospital details will be
displayed for modification. The mandatory fields are still mandatory and we
cannot overlook this.

Deleting Records
Here again the Patient ID the searching criteria. This is the mandatory
field. Based on a particular name there may be more than one record exists.
We are displaying all the records, one at time. A operator can select any one
record to delete at a single instance of time. The user performs deletion after
the confirmation. Once we select a particular record to delete, all the
information regarding that particular person will be deleted permanently
from our database.

Searching Records
There are different fields based on which we can perform searching.
We are providing here a drop down list and not taking the actual input from
the user as text.
The drop down list contains
Patient ID
The user has to select any one of the specified fields. Based on the selected
field unique results will appear in a second drop down. We have to select a
particular entry from the second drop down and it will show all the related
records, one at a time. Here user cannot make any actual changes in the
displayed record.
OBJECTIVE AND SCOPE

The objective of this proposal is to implement software (HMS) at your


organization. Hospital Management System (HMS) provides the benefits of
streamlined operations, enhanced administrations & control, improved
response to patient care, cost control & improved profitability & efficiency.
Hence flexibility is built into HMS.

Objective of HMS
Lean and efficient system
High performance even on modest hardware
Easy to install
Speedy to install
Fast implementation
Easy to administrator

Salient Features: -
User-friendly screens developed on latest technology.
Modular approach
Integrated software solution.
High level of security.
Backend independent.
Easy to customize
Easy to install
Comprehensive data entry to generate maximum output.
Quick info for patient management & billing.
Modules of soft solution HMS: -
Front Office (OPD & IPD registration).
Ward management.
Patient management.
Emergency (ICU & ICCU).
OT management.
Patient billing (OPD & IPD).
Blood bank.
Doctors databank.
Security and Administration.
INSITE OF MODULES

RECEPTION (OPD AND IPD REGISTRATION): -

OPD Registration: -
Registration of patient as per classification.
Collection from out patient..
Tracking previous visit of patient.
No repetitive entries of patient details when the patient has visited the
hospital previously.

IPD Registration: -
Registration of in-patient.
Advance collection from in-patient.
Conversion from out patient to in-patient.
No repetitive entries of patient details when the patient has visited the
Hospital previously.
IPD slip generation.
Tracking previous visit of patient.
Registration as per classification.
Handling of corporate patients.
List of doctors as per department and vice versa.
Charge Slip: -
Cash and credit bill for both inpatient and out patient.
Billing for corporate patient.
Receipts for payment received.
Fully integrated with patient billing
MIS REPORTS: -
Patient information as per following selection criteria:
a) Data wise.
b) Category wise.
c) Doctor Wise.
d) Department wise.

Daily collection report as per following selection criteria:


a) Data wise.
b) Category wise.
c) Doctor Wise.
d) Department wise.

Bed occupancy report as per following selection criteria:


a Ward wise
b Date wise.
c Category wise.
Patient diet report.
No redundancy of records.
Easy addition of records.
Modification of the record.
E R DIAGRAM

Pt_name Ref_dr_name Expr_info Treat_deta

Pt_add Reg_no

Pt_sex Reg_chargeg
e
Pt_age Dr_id

Pt_id Pt_MST Pt_Reg Doctor


Dr_name
Kin_name
Dr_dept
Kin_add

Reg_chargeg
Ph_no Is e
No IPD

Pt_occu Reg_dt

Yes
Admin_dt Admin_tme

Ward_id Admission Pt_id

Bed_id
Admin_no
Pt_id
Pt_cate
Advance
Bil
Conce l Total_char

Dr_name Date_dischar
Pt_treat Ward Table ge
Pris_medi

Pt_id

Pt_recovery Ward_sta Bed_occ Ward_id Ward_desc

Hospital
Management
System

Patient
DATA FLOW DIAGRAM
DATA FLOW DIAGRAM FOR OPD
CONTEXT FLOW DIAGRAM
HOSPITAL FRM DOCTOR (CODE)

Option Explicit
Dim adding As Boolean
Dim ans As String

Private Sub cboName_Click()


Dim name As String
name = frmDoctor.cboName.Text
rsdoctor.find "[dr_name]=" & "'" & name & "'", 0, adSearchForward, adBookmarkFirst
If rsdoctor.EOF Or rsdoctor.BOF Then
MsgBox ("Doctor name not found")
Else
Filldoctor
End If
End Sub

Private Sub cmdadd_Click()


frmDoctor.cmdadd.Enabled = False
frmDoctor.cmddelete.Enabled = False
frmDoctor.cmdexit.Enabled = False
frmDoctor.cmdBrowse(0).Enabled = False
frmDoctor.cmdBrowse(1).Enabled = False
frmDoctor.cmdBrowse(2).Enabled = False
frmDoctor.cmdBrowse(3).Enabled = False

adding = True

frmDoctor.txtDID.Text = ""
frmDoctor.txtname.Text = ""
frmDoctor.txtspecial.Text = ""
frmDoctor.txtqualify.Text = ""
frmDoctor.txtfee.Text = ""
frmDoctor.txtphone.Text = ""
frmDoctor.txtAddress.Text = ""
frmDoctor.txtdeptname.Text = ""
frmDoctor.txtDID.SetFocus
frmDoctor.txtDID.SelLength = Len(txtDID.Text)
frmDoctor.txtname.Visible = True
frmDoctor.cboName.Visible = False

End Sub

Private Sub cmdbrowse_Click(Index As Integer)


On Error GoTo errorhandler
Select Case Index
Case 0
rsdoctor.MoveFirst
Filldoctor

Case 1
rsdoctor.MovePrevious
If rsdoctor.BOF Then
rsdoctor.MoveFirst
MsgBox "You are on the first file."
End If
Filldoctor
Case 2
rsdoctor.MoveNext
If rsdoctor.EOF Then
rsdoctor.MoveLast
MsgBox "You are on the last file."
End If
Filldoctor
Case 3
rsdoctor.MoveLast
Filldoctor

End Select
Exit Sub
errorhandler:
frmDoctor.cboName.Enabled = True
frmDoctor.txtname.Enabled = False
frmDoctor.Show
Filldoctor

End Sub
Private Sub cmdCancel_Click()
If adding = True Then
rsdoctor.CancelUpdate
adding = False
Else
Dim currentrecord As Variant
currentrecord = rsdoctor.Bookmark
rsdoctor.CancelUpdate
rsdoctor.Bookmark = currentrecord
End If
frmDoctor.cboName.Visible = True
frmDoctor.txtname.Visible = False
Filldoctor
enable2
End Sub

Private Sub cmddelete_Click()


If MsgBox("Are you sure ??", vbYesNo, "Delete") = vbYes Then
rsdoctor.Delete
rsdoctor.MoveNext
If rsdoctor.EOF Then
rsdoctor.MoveLast
End If
Filldoctor
End If
End Sub

Private Sub cmdexit_Click()


ans = MsgBox("Return to Main Window?", vbYesNo, "Exit Form")
If ans = vbYes Then
frmDoctor.Hide
frmInvoice.Hide
frmPatient.Hide
frmadmission.Hide
Registrationfrm.Hide
testresult.Hide
warddetails.Hide
frmGoto.Show
End If
End Sub

Private Sub cmdmodify_Click()


txtDID.SetFocus
If adding = True Then
rsdoctor.AddNew
End If
rsdoctor![dr_name] = cboName.Text
rsdoctor![dr_quali] = txtqualify.Text
rsdoctor![dr_spl] = txtspecial.Text
rsdoctor![dr_address] = txtAddress.Text
rsdoctor![dr_ID] = txtDID.Text
rsdoctor![Dr_fee] = txtfee.Text
rsdoctor![dr_phno] = txtphone.Text
rsdoctor![dept_name] = txtdeptname.Text
rsdoctor.Update
enable2
adding = False
Filldoctor
End Sub

Private Sub cmdsave_Click()

Dim strDID As String, strName As String, strspecial As String, strqualify As String,


straddress As String
Dim strdept As String, strfee As String, strphone As String

strDID = frmDoctor.txtDID.Text
strphone = frmDoctor.txtphone.Text
strName = frmDoctor.cboName.Text
strspecial = frmDoctor.txtspecial.Text
strqualify = frmDoctor.txtqualify.Text
straddress = frmDoctor.txtAddress.Text
strdept = frmDoctor.txtdeptname.Text
strfee = frmDoctor.txtfee.Text

If adding = True Then


rsdoctor.AddNew
End If
On Error GoTo errorhandler
'add it to the table
rsdoctor![dr_ID] = txtDID.Text
rsdoctor![dr_name] = cboName.Text
rsdoctor![dr_spl] = txtspecial.Text
rsdoctor![dr_quali] = txtqualify.Text
rsdoctor![dr_phno] = txtphone.Text
rsdoctor![dr_address] = txtAddress.Text
rsdoctor![dept_name] = txtdeptname.Text
rsdoctor![Dr_fee] = txtfee.Text
enable2
frmDoctor.cboName.Visible = True
frmDoctor.txtname.Visible = False
Filldoctor
fillcboName
Exit Sub
errorhandler:
MsgBox "You must enter data into all fields"
If adding = True Then
rsdoctor.CancelUpdate
adding = True
txtDID.Text = strDID
txtspecial.Text = strspecial
cboName.Text = strName
txtqualify.Text = strqualify
txtphone.Text = strphone
txtAddress.Text = straddress
txtdeptname.Text = strdept
txtfee.Text = strfee
If frmDoctor.txtDID.Text = "" Then
frmDoctor.txtDID.SetFocus
ElseIf frmDoctor.cboName.Text = "" Then
frmDoctor.cboName.SetFocus
ElseIf frmDoctor.txtqualify.Text = "" Then
frmDoctor.txtqualify.SetFocus
ElseIf frmDoctor.txtspecial.Text = "" Then
frmDoctor.txtspecial.SetFocus
ElseIf frmDoctor.txtphone = "" Then
frmDoctor.txtphone.SetFocus
ElseIf frmDoctor.txtAddress = "" Then
frmDoctor.txtAddress.SetFocus

ElseIf frmDoctor.txtdeptname = "" Then


frmDoctor.txtdeptname.SetFocus
ElseIf frmDoctor.txtfee = "" Then
frmDoctor.txtfee.SetFocus
End If

End If

End Sub

Private Sub Form_Activate()


status
End Sub

Private Sub Form_Load()


frmDoctor.Top = (Screen.Height - frmDoctor.Height) / 2
frmDoctor.Left = (Screen.Width - frmDoctor.Width) / 2
Connect
txtname.Visible = False
cboName.Visible = True
fillcboName
End Sub
HOSPITAL FRM ADMISSION (CODE)

Option Explicit
Dim adding As Boolean

Private Sub cboID_Click()


Dim id As String
id = frmadmission.cboID.Text
rsadmission.find "[pt_ID]=" & "'" & id & "'", 0, adSearchForward, adBookmarkFirst
If rsadmission.EOF Or rsadmission.BOF Then
MsgBox "Patient id not found !!!"
Else
filladmission
End If
End Sub

Private Sub cmdadd_Click()


cboID.Visible = True
cboID.Locked = False
txtLast.Locked = False
txtFirst.Locked = False
txt_peradd.Locked = False
txt_tempadd.Locked = False
disease.Locked = False
txtage.Locked = False
txtsex.Locked = False
txtdate.Locked = False
txttime.Locked = False
txtphone.Locked = False
txtother.Locked = False
txtdoctor.Locked = False
txtregno.Locked = False
txtDOB.Locked = False
cboID.Text = ""
txtFirst.Text = ""
txtLast.Text = ""
txtphone.Text = ""
txtdoctor.Text = ""
txtregno.Text = ""
txtage.Text = ""
txtsex.Text = ""
txtDOB.Text = ""
txt_peradd.Text = ""
txt_tempadd.Text = ""
disease.Text = ""
txtother.Text = ""
txtdate.Text = ""
txttime.Text = ""
frmadmission.cboID.SetFocus
adding = True
disable
clear
frmadmission.cboID.Enabled = True
frmadmission.cboID.SetFocus
frmadmission.cboID.SelStart = 0
frmadmission.cboID.SelLength = Len(cboID.Text)
End Sub
Public Sub Formactivate()
status
End Sub

Private Sub cmdclear_Click()


cboID.Text = ""
txtFirst.Text = ""
txtLast.Text = ""
txtphone.Text = ""
txtdoctor.Text = ""
txtregno.Text = ""
txtage.Text = ""
txtsex.Text = ""
txtDOB.Text = ""
txt_peradd.Text = ""
txt_tempadd.Text = ""
disease.Text = ""
txtother.Text = ""
txtdate.Text = ""
txttime.Text = ""
frmadmission.cboID.SetFocus
End Sub

Private Sub cmddelete_Click()


If MsgBox("Are you sure to delete this record?", vbYesNo, "Delete record") = vbYes
Then
rsadmission.Delete
rsadmission.MoveNext
If rsadmission.EOF Then
rsadmission.MoveLast
End If
filladmission
End If
End Sub

Private Sub cmdmain_Click()

frmadmission.Hide
frmGoto.Show

End Sub
Private Sub cmdmodify_Click()
MsgBox "Do you want to modify some fields ?", vbQuestion, "modify"
cboID.SetFocus
cboID.Locked = False
txtLast.Locked = False
txtFirst.Locked = False
txt_peradd.Locked = False
txt_tempadd.Locked = False
disease.Locked = False
txtage.Locked = False
txtsex.Locked = False
txtdate.Locked = False
txttime.Locked = False
txtphone.Locked = False
txtDOB.Locked = False
txtother.Locked = False
txtdoctor.Locked = False
txtregno.Locked = False
If adding = True Then
rsadmission.AddNew
End If
rsadmission![pt_ID] = cboID.Text
rsadmission![pt_lname] = txtLast.Text
rsadmission![pt_fname] = txtFirst.Text
rsadmission![per_add] = txt_peradd.Text
rsadmission![temp_add] = txt_tempadd.Text
rsadmission![disease] = disease.Text
rsadmission![age] = txtage.Text
rsadmission![sex] = txtsex.Text
rsadmission![Dt_ofBirth] = txtDOB.Text
rsadmission![Time] = txttime.Text
rsadmission![phone] = txtphone.Text
rsadmission![other] = txtother.Text
rsadmission![dr_name] = txtdoctor.Text
rsadmission![regis_no] = txtregno.Text
rsadmission![dt_of_admission] = txtdate.Text

rsadmission.Update
enable3
adding = False
filladmission
End Sub

Private Sub cmdsave_Click()


Dim strid2 As String, str1Name As String, str2Name As String, strperadd As String,
strtempadd As String, strdisease As String, strage As String
Dim strsex As String, strDOB As String, strdate As String, strtime As String, strother As
String, strphone As String
Dim strdr As String, strregno As String
strid2 = frmadmission.cboID.Text
strphone = frmadmission.txtphone.Text
str2Name = frmadmission.txtLast.Text
str1Name = frmadmission.txtFirst.Text
strperadd = frmadmission.txt_peradd.Text
strtempadd = frmadmission.txt_tempadd.Text
strdisease = frmadmission.disease.Text
strage = frmadmission.txtage.Text
strsex = frmadmission.txtsex.Text
strDOB = frmadmission.txtDOB.Text
strdate = frmadmission.txtdate.Text
strtime = frmadmission.txttime.Text
strother = frmadmission.txtother.Text
strdr = frmadmission.txtdoctor.Text
strregno = frmadmission.txtregno.Text

If adding = True Then


rsadmission.AddNew
End If
On Error GoTo errorhandler
'add it to the table
rsadmission![pt_ID] = cboID.Text
rsadmission![pt_lname] = txtLast.Text
rsadmission![pt_fname] = txtFirst.Text
rsadmission![per_add] = txt_peradd.Text
rsadmission![temp_add] = txt_tempadd.Text
rsadmission![disease] = disease.Text
rsadmission![age] = txtage.Text
rsadmission![sex] = txtsex.Text
rsadmission![dt_of_admission] = txtdate.Text
rsadmission![Time] = txttime.Text
rsadmission![phone] = txtphone.Text
rsadmission![Dt_ofBirth] = txtDOB.Text
rsadmission![other] = txtother.Text
rsadmission![dr_name] = txtdoctor.Text
rsadmission![regis_no] = txtregno.Text
enable3
frmadmission.cboID.Visible = True
frmadmission.cboID.Enabled = True
filladmission
FillcboID
MsgBox "modification/change is successful!!!", vbInformation, "message"
Exit Sub
errorhandler:
MsgBox "modification/change not made,try again!!!", vbCritical, "error"
If adding = True Then
rsadmission.CancelUpdate
adding = True
cboID.Text = strid2
txtphone.Text = strphone
txtLast.Text = str2Name
txtFirst.Text = str1Name
txt_peradd.Text = strperadd
txt_tempadd.Text = strtempadd
disease.Text = strdisease
txtage.Text = strage
txtsex.Text = strsex
txtDOB.Text = strDOB
txtdate.Text = strdate
txttime.Text = strtime
txtother.Text = strother
txtdoctor.Text = strdr
txtregno.Text = strregno

If frmadmission.cboID.Text = "" Then


frmadmission.cboID.SetFocus
ElseIf frmadmission.txtphone.Text = "" Then
frmadmission.txtphone.SetFocus
ElseIf frmadmission.txtLast.Text = "" Then
frmadmission.txtLast.SetFocus
ElseIf frmadmission.txtFirst.Text = "" Then
frmadmission.txtFirst.SetFocus
ElseIf frmadmission.txt_peradd.Text = "" Then
frmadmission.txt_peradd.SetFocus
ElseIf frmadmission.txt_tempadd.Text = "" Then
frmadmission.txt_tempadd.SetFocus
ElseIf frmadmission.disease.Text = "" Then
frmadmission.disease.SetFocus
ElseIf frmadmission.txtage = "" Then
frmadmission.txtage.SetFocus
ElseIf frmadmission.txtsex.Text = "" Then
frmadmission.txtsex.SetFocus
ElseIf frmadmission.txtDOB.Text = "" Then
frmadmission.txtDOB.SetFocus
ElseIf frmadmission.txtdate.Text = "" Then
frmadmission.txtdate.SetFocus
ElseIf frmadmission.txttime.Text = "" Then
frmadmission.txttime.SetFocus
ElseIf frmadmission.txtdoctor.Text = "" Then
frmadmission.txtdoctor.SetFocus
ElseIf frmadmission.txtother.Text = "" Then
frmadmission.txtother.SetFocus
ElseIf frmadmission.txtregno.Text = "" Then
frmadmission.txtregno.SetFocus
End If

End If

End Sub
Private Sub cmdsearch_Click()
Dim bmark As Variant
Dim find As Integer
cboID.Locked = False
txtLast.Locked = True
txtFirst.Locked = True
txt_peradd.Locked = True
txt_tempadd.Locked = True
disease.Locked = True
txtage.Locked = True
txtsex.Locked = True
txtdate.Locked = True
txttime.Locked = True
txtphone.Locked = True
txtDOB.Locked = True
txtother.Locked = True
txtdoctor.Locked = True
txtregno.Locked = True
bmark = rsadmission.Bookmark
On Error GoTo errorhandler
find = InputBox("Enter patient ID", "Find")
rsadmission.find "[pt_ID] = " & "'" & find & "'", 0, adSearchForward,
adBookmarkFirst
If rsadmission.EOF Or rsadmission.BOF Then
MsgBox "patient not found !!", vbCritical, "error"
rsadmission.Bookmark = bmark
End If
filladmission
Exit Sub
errorhandler:
MsgBox "invalid arguement"
End Sub

Private Sub Form_Load()


frmadmission.Top = (Screen.Height - frmadmission.Height) / 2
frmadmission.Left = (Screen.Width - frmadmission.Width) / 2
Connect
cboID.Visible = True
filladmission
FillcboID
End Sub
HOSPITAL WARD DETAILS (CODE)

Private Sub cbobedno_Click()


Dim name As String
name = warddetails.cbobedno.Text
rsward.find "[bedno]=" & "'" & name & "'", 0, adSearchForward, adBookmarkFirst

If rsward.EOF Or rsward.BOF Then


MsgBox ("Invoice not found")
Else
fillward
End If
End Sub

Private Sub cmdbrowse_Click(Index As Integer)


On Error GoTo errorhandler
Select Case Index
Case 0
rsward.MoveFirst
fillward

Case 1
rsward.MovePrevious
If rsward.BOF Then
rsward.MoveFirst
MsgBox "You are on the first file."
End If
fillward
Case 2
rsward.MoveNext
If rsward.EOF Then
rsward.MoveLast
MsgBox "You are on the last file."
End If
fillward
Case 3
rsward.MoveLast
fillward

End Select
Exit Sub
errorhandler:
MsgBox "enter valid arguments", vbCritical, "error"
fillward
End Sub

Private Sub cmddelete_Click()


If MsgBox("Are you sure to delete this record?", vbYesNo, "Delete record") = vbYes
Then
rsward.Delete
rsward.MoveNext
If rsward.EOF Then
rsward.MoveLast
End If
fillward
End If
End Sub

Private Sub cmdexit_Click()


warddetails.Hide
frmGoto.Show
End Sub

Private Sub cmdsave_Click()


Dim adding As Boolean

warddetails.cbobedno.Enabled = True
If adding = True Then
rsward.AddNew
End If

rsward![bedno] = cbobedno.Text
rsward![wardno] = txtwardno.Text
rsward![ward_desc] = txtwardDesc.Text
rsward![ward_cat] = txtcategory.Text
rsward![no_of_bed] = txtnoofbeds.Text
rsward![total] = txtTotal.Text
rsward![pt_ID] = txtID.Text
rsward![pt_name] = txtname.Text
rsward![pt_sex] = txtsex.Text
rsward![pt_age] = txtage.Text
rsward![bed_occupied] = txtbed.Text

rsward.Update
enable6
adding = False
fillward
MsgBox "Save made by you is successful", vbInformation, "test result"
Exit Sub
errorhandler:
MsgBox "You have already saved the record", vbCritical, "Saved"
End Sub

Private Sub cmdshow_Click()


Dim bmark As Variant
Dim find As Integer
bmark = rsadmission.Bookmark
On Error GoTo errorhandler
find = InputBox("Enter patient ID to veiw the ward details", "Find")
rsward.find "[pt_ID] = " & "'" & find & "'", 0, adSearchForward, adBookmarkFirst
If rsward.EOF Or rsward.BOF Then
rsward.Bookmark = bmark
End If
fillward
Exit Sub
errorhandler:
MsgBox "invalid arguement or patient ID entered", vbCritical, "error"
End Sub

Private Sub Form_Load()


warddetails.Top = (Screen.Height - warddetails.Height) / 2
warddetails.Left = (Screen.Width - warddetails.Width) / 2
Connect
cbobedno.Visible = True
fillward
fillcbobedno
End Sub
HOSPITAL FRMLOGIN (CODE)

Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdexit_Click()
LoginSucceeded = False
Me.Hide
End Sub

Private Sub cmdok_Click()


If txtpassword = "rohit" And txtuser = "rahul" Then
LoginSucceeded = True
Me.Hide
frmGoto.Show
frmlogin.Hide
Else
MsgBox "Invalid Password or username, try again!", , "Login"
txtuser.SetFocus
SendKeys "{Home}+{End}"

End If
End Sub

Private Sub Form_Load()


frmlogin.Top = (Screen.Height - frmlogin.Height) / 2
frmlogin.Left = (Screen.Width - frmlogin.Width) / 2
Connect
End Sub
HOSPITAL FRMPATIENT (CODE)

Option Explicit
Dim adding As Boolean
Dim ans As String
Dim find As String

Private Sub cbopatientID_click()


Dim id As String
id = frmPatient.cbopatientID.Text
rspatient.find "[pt_ID]=" & "'" & id & "'", 0, adSearchForward, adBookmarkFirst
If rspatient.EOF Or rspatient.BOF Then
MsgBox "Patient id not found !!!"
Else
Fillpatient
End If
End Sub

Private Sub cmdadd_Click()


adding = True
disable
clear
frmPatient.cbopatientID.Enabled = True
frmPatient.cbopatientID.SetFocus
frmPatient.cbopatientID.SelStart = 0
frmPatient.cbopatientID.SelLength = Len(cbopatientID.Text)
End Sub

Private Sub cmdbrowse_Click(Index As Integer)


Select Case Index
Case 0
rspatient.MoveFirst
Fillpatient

Case 1
rspatient.MovePrevious
If rspatient.BOF Then
rspatient.MoveFirst
MsgBox "You are on the first file."
End If
Fillpatient
Case 2
rspatient.MoveNext
If rspatient.EOF Then
rspatient.MoveLast
MsgBox "You are on the last file"
End If
Fillpatient
Case 3
rspatient.MoveLast
Fillpatient

End Select

End Sub

Private Sub cmdCancel_Click()


If adding = True Then
rspatient.CancelUpdate
adding = False
Else
Dim currentrecord As Variant
currentrecord = rspatient.Bookmark
rspatient.CancelUpdate
rspatient.Bookmark = currentrecord
End If
Fillpatient
enable

End Sub

Private Sub cmddelete_Click()


If MsgBox("Are you sure ??", vbYesNo, "Delete") = vbYes Then
rspatient.Delete
rspatient.MoveNext
If rspatient.EOF Then
rspatient.MoveLast
End If
Fillpatient
End If

End Sub

Private Sub cmdexit_Click()


ans = MsgBox("Back to Main Menu?", vbYesNo, "Close Form")
If ans = vbYes Then
frmPatient.Hide
frmGoto.Show
End If
End Sub

Private Sub cmdfind_Click()


Dim bmark As Variant
bmark = rspatient.Bookmark
On Error GoTo errorhandler
find = InputBox("Enter patient's ID", "Find")
rspatient.find "[pt_ID] = " & "'" & find & "'", 0, adSearchForward, adBookmarkFirst
If rspatient.EOF Or rspatient.BOF Then
MsgBox "patient not found"
rspatient.Bookmark = bmark
End If
Fillpatient
Exit Sub
errorhandler:
MsgBox "enter a valid patient ID"
End Sub

Private Sub cmdmainform_Click()


frmPatient.Hide
frmGoto.Show

End Sub

Private Sub cmdsave_Click()


frmPatient.txtadvance.Enabled = True
If adding = True Then
rspatient.AddNew
End If
cbopatientID.Enabled = True
rspatient![pt_ID] = cbopatientID.Text
rspatient![pt_lastname] = txtLast.Text
rspatient![pt_firstname] = txtFirst.Text
rspatient![pt_add] = txtAddress.Text
rspatient![City] = txtCity.Text
rspatient![Province] = txtProvince.Text
rspatient![phone] = txtphone.Text
rspatient![PostalCode] = txtPostal.Text
rspatient![pt_age] = txtage.Text
rspatient![pt_sex] = txtsex.Text
rspatient![pt_occu] = txtoccupation.Text
rspatient![doctoronduty] = txtdoctor.Text
rspatient![father_husname] = txtfather.Text
rspatient![extra_info] = txtother.Text
rspatient![advance] = txtadvance.Text

rspatient.Update
enable
adding = False
Fillpatient
MsgBox "Your changes have been successfully completed", vbInformation, "message"
End Sub

Private Sub Form_Activate()


status
End Sub
Private Sub Form_Load()
frmPatient.Top = (Screen.Height - frmPatient.Height) / 2
frmPatient.Left = (Screen.Width - frmPatient.Width) / 2
Connect
cbopatientID.Visible = True
cbopatientID.Enabled = True
FillcbopatientID
Fillpatient
End Sub

Private Sub txtAddress_Validate(Cancel As Boolean)


If txtAddress.Text = "" Then
If MsgBox("You must enter the patient's address.", vbOKCancel, "Error") = vbOK
Then
Cancel = True
Else
Fillpatient
enable
End If
End If
txtAddress.SetFocus
txtAddress.SelStart = 0
txtAddress.SelLength = Len(txtAddress.Text)

End Sub

Private Sub txtadvance_Validate(Cancel As Boolean)


If txtadvance.Text = "" Then
If MsgBox("You must enter advance for the customer if any.", vbOKCancel,
"Error") = vbOK Then
Cancel = True
Else
Fillpatient
enable
End If
ElseIf Not IsNumeric(txtadvance) Then
MsgBox "This field requires a number"
End If
txtadvance.SetFocus
txtadvance.SelStart = 0
txtadvance.SelLength = Len(txtadvance.Text)
End Sub

Private Sub txtCity_Validate(Cancel As Boolean)


If txtCity.Text = "" Then
If MsgBox("You must enter the name of the patient's city.", vbOKCancel, "Error") =
vbOK Then
Cancel = True
Else
Fillpatient
enable
End If
End If
txtCity.SetFocus
txtCity.SelStart = 0
txtCity.SelLength = Len(txtCity.Text)
End Sub

Private Sub txtpostal_Validate(Cancel As Boolean)


If Not IsNumeric(txtPostal.Text) Then
If MsgBox("Postal code must be entered as numeric", vbOKCancel, "Error") =
vbOK Then
Cancel = True
Else
Fillpatient
enable
End If
End If
txtPostal.SetFocus
txtPostal.SelStart = 0
txtPostal.SelLength = Len(txtPostal.Text)
End Sub

Private Sub txtage_Validate(Cancel As Boolean)


If Not IsNumeric(txtage.Text) Then
If MsgBox("This field must be a number!", vbOKCancel, "Error") = vbOK Then
Cancel = True
Else
Fillpatient
enable
End If

End If
txtage.SetFocus
txtage.SelStart = 0
txtage.SelLength = Len(txtage.Text)
End Sub

Private Sub txtsex_Validate(Cancel As Boolean)


If Not (txtsex.Text = "m") Or (txtsex.Text = "f") Then
If MsgBox("patient's sex must be entered as 'm(male) or f (female)'", vbOKCancel,
"Error") = vbOK Then
Cancel = True
Else
Fillpatient
enable
End If
End If
txtsex.SetFocus
txtsex.SelStart = 0
txtsex.SelLength = Len(txtsex.Text)

End Sub

Private Sub txtFirst_Validate(Cancel As Boolean)


If txtFirst.Text = "" Then
If MsgBox("You must enter the patient's first name.", vbOKCancel, "Error") =
vbOK Then
Cancel = True
Else
Fillpatient
enable
End If
End If
txtFirst.SetFocus
txtFirst.SelStart = 0
txtFirst.SelLength = Len(txtFirst.Text)
End Sub

Private Sub txtdoctor_Validate(Cancel As Boolean)


If txtdoctor.Text = "" Then
If MsgBox("You must enter the name of the doctor on duty.", vbOKCancel, "Error")
= vbOK Then
Cancel = True
Else
Fillpatient
enable
End If
End If
txtdoctor.SetFocus
txtdoctor.SelStart = 0
txtdoctor.SelLength = Len(txtdoctor.Text)
End Sub

Private Sub txtLast_Validate(Cancel As Boolean)


If txtLast.Text = "" Then
If MsgBox("You must enter the patient's last name.", vbOKCancel, "Error") = vbOK
Then
Cancel = True
Else
Fillpatient
enable
End If

End If
txtLast.SetFocus
txtLast.SelStart = 0
txtLast.SelLength = Len(txtLast.Text)
End Sub
Private Sub txtfather_Validate(Cancel As Boolean)
If txtfather.Text = "" Then
If MsgBox("You must enter the name of the patient's father or husband.",
vbOKCancel, "Error") = vbOK Then
Cancel = True
Else
Fillpatient
enable
End If
End If
txtfather.SetFocus
txtfather.SelStart = 0
txtfather.SelLength = Len(txtfather.Text)
End Sub

Private Sub txtProvince_Validate(Cancel As Boolean)


If txtProvince.Text = "" Then
If MsgBox("You must enter the patient's province.", vbOKCancel, "Error") = vbOK
Then
Cancel = True
Else
Fillpatient
enable
End If
End If
txtProvince.SetFocus
txtProvince.SelStart = 0
txtProvince.SelLength = Len(txtAddress.Text)
End Sub
HOSPITAL FRM GOTO (CODE)

Option Explicit

Private Sub cmdCancel_Click()


Dim ans As String
ans = MsgBox("Do you wish to exit?", vbYesNo, "End Program")
If ans = vbYes Then
Unload frmDoctor
Unload frmInvoice
Unload frmPatient
Unload frmadmission
Unload frmGoto
Unload Registrationfrm
Unload frmlogin
Unload testresult
Unload warddetails
End
End If
End Sub

Private Sub cmdGoto_Click()


If optGoto(0).Value = True Then
Registrationfrm.Show vbModal
ElseIf optGoto(1).Value = True Then
frmadmission.Show
ElseIf optGoto(4).Value = True Then
frmInvoice.Show vbModal
frmInvoice.txtdate.Text = ""
frmInvoice.txtNumber.Text = ""
frmInvoice.txtdoctor.Text = ""
frmInvoice.txtfee.Text = ""
frmInvoice.txtadvance.Text = ""
frmInvoice.txtbed.Text = ""
frmInvoice.txtconcession.Text = ""
frmInvoice.txtother.Text = ""
frmInvoice.txtTotal.Text = ""
ElseIf optGoto(2).Value = True Then
frmPatient.Show vbModal
ElseIf optGoto(3).Value = True Then
frmDoctor.Show vbModal
ElseIf optGoto(5).Value = True Then
testresult.Show vbModal
ElseIf optGoto(6).Value = True Then
warddetails.Show vbModal
End If
frmGoto.Hide
End Sub
Private Sub Form_Load()
frmGoto.Top = (Screen.Height - frmGoto.Height) / 2
frmGoto.Left = (Screen.Width - frmGoto.Width) / 2
optGoto(0).Value = True
End Sub
HOSPITAL FRM GOTO (CODE)

Option Explicit

Private Sub cmdCancel_Click()


Dim ans As String
ans = MsgBox("Do you wish to exit?", vbYesNo, "End Program")
If ans = vbYes Then
Unload frmDoctor
Unload frmInvoice
Unload frmPatient
Unload frmadmission
Unload frmGoto
Unload Registrationfrm
Unload frmlogin
Unload testresult
Unload warddetails
End
End If
End Sub

Private Sub cmdGoto_Click()


If optGoto(0).Value = True Then
Registrationfrm.Show vbModal
ElseIf optGoto(1).Value = True Then
frmadmission.Show
ElseIf optGoto(4).Value = True Then
frmInvoice.Show vbModal
frmInvoice.txtdate.Text = ""
frmInvoice.txtNumber.Text = ""
frmInvoice.txtdoctor.Text = ""
frmInvoice.txtfee.Text = ""
frmInvoice.txtadvance.Text = ""
frmInvoice.txtbed.Text = ""
frmInvoice.txtconcession.Text = ""
frmInvoice.txtother.Text = ""
frmInvoice.txtTotal.Text = ""
ElseIf optGoto(2).Value = True Then
frmPatient.Show vbModal
ElseIf optGoto(3).Value = True Then
frmDoctor.Show vbModal
ElseIf optGoto(5).Value = True Then
testresult.Show vbModal
ElseIf optGoto(6).Value = True Then
warddetails.Show vbModal
End If
frmGoto.Hide
End Sub
Private Sub Form_Load()
frmGoto.Top = (Screen.Height - frmGoto.Height) / 2
frmGoto.Left = (Screen.Width - frmGoto.Width) / 2
optGoto(0).Value = True
End Sub
TESTING AND TOOL

Testing is the phase in the whole software development process that is


regarded as destructive processes rather then a constructive one
1. All tests should be traceable requirement
2. Test should be planed long before testing beings.
3. Testing should begin in the small and progress towards testing in the
large.
4. To be most effective & independent.
There are mainly two fundamentally approaches to testing. These are:

BLACK BOX TESTING: Black box testing checks for the


fundamental aspect of the system with little regard for the internal logic
structure of the software. Black box test are use to demonstrate that
software. Software function is operational, that input is properly accepted
and output is correctly produced.

WHITE BOX TESTING: White box testing is used to insure that


internal operational is performed according to specification and internal
component have been adequately exercise. The development has following
type of testing.

a) Unit Testing.
b) Integration Testing.
c) Validation Testing.
d) System Testing.
SYSTEM REQUIREMENT
Hardware requirements:-

Pentium III 833 MHz or Higher processor


128 MB or Higher RAM
20 GB or Higher Hard Disk
Higher CD Drive
Keyboard 101 key
2 Button Mouse
14 Color Monitor
Twin Battery 30 Minute Backup UPS

Software Requirements: -

>Win 98 & x-p


>V.B. 6.0(front end)
> MS Access (Back End)
>MS word
LIMITATIONS OF THE PROJECT

1. Modification on the patient details.


2. This is a normal MIS project in which different integrity
constraints havent been checked.
3. Reports cannot be generated.
CONCLUSION

This project is one of the modules of HOSPITAL


MANAGEMENT INFORMATION SYSTEM. We have taken
different forms and try to cover all the requirements given by the
METRO HOSPITAL. This project is a live project, which is given
to us by the METRO HOSPITAL NOIDA (U.P)

This project is helpful for METRO HOSPITAL who deals with


patient from different categories and maintains their databank.

The project on METRO HOSPITAL NOIDA is like a challenge for


us, which we accepted & completed with best of our efforts,
knowledge & skills.
BIBLIOGRAPHY

1 Visual Basic in 21 Days (Tec media publications)


2 Visual Basic Unleashed (Tec media Publications)
3 Visual basic 6 programming black book (Steven
holzner)
4 Flash in 24 hours (Tec media Publications)
5 Ms Access (basic Ms Access)
6 Ms word (basic Ms Access)

Potrebbero piacerti anche