CONTENTS

1 2 3 4 5 6 7 8 9 10 11 12

Abstract Problem Description System Specification System Study DFD E-R Diagram Software Description Database Design Sample Coding Output Conclusion Bibliography

2 3 4 5 9 12 13 28 32 83 91 93

ABSTRACT

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.

2

Hospital Management System

PROBLEM DESCRIPTION

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 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

3

Hospital Management System

SYSTEM SPECIFICATION 1. Software Requirements OS Front End Back End : : : MS WINDOWS XP SP2 Visual Basic 6.0 Microsoft Access 2003 4 Hospital Management System .4 GHZ or above : 500 MHZ : 32 bits : 256MB of RAM : 40 GB or higher : SVGA COLOR : 108 keys : 2 button mouse 2. Hardware Requirements Processor Clock speed System bus RAM HDD Monitor Keyboard Mouse : Intel Pentium IV 2.

SYSTEM STUDY INTRODUCTION The goal of any system development is to develop and implement the system cost effectively. During analysis. data collected on the files. Many problems were identified during the initial study of the existing system. 5 Hospital Management System . Different kinds of tools are used in analysis of which interview is a common one. decision points and transactions handled by the present system. INITIAL INVESTIGATION The first step in system development life cycle is the identification of need of change to improve or enhance an existing system. Analysis is the study of the various operations performed by the system and their relationship within and outside of the system. user-friendly and most suited to the user’s analysis is the heart of the process. The present system of hospital is completely manual. An initial investigation on existing system was carried out.

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. decision points and transactions handled by the present system. A good analysis model should provide not only the mechanisms of problem understanding but also the framework of the solution. data collected on the various files. experience and common sense are required for collection of relevant information needed to develop the system. training. During analysis. interviews. Then the proposed system should be analyzed thoroughly in accordance with the needs. • • System planning and initial investigation Information gathering 6 Hospital Management System . thoroughly investigated and properly carried out through the choice of solution. 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. The commonly used tools in the system are Data Flow Diagram. The success of the system depends largely on how clearly the problem is defined. System analysis can be categorized into four parts. etc.

etc. The proposed systems eliminate the drawbacks of the existing system to a great extent and it provides tight security to data. it can be easily receive and used at any time. including home and business desktops. Moreover it is very difficult to retrieve data. 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. The proposed system will easily handle all the data and the work done by the existing systems. Redundancy of data may occur and this may lead to the inconsistency. ABOUT OPERATING SYSTEM Windows XP is a line of operating systems developed by Microsoft for use on general purpose computer systems. The proposed system is very easy to operate. The data are stored in the computer’s secondary memories like hard disk. notebook computers and 7 Hospital Management System . Speed and accuracy are the main advantages of proposed system. There is no redundancy of data.• • • Applying analysis tools for structured analysis Feasibility study Cost/benefit analysis PROPOSED SYSTEM The drawback of the existing system is that it is very difficult to retrieve data from case files. The manual system is so time-consuming.

Windows XP Tablet PC edition is designed to run the inkaware Tablet PC platform. 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. 8 Hospital Management System .media centers. Windows XP 64 bit edition for IA-64(Itanium) processors and Windows XP Professional x64 edition for x86-64 processors. support for Windows server domain and two physical processors and is targeted at power users and business clients. which is targeted at home users. The letters ‘XP’ stand for experience. Two separate 64 bit versions of Windows XP were also released. The most common editions of operating systems are Windows XP home edition. and Windows XP professional. which has additional features such as.

DATA FLOW DIAGRAMS DFD for Login Module Ok Password Administrator User Verifying User Name and Password User Password Login File Enter Administrator/User Rejected DFD for Billing process File User Item Details Sales process Updating process Item Code Item Quotation Details Stock File Billing process Bill Customer 9 Hospital Management System .

User Me D 10 Hospital Management System .Purchase Details DF D.

ENTITY RELATIONSHIP DIAGRAMS Administrator Controls Name Employee DateStarted HOD Wor ks On Department EmpNumber Address Dept Name Works On Name Name Dept number Name Patient Trea ted by Doctor Patient ID Address 11 Dr-ID Address Hospital Management System .

With to days Windows Operating System. and makes programming enjoyable. The impressive array of 12 Hospital Management System . Although writing programs can be a tedious chore at time. the user can visually design the objects that your application uses. Keyboard.0 is Microsoft’s latest version of the Visual Basic Programming language. The environment provided by Visual Basic is suitable for any type of application. a program must be able to interact with the screen. Visual Basic 6. test and debug your applications. Visual Basic makes many aspects of programming as simple as dragging graphics objects on to screen with your mouse. run. it’s an integrated development environment in which you can develop. Using this environment. Visual Basic reduces the effort required on your part. mouse and printer graphically.0 Visual Basic 6. the secret to Visual Basic is in its name” Visual”.SOFTWARE DESCRIPTION Microsoft Visual Basic 6. Visual Basic is not just a languages.0 is more than just a programming language.

• Click on Visual Basic # (where again # is your version). A form is a major part of Visual Basic application. then Microsoft Visual Basic # (where # is your version of Visual Basic). Starting Visual Basic To start Visual Basic: • Click on the Start button on the Windows task bar.programming resources provided by Visual Basic enables to create the objects extemporaneously which can range from pop-up menu to a message box. 13 Hospital Management System . which allows the user to enter the data as well as view the result. Hence a Visual Basic application is a combination of object like forms and controls. A control is an object that we draw on a form to enable or enhance user interaction with an application. • Select Programs. procedures that can respond to Events and other general-purpose procedures.

Title Bar Main Menu Toolbar 14 Hospital Management System .

At the top of the screen is the Visual Basic Main Window. Parts of a Visual Basic Project There are three major components in a Visual Basic project: the project itself. If you put the mouse cursor over one of these buttons for a second or so. the form. Other words used to describe a project are application or program. Project is the word used to encompass everything in a Visual Basic project. much like the main menu. Controls are also referred to as objects. Here little buttons with pictures also allow us to control Visual Basic. Controls are graphical features or tools that are placed on forms to allow user interaction (text boxes. command buttons). a project is: Control Project Control Control Form Control 15 Hospital Management System . scroll bars. Under the main menu is the Toolbar. Pictorially. and the controls. Recall the form itself is a control. The title bar gives us information about what program we’re using and what Visual Basic program we are working with. a little ‘tool tip’ will pop up and tell you what that particular button does. labels. The Form is the window where you create the interface between the user and the computer. At the top of the main window is the Title Bar.

Visual Basic is governed by an event processor. the project finds a series of instructions related to that event. Two primary files are used to save a Visual Basic project. That means that nothing happens in a Visual Basic project until some event occurs. sizes. there is sometimes a form file with an frx extension). Once an event is detected. Example properties include names. there is sometimes a file with a vbw extension). An important concept concerning a Visual Basic project is that of a property. captions. and then program control is returned to the event: EVENT 16 Hospital Management System . The form file has an extension of frm (in addition.Project consists of a form containing several controls. That procedure is executed. Every characteristic of a control (including the form itself) is specified by a property. Visual Basic is an event-driven language. position on the form. The project file will have an extension of vbp (in addition. called an event procedure. In looking around your computer’s file directory. you may find some files associated with a Visual Basic project. colors. and contents.

we can begin and build our project. Within this one environment. Main Window 17 Hospital Management System . many times you need a separate text editor to write your program. Let’s look at the parts of the Visual Basic environment.Event processor Event Procedure Event Procedure Event Procedure Event procedures are where we do the actual computer programming and are saved with the form in the file with the frm extension. run and test our project. With other computer languages. You will learn a lot of programming and BASIC language in this course. eliminate errors (if any) in our project. Parts of the Visual Basic Program Visual Basic is more than just a computer language. These procedures are where we write BASIC language statements. and then a different area to test your program. something called a compiler to create the program. Visual Basic integrates each step of the project building process into one environment. and save our project for future use. The BASIC you will learn is very similar to the original BASIC used by Bill Gates and Paul Allen when starting Microsoft. It is a project building environment.

The menu bar has drop-down menus from which you control the operation of the Visual Basic environment. Notice that several windows appear.Start Visual Basic using the procedure learned in Class 1. break. The title bar indicates the project name and the current Visual Basic operating mode (design. The main window consists of the title bar. run). 18 Hospital Management System . The Main Window is used to control most aspects of the Visual Basic project building and running process. and toolbar. It is where you develop your application. Form Window The Form Window is central to developing Visual Basic applications. menu bar.

the form has many (over 40) properties.If the form window is not present on the screen: Properties Like all controls. Fortunately. The properties we will be concerned with are: Property Name Description Name used to identify form. Three letter prefix for form names is frm. Reference to icon that appears in title bar of form. Distance from left side of computer screen to left side of form. we only have to know about some of them. 19 Hospital Management System . Caption Icon Left Text that appears in the title bar of form.

Load Event executed when the form first loads into the computer’s memory. Height of form in twips. Form can either be sizable (can resize using the mouse) or fixed size. but it does support events. Form Events The form primarily acts as a ‘container’ for other controls. This is a good place to set initial values for various properties and other project values. it can respond to some user interactions. Background color of form. We will only be concerned with two form events in this course: Event Click Description Event executed when user clicks on the form with the mouse. 20 Hospital Management System . Width Height Back Color Border Style Width of the form in twips.Top Distance from top side of computer screen to top side of form. That is.

Toolbox Window The Toolbox Window is the selection menu for controls used in your application. VB6: Pointer Label Frame Check Box Combo Box Horizontal Scroll Bar Timer Directory Shape Image OLE Picture Box Text Box Command Button Option Button List Box Vertical Scroll Bar Drive Files Line Data Control 21 Hospital Management System .

you can expand your computer's usefulness by writing applications to use in your own job. revise. whatever you do. VB encourages you to experiment. Online Help 7. 2. Good User Interface. correct. 3. Personal Programming is what Visual Basic is all about. Data Access. Areas of Application The term "Personal Programming" refers to the idea that. Data Management 6. then Toolbox. wherever you work. and 22 Hospital Management System . 4. 5. Features of Visual Basic: 1. click View on the main menu. 32 bit Programming Languages. Using Visual Basic's tools.If the toolbox window is not present on the screen. OLE Features. Windows API Features. you quickly translate an abstract idea into a program design you can actually see on the screen.

VB presents a 3-step approach for creating programs: 1. 23 Hospital Management System . Design the appearance of your application. for example: • • • • • • • • • • Education Research Medicine Business Commerce Marketing and Sales Accounting Consulting Law Science Microsoft Access 2003. 3. Assign property settings to the objects of your program. 2. most of all. Visual Basic can and is used in a number of different areas. Visual Basic is ideal for developing applications that run in the new Windows 95 operating system. Write the code to direct specific tasks at runtime. However.network your design until the new project meets your requirements. it inspires your imagination and creativity.

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 supports some object-oriented techniques but falls short of being a fully object-oriented development tool. forms. meant to compete with ProComm and other programs. queries. reports. Microsoft SQL Server. or any ODBCcompliant data container (including MySQL and PostgreSQL). Relatively unskilled programmers and non-programmer "power users" can use it to build simple applications. macros modules and shortcuts top data access pages. and by hobby programmers to create ad hoc customized desktop systems for handling the creation and 24 Hospital Management System . Microsoft Access is a Relational Database Management System. Oracle. Access was also the name of a communications program from Microsoft. previously known as Microsoft Access. Years later Microsoft reused the name for its database software. It is a member of the 2007 Microsoft Office system. Skilled software developers and data architects use it to develop application software. In general MS-Access database can have several small tables. Using Access we can organize our data according to subject and can store information about how different subject are related. Access is used by small businesses. Microsoft Office Access.Microsoft Access is the default database of Microsoft Visual Basic. within departments of large corporations. Microsoft Access 2003 provides many new features that make working with data and designing a database even easier. This proved a failure and was dropped. Access can use data stored in Access/Jet. Microsoft Access Database is a collection of data and objects related to particular topic or purpose. Microsoft Access Database may contain tables.

manipulation of data. so applications that are used by more than a handful of people tend to rely on Client-Server based solutions. especially for the creation of prototypes and standalone applications that serve as tools for on-the-road salesmen. including JET (file-based database engine. Microsoft SQL Server. Access does not scale well if data access is via a network. Oracle. the Access and the Jet Engine implements database triggers and stored procedures in a non-standard way. queries and VB code) can be used against a host of database back ends. Most typical web applications should use tools like ASP/Microsoft SQL Server or the LAMP stack. MSDE (Microsoft SQL Server Desktop Engine) 2000. However. Unlike a modern RDBMS. 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 25 Hospital Management System . reports. 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. used in Access by default). and SQL statements can be used directly in Macros and VBA Modules to manipulate Access tables. an Access "front end" (the forms. is included with the developer edition of Office XP and may be used with Access as an alternative to the Jet Database Engine. Some professional application developers use Access for rapid application development. Stored Procedures are implemented in VBA. Users may mix and use both VBA and "Macros" for programming forms and logic and offers object-oriented possibilities. a mini-version of MS SQL Server 2000. and any other ODBC-compliant product.

the database-related features are entirely different. In ADP files (supported in MS Access 2003 and later). Client applications built with VB or C++ are not able to access these features. However. and it is common to use pass-through queries and other techniques in Access to run stored procedures in RDBMSs that support these. After designing the input and output. Starting in MS Access 2003 (Jet 4.Triggers are only available from embedded Forms. A database is a collection of interrelated data stored with minimum redundancy to serve many users quickly and effectively. only forms.0). stored procedures and UDF-s). Both Triggers and Stored procedures are only available to applications built completely within the Access database management system. there is a new syntax for creating queries with parameters. DATABASE DESIGN The general theme behind a database is to handle information as an integrated whole. Thus. but these procedures are still limited to one statement per procedure. macros and modules are stored in the ADP file (the other objects are stored in the back-end database). instead of using the Jet Engine. reports. 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). the analyst must concentrate on database design or how data should be organized around user requirements. 26 Hospital Management System . views. it supports the creation of nearly all objects in the underlying server (tables with constraints and triggers. because this type of file connects to a MSDE or Microsoft SQL Server. in a way that looks like creating stored procedures.

Login Field Name User Name Password Description User Name User Name Data Type Text Text Width 50 50 File Name :. the following objectives are concerned:• • • • • Controlled redundancy Easy to learn and use More information and low cost Accuracy Integrity File Name :.The general objective is to make information access. During database design. easy. inexpensive and flexible for other users. quick.Doctor Registration Field Name Dr name Sex Dept Description Doctor Name Sex Department Data Type Text Text Text Width 50 50 50 27 Hospital Management System .

Consultation time Address Contact no Emergency no Consult fee Date Consultation day Tot pat Consultation Time Address Contact Number Emergency Number Consultation fees Date Consultation Day Total Patient Text Text Long Long Long Date/Time Text Double 50 50 50 50 50 50 50 50 File Name:-Patient Details Field Name Name Age Sex Address Doctor Patient id Reg fee Admin Date Room no Description Name Age Sex Address Doctor Patient id Registration fees Admitted Date Room Number Data Type Text Integer Text Text Text Text Double Date/Time Integer Width 50 50 50 50 50 50 50 50 50 File Name:-Medicine Field Name Medname Medtype Amt Expdate Stock Description Medicine Name Medicine Type Amount Expiry Date Stock Data Type Text Text Double Date/Time Double Width File Name:-Discharge Sheet 28 Hospital Management System .

Field Name Patient id Name Doctor Remark Totbill Date Description Patient id Name Doctor Remark Total Bill Date Data Type Double Text Text Text Double Date/Time Width 50 50 50 50 50 50 SAMPLE CODING LOGIN Private Sub Command2_Click () 29 Hospital Management System .

mn RegAdmin.Enabled = True frmMDI. Execute ("SELECT * FROM LOGIN where username='" & txt_username.mnulogoff.mnuLogin.Enabled = True 30 Hospital Management System . EOF () Then If (rs(1) = txt_ password.Enabled = False frmMDI.Enabled = True frmMDI.mnuBilling.Enabled = True frmMDI. Text) Then MsgBox "Login Successful" frmMDI.mnuEditdr.Enabled = True frmMDI.mnuPatient.Enabled = True frmMDI.mnuAddDept.mnuSearch.Enabled = True frmMDI. Open Set rs = db.mnuRegDr.Enabled = True frmMDI.Enabled = True frmMDI.mnuRegUser.Text & "'") If (txt_ password = "" And txt_ username = "") Then MsgBox "Login not possible" Else If No t rs.mnuAddrooms.Unload Me End Sub Private Sub Command3_Click () Db.Enabled = True frmMDI.

mnuSearch.Close End Sub Private Sub Command4_Click() db.frmMDI.Enabled = True 31 Hospital Management System .Open Set rs = db.mnuPatient.mnuuser.Text & "'") If Not rs.Enabled = True frmMDI.mnulogoff.mnuBilling.Text) Then MsgBox "Login Successful" frmMDI.mnuLogin.Enabled = True Unload Me Else MsgBox "Login not success" End If Else MsgBox "EOF Reached" End If End If db.Execute("SELECT * FROM STAFFLOGIN where username='" & txt_username.EOF() Then If (rs(1) = txt_password.Enabled = True frmMDI.Enabled = False frmMDI.Enabled = True frmMDI.

mnuuser.frmMDI.Enabled = True Unload Me Else MsgBox "Login not success" End If Else MsgBox "Invalid Username or Password" End If db.Close End Sub Private Sub Form_Load() connectdb End Sub ADMINISTRATOR REGISTRATION Private Sub cmd_cancel_Click() Unload Me End Sub Private Sub cmd_save_Click() 32 Hospital Management System .

Open db.Close End Sub Private Sub Form_Load () connectdb End Sub DOCTOR’S REGISTRATION Dim m_time As String Dim m_MissingFields As String Private Sub Command1_Click () If ValidateForm = True Then db. db.Text rs.AddNew rs!drname = txt_name.Open "DrREGISTRATION".Text & "'.Value = True Then 33 Hospital Management System .Text & “to” & txt_timeto.Text If Opt_male.db.Open m_time = txt_timefrom.Text & "')") MsgBox "Record added successfully" db.'" & txt_password.Execute ("INSERT INTO LOGIN VALUES ('" & txt_username. adOpenDynamic. adLockOptimistic rs.

vbInformation.Text rs!emergencyno = txt_emergency. db.Text rs!consultationtime = m_time rs!address = txt_address.Text rs!patcount = txt_totpat.Open "PATCOUNT".Text rs!Date = DTP. adLockOptimistic rs.AddNew rs!drname = txt_name.Text rs!consultfee = txt_fee.Close rs.Update MsgBox "One Doctor Registered". adOpenDynamic.Value rs!consultationday = comb_day.Value rs.Text rs.rs!sex = "Male" Else rs!sex = "Female" End If rs!dept = cmb_dept. "Doctor ADDED" rs.Text rs!Date = DTP.Text rs!contactno = txt_contactno.Update db.Text rs!totpat = txt_totpat.Close 34 Hospital Management System .

vbCritical + vbOKOnly.AddItem "Friday" comb_day. please fill the fields and try again".AddItem "Thursday" comb_day.AddItem "Monday" comb_day. "Missing fields" m_MissingFields = "" End If End Sub Private Sub Command2_Click () Unload Me End Sub Private Sub Form_Load() connectdb comb_day.AddItem "Saturday" comb_day.AddItem "Wednesday" comb_day.AddItem "Sunday" End Sub Private Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True 35 Hospital Management System . Len (m_MissingFields) .AddItem "Tuesday" comb_day.1) MsgBox "Some fields (" & m_MissingFields & ")" & vbCrLf & " are missing.Else m_MissingFields = Left (m_MissingFields.

If txt_name." m_valid = False End If If txt_address.Text = "" Then m_MissingFields = m_MissingFields & "Time From.Text = "" Then m_MissingFields = m_MissingFields & "Time To." m_valid = False 36 Hospital Management System ." m_valid = False End If If txt_timefrom.Text = "" Then m_MissingFields = m_MissingFields & "Dept Name." m_valid = False End If If txt_timeto." m_valid = False End If If cmb_dept.Text = "" Then m_MissingFields = m_MissingFields & "Name.Text = "" Then m_MissingFields = m_MissingFields & "Contact no.Text = "" Then m_MissingFields = m_MissingFields & "Address." m_valid = False End If If txt_contactno.

Text = "" Then m_MissingFields = m_MissingFields & "Emergency no.End If If txt_emergency." m_valid = False End If If txt_fee." & Date & "." m_valid = False End If ValidateForm = m_valid End Function PATIENT REGISTRATION Dim m_sx As String Dim m_patid As Integer Dim m_patcount As Integer Dim m_totpat As Integer Dim m_MissingFields As String Private Sub cmd_del_Click() 'MsgBox ("DELETE FROM PATIENTDETAILS WHERE timestampdiff(SQL_TSI_MONTH.Text = "" Then m_MissingFields = m_MissingFields & "Fees.ts admindate))") 37 Hospital Management System .

Close rs. adLockOptimistic If Not rs. adOpenDynamic. adOpenDynamic. adLockOptimistic If Not rs.Text & "'". db.End Sub Private Sub Combo_drpref_Click() db.Open "SELECT totpat FROM DrREGISTRATION WHERE drname='" & Combo_drpref.Text & "' ".Open "SELECT * FROM PATCOUNT WHERE drname='" & Combo_drpref.Open "SELECT * FROM DrREGISTRATION WHERE drname='" & Combo_drpref.Text & "' ".Open rs.EOF() Then m_totpat = rs!totpat Else MsgBox "Not found" End If rs.Text = rs!consultfee Else MsgBox "Record not found" End If rs.EOF() Then m_patcount = rs!patcount 38 Hospital Management System . db. adLockOptimistic If Not rs.Close rs. db.EOF() Then txt_regfee. adOpenDynamic.

AddItem rs!Name lst_age.Enabled = False End Sub Private Sub Command1_Click () Dim pattype As String Dim rno As Integer If Opt_male = True Then 39 Hospital Management System .Open rs. adLockOptimistic lst_names.AddItem rs!age lst_add. adOpenDynamic.AddItem rs!address db.Text & "'". db.Close End Sub Private Sub Combo_patid_Click() db.Close db.Close Command3.Open "SELECT * FROM PATIENTDETAILS WHERE patientid='" & Combo_patid.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.

Text & "'." & rno & ")") 40 Hospital Management System . adOpenDynamic.'" & m_sx & "'. db.' “& _ DTP.Caption rno = Val(cmbRoomNo.Value = True Then pattype = rdoIP.Value & "'.Text & "'.Text) Else pattype = rdoOP. adLockOptimistic If Not rs.'" & txt_address.Text & "." & txt_regfee & ".Text & "' ".'" & _ Combo_drpref.'" & pattype & "'.Open "SELECT * FROM PATIENTDETAILS where patientid='" & txt_patientid.Open rs.Execute ("INSERT INTO PATIENTDETAILS VALUES ('" & txt_name.'" & txt_patientid & "'.Text & "'.EOF() Then MsgBox "Patient ID allready exist" Else If ValidateForm = True Then If rdoIP." & _ txt_age.Caption rno = -1 End If db.m_sx = "male" Else m_sx = "female" End If db.

adOpenDynamic.Text & "'".db. Len (m_MissingFields) . adLockOptimistic WHERE drname=' " & Combo_drpref.Text & "' ") 41 Hospital Management System . db.Close 'm_patid = m_patid + 1 txt_address.Text = "" txt_name.Text)) MsgBox "Record added successfully" m_patid = m_patid + 1 Else m_MissingFields = Left (m_MissingFields. "Missing fields" m_MissingFields = "" End If End If db. please fill the fields and try again".Open m_patcount = m_patcount + 1 rs.Text = "" txt_patientid. vbCritical + vbOKOnly.Open "SELECT * FROM PATCOUNT WHERE drname='" & Combo_drpref.Text = "" txt_regfee.Text = "" txt_age.1) MsgBox "Some fields (" & m_MissingFields & ")" & vbCrLf & " are missing.Execute ("UPDATE ADDROOM SET Allocated='Y' WHERE roomno=" & Val (cmbRoomNo.Text = m_patid db.

Text = "") Then MsgBox "Please enter the date".AddItem rs!Name lst_age.EOF () Then rs!patcount = m_patcount rs. adLockOptimistic While Not rs.EOF() lst_names. adOpenDynamic. vbCritical.Update Else MsgBox "Please fill all the fields" End If db.Open "SELECT * FROM PATIENTDETAILS WHERE admindate= #" & txt_dt. db. "Warning" Else db.If Not rs.AddItem rs!age 42 Hospital Management System .Open rs.Close End Sub Private Sub DTPicker1_Change () End Sub Private Sub Command2_Click () Unload Me End Sub Private Sub Command3_Click () If (txt_dt.Text & "# ".

AddItem rs!address rs.Clear lst_names.lst_add.Clear lst_add.EOF () 43 Hospital Management System .Close End If End Sub Private Sub Command4_Click () Unload Me End Sub Private Sub Command5_Click () Combo_patid.Text = "" lst_age.Text = "" txt_dt. adOpenDynamic.Open rs. db.Clear End Sub Private Sub Command6_Click() End Sub Private Sub Form_Load () connectdb db.MoveNext Wend db.Open "SELECT * FROM DrREGISTRATION". adLockOptimistic While not rs.

adOpenDynamic.Close rdoOP.AddItem rs!drname rs.Value = True Then cmbRoomNo.Text = m_patid Else m_patid = rs(0) + 1 txt_patientid.Enabled = True 44 Hospital Management System .Enabled = False End Sub Private Sub rdoIP_Click () If rdoIP.MoveNext Wend rs. adLockOptimistic If (rs(0) = 0) Then m_patid = 1 txt_patientid.Open "SELECT COUNT (*) FROM PATIENTDETAILS".Value = True loadRooms cmbRoomNo.Close rs. db.Combo_drpref.Text = rs (0) + 1 End If db.

adLockOptimistic While not rs.Close End Sub Private Sub txt_dt_GotFocus () Command3. db.Value = True Then cmbRoomNo.MoveNext Wend db.End If End Sub Private Sub rdoOP_Click () If rdoOP.Open rs.EOF Combo_patid.AddItem rs!patientid rs.Text = "" Then 45 Hospital Management System .Open "PATIENTDETAILS".Enabled = True End Sub Private Function ValidateForm () As Boolean Dim m_valid As Boolean m_valid = True If txt_name. adOpenDynamic.Enabled = False End If End Sub Private Sub SSTab1_Click (PreviousTab as Integer) db.

Clear While Not rs.Open rs." m_valid = False End If If txt_regfee.Text = "" Then m_MissingFields = m_MissingFields & "Age. adOpenDynamic.Text = "" Then m_MissingFields = m_MissingFields & "Address.m_MissingFields = m_MissingFields & "Name.EOF 46 Hospital Management System . adLockOptimistic cmbRoomNo." m_valid = False End If If txt_address." m_valid = False End If If txt_age.Text = "" Then m_MissingFields = m_MissingFields & "Registration Fee." m_valid = False End If ValidateForm = m_valid End Function Public Sub loadRooms() db. db.Open "SELECT roomno FROM ADDROOM WHERE Allocated='N'".

Fields(0) rs.cmbRoomNo.Close Else 47 Hospital Management System .ListIndex = 0 End If db.Text rs.AddItem rs.EOF() Then rs!consultationtime = txt_time.Text rs!address = txt_address. 3 If Not rs.Open rs.Open "SELECT * FROM DrREGISTRATION WHERE Drname= '" + Combo_drname. db.Close End Sub EDIT DOCTOR Private Sub cmd_update_Click() db.Text + "'".MoveNext Wend If (cmbRoomNo.ListCount > 0) Then cmbRoomNo. 3.Text rs!contactno = txt_contactno.Text rs!emergencyno = txt_emergencyno.Update MsgBox "Record updated Successfully" db.

adOpenDynamic.Text = rs!address txt_contactno.EOF Combo_drname.Text = rs!consultationtime txt_address.Open rs.AddItem rs!drname 48 Hospital Management System . adLockOptimistic While Not rs.Open rs.Open "DrREGISTRATION". db.Text = rs!contactno txt_emergencyno.Text + "' ".Close End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() connectdb db.MsgBox "Record not found" End If End Sub Private Sub Combo_drname_Click() db.Open "SELECT * FROM DrREGISTRATION where drname='" + Combo_drname. adLockOptimistic txt_time.Text = rs!emergencyno db. adOpenDynamic. db.

Open rs. db.Open "SELECT * FROM PATIENTDETAILS WHERE patientid='" + Combo1_patid.Close Else 49 Hospital Management System . db.Text rs.Update MsgBox "Record Updated" db. adLockOptimistic If Not rs.Close End Sub EDIT PATIENT Private Sub cmdupdate_Click() db. adOpenDynamic.MoveNext Wend db.rs.Text + "' ". adLockOptimistic rs!address = txt_address.Close End Sub Private Sub Combo1_patid_Click() db.Open "PATIENTDETAILS".Open rs.EOF() Then txt_address.Text = rs!address db. adOpenDynamic.

MsgBox "Record not found" End If End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() connectdb db.Open rs.Open "PATIENTDETAILS", db, 3, 3 While Not rs.EOF() Combo1_patid.AddItem rs!patientid rs.MoveNext Wend db.Close End Sub

INPATIENT BILL

Dim billno As Integer Dim w As Integer Dim addt As Date Dim diff As Integer

50

Hospital Management System

Private Sub cm_close_Click() 'End If Unload Me End Sub Private Sub cmd_dis_Click() w=0 db.Open 'rs.Open "select * from PATIENTDETAILS where patientid='" + txtPatID.Text + "' ", db, adOpenDynamic, adLockOptimistic rs.Open "select * from LABBILL where patientid=" + Combo_patid.Text + " ", db, adOpenDynamic, adLockOptimistic If Not rs.EOF() Then w = w + rs("total") Else 'MsgBox "Record not found" w=w End If rs.Close rs.Open "select * from PHARBILL where patientid=" + Combo_patid.Text + " ", db, adOpenDynamic, adLockOptimistic If Not rs.EOF() Then w = w + rs("tot") Else

51

Hospital Management System

'MsgBox "Record not found" w=w End If rs.Close rs.Open "select * from IPBILL where patientid=" + Combo_patid.Text + " ", db, adOpenDynamic, adLockOptimistic If Not rs.EOF() Then w = w + rs("tot") Else 'MsgBox "Record not found" w=w End If rs.Close db.Close 'txt_totbill.Text = w Load DISCHARGEsheet DISCHARGEsheet.txt_totbill.Text = w DISCHARGEsheet.txtPatID.Text = Combo_patid.Text DISCHARGEsheet.txt_dr.Text = Combo_dr.Text DISCHARGEsheet.txt_name.Text = txt_name.Text DISCHARGEsheet.Show End Sub

52

Hospital Management System

Text rs!patientid = Combo_patid.Update rs.Text rs!amt = txt_amt. vbCritical + vbOKOnly.1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing. Len(m_MissingFields) .Text rs!doctor = Combo_dr. "Missing fields" m_MissingFields = "" End If 53 Hospital Management System .Open "IPBILL". db.Private Sub cmd_save_Click() If ValidateForm = True Then db. adLockOptimistic rs. please fill the fields and try again".AddNew rs!Name = txt_name.Text rs!billno = txt_billno.Close MsgBox "Recorded added sucessfully" Else m_MissingFields = Left(m_MissingFields.Text rs!regdate = txt_regdate.Text rs!regdate = txt_regdate.Open rs. adOpenDynamic.Text rs!room = txt_room.Text rs!tot = diff rs.

db.Close cmd_dis.Enabled = True cmd_save.Enabled = False End Sub

Private Sub Combo_patid_Click() db.Open rs.Open "SELECT * FROM PATIENTDETAILS WHERE patientid='" + Combo_patid.Text + "'", db, adOpenDynamic, adLockOptimistic If 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 Combo_patid.Text + "'", db, adOpenDynamic, adLockOptimistic txt_room.Text = rs!roomno 'txt_amt.Text = rs!amt 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

54

Hospital Management System

Else MsgBox "No Rooms allotted" End If 'rs.Open "SELECT * FROM PATIENTDETAILS", db, adOpenDynamic, adLockOptimistic db.Close diff = DateDiff("d", addt, Now) diff = diff * Val(txt_amt.Text) 'MsgBox diff txt_tot.Text = diff End Sub Private Sub Form_Load() connectdb db.Open rs.Open "SELECT patientid FROM PATIENTDETAILS WHERE Type='IP'", db,

adOpenDynamic, adLockOptimistic While Not rs.EOF Combo_patid.AddItem rs!patientid rs.MoveNext Wend db.Close db.Open rs.Open "DrREGISTRATION", db, adOpenDynamic, adLockOptimistic While Not rs.EOF

55

Hospital Management System

Combo_dr.AddItem rs!drname rs.MoveNext Wend db.Close 'db.Open db.Open rs.Open "SELECT COUNT(*) FROM IPBILL", db, adOpenDynamic, adLockOptimistic If (rs(0) = 0) Then txt_billno.Text = 1 Else billno = billno + 1 txt_billno.Text = billno End If db.Close End Sub Private Sub Label11_Click() End 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

56

Hospital Management System

" m_valid = False End If ValidateForm = m_valid End Function OUTPATIENT BILL Dim m_count As Integer Dim total As Integer Dim m_MissingFields As String Private Sub Command1_Click() db.Text 57 Hospital Management System . db.Open rs.Text rs!labamt = txt_lamt. adLockOptimistic rs.Text = "" Then m_MissingFields = m_MissingFields & "Amount.Text rs!billno = txt_billno.AddNew rs!Name = txt_name.Value rs!pamt = txt_pamt. adOpenDynamic.Text rs!tot = txt_tot.Open "OPPHARMACY".Text rs!Amount = txt_amt.End If If txt_amt.Text rs!Date = DTP.

Close Else m_MissingFields = Left(m_MissingFields. "UserAdded" rs. vbInformation.Text &_ ".Update 'MsgBox "You are registered".rs!patientid = Combo_patid.Open db.Close db.Text rs!doctor = Combo_dr. vbCritical + vbOKOnly.Execute "INSERT INTO OPBILL VALUES(" & txt_billno." & txt_amt.Text rs." & txt_tot.Close End Sub Private Sub cmd_save_Click() If ValidateForm = True Then db.Text & ".Text & ".Text & " )" MsgBox "Record added successfully" db." & txt_pamt.1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing.Text & _ "'." & txt_lamt.'" & DTP.'" & Combo_dr. Len(m_MissingFields) . please fill the fields and try again". "Missing fields" m_MissingFields = "" 58 Hospital Management System ." & Combo_patid.'" & txt_name.Text & ".Value & "'.Text & ".Text & "'.

adLockOptimistic If Not rs.Text + " ".EOF() Then txt_pamt.Open rs.EOF() Then txt_name.Text + "'".Text = rs!Name Else MsgBox "Record not found" End If rs.Text = rs!tot rs.Close Else MsgBox "Not Found" End If rs. adLockOptimistic If Not rs. db. adOpenDynamic.End If End Sub Private Sub Combo_patid_Click() db.Open "SELECT * FROM PATIENTDETAILS WHERE patientid='" + Combo_patid.Open "SELECT * FROM PHARBILL WHERE patientid=" + Combo_patid. db.Text + " ". adLockOptimistic 59 Hospital Management System .Open "SELECT * FROM LABBILL WHERE patientid=" + Combo_patid. adOpenDynamic.Close rs.Close rs. adOpenDynamic. db.

AddItem rs!drname rs. adLockOptimistic While Not rs.Close db.Open "PATIENTDETAILS". adOpenDynamic.Text = rs!total rs. adOpenDynamic.MoveNext Wend db.EOF() Then txt_lamt.If Not rs.Open rs. adLockOptimistic While Not rs.Open "DrREGISTRATION".EOF 60 Hospital Management System .Close Else MsgBox "Amount field is empty" End If db. db.Close End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() connectdb db.EOF Combo_dr. db.Open rs.

MoveNext Wend db.Text = m_count End If db.Close db.Combo_patid.Text = total cmd_save.AddItem rs!patientid rs. db.SetFocus End If End Sub 61 Hospital Management System .Text) + Val(txt_lamt.Close End Sub Private Sub txt_amt_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then total = Val(txt_amt.Text) txt_tot.Text = m_count Else m_count = m_count + 1 txt_billno.Open rs.Text) + Val(txt_pamt. adLockOptimistic m_count = rs(0) If (m_count = 0) Then m_count = 1 txt_billno. adOpenDynamic.Open "SELECT COUNT(*) FROM OPBILL".

" m_valid = False End If If txt_pamt.Text = "" Then m_MissingFields = m_MissingFields & "Lab Amount.Text = "" Then m_MissingFields = m_MissingFields & "Total.Text = "" Then m_MissingFields = m_MissingFields & "Name." m_valid = False End If If txt_amt.Private Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_name." m_valid = False End If 62 Hospital Management System .Text = "" Then m_MissingFields = m_MissingFields & "Amount." m_valid = False End If If txt_tot." m_valid = False End If If txt_lamt.Text = "" Then m_MissingFields = m_MissingFields & "Pharmacy Amount.

'" & DTP. 1) & "'.Value & _ "'.TextMatrix(k.TextMatrix(k.Rows .'" & MSF.2 db.Caption & ")") Next MsgBox "Recorded added successfully" Else 63 Hospital Management System .Execute ("INSERT INTO PHARBILL VALUES( " & txt_billno. 2) & _ "'. 3) & ".'" & Combo_patid.TextMatrix(k.Text & "'.'" & MSF." & MSF." & lblTotal.Text & ".ValidateForm = m_valid End Function PHARMACY BILL Dim i As Integer Dim j As Integer Dim amt As Double Dim billno As Integer Dim m_MissingFields As String Private Sub cmd_save_Click() If ValidateForm = True Then For k = 1 To MSF.

please fill the fields and try again".Close End Sub Private Sub Combo_med_Click() rs.Close txt_qty.1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing.Open "SELECT * FROM MEDICINE WHERE medname='" + Combo_med. Len(m_MissingFields) . adOpenDynamic.SetFocus End Sub Private Sub Command3_Click() Unload Me db.Close End Sub 64 Hospital Management System . "Missing fields" m_MissingFields = "" End If db.Caption = rs!amt End If rs.m_MissingFields = Left(m_MissingFields.EOF() Then lblprice. vbCritical + vbOKOnly. adLockOptimistic If Not rs. db.Text + "'".

Text = 1 Else billno = billno + 1 txt_billno.AddItem "" While Not rs. adOpenDynamic. adLockOptimistic Combo_med.Private Sub Form_Load() i=1 connectdb db.Close 65 Hospital Management System . db.Open "SELECT COUNT(*) FROM PHARBILL".Open rs.MoveNext Wend rs. adOpenDynamic.AddItem rs!medname rs.Close rs.Text = billno End If rs.Open "SELECT * FROM MEDICINE".EOF() Combo_med. adLockOptimistic billno = rs(0) If (billno = 0) Then txt_billno. db.

3) = CDbl(Val(txt_qty.Text = "" lblprice.ListIndex = 0 End If 66 Hospital Management System . adOpenDynamic.Rows = MSF. 1) = Combo_med. 0) = i MSF.rs.AddItem rs!patientid rs. 2) = txt_qty.Caption = Val(lblTotal.Caption)) lblTotal.Rows + 1 i=i+1 txt_qty.Open "SELECT * FROM PATIENTDETAILS".Caption = "" Combo_med.TextMatrix(i.Text MSF.TextMatrix(i.Text MSF.MoveNext Wend rs.Text) * Val(lblprice. adLockOptimistic While Not rs.TextMatrix(i.TextMatrix(i.Close End Sub Private Sub txt_qty_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then MSF.Caption) + MSF. 3) MSF. db.TextMatrix(i.EOF() Combo_patid.

End Sub Private Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_qty.ListIndex = 0) Then Command4.Text = "" Then m_MissingFields = m_MissingFields & "Qty.Enabled = True 67 Hospital Management System ." m_valid = False End If ValidateForm = m_valid End Function LAB BILL Dim billno As Integer Dim i As Integer Dim k As Integer Dim m_MissingFields As String Private Sub combo_labtests_Click() If (combo_labtests.Enabled = False Else Command4.

EOF() Then lblamt. 1) & "'. please fill the fields and try again". db.Caption & ")") Next MsgBox "Recorded added successfully" Else m_MissingFields = Left(m_MissingFields.1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing. adLockOptimistic If Not rs. 2) & _ ".TextMatrix(k.TextMatrix(k. adOpenDynamic.Caption = rs!amt End If rs. "Missing fields" m_MissingFields = "" End If 68 Hospital Management System .2 db.Execute ("INSERT INTO LABBILL VALUES( " & txt_billno.Close End Sub Private Sub Command2_Click() If ValidateForm = True Then For k = 1 To MSF.Text & ".'" & MSF.Open "SELECT * FROM LABUPDATE WHERE testname='" & combo_labtests.Text & "'".End If rs.'" & Combo_patid." & MSF." & lbl_tot. Len(m_MissingFields) .Text & _ "'.Rows . vbCritical + vbOKOnly.

2) = lblamt.2 MSF.Rows .Caption) + MSF.Rows = 2 i=1 txt_billno.TextMatrix(i.TextMatrix(i. 2) MSF.Close End Sub Private Sub Command3_Click() billno = billno . 1) = combo_labtests.Rows = MSF.TextMatrix(k. 0) = i MSF.1 db.Text = billno + 1 db.Text MSF.TextMatrix(i.Close Unload Me End Sub Private Sub Command4_Click() MSF.TextMatrix(i.TextMatrix(k.TextMatrix(k. 2) = "" Next MSF. 0) = "" MSF. 1) = "" MSF.Caption = Val(lbl_tot.Rows + 1 69 Hospital Management System .For k = 1 To MSF.Caption lbl_tot.

MoveNext Wend rs. adLockOptimistic 70 Hospital Management System .Text = "") Then Command4.Caption = "" End Sub Private Sub Form_Load() If (combo_labtests.Enabled = False Else Command4. db.Open "SELECT * FROM PATIENTDETAILS". db.ListIndex = 0 lblamt.AddItem "" rs.Open combo_labtests.EOF() combo_labtests. adOpenDynamic.i=i+1 combo_labtests.Close rs. adLockOptimistic While Not rs.Enabled = True End If i=1 connectdb db.Open "SELECT * FROM LABUPDATE". adOpenDynamic.AddItem rs!testname rs.

db." m_valid = False 71 Hospital Management System .Close lbl_tot.Caption = 0 rs. adOpenDynamic.Close End Sub Private Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If MSF.Text = billno End If rs.Open "SELECT COUNT(*) FROM LABBILL".AddItem rs!patientid rs.MoveNext Wend rs.While Not rs.TextMatrix(2. adLockOptimistic billno = rs(0) If (billno = 0) Then txt_billno. 1) = "" Then m_MissingFields = m_MissingFields & "Test Name.EOF() Combo_patid.Text = 1 Else billno = billno txt_billno.

'" & txt_dr. db. '" & txt_remarks.Text & "'.Text & "'.Open "SELECT RoomNo FROM PATIENTDETAILS WHERE patientid='" & Val(txtPatID.'" & DTP.End If ValidateForm = m_valid End Function DISCHARGE SHEET Dim m_MissingFields As String Dim w As Double Private Sub cmd_cancel_Click() Unload Me End Sub Private Sub cmd_save_Click() Dim roomno As Integer If ValidateForm = True Then db.EOF Then roomno = rs!roomno End If 72 Hospital Management System .Text & " '." & txt_totbill.Execute ("INSERT INTO DISCHARGESHEET VALUES('" & txtPatID. adOpenDynamic. adLockOptimistic If Not rs.Open db.Value & "')") rs.Text & "'.Text) & "'".'" & txt_name.Text & ".

Close db.Execute ("UPDATE ADDROOM SET Allocated='N' WHERE roomno=" & roomno) MsgBox "Recorded added successfully" db.rs. vbCritical + vbOKOnly.Text = "" Then m_MissingFields = m_MissingFields & "Remarks .Text = "" Then 73 Hospital Management System ." m_valid = False End If If txt_totbill. Len(m_MissingFields) . please fill the fields and try again".Close Else m_MissingFields = Left(m_MissingFields. "Missing fields" m_MissingFields = "" End If End Sub Private Sub Form_Load() connectdb End Sub Private Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_remarks.1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing.

db.EOF() Then txt_name.Open "SELECT * FROM PATIENTDETAILS WHERE patientid= '" + Combo_patid.Text = rs!address Else MsgBox "Record not found" End If rs.Text + "'".m_MissingFields = m_MissingFields & "Bill Amount. adLockOptimistic If Not rs.Text = rs!Name txt_address. adOpenDynamic.Open rs.Close 74 Hospital Management System ." m_valid = False End If ValidateForm = m_valid End Function INPATIENT SEARCH Private Sub cmd_close_Click() Unload Me End Sub Private Sub Combo_patid_Click() db.

db.'rs.MoveNext Wend db.Open rs.Open "SELECT * FROM ROOMALLOCATION WHERE patientid= '" & Combo_patid.EOF() Then txt_roomno.Text & "' " rs. adOpenDynamic.Close End Sub 75 Hospital Management System .EOF() Combo_patid.AddItem rs!patientid rs.Close End Sub Private Sub Form_Load() connectdb db.Text = rs!roomno Else MsgBox "Record not found" End If db. adLockOptimistic While Not rs.Open "SELECT * FROM PATIENTDETAILS WHERE patientid= '" & Combo_patid.Open "SELECT * FROM PATIENTDETAILS WHERE type='IP'".Text & "' and type='IP'" If Not rs.

Open "DrREGISTRATION". db. adOpenDynamic.Caption = rs!dept Label8.MoveNext 76 Hospital Management System .Open rs.Caption = rs!address Label12.Open "select * from DrREGISTRATION where drname='" + Combo1.EOF Combo1.Caption = rs!emergencyno db.Caption = rs!consultationtime Label11.Open rs. adLockOptimistic While Not rs.Text + "' ". adOpenDynamic.Caption = rs!contactno Label13.Close End Sub Private Sub Command1_Click() Unload Me End Sub Private Sub Form_Load() connectdb db. db. adLockOptimistic Label6.AddItem rs!drname rs.DOCTOR SEARCH Private Sub Combo1_Click() db.

Close End Sub MEDICINE UPDATES Private Sub Command1_Click() db.Execute ("INSERT INTO MEDICINE VALUES('" & txt_mname.Text & ")") MsgBox "Record Successfully added" db.AddItem "Capsule" Combo_medtype.'" & DTP.Text = "Capsule" Combo_medtype." & txt_stock.'" & Combo_medtype.Value & "'.Text & "'." & txt_amt.Wend db.Open db.Text & ".Close End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() connectdb Combo_medtype.Text & "'.AddItem "Syrup" End Sub 77 Hospital Management System .

Private Sub Label1_Click() End Sub ROOM ALLOCATION Dim m_MissingFields As String Private Sub Command1_Click() 'On Error GoTo er If ValidateForm = True Then db.1) MsgBox "Some fields(" & m_MissingFields & ")" & vbCrLf & " are missing. Len(m_MissingFields) .'" & combo_rtype. vbCritical + vbOKOnly.Execute "INSERT INTO ROOMALLOCATION VALUES('" & txt_patid.Text & "'. please fill the fields and try again".Text & "'." & txt_roomno.Text & ".Text & ")" MsgBox "Record added successfully" db.Close Else m_MissingFields = Left(m_MissingFields.Open db. "Missing fields" m_MissingFields = "" End If End Sub Private Sub Command2_Click() Unload Me 78 Hospital Management System ." & txt_amt.

Text = "" Then m_MissingFields = m_MissingFields & "Amount.Text = "Single room" combo_rtype.Text = "" Then m_MissingFields = m_MissingFields & "Patient ID." m_valid = False End If If txt_amt." m_valid = False End If If txt_roomno.AddItem "Double room" End Sub Private Function ValidateForm() As Boolean Dim m_valid As Boolean m_valid = True If txt_patid.Text = "" Then m_MissingFields = m_MissingFields & "Room No.End Sub Private Sub Form_Load() connectdb combo_rtype.AddItem "Single room" combo_rtype." m_valid = False End If ValidateForm = m_valid 79 Hospital Management System .

End Function OUTPUTS Login 80 Hospital Management System .

Admin Registration 81 Hospital Management System .

Change Password Doctor Registration 82 Hospital Management System .

Patient Registration 83 Hospital Management System .

In Patient Search 84 Hospital Management System .

Medicine Update 85 Hospital Management System .

IP Bill Discharge Sheet 86 Hospital Management System .

Doctor Search 87 Hospital Management System .

88 Hospital Management System .

The hospital managing system was thoroughly checked and tested with dummy data and thus is found to be very reliable. the front office managing is very slow.CONCLUSION The HOSPITAL MANAGEMENT SYSTEM is a great improvement over the manual system using case fields and paper. In the current system. The computerization of the system has sped up the process. 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 89 Hospital Management System . ADVANTAGES • • • • • • It is fast.

We can enhance this system by including more facilities like billing system.FUTURE ENHANCEMENTS The proposed system is Hospital Management System. inpatient room allotment for the admitted patients and the stock details of medicines in the pharmacy. 90 Hospital Management System . Providing such features enable the users to include more comments into the system.

vbcodesource.BIBLIOGRAPHY Books • A Complete Guide to Programming in Visual Basic .Tem R Neito • Advanced Programming Using Visual Basic: Version 6.associatedcontent.Paul j deitel.tripod.members.com 91 Hospital Management System .Net -Michael McMillian • A Complete Visual Basic 6 Training Course: How to Programme: Package -Harvey M deitel.com www.0 -Julia Case Bradley • Access 2003 Power Programming with VBA -Allen G Taylor • Advanced MS Visual Basic -Peter Morris Site Address • • • www.com www.

Sign up to vote on this title
UsefulNot useful