Download - Hospital Management BCA
-
7/29/2019 Hospital Management BCA
1/46
Hospital Management
ProjectReportissubmittedto
SIKKIM MANIPAL UNIVERSITY
OF HEALTH, MEDICAL &
TECNOLOGICAL SCIENCES
In partial fulfillment of the requirement
For reward of the degree
Bachelor of Computer Application
Supervisedby: Submitted by:
Mr. Ashok Kumar Kritanash Sharma
Roll No: 521027958
JULY 2013-05-20
1
-
7/29/2019 Hospital Management BCA
2/46
Hospital Management
CERTIFICATE
It is to certify that the project work entitledHospital Management,
which is being submitted byKritanash Sharma in partial fulfillment of the
requirement for the award of degree ofBCAin an authentic work carried
out by us atMEC computer education Kullu under the supervision and
guidance ofMr.Ashok Kumar. The work has reached the standard worthy
of the degree certificate.
(Signature & Name of Supervisor)
Mr. Ashok Kumar
(Signature of Student) Reg.No
Kritanash Sharma 521027958
Signature of Signature ofInternal Examiner External Examiner
(Name &Signature of the Centre Head)
ACNOWLEDGEMENT
2
-
7/29/2019 Hospital Management BCA
3/46
Hospital Management
We express out deep sense of gratitude to Mr. Nitin Sood (director) MEC
Computer Education, Kullu, who helped us a lot in preparing the project
without which I could never have been able to complete this project.
A feeling of elation insists us on expressing our heartiest thanks, deep
sense of gratitude and indebtedness to our major advisor Mr. Ashok Kumar
(Project Guide), impeccable and precious guidance, constant and vital
encouragement, perceptive enthusiasm, unstilted interest and untiring
efforts, even in their busy schedule.
With a deep sense of gratitude, I express my cordial thanks to the entire
faculty member, lab assistants for their counsel, valuable suggestion, willing
support and co-operation during the comes of our study. I express my
sincere thanks and regard to all my friends for their cheerful company, close
association and during the comes of our study.
Everyone met not have got a mention, but none is forgotten.
Thanks
Kritanash Sharma
CONTENTS
3
-
7/29/2019 Hospital Management BCA
4/46
Hospital Management
Requirement Analysis
Objectives
Logical DFD
Features of the Project
Tools/Environment Used
Front End
Back End
Database Tables
Design & Coding
Testing Plan
Suggestion &Conclusions
Bibliography
4
-
7/29/2019 Hospital Management BCA
5/46
Hospital Management
Requirement Analysis
Since I was studing in mec computer education. So I discussed the concept
with my teachers. Then with the help of my advisor Mr.Ashok Kumar I
started working on this project. Finally I succeeded in my objective and
presenting this software for the various needed schools.
OBJECTIVE
To bring out a comprehensive package to manage and assist the hospital
5
-
7/29/2019 Hospital Management BCA
6/46
Hospital Management
industry, this package has to be designed to provide a total solution to the health
care industry and it meets the international hospital requirements. It is proposed
to bring out the package using Visual Basic 6.0 as Front end and Oracle as the
back end.
Logical DFD
6
Hospital
Managemen
t
-
7/29/2019 Hospital Management BCA
7/46
Hospital Management
Features
7
Enquiry Patients Doctors Reports
Database
Storage
(database Files)
Patient Doctor Available
Room
Main Menu
Login to Hospital
Management
In Patient Out Patient
Add Save Modify Delete View
PatientReport
DoctorReport
BillReport
-
7/29/2019 Hospital Management BCA
8/46
Hospital Management
1. Easy to understand.
2. Software is easy to use for any user.
3. Attractive and Colorful.
4. Small in size and portable
.
5. Comments provide easy understanding of procedures.
6. Provision to do any type of updating in future
7. Up to Hospital, clinics etc.
Visual Basic
8
-
7/29/2019 Hospital Management BCA
9/46
Hospital Management
(Front End Environment)
Till recently, applications generally provided a character- based
interface. In a character based system, text was the medium of
information exchange. The application displaced text that prompted the
user for the required information. It also specified the valid option, if any.
The user then responded to these prompts by specifying the required
information.
With the advent of graphical operating system like windows, the
world of computing went through a dramatic change. It opened up a wholenew world of graphics. VISUAL BASIC is also one of the visual
programming tools, through which we can design very attractive and user-
friendly software. A visual programming environment automates the
process of creating a user interface. The interface provided by visual
programming environment to the programmer is called visual interface.
Using the visual interface, the programmer designs the user interfacevisually instead of writing code.
The biggest advantage of visual programming is its Ready-to-use
components. The visual programming environment displays a list of
available components. The programmer picks up the required component
from this list. These components can be moved, resized and even deleted,
if so required.
We have designed this software in VISUAL BASICusing oracle
database, with some oracle commands for some queries.
Relational database
9
-
7/29/2019 Hospital Management BCA
10/46
Hospital Management
(Back End Environment)
Oracle is an RDBMS. (Relational Database Management
System) is software provided by a vendor such as Oracle Corporation that
manages a relational database. An RDBMS supports the use of declarative
statements which describe the rules the data must satisfy. This feature
referred to as declarative integrity.
We can use the SQL statement to manipulate ORACLE data and
flow of control statements to process the data. With the oracle application
can be built more closely match the needs. Oracle stores each data in itsown field. Oracle store record relating to each other in a table.
The oracle 9i database offers us to create, store, manage and
retrieve the data in the database. A database administrator who is
responsible for administrating a database should have a complete and
thorough understanding of the architecture of the database. The oracle 9i
database is made up of three components namely. The oracle server, theoracle instance and the oracle database.
Oracle 9i provides the transparent application scalability by
sharing cluster wide caches for co-ordinate data access. Oracle provides
recovery from disaster situation and also provides multiple layers of
security.
Database Tables
10
-
7/29/2019 Hospital Management BCA
11/46
Hospital Management
As earlier we have written the oracle database has been used as backend for
this software.
BILL.SQL
NAME TYPE
PNAME
PID
JDATE
DDATENO.DAYS
TRC
MDC
AMOUNTP
GTOTAL
TOTALDUE
VARCHAR2(20)
NUMBER
VARCHAR2(20)
VARCHAR2(20)VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
DOCTOR.SQL
NAME TYPE
DID
NAME
SPECIALIST
ADDRESS
PHONE
TIMING
NUMBER UNIQUE
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
OUTPATIENT.SQL
11
-
7/29/2019 Hospital Management BCA
12/46
Hospital Management
NAME TYPE
NAME
ID
AGE
HNOCITY
STATE
DID
DNAME
SEX
DISEASE
JDATE
DDATE
VARCHAR2(20)
NUMBER UNIQUE
VARCHAR2(20)
VARCHAR2(20)VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
DID.SQL(DOCTOR)
NAME TYPE
DID NUMBER
GENERAL.SQL
NAME TYPE
ROOMS VARCHAR2(10)
PAYINIG.SQL
12
-
7/29/2019 Hospital Management BCA
13/46
Hospital Management
NAME TYPE
ROOMS VARCHAR2(10)
SPECIAL.SQL
NAME TYPE
ROOMS VARCHAR2(10)
ID.SQL(PATIENT)
NAME TYPE
ID NUMBER
INPATIENT.SQL
13
-
7/29/2019 Hospital Management BCA
14/46
Hospital Management
NAME TYPE
NAME
PID
PAGEHNO
CITY
STATE
DID
DNAME
SPECIALIST
SEX
DISEASE
JDATE
JTIME
AMOUNTWARD
ROOM
VARCHAR2(20)
NUMBER UNIQUE
VARCHAR2(20)VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)
VARCHAR2(20)VARCHAR2(20)
VARCHAR2(20)
14
-
7/29/2019 Hospital Management BCA
15/46
Hospital Management
DESIGN
&
CODING
Design View :-
15
-
7/29/2019 Hospital Management BCA
16/46
Hospital Management
Object Code :-
Private Sub Timer1_Timer()
If Timer1.Interval 0 Then
FORM2.Show
Timer1.Interval = 0
End If
End Sub
Login Form:-
16
-
7/29/2019 Hospital Management BCA
17/46
Hospital Management
Object Code :-
Option Explicit
Private Sub Command1_Click()
If Text2.Text = "kritansh" Or Text2.Text = "kritansh" Then
form3.ShowUnload FORM2
Else
Text1.Text = ""
Text2.Text = ""
MsgBox "YOU ARE NOT AUTHORIZED USER"
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()Unload FORM2
Unload frmSplash
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then
17
-
7/29/2019 Hospital Management BCA
18/46
Hospital Management
Command1.SetFocus
End If
End Sub
Design View :-
Object Code :-
Private Sub Command1_Click()
Form9.Show
Unload form3
End Sub
Private Sub Command2_Click()
Form6.Show
Unload form3
End Sub
Private Sub Command3_Click()
Form7.Show
Unload form3
End Sub
Private Sub Command4_Click()
Form12.Show
Unload Me
End Sub
Private Sub Command5_Click()Dim I As Integer
18
-
7/29/2019 Hospital Management BCA
19/46
Hospital Management
I = MsgBox(" ARE YOU SURE YOU WANT TO EXIT ",
vbOKCancel)
If I = 1 Then
End
End If
End Sub
Private Sub Timer1_Timer()
Label3.Caption = Date
Label5.Caption = Time
End Sub
Design View :-
Object Code :-
Option Explicit
Private Sub Command1_Click()Form4.Show
Unload Form9
End Sub
Private Sub Command2_Click()
Form5.Show
Unload Form9
End Sub
Private Sub Command3_Click()
Form8.ShowUnload Form9
19
-
7/29/2019 Hospital Management BCA
20/46
Hospital Management
End Sub
Private Sub Command4_Click()
form3.Show
Unload Form9
End Sub
Design View :-
Object Code :-
Option Explicit
Private Sub Command1_Click()
Form4.Show
Unload Form9
End Sub
Private Sub Command2_Click()
Form5.Show
Unload Form9
End Sub
Private Sub Command3_Click()
Form8.Show
Unload Form9
End Sub
Private Sub Command4_Click()
form3.Show
Unload Form9
End Sub
20
-
7/29/2019 Hospital Management BCA
21/46
Hospital Management
Design View :-
Object Code :-
Private Sub Command1_Click()
If d.RecordCount 0 Then
d.MoveFirst
End If
While d.EOF = False
NSK
CurrentX = 400
CurrentY = 500MsgBox " ENTER OK TO SEE NEXT RECORD ", vbMsgBoxRight
d.MoveNext
Wend
End Sub
Private Sub Command2_Click()
Dim A As String
Dim F As Integer
F = 0
A = InputBox("ENTER THE NAME OF DOCTOR TO FIND")If d.RecordCount 0 Then
21
-
7/29/2019 Hospital Management BCA
22/46
Hospital Management
M.d.MoveFirst
End If
While M.d.EOF = False
If LCase(M.d.Fields(1)) = LCase(A) Then
F = 1
NSKEnd If
M.d.MoveNext
Wend
If F = 0 Then
MsgBox "THERE IS NO DOCTOR WITH THE NAME " & A
End If
End Sub
Private Sub Command3_Click()
Form9.Show
Unload Me
End Sub
Public Sub NSK()
Text1(0).Text = M.d.Fields(0)
Text1(1).Text = M.d.Fields(1)
Text1(2).Text = M.d.Fields(2)
Text1(3).Text = M.d.Fields(3)
Text1(4).Text = M.d.Fields(4)
Text1(5).Text = M.d.Fields(5)End Sub
Private Sub Form_Load()
kk
End Sub
Design View :-
22
-
7/29/2019 Hospital Management BCA
23/46
Hospital Management
Object Code :-
Option Explicit
Private Sub Combo1_Click()
Dim I As Integer
I = 0
List1.ClearIf Combo1.Text = "GENERAL" Then
Text3.Text = 75
Text2.Text = 20
rg.MoveFirst
While rg.EOF = False
I = I + 1
List1.AddItem (rg.Fields(0))
rg.MoveNext
WendEnd If
If Combo1.Text = "PAYING" Then
Text3.Text = 250
Text2.Text = 15
rp.MoveFirst
While rp.EOF = False
I = I + 1
List1.AddItem (rp.Fields(0))
rp.MoveNextWend
23
-
7/29/2019 Hospital Management BCA
24/46
Hospital Management
End If
If Combo1.Text = "SPECIAL" Then
Text3.Text = 500
Text2.Text = 10
rs.MoveFirst
While rs.EOF = FalseI = I + 1
List1.AddItem (rs.Fields(0))
rs.MoveNext
Wend
End If
Text1.Text = I
End Sub
Private Sub Combo1_Validate(Cancel As Boolean)
Dim I, J, F As Integer
F = 0
If Combo1.Text "" Then
J = Combo1.ListCount
For I = 0 To J - 1
If Combo1.Text = Combo1.List(I) Then
F = 1
End If
Next I
If F = 0 Then
MsgBox " THERE IS NO WARD THAT YOU SPECIFIED "Combo1.Text = ""
End If
End If
End Sub
Private Sub Command7_Click()
Form9.Show
Unload MeEnd Sub
Private Sub Form_Load()
kk
End Sub
Design View :-
24
-
7/29/2019 Hospital Management BCA
25/46
Hospital Management
25
-
7/29/2019 Hospital Management BCA
26/46
Hospital Management
Object Code :-
Option Explicit
Dim A As Boolean
Private Sub Combo1_Click()
If Combo1.Text = "GENERAL" Or Combo1.Text = "general" Then
M.rg.MoveFirst
Combo2.Clear
While M.rg.EOF = FalseCombo2.AddItem M.rg.Fields(0)
26
-
7/29/2019 Hospital Management BCA
27/46
Hospital Management
M.rg.MoveNext
Wend
Else
If Combo1.Text = "PAYING" Or Combo1.Text = "paying" Then
M.rp.MoveFirst
Combo2.ClearWhile M.rp.EOF = False
Combo2.AddItem M.rp.Fields(0)
M.rp.MoveNext
Wend
Else
If Combo1.Text = "SPECIAL" Or Combo1.Text = "special" Then
M.rs.MoveFirst
Combo2.Clear
While M.rs.EOF = False
Combo2.AddItem M.rs.Fields(0)
M.rs.MoveNext
Wend
End If
End If
End If
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo2.SetFocusEnd If
End Sub
Private Sub Combo1_Validate(Cancel As Boolean)
Dim I, J, F As Integer
F = 0
If Combo1.Text "" Then
J = Combo1.ListCount
For I = 0 To J - 1
If Combo1.Text = Combo1.List(I) ThenF = 1
End If
Next I
If F = 0 Then
MsgBox " THERE IS NO WARD THAT YOU SPECIFIED "
Combo1.Text = ""
End If
End If
End Sub
27
-
7/29/2019 Hospital Management BCA
28/46
Hospital Management
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command14.SetFocus
End If
End SubPrivate Sub Combo2_Validate(Cancel As Boolean)
Dim I, J, F As Integer
If Command14.Caption = "&SAVE" Then
F = 0
If Combo2.Text "" Then
J = Combo2.ListCount
For I = 0 To J - 1
If Combo2.Text = Combo2.List(I) Then
F = 1
End If
Next I
If F = 0 Then
MsgBox " THERE IS NO ROOM THAT YOU SPECIFIED "
Combo2.Text = ""
End If
End If
End If
End SubPrivate Sub Combo3_Change()
Dim I, J, F As Integer
F = 0
J = Combo3.ListCount
For I = 0 To J - 1
If Combo3.Text = Combo3.List(I) Then
F = 1
End If
Next IIf F = 0 Then
MsgBox " THERE IS NO ID NO THAT YOU SPECIFIED "
Combo3.Text = ""
End If
End Sub
Private Sub Combo3_Click()
Dim I As Integer
Frame1.Visible = TrueFrame2.Visible = True
28
-
7/29/2019 Hospital Management BCA
29/46
Hospital Management
Frame3.Visible = True
r.MoveFirst
While r.EOF = False
If r.Fields(1) = Val(Combo3.Text) Then
NK
Command9.Enabled = FalseCommand14.Caption = "&UPDATE"
For I = 0 To 12
Text1(I).Locked = False
Next I
Command14.Enabled = True
Text1(1).SetFocus
Timer1.Interval = 500
Combo3.Visible = False
Exit Sub
End If
r.MoveNext
Wend
End Sub
Private Sub Command1_Click()
Frame1.Visible = False
Frame3.Visible = True
Frame2.Visible = False
End SubPrivate Sub Command13_Click()
Frame3.Visible = True
Frame2.Visible = False
Frame1.Visible = False
End Sub
Private Sub Command14_Click()
Dim I As Integer
Dim F As Integer
Dim J As IntegerF = CHECK()
If F = 1 Then
Exit Sub
Else
Command9.Enabled = True
Command7.Enabled = True
If Text1(10).Text = "" Then
Text1(10).Text = DateEnd If
29
-
7/29/2019 Hospital Management BCA
30/46
Hospital Management
If Text1(11).Text = "" Then
Text1(11).Text = Time
End If
If Text1(12).Text = "" Then
Text1(12).Text = 0
End IfIf Command14.Caption = "&SAVE" Then
If r.RecordCount = 0 Then
Text1(0).Text = 1
Else
Text1(0).Text = id.Fields(0) + 1
End If
End If
Timer1.Interval = 0
Command14.BackColor = &H8000000F
If Command14.Caption = "&SAVE" Then
M.r.AddNew
End If
SUJ
If Command14.Caption = "&SAVE" Then
id.Fields(0) = Text1(0).Text
id.Update
End If
M.r.Update
For I = 0 To 11
Text1(I).Locked = True
Next I
Combo1.Locked = True
Combo2.Locked = True
Command14.Enabled = False
If Command14.Caption = "&SAVE" Then
MsgBox " SAVED ", , "MESSAGE"
ElseMsgBox " UPDATED ", , "MESSAGE"
End If
If Command14.Caption = "&SAVE" Then
If Combo1.Text = "GENERAL" Or Combo1.Text = "general" Then
M.rg.MoveFirst
While rg.EOF = False
If M.rg.Fields(0) = Combo2.Text Then
rg.DeleteEnd If
30
-
7/29/2019 Hospital Management BCA
31/46
Hospital Management
M.rg.MoveNext
Wend
End If
If Combo1.Text = "PAYING" Or Combo1.Text = "paying" Then
M.rp.MoveFirstWhile M.rp.EOF = False
If M.rp.Fields(0) = Combo2.Text Then
rp.Delete
End If
M.rp.MoveNext
Wend
End If
If Combo1.Text = "SPECIAL" Or Combo1.Text = "special" Then
M.rs.MoveFirst
While M.rs.EOF = False
If M.rs.Fields(0) = Combo2.Text Then
rs.Delete
End If
rs.MoveNext
Wend
End If
I = Combo2.ListCountFor J = 1 To I
If Combo2.List(J) = Combo2.Text Then
Combo2.RemoveItem Combo2.List(J)
End If
Next J
End If
End If
End SubPrivate Sub Command2_Click()
Form11.Show
Unload Me
End Sub
Private Sub Command3_Click()
Frame2.Visible = True
Frame3.Visible = False
Frame1.Visible = False
End SubPrivate Sub Command4_Click()
31
-
7/29/2019 Hospital Management BCA
32/46
Hospital Management
Unload Form6
form3.Show
End Sub
Private Sub Command5_Click()
Form10.Show
Unload MeEnd Sub
Private Sub Command6_Click()
Frame1.Visible = True
Frame2.Visible = False
Frame3.Visible = False
End Sub
Private Sub Command7_Click()
Dim I, F As Integer
Dim A As String
A = InputBox("ENTER THE NAME OF PATIENT TO MODIFY ")
F = FINDM(A)
If F = 1 Then
Command9.Enabled = False
Command14.Caption = "&UPDATE"
For I = 0 To 12
Text1(I).Locked = False
Next I
Command14.Enabled = True
Text1(1).SetFocus
Timer1.Interval = 500
End If
If F = 0 Then
MsgBox " THERE IS NO PATIENT WITH THE NAME " & A
End If
End Sub
Private Sub Command9_Click()Dim I As Integer
Command7.Enabled = False
Command14.Caption = "&SAVE"
For I = 1 To 12
Text1(I).Locked = False
Next I
Combo1.Locked = False
Combo2.Locked = False
Command14.Enabled = True
32
-
7/29/2019 Hospital Management BCA
33/46
Hospital Management
Combo1.Text = ""
Combo2.Text = ""
For I = 0 To 12
Text1(I).Text = ""
Next I
Option1.Value = FalseOption2.Value = False
Text1(1).SetFocus
Timer1.Interval = 500
End Sub
Private Sub Form_Load()
Dim I As Integer
M.kk
For I = 0 To 11
Text1(I).Locked = True
Next I
Combo1.Locked = True
Combo2.Locked = True
Command14.Enabled = False
Combo3.Visible = False
Frame1.Visible = True
Frame2.Visible = False
Frame3.Visible = False
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If Index = 12 And KeyAscii = 13 Then
Option1.SetFocus
Else
If KeyAscii = 13 Then
If Index = 8 Thendoc
End If
Text1(Index + 1).SetFocus
End If
End If
End Sub
Private Sub Text1_Validate(Index As Integer, Cancel As Boolean)
If Index = 8 Then
If Text1(8).Text "" Thendoc
33
-
7/29/2019 Hospital Management BCA
34/46
Hospital Management
End If
End If
End Sub
Private Sub Timer1_Timer()
If A Then
Command14.BackColor = RGB(14, 130, 0)Else
Command14.BackColor = &H8000000F
End If
A = Not A
End Sub
Public Sub SUJ()
Dim A As String
If Option2.Value = True Then
A = Option2.Caption
Else
A = Option1.Caption
End If
r.Fields(1) = Text1(0).Text
r.Fields(0) = Text1(1).Text
r.Fields(2) = Text1(2).Text
r.Fields(3) = Text1(3).Text
r.Fields(4) = Text1(4).Text
r.Fields(5) = Text1(5).Text
r.Fields(6) = Text1(6).Textr.Fields(7) = Text1(7).Text
r.Fields(8) = Text1(8).Text
r.Fields(10) = Text1(9).Text
r.Fields(11) = Text1(10).Text
r.Fields(12) = Text1(11).Text
r.Fields(14) = Combo1.Text
r.Fields(15) = Combo2.Text
r.Fields(13) = Text1(12).Text
r.Fields(9) = AEnd Sub
Public Function CHECK()
Dim F As Integer
Dim I As Integer
F = 0
For I = 1 To 9
If Text1(I).Text = "" Then
Text1(I).BackColor = RGB(0, 200, 215)
F = 1Else
34
-
7/29/2019 Hospital Management BCA
35/46
Hospital Management
Text1(I).BackColor = &H80000005
End If
Next I
If Combo1.Text = "" Then
Combo1.BackColor = RGB(0, 200, 215)F = 1
Else
Combo1.BackColor = &H80000005
End If
If Combo2.Text = "" Then
Combo2.BackColor = RGB(0, 200, 215)
F = 1
Else
Combo2.BackColor = &H80000005
End If
If Option1.Value = False And Option2.Value = False Then
MsgBox "SELECT OPTION MALE OR FEMALE", , "MESSAGE"
F = 1
End If
CHECK = F
End Function
Public Sub doc()Dim F As Integer
F = 0
d.MoveFirst
While d.EOF = False
If LCase(Text1(8).Text) = LCase(d.Fields(2)) Then
Text1(6) = d.Fields(0)
Text1(7) = d.Fields(1)
F = 1
End Ifd.MoveNext
Wend
If F = 0 Then
MsgBox "THERE IS NO DOCTOR WHO IS THE SPECILIST OF " &
Text1(8).Text
Text1(8).Text = ""
End If
End Sub
Public Function FINDM(A As String)Dim F, N As Integer
35
-
7/29/2019 Hospital Management BCA
36/46
Hospital Management
N = 0
r.MoveFirst
While r.EOF = False
If LCase(r.Fields(0)) = LCase(A) Then
N = N + 1
F = r.Fields(1)End If
r.MoveNext
Wend
If N = 0 Then
FINDM = 0
End If
If N = 1 Then
r.MoveFirst
While r.EOF = False
If r.Fields(1) = F Then
NK
FINDM = 1
Exit Function
End If
r.MoveNext
Wend
End If
If N > 1 Then
Frame1.Visible = False
Frame2.Visible = False
Frame3.Visible = False
Combo3.Visible = True
MsgBox " THERE ARE MORE PATIENT WITH THE NAME " &
A & " SELECT THE ID NO OF PATIENT"
r.MoveFirstCombo3.Clear
While r.EOF = False
If LCase(r.Fields(0)) = LCase(A) Then
Combo3.AddItem (r.Fields(1))
End If
r.MoveNext
Wend
FINDM = 2
End IfEnd Function
36
-
7/29/2019 Hospital Management BCA
37/46
Hospital Management
Public Sub NK()
If r.Fields(9) = "MALE" Then
Option1.Value = True
Else
Option2.Value = True
End IfText1(0).Text = r.Fields(1)
Text1(1).Text = r.Fields(0)
Text1(2).Text = r.Fields(2)
Text1(3).Text = r.Fields(3)
Text1(4).Text = r.Fields(4)
Text1(5).Text = r.Fields(5)
Text1(6).Text = r.Fields(6)
Text1(7).Text = r.Fields(7)
Text1(8).Text = r.Fields(8)
Text1(9).Text = r.Fields(10)
Text1(10).Text = r.Fields(11)
Text1(11).Text = r.Fields(12)
Combo1.Text = r.Fields(14)
Combo2.Text = r.Fields(15)
Text1(12).Text = r.Fields(13)
End Sub
Design View :-
37
-
7/29/2019 Hospital Management BCA
38/46
Hospital Management
Object Code :-
Option Explicit
Dim A As Boolean
Private Sub Command1_Click()
Dim I As IntegerFor I = 1 To 5
Text1(I).Locked = False
Next I
Command2.Caption = "&SAVE"
For I = 0 To 5
Text1(I).Text = ""
Next I
Text1(1).SetFocus
Timer1.Interval = 500
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command2.Enabled = True
Command1.Enabled = False
End Sub
Private Sub Command2_Click()
Dim I As Integer
Dim F As Integer
F = 0
For I = 1 To 5
If Text1(I).Text = "" Then
Text1(I).BackColor = RGB(0, 200, 215)
F = 1
Else
Text1(I).BackColor = &H80000005
End If
Next IIf F = 0 Then
For I = 1 To 5
Text1(I).Locked = True
Next I
If Command2.Caption = "&SAVE" Then
If d.RecordCount = 0 Then
Text1(0).Text = 1Else
38
-
7/29/2019 Hospital Management BCA
39/46
Hospital Management
Text1(0).Text = did.Fields(0) + 1
End If
End If
Timer1.Interval = 0
Command1.Enabled = True
Command2.BackColor = &H8000000FCommand2.Enabled = False
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
If Command2.Caption = "&SAVE" Then
d.AddNew
ADD
Else
ADD
End If
If Command2.Caption = "&SAVE" Then
did.Fields(0) = Text1(0).Text
did.Update
End If
d.Update
If Command2.Caption = "&SAVE" Then
MsgBox " SAVED "
Else
MsgBox " UPDATED "End If
End If
End Sub
Private Sub Command3_Click()
Dim A As String
Dim F As Integer
Dim I As Integer
For I = 1 To 5
Text1(I).Locked = FalseNext I
A = InputBox("ENTER THE NAME OF DOCTOR TO MODIFY")
F = FIND1(A)
If F = 0 Then
MsgBox "THERE IS NO DOCTOR WITH THE NAME " & A
Else
Command2.Caption = "&UPDATE"
Text1(0).SetFocus
Timer1.Interval = 500Command1.Enabled = False
39
-
7/29/2019 Hospital Management BCA
40/46
Hospital Management
Command2.Enabled = True
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Text1(0).Locked = True
End IfEnd Sub
Private Sub Command4_Click()
Dim A As String
Dim F As Integer
Dim N As Integer
A = InputBox("ENTER THE NAME OF DOCTOR TO DELETE")
F = FIND1(A)
If F = 1 Then
N = MsgBox("ARE YOU SURE YOU WANT DELETE", vbOKCancel)
If N = 1 Then
d.Delete
MsgBox "ONE RECORD DELETED"
For N = 0 To 5
Text1(N).Text = ""
Next N
End If
Else
MsgBox "THERE IS NO DOCTOR WITH THE NAME " & A
End IfEnd Sub
Private Sub Command5_Click()
If d.RecordCount 0 Then
d.MoveFirst
End If
While d.EOF = False
NSK
MsgBox "PRESS OK BUTTON TO SEE NEXT RECORD"
d.MoveNextWend
End Sub
Private Sub Command6_Click()
form3.Show
Unload Form7
End Sub
Private Sub Form_Load()
Dim I As Integer
kkCommand2.Enabled = False
40
-
7/29/2019 Hospital Management BCA
41/46
Hospital Management
For I = 1 To 5
Text1(I).Locked = True
Next I
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then
If Index 5 Then
Text1(Index + 1).SetFocus
End If
End If
End Sub
Private Sub Timer1_Timer()
If A Then
Command2.BackColor = RGB(14, 130, 0)
Else
Command2.BackColor = &H8000000F
End If
A = Not A
End Sub
Public Sub ADD()
d.Fields(0) = Text1(0).Text
d.Fields(1) = Text1(1).Text
d.Fields(2) = Text1(2).Textd.Fields(3) = Text1(3).Text
d.Fields(4) = Text1(4).Text
d.Fields(5) = Text1(5).Text
End Sub
Public Sub NSK()
Text1(0).Text = M.d.Fields(0)
Text1(1).Text = M.d.Fields(1)
Text1(2).Text = M.d.Fields(2)
Text1(3).Text = M.d.Fields(3)Text1(4).Text = M.d.Fields(4)
Text1(5).Text = M.d.Fields(5)
End Sub
Public Function FIND1(A As String)
If d.RecordCount 0 Then
d.MoveFirst
End If
While d.EOF = False
If LCase(A) = LCase(d.Fields(1)) ThenNSK
41
-
7/29/2019 Hospital Management BCA
42/46
Hospital Management
FIND1 = 1
Exit Function
End If
d.MoveNext
Wend
FIND1 = 0End Function
Design View :-
42
-
7/29/2019 Hospital Management BCA
43/46
Hospital Management
43
-
7/29/2019 Hospital Management BCA
44/46
Hospital Management
Object Code :-
Private Sub Command1_Click()
Frame1.Visible = False
Frame2.Visible = True
End SubPrivate Sub Command2_Click()
DataReport3.Show
End Sub
Private Sub Command3_Click()
DataReport4.Show
End Sub
Private Sub Command4_Click()
form3.Show
Unload Me
End Sub
Private Sub Command5_Click()
DataReport1.Show
End Sub
Private Sub Command6_Click()
DataReport2.Show
End Sub
Private Sub Command7_Click()
Frame1.Visible = True
Frame2.Visible = FalseEnd Sub
Private Sub Form_Load()
Frame1.Visible = True
Frame2.Visible = False
End Sub
44
-
7/29/2019 Hospital Management BCA
45/46
Hospital Management
Testing Plan
First I will design and code each window. Then I will test each form by
running these windows. After testing of each window, I will combine these
all window together and then in will test this complete software again.
Then I will test this software in real life situation i.e. I will give this a copy
of this software to any school with same infrastructure. Then I take
feedback from real life situation. Finally from these feedbacks, I will make
all possible changes in design and coding of the software then finally, I
will test this software. In last, this software will be ready for future use.
Suggestions and Conclusions1. Maintain regular Notes With detail of every step used for future ease.
2. Treat separate parts of program separately to avoid confusion.
3. Stepwise development program is necessary for speedy and easy
development of program.
4. Function should be easy to understand.5. Comment every part of a program for quick understanding.
6. Deletion of any part should be done with care.
7. Try to consider all exceptions and way to handle them.
8. Debugging should be performed to uncover the run-time error.
45
-
7/29/2019 Hospital Management BCA
46/46
Hospital Management
BIBLOGRAPHY
On-line Classes concluded by Sikkim Manipal University
Visual Basic in 21 Days.
Every solution with VB 6.0.
Visual Basic 6 Programming black book.
Oracle 9i the complete reference.
Oracle and Distributed database.
This project is designed in 1280 X 720 screen resolution pixels.