Vous êtes sur la page 1sur 68

Introduction &

Objective
Introduction And

Objective
This software “CLINIC MANAGEMENT SYSTEM” is being built for managing
and maintaining patients’ records at any small hospital or clinic at a lower level
by the Doctor or any Administrator and thus to solve the problem on daily basis.

Salient feature about the system

• The system keeps detail of Patient Records.

• The system supports keyboard functions and is not solely depended upon
mouse.

• The system is fully computerized and user friendly.

• The system is capable of storing bulk of data.

• The system is so made that it is easy for a naïve user to work upon.

• The system is protected and hence the management is only entitled to


retrieve the necessary information.

• New information is fed into the system with ease and any changes or
modifications can be performed without any difficulty.
• The system is fully functional on any version of Windows operating
system.

• The system is so developed that it is adaptable to any changes made to it


in the future.

• The system is capable of handling all types of errors and faults on its
own.

• The system presents well-formatted report in front of the management.

Scope Of Project
Clinic Management System for managing a Clinic is a Computer Based
Management System, which is being designed to cover whole
functioning of any small Hospital or a Clinic. It covers details of all the
patient related activities like there registration , allotment of medicine in the
clinic, fixing appointment with the Doctors and all transaction of the medicine
that takes place in Clinic’s Medical store. The basic idea behind the
development of the Clinic Management System is that there all the activities
related with Patient care and clinic should come under certain framework
and that framework must provide a smooth effective and better co-
coordinated working among various constituent of the clinic.
System
Analysis
Identification Of Need
Analysis Of Project
This Software package Clinic Management System is developed for managing
a Clinic or a small hospital.

The purpose of this proposed system is to automate the whole


functionality of Clinic. The whole Clinic has a lot of departments and each &
every departments have different functions. The functionality starts when a
patient enters for appointment, takes admission till discharge.

The Developed system has the following functionality:


• To minimize the Total Manual Time and Effort involved in Compilation
and Retrieval of Meaningful Information.

• To Centralized the Management System and centrally control all the


data and information.

• To generate the required reports on time and according to the format


required by various level of official hierarchy.
• To identify the Critical Operational Procedures and possibilities of
simplification using IT tools.

• To define Efficient Information Storage, Flow and Retrieval System.

• To improve the Quality and Integrity of the Information for Better


Monitoring.
• The requisition automatically generated by system as it got the wind
that the particular stock is in short position.

• Provide security features in using the system like one Administrator


password, Creating users and Assigning privileges to users of the
system.

Descripti
on
Patient Registration Process:
When a patient enters in a clinic, he enquires for the specified doctor then
looks for an appointment with the same doctor. When a patient gets an
appointment he registers himself with the Clinic/Hospital. Here our system
records all details of the patient. The first module registration starts working
from here.
Registration: The registration process has sub-parts:
• Candidate Name, Age, Address, Sex, Telephone No., E-mail ID, Fees
details, Picture if available.

Fees Collection Process:


Here the fee is added by the administrator or the Doctor in regard to the
patient’s ailment. The fees is added in the database by the prior selection
of the patient ID, which makes it easier for the Doctor in selecting the fees
from the already present database which was fed by the Administrator
during the design of this software package.

Medicine Prescription Process:


In this section the doctor selects the patient ID and then studies the
ailment of the person. After careful study of the disease the doctor
prescribes the medicines required. In this the doctor can also refer the
patient to any other hospital if he feels that the remedy is not possible in
his clinic. This process includes patient’s name, age, sex, address, and
his dates of present visit and previous visit with the registration date. The
text boxes include the prescription by the doctor. And also the doctor as
and when required can manually change the last treatment history by any
other doctor.

Patient Modification Process:


Every department has the facility of modifying or changing the present
record as and when required. So this software also includes the ability to
modify any patient’s record such as his/her name, age, sex, telephone
no., Email-ID and consequently change his address also. The past record
is replaced by the current record in the oracle database. The doctor
should be careful while modifying the record as once the record is
modified, it cannot be brought back to it’s original form.

Patient Deletion Process:


The deletion process is much like the modification process. The only
change one can see here is that the modify patient button on the form
has been replaced by delete patient button. For deleting the record the
doctor must select the present patient ID from the database, and then
subsequently delete the record. In this only one record can be deleted at
a time. Here the operator should be careful while deleting the record as
once the record has been deleted it cannot be brought back from the
database. Hence we can say that deletion is permanent from the
database.

Modifying The Fees:


The fees process is equally important as the rest of processes. This part
includes the following fields:
Description: This includes the type of ailments one at a time, like Cardio
Vascular shown in the figure above.
Fees ID: This field displays the valid fees identification number which is
unique for a single disease.
Amount: This box contains the amount prescribed by the doctor at the
time of entering the fees off different diseases.
Modify: By clicking this button one can modify the fees details already
present in the database.
Delete: Similarly we can also delete a fees record from the database.
Record once deleted cannot be brought back in the database. So care
should be taken while performing this action.

Modifying Medicine Purchase:


This process modifies the purchase quantity and amount of medicine
bought. It has the following fields:
Date of Purchase: Includes date of medicine purchase.
Name: Contains medicine name as entered previously.
Select Entry: Here we select the desired medicine to modify it’s quantity
and amount.
New Quantity: Here we enter the new quantity to modify the existing
record.
New Amount: Here we enter the new amount to modify the existing
record.

Data
Flow
Diagrams
Context Level DFD
First Level Of Registration Process

Prescription Process
Patient History In Database

Purchase Process Fees Master


Entity Relationship Diagram
Proposed
System

Proposed System
As the alternative of existing system, an updated system is proposed.
Proposed System is developed in Oracle 8 and Visual Basic 6.0.

VISUAL BASIC (VERSION - 6.0)


Visual Basic is the most popular programming language , but does
that make it suitable to use as a front - end for oracle ? There are
some important reasons to use Visual Basic rather than any of the
others.
Capability:-
Visual Basic is capable of producing software as sophisticated as
data access techniques available, another suitable utilities which enhance
the capability of visual basic best is , API's, Active X Controls, which can be
used any where in any system without any constraint of operating system.
Flexibility:-
Visual Basic supports Modular Programming, which enhance the flexibility of
any product.
Familiarity :-
There is no need for any skilled staff for any specialized work.
Popularity:-
The popularity of a product is important for you to become familiar
with because you will see more magazine articles and books as well
as have a better supply of third party. A product from companies who
will devote their resources in which there is payback..

Overview of Oracle:
Oracle is an object-relational database. A relational database is an
extremely simple way of thinking about and managing the data used in a
business. It is nothing more than a collection of tables of data.
A relational database management system such as Oracle
gives you a way of doing things in an understandable and reasonably
uncompelled way. Oracle basically does three things:
Lets you put data into it.
Keeps the data.
Lets you get the data out and work with it.
The information stored in Oracle is kept in tables. There are three major
characteristics of the tables.
Columns
Rows
Name
Tables of Information:
Oracle stores information in tables. These tables have one or more columns.
The columns heading describe the kind of information kept in the column.
The information is stored row after row. Each unique set of data gets is own
row.
Even though the tables are independent, we can easily see that they are
related. A column in one table is related to a column in the other table. This
relationship is the basis for the name relational database. This is the basic
idea of a relational (sometimes called a relational model). Data is stored in
tables. Tables have columns, rows, and names. Tables can be related to
each other if each has a column with a common type of information.
The retrieval of data from a database can be faster with primary key. A
primary key is a field that uniquely identifies each record in a table is called a
foreign key.

To cascade updating and deletion of related fields, we enforce the referential


integrity. Whenever a change is made to primary key, Oracle automatically
makes those changes in the foreign key.
When two tables have single common field, they are said to be 'related'. The
types of relationships, which the tables in Oracle can have, are:
One to One
One to many
Many to One
Many to many

Structured Query Language (SQL)


Oracle was the first company to release a product that used the English-
based structured Query Languages, or SQL. This Language allowed end
users to extract information themselves, without using a systems group for
every little report. The key words used in a query to Oracle to help it
understand your request and respond with the correct answer.
The Oracle database system provides a number of benefits, some of which
can also be found in other relational database systems. Oracle and its
components run on more than 100 different hardware & operating system
platform (including all the different versions of Unix from the many different
vendors). Oracle Corporation also provides a full suite of development tools,
end-user tools, applications, and utilities. Some benefits of using Oracle are:
1. Large Databases
2. Many Users (multiple user can work)
3. Portable
4. Backup & Recovery features
5. Security

Oracle 8 :
It is used as a back end tool. It is a RDBMS (Relational Data Base
Management System). Operating with in the framework of Network
Computing Architecture (NCA), it provides maximum performance and
scalability through its unique design. In addition Oracle 8 for windows
has been optimized to take full advantage of multitasking and input
output capabilities. The oracle database system provides a number of
benefits, some of which can also be found in other relational database
systems .
Oracle and its components run on more than 100 different hardware and
operating System platform (including all the different versions of unix from
the many different vendors). Oracle Corporation also provides a full suite of
development tools, end user tools, applications and utilities.

• Some benefits of using oracle are:-


• Large Databases
• Many Users (multiple users can work)
• Portability
• Backup and Recovery features
• Security
• Client Server Support
Visual Basic 6.0
It is used as a front – end tool. Visual Basic is a part of Visual Studio.
Visual Basic programming system allows creating attractive and useful
applications that fully exploit the graphical user interface (GUI). Visual
Basic is more productive by providing appropriate tools for the
different aspects of GUI development. Visual Basic version 6.0 is the
newest addition to the family of Visual Basic products. It allows us to
develop windows application quickly and easily for PC without being an
expert in C++ or other programming languages.
Visual Basic provides graphical environment in which we visually design the
forms and controls that ecome building blocks of your application. Visual
Basic supports many useful tools will help us to be more productive for
example projects, forms, class, objects, templates, custom controls, add_ins
and database managers. We can use these tools to create complete
applications in months, weeks or even days. Producing an application using
another language can take much longer.
For developing the proposed system our need is to windows 98 /
window 2000 / window NT operating system. Windows 98 Operating
System is the enhanced version of windows 97. It is easier to use,
we can use multiple monitors with a single computer, dramatically
increasing the size of your workspace. Installing new hardware is
easy because Windows 98 supports the universal serial bus (USB)
standard, allowing us to plug in new hardware and use it immediately
without restarting the computer.
Now, in proposed system the records are stored in forms of tables in
database with the help of forms generated in front end at the time of
first registration of a Patient. This would be stored in master table
(Patient information), (e.g. Name, Address, DOB etc.). After that stores
rest of the related information i.e. ID No., Registration date & Referred
Doctor should be entered automatically. This information is not to enter
manually, which will reduce redundancy and many other mistakes.
There should be checks on all the fields, so that if user will enter any
wrong data then system will pop a error – message / warning with the
help about that entry for user, then system will rarely halt.
For security propose we should divide the system in hierarchy, where
the lowest level user can only view the data but can not change or
enter the data.
Top - level user can do all things that he wants. It means that he can
view the data, update and delete the data also. This represents the
top level user is master / supervisor.
All the users of different levels will have their passwords, through
which they can enter the system and can work on what they are
authorized. Only System Administrator can change their passwords for
the security purpose.
Feasibilit
y
Study
Feasibility Study
With the advancement of management and information technology sector,
need arises to do things in a better coordinated way, quickly, precisely and
most importantly to retrieve the desired information in full or part with a click
of finger. The field patient care is not exception.

In order to meet above goal, it was decided to computerize the whole


system but before the development of any system, it is necessary to
determine whether such a system would be feasible or not. That’s why a
feasibility study was conducted in order to assertion whether this Project is
worth doing or not.

There are several aspects of feasibility study like:

Technical Feasibility
This type of feasibility checks proposed system can be technically built of
not. It also focuses on the technical needs of the system, which can be
included.
Operational Feasibility
This type of feasibility is mainly related to human organization and political
aspects. The new skills required in existing staff members is also
considered.
Economic Feasibility
This type of analysis is the most frequently used technique for evaluating the
effectiveness of a proposed system. This procedure determines the benefit
and saving that are expected from proposed system and compare them with
cost.

Social Feasibility:
This type of feasibility analysis determines whether a proposed project will
be acceptable to the people or not . This determination typically examines
the probability of the project being accepted by the group directly affected by
the proposed system change.

Management Feasibility
This is a study of determination of whether a proposed project will be
acceptable to management .If management does not accept a project or
gives a negligible support to it, the project is considered as a non-feasible
one.

Legal Feasibility:
This analysis is a determination of whether a proposed system infringes on
known acts, statuses as well as penalty legislation.

Time Feasibility:
This feasibility study determines whether a proposed project can be
implemented fully within a stipulated time frame.
Considering all above aspects it was decided to go ahead with the proposed
system. The various clinic activities are categorized in to several groups
according to the nature of activities like Reception, ward, Pharmacy etc. This
categorization has been done in such a way that all the groups when
integrated form the completed Clinic Management System. These groups
have been named as Modules.
Scope of further
enhancement
Following modules can be added to this software for its enhancement

Billing :
The billing module facilitates cashier and billing operations for different
categories of patients, providing automatic posting of charges related to
different services like bed charges, lab tests conducted, medicines issued,
consultant's fee, food and beverage charges etc. This module provides for
credit party billing and can be integrated with the financial accounting
module if need be

Stores:
This module caters to the needs of a full-fledged Inventory Management
System. The activities include generating and raising purchase requisitions,
receiving quotations, raising recommendations, raising of purchase order
and much more. With the help of the enquiries provided, one can also keep
a track of stock balance, items below safety stock, items with due expiry
date, excess stock of items, etc

Laboratory:
This module allows for maintenance of investigation requests by patient and
results for various available services such as clinical pathology, X-ray, Ultra
sound etc. Requests can be made from various points including wards,
billing, sample collection point, or the laboratory receiving point. The
laboratory module is integrated with the IP/OP Registration, Wards and
Billing modules

Operation Theater:
This module deals with the operation theater activities such as pre-
anesthetic check-ups, pre-anesthetic notes generation, recording the
anesthesia details, maintaining the list of procedures for various operations,
recording operation details and maintaining the OT scheduling

Blood Bank:
The Blood Bank module provides information on collection and stock of
blood and its components and on results of tests, cross matching
identifications and transfusion reaction. It also keeps information on donors’
mailing list and donation ledgers.

Financial Accounting:
This module deals with cash/bank, receipts/payments, and journal vouchers
etc. Various books of accounts are maintained using this module. Books like
cash book, bank book and ledgers can be generated. This module also
generates reports like trial balance, balance sheet and profit and loss
statement

Payroll:
This module deals with pay (and deductions) calculations, printing of salary
slip, salary certificates, PF statements and also provides a monthly analysis

Medical Records:
This module keeps an abstract of clinical data about patients. It allows easy
retrieval of medical records on patients. A facility exists to maintain the ICD
and CPT information. Data can be analyzed and reports generated on
various parameters like ICD, CPT, age, sex and duration of stay
Other Software
Packages Used
1. RFShape: In preparation of Data flow diagrams ( DFD ) and Entity

Relationship Diagram ( ERD )

2. 1st Page 2000 : In preparation of HTML Documents

3. Xara3D: In preparation of graphics on opening screen of the software.

4. Notepad: In preparation of path files

5. MS Word: In preparing the complete Documentation of the system.


Hardware Software
Platform

Hardware Requirements
Processor - Pentium I (min.)
Speed - 133 MHz (min.)
RAM - 32 MB RAM
Hard Disc capacity - 1.2 GB
Monitor - SVGA color monitor
Printer - Dot Matrix / HP Laser Jet

Software Requirements
Operating System - Windows NT 4.0
Front End - Visual Basic 6.0
Back End -Oracle 8.0
Web Browser - Internet Explorer 5.0
Project
Coding

MODULE
Public conn As New ADODB.Connection
Public Sub main()
If conn.State = adStateOpen Then conn.Close
conn.CursorLocation = adUseClient
conn.Open "provider=msdaora.1;user id=siddharth/sidd"
frmLogin.Show
'frmMDI.Show
End Sub
Public Sub OpenDataConnection(con As ADODB.Connection)
End Sub
Public Sub CloseDataConnection(conn As Object)
End Sub
Public Function LoadNoPicture(PictControl As Object) As Boolean
Dim sTempFile As String
On Error GoTo ErrorHandler
sTempFile = App.Path & "\NoPicture.jpg"
PictControl.Picture = LoadPicture(sTempFile)
LoadNoPicture = True
ErrorHandler:
End Function
Public Function LoadPictureFromDB(PictControl As Object, _
rs As Object, FieldName As String) As Boolean
Dim sTempFile As String
Dim iFileNum As Integer
Dim lFileLength As Long
Dim abBytes() As Byte
On Error GoTo ErrorHandler
sTempFile = App.Path & "\TempPic.jpg"
If Len(Dir$(sTempFile)) > 0 Then
Kill sTempFile
End If
iFileNum = FreeFile
Open sTempFile For Binary As #iFileNum
lFileLength = LenB(rs(FieldName))
abBytes = rs(FieldName).GetChunk(lFileLength)
Put #iFileNum, , abBytes()
Close #iFileNum
PictControl.Picture = LoadPicture(sTempFile)
Kill sTempFile
LoadPictureFromDB = True
ErrorHandler:
End Function
Public Function SavePictureToDB(PictControl As Object, _
rs As Object, FieldName As String) As Boolean
Dim oPict As StdPicture
Dim sTempFile As String
Dim iFileNum As Integer
Dim lFileLength As Long
Dim abBytes() As Byte
On Error GoTo ErrorHandler
Set oPict = PictControl.Picture
sTempFile = App.Path & "\TempPic.jpg"
SavePicture oPict, sTempFile
iFileNum = FreeFile
ErrorHandler:
End Function

WELLCOME
SCREEN
Option Explicit
Private Sub Form_KeyPress(KeyAscii As Integer)
Unload Me
End Sub
Private Sub Form_Load()
Timer1.Interval = 500
End Sub
Private Sub Frame1_Click()
Unload Me
End Sub
Private Sub Timer1_Timer()
If Pb.Value < 100 Then
Pb.Value = Pb.Value + 10
End If
If Pb.Value > 0 And Pb.Value < 20 Then
Label2.Caption = "Checking System...."
End If
If Pb.Value > 20 And Pb.Value < 60 Then
Label2.Caption = "Loading Database...."
End If
If Pb.Value > 60 And Pb.Value < 80 Then
Label2.Caption = "Loading Settings...."
End If
If Pb.Value > 80 Then
Label2.Caption = "Starting...."
Unload Me
frmMDI.Show
End If
End Sub

MDI FORM
Private Sub MDIForm_Load()
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
Dim cn As New ADODB.Connection
Set cn = Nothing
End
End Sub
Private Sub mnuAbout_Click()
frmAbout.Show
End Sub
Private Sub mnuAppointments_Click()
frmAppointments.Show
End Sub
Private Sub mnuBackup_Click()
If MsgBox("Do you want to create a Backup copy of your Database", vbYesNo, "Create Backup?") = vbYes Then
On Error Resume Next
frmThemePath.Show
End If
End Sub
Private Sub mnuCascade_Click()
frmMDI.Arrange vbCascade
End Sub
Private Sub mnuCollection_Click()
frmCollectionReport.Show
End Sub
Private Sub mnuCollectionRep_Click()
frmCollectionRep.Show
End Sub
Private Sub mnuExit_Click()
If MsgBox("Are You Sure?", vbYesNo) = vbYes Then
Dim cn As New ADODB.Connection
Set cn = Nothing
End
End If
End Sub
Private Sub mnuFeesMaster_Click()
frmFeesMaster.Show
End Sub
Private Sub mnuFeesMasterRep_Click()
frmFeesMaster.Show
End Sub
Private Sub mnuModify_Click()
frmModifyRegistration.Show
End Sub
Private Sub mnuNewReg_Click()
frmAddPatient.Show
End Sub
Private Sub mnuOpenPrescription_Click()
frmOpenPrescription.Show
End Sub
Private Sub mnuPassword_Click()
frmConfirmPass.Show
End Sub
Private Sub mnuPatientHistory_Click()
frmModifyRegistration.Show
End Sub
Private Sub mnuPatientMasterRep_Click()
Form1.Show
End Sub
Private Sub mnuPatientReg_Click()
frmPatientReg.Show
End Sub
Private Sub mnuPrinterOption_Click()
CDl.ShowPrinter
End Sub
Private Sub mnuPurchaseEntry_Click()
frmPurchaseEntry.Show
End Sub
Private Sub mnuPurchaseRep_Click()
frmPurchaseRep.Show
End Sub
Private Sub mnuRegister_Click()
frmRegister.Show vbModal
End Sub
Private Sub mnuSearchHelp_Click()
frmSearchHelp.Show
End Sub
Private Sub mnuTiles_Click()
frmMDI.Arrange vbTileHorizontal
End Sub
Private Sub StatusBar1_PanelClick(ByVal Panel As MSComctlLib.Panel)
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
If Button.Description = "Exit" Then
Dim cn As New ADODB.Connection
Call CloseDataConnection(conn)
Set cn = Nothing
If MsgBox("Are You Sure?", vbYesNo) = vbYes Then
End
End If
End If
If Button.Description = "About" Then
frmAbout.Show
End If
If Button.Description = "Check Connectivity" Then
Call OpenDataConnection(conn)
If conn.State = adStateOpen Then
Dim strmsg As String
strmsg = "Connection to database available."
MsgBox strmsg, vbInformation, "Success"
Call CloseDataConnection(conn)
Else
strmsg = "Connection to database failed."
MsgBox strmsg, vbExclamation, "Error"
End If
Set cn = Nothing
End If
If Button.Description = "Collection" Then
Screen.MousePointer = vbHourglass
frmCollectionRep.Show
End If
If Button.Description = "Existing Patient" Then
Screen.MousePointer = vbHourglass
frmPatientReg.Show
End If
If Button.Description = "Help" Then
frmSearchHelp.Show
End If
If Button.Description = "Modify Registration" Then
frmModifyRegistration.Show
End If
If Button.Description = "New Patient" Then
Screen.MousePointer = vbHourglass
frmAddPatient.Show
End If
If Button.Description = "Printer Setup" Then
CDl.ShowPrinter
End If
End Sub

ADD PATIENT
Dim cn As New ADODB.Connection
Dim rstData As New ADODB.Recordset
Private Sub Combo1_Click()
If Combo1.Text <> " " Then
Call OpenDataConnection(cn)
Dim rstData As New ADODB.Recordset
SQLstm = "Select * from FeesMaster where FeesID like " & Combo1.Text & " order by FeesID"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Do While Not rstData.EOF
Text6.Text = rstData.Fields("Description").Value
Text7.Text = rstData.Fields("Amount").Value
rstData.MoveNext
Loop
rstData.Close
Else
Text6.Text = "" 'Description
Text7.Text = "" 'Amount
End If
End Sub
Private Sub Command1_Click()
Dim sConn As String
Dim updateData As Boolean
Dim netAmount As Integer
Dim expiryDate As Date
updateData = False
If IsNumeric(Text8.Text) = False Then ' Discount
Text8.Text = 0
End If
If IsNumeric(Text9.Text) = False Then ' Age
Text9.Text = 0
End If
If Text1.Text <> "" Then 'Name must be entered
If Text2.Text <> "" Then 'Address must be entered
If Text9.Text > 0 Then 'Valid Age
If Text8.Text >= 0 Then 'Valid Discount
If optSex(0).Value = False Or optSex(1).Value = False Then
If Combo1.Text <> " " And Combo1.Text <> "" Then
netAmount = Text7.Text - Text8.Text
If netAmount >= 0 Then
PatientSex = ""
If optSex(0).Value = True Then
PatientSex = "M"
Else
PatientSex = "F"
End If
expiryDate = DateAdd("yyyy", 1, Date)
updateData = True
Else
strmsg = "Please give valid 'Discount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text8.SetFocus
End If
Else
strmsg = "Please select 'Fees ID' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.SetFocus
End If
Else
strmsg = "Please select 'Sex' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.SetFocus
End If
Else
strmsg = "Please give valid 'Discount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text8.SetFocus
End If
Else
strmsg = "Please enter valid 'Age' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.SetFocus
End If
Else
strmsg = "Please enter 'Address' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
Else
strmsg = "Please enter 'Name' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text1.SetFocus
End If
If updateData = True Then
Dim rstData As New ADODB.Recordset
rstData.Open "select * from patientmaster", conn, adOpenKeyset, adLockOptimistic
rstData.AddNew
rstData!patientid = Text5.Text
rstData!patientname = Text1.Text
rstData!age = Text9.Text
If optSex(0).Value = True Then
rstData!sex = "M"
Else
rstData!sex = "F"
End If
rstData!patientaddress = Text2.Text
rstData!telephone = Text3.Text
rstData!emailid = Text4.Text
rstData!regdate = Date
rstData!ExpDate = expiryDate
rstData!Image = cmdlg.FileName
rstData.Update
rstData.Close
If rstData.State = 1 Then Set rstData = Nothing
rstData.Open "select * from fees", conn, adOpenKeyset, adLockOptimistic
rstData.AddNew
rstData!patientid = UCase(Text5.Text)
rstData!dateid = Date
rstData!feesid = (Combo1.Text)
rstData!amount = UCase(Text7.Text)
rstData!discount = Text8.Text
rstData.Update
rstData.Close
strmsg = "Record has been added."
MsgBox strmsg, vbInformation, "Success"
Text1.Text = "" 'Patient Name
Text2.Text = "" 'Patient Address
Text3.Text = "" 'Telephone
Text4.Text = "" 'Email
Text8.Text = "" 'Discount
Text9.Text = "" 'Age
Text5.Text = "" 'Patient ID
optSex(0).Value = False 'Sex Option - Male
optSex(1).Value = False 'Sex Option - Female
picTmp.Picture = LoadPicture()
Combo1.Text = " " 'Fees ID
Text6.Text = "" 'Description
Text7.Text = "" 'Amount
Text10.Text = Date 'Today's date
End If
End Sub
Private Sub Command2_Click()
Set cn = Nothing
Unload Me
End Sub
Private Sub Command3_Click()
On Error Resume Next
With Me.cmdlg
.Filter = "All Graphic Files |*.Gif;*.Jpg;*.Bmp;*.Wmf;"
.DialogTitle = "Select Patient Photo"
.ShowOpen
Me.picTmp.Picture = LoadPicture(Me.cmdlg.FileName)
End With
End Sub
Private Sub Form_Load()
Dim patientid As Integer
Text10.Text = Date
On Error GoTo ErrHandler
Me.Width = 11185
Me.Height = 6130
Combo1.AddItem " "
rstData.Open "select * from feesmaster order by feesid", conn, adOpenKeyset, adLockOptimistic
Do While Not rstData.EOF
Combo1.AddItem rstData.Fields("FeesID").Value
rstData.MoveNext
Loop
rstData.Close
Screen.MousePointer = vbDefault
Exit Sub
ErrHandler:
Screen.MousePointer = vbDefault
Debug.Print Err.Description
Resume Next
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call CloseDataConnection(cn)
Set cn = Nothing
End Sub
Private Sub Text1_LostFocus()
Dim pattern As Boolean
Dim rstData As New ADODB.Recordset
pattern = False
SQLstm = "Select PatientID from PatientMaster where PatientID like '" & Left(Text1.Text, 1) & "%'"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Do While Not rstData.EOF
patientid = rstData.Fields("PatientID").Value
pattern = True
rstData.MoveNext
Loop
If pattern = True Then
split_patient = Right(patientid, Len(patientid) - 2)
split_patient = CInt(split_patient)
split_patient = split_patient + 1
split_len = Len(split_patient)
Text5.Text = UCase(Left(Text1.Text, 1)) & "-"
For i = 1 To 5 - split_len
Text5.Text = Text5.Text & "0"
Next
Text5.Text = Text5.Text & split_patient
Else
Text5.Text = UCase(Left(Text1.Text, 1)) & "-00100"
End If
End Sub
Private Sub Text8_LostFocus()
Dim netAmount As Integer
If IsNumeric(Text7.Text) = False Then ' Amount
Text7.Text = 0
End If
If IsNumeric(Text8.Text) = False Then ' Discount
Text8.Text = 0
End If
netAmount = Text7.Text - Text8.Text
If netAmount < 0 Then
strmsg = "Please give valid 'Discount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text8.SetFocus
End If
End Sub

ADD FEES
Dim cn As New ADODB.Connection
Dim expiryDate As Date
Dim rstData As New ADODB.Recordset
Private Sub Command3_Click()
Dim rstData As New ADODB.Recordset
Dim SQLstm As String
Text7 = 0
Text6 = ""
For i = 0 To List1.ListCount - 1
List1.ListIndex = i
If List1.Selected(i) = True Then
SQLstm = "Select * from FeesMaster where FeesID like '" & i + 1 & "'"
If rstData.State = 1 Then Set rstData = Nothing
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
If List1.SelCount = 1 Then
Text6.Text = rstData.Fields("Description").Value
Else
Text6.Text = Text6 & "," & rstData.Fields("Description").Value
End If
Text7.Text = Val(Text7.Text) + rstData.Fields("Amount").Value
End If
Next
List1.ListIndex = List1.Selected(List1.ListIndex)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set cn = Nothing
End Sub
Private Sub List1_Click()
List1.ListIndex = List1.ListIndex
End Sub
Private Sub Combo2_Click()
FillData
End Sub
Private Sub FillData()
Dim sConn As String
Dim rstData As New ADODB.Recordset
Dim rstData1 As New ADODB.Recordset
Dim dt As Date
Dim SQLstm As String
SQLstm = "Select * from Fees where PatientID like '" & Combo2.Text & "' and DateID ='" & dt & "'"
rstData1.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
If rstData1.EOF = True Then 'Payment not recd. for today
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo2.Text & "'"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
expiryDate = rstData.Fields("ExpDate").Value
VerifyExpiration
Text3.Text = rstData.Fields("PatientName").Value
Text2.Text = rstData.Fields("PatientAddress").Value
If IsNull(rstData.Fields("Image")) Then
Set picDBImage.Picture = Nothing
picDBImage.Picture = LoadPicture("")
Else
picDBImage.Picture = LoadPicture(rstData.Fields("image"))
End If
Else
Dim strmsg As String
strmsg = "Payment has already been made by this patient for '" & dt & "'."
MsgBox strmsg, vbInformation, "MESSAGE"
ResetFields
End If
End Sub
Private Sub VerifyExpiration()
Dim dt As Date
If expiryDate < dt Then
Dim strmsg As String
strmsg = "Registration for this patient has been 'EXPIRED' on " & expiryDate
strmsg = strmsg & vbCrLf & "Please proceed with caution."
MsgBox strmsg, vbExclamation, "Error"
RegistrationStatus.Caption = "Reg. Expired"
Else
End If
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
FillData
End If
End Sub
Private Sub Command1_Click()
Dim updateData As Boolean
Dim netAmount As Integer
updateData = False
If IsNumeric(Text8.Text) = False Then
Text8.Text = 0
End If
If Combo2.Text <> "" Then
If List1.Text <> "" Or List1.ListCount <> 0 Then
If Text8 >= 0 Then
netAmount = Text7.Text - Text8.Text
If netAmount >= 0 Then
updateData = True
Else
strmsg = "Please give valid 'Discount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text8.SetFocus
End If
Else
strmsg = "Please give valid 'Discount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text8.SetFocus
End If
Else
strmsg = "Please enter valid 'Fees ID' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
End If
Else
strmsg = "Please enter valid 'Patient ID' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
End If
If updateData = True Then
Dim rstData As New ADODB.Recordset
rstData.Open "select * from fees", conn, adOpenKeyset, adLockOptimistic
rstData.AddNew
rstData!patientid = UCase(Combo2.Text)
rstData!dateid = Date
rstData!feesid = (List1.Text)
rstData!amount = UCase(Text7.Text)
rstData!discount = Text8.Text
rstData.Update
rstData.Close
If expiryDate < Date Then
Dim rstData1 As New ADODB.Recordset
SQLstm = "Update PatientMaster Set ExpDate='" & DateAdd("yyyy", 1, Date) & "' where PatientID like '" &
UCase(Combo2.Text) & "'"
Set rstData1 = conn.Execute(SQLstm)
End If
strmsg = "Record has been added."
MsgBox strmsg, vbInformation, "Success"
ResetFields
End If
End Sub
Private Sub ResetFields()
Combo2.Text = ""
Combo2.Text = ""
Text3.Text = ""
Text2.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
End Sub
Private Sub Command2_Click()
Set cn = Nothing
Unload Me
End Sub
Private Sub Form_Load()
Me.Width = 7155
Me.Height = 6630
Call OpenDataConnection(conn)
Dim SQLstm As String
SQLstm = "Select FeesID,description from FeesMaster order by FeesID"
Dim rstData As New ADODB.Recordset
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Do While Not rstData.EOF
List1.AddItem rstData.Fields("FeesID").Value & " " & rstData!Description
rstData.MoveNext
Loop
rstData.Close
SQLstm = "Select PatientID from PatientMaster order by PatientID"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Do While Not rstData.EOF
Combo2.AddItem rstData.Fields("PatientID").Value
rstData.MoveNext
Loop
Dim dt As Date
Text4.Text = Date
Screen.MousePointer = vbDefault
End Sub
Private Sub Text1_Change()
Text1.Text = UCase(Text1.Text)
End Sub
Private Sub Text8_LostFocus()
Dim netAmount As Integer
If IsNumeric(Text8.Text) = False Then ' Discount
Text8.Text = 0
End If
netAmount = Val(Text7.Text) - Val(Text8.Text)
If netAmount < 0 Then
strmsg = "Please give valid 'Discount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text8.SetFocus
End If
End Sub

MEDICINE
PRESCRIPTION
PROCESS
Dim cn As New ADODB.Connection
Dim pat_id As String
Dim expiryDate As Date
Dim date_list As Date
Dim rstData As New ADODB.Recordset
Private Sub Combo1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set cn = Nothing
End Sub
Private Sub Combo1_Click()
FillData
End Sub
Private Sub FillData()
On Error Resume Next
Dim rstData As New ADODB.Recordset
Dim rstData1 As New ADODB.Recordset
Dim sConn As String
Dim acceptData As Boolean
SQLstm = "Select * from Fees where PatientID like '" & Combo1.Text & "' and DateID like '" & Date & "'"
Set rstData1 = conn.Execute(SQLstm)
acceptData = True
If rstData1.EOF = True Then 'Payment not recd.
If MsgBox("No Payment Has been Made For This Patient. Continue?", vbYesNo) = vbNo Then
acceptData = False
Combo1.Text = ""
Combo1.SetFocus
End If
End If
If acceptData = True Then
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo1.Text & "'"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
expiryDate = rstData.Fields("ExpDate").Value
If expiryDate < Date Then
strmsg = "Registration for this patient has been 'EXPIRED' on " & expiryDate
strmsg = strmsg & vbCrLf & "Please proceed with caution."
MsgBox strmsg, vbExclamation, "Error"
RegistrationStatus.Caption = "Reg. Expired"
Else
RegistrationStatus.Caption = ""
End If
Text1.Text = rstData.Fields("PatientName").Value
Text2.Text = rstData.Fields("Age").Value
Text7.Text = rstData.Fields("Sex").Value
Text5.Text = rstData.Fields("LastVisit").Value
Text4.Text = rstData.Fields("RegDate").Value
Text3.Text = rstData.Fields("History").Value
DTPicker1 = rstData.Fields("NextVisit").Value
If IsNull(rstData.Fields("Image")) Then
Set picDBImage.Picture = Nothing
LoadNoPicture picDBImage
Else
LoadPictureFromDB picDBImage, rstData, "Image"
End If
SQLstm = "Select * from Treatment where PatientID like '" & Combo1.Text & "' order by DateID desc"
Set rstData = conn.Execute(SQLstm)
List1.Clear
Do While Not rstData.EOF
problemid = rstData.Fields("Treatment").Value
problemid = Replace(problemid, vbCrLf, ", ")
If Len(problemid) > 35 Then
problemid = Left(problemid, 35) & "..."
End If
List1.AddItem rstData.Fields("DateID").Value & " | " & problemid
rstData.MoveNext
Loop
pat_id = Combo1.Text
End If
End Sub
Private Sub Command1_Click()
Call CloseDataConnection(cn)
Set cn = Nothing
Unload Me
End Sub
Private Sub Command2_Click()
If Combo1.Text <> "" Then
If Text6.Text <> "" Then
Dim rstData As New ADODB.Recordset
SQLstm = "Select * from Treatment where DateID='" & Date & "' and PatientID like '" & pat_id & "'"
Set rstData = conn.Execute(SQLstm)
If Not rstData.EOF Then
strmsg = "Prescription for the date selected is already present."
strmsg = strmsg & vbCrLf & vbCrLf & "Please change the prescription in 'Prescription...' box and"
strmsg = strmsg & vbCrLf & "click on 'Save' button to update."
MsgBox strmsg, vbExclamation, "Error"
Exit Sub
End If
SQLstm = "Update PatientMaster Set LastVisit='" & Date & "' where PatientID like '" & pat_id & "'"
Set rstData = conn.Execute(SQLstm)
SQLstm = "Update PatientMaster Set NextVisit='" & DTPicker1 & "' where PatientID like '" & pat_id & "'"
Set rstData = conn.Execute(SQLstm)
SQLstm = "Update PatientMaster Set ExpDate='" & DateAdd("yyyy", 1, Date) & "' where PatientID like '" & pat_id & "'"
Set rstData = conn.Execute(SQLstm)
SQLstm = "Insert Into Treatment(PatientID, DateID, Treatment) "
SQLstm = SQLstm & " values('" & pat_id & "',"
SQLstm = SQLstm & "'" & Date & "',"
SQLstm = SQLstm & "'" & Text6.Text & "')"
Set rstData = conn.Execute(SQLstm)
strmsg = "Treatment Has Been Added For " & Date
MsgBox strmsg, vbInformation, "Success"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
DTPicker1 = Date
Combo1.Text = ""
List1.Clear
Combo1.Clear
RegistrationStatus.Caption = ""
DTPicker1 = DateAdd("d", Date, 15)
picDBImage.Picture = LoadPicture()
SQLstm = "Select PatientID from PatientMaster order by PatientID"
Set rstData = conn.Execute(SQLstm)
Do While Not rstData.EOF
Combo1.AddItem rstData.Fields("PatientID").Value
rstData.MoveNext
Loop
Else
strmsg = "Please enter 'Treatment/Prescription' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text6.SetFocus
End If
Else
strmsg = "Please enter valid 'Patient ID' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.Text = ""
Combo1.SetFocus
End If
End Sub
Private Sub Command3_Click()
Text6.Text = ""
Dim date_list As Date
End Sub
Private Sub Command4_Click()
If Text6.Text <> "" Then
Dim rstData As New ADODB.Recordset
SQLstm = "Update PatientMaster Set NextVisit='" & DTPicker1 & "' where PatientID like '" & pat_id & "'"
Set rstData = conn.Execute(SQLstm)
SQLstm = "update Treatment Set Treatment='" & Text6.Text & "' where DateID like '" & date_list & "' and PatientID like '" & pat_id
& "'"
Set rstData = conn.Execute(SQLstm)
Text6.Text = ""
List1.Clear
SQLstm = "Select * from Treatment where PatientID like '" & Combo1.Text & "' order by DateID desc"
Set rstData = conn.Execute(SQLstm)
Do While Not rstData.EOF
problemid = rstData.Fields("Treatment").Value
problemid = Replace(problemid, vbCrLf, ", ")
If Len(problemid) > 35 Then
problemid = Left(problemid, 35) & "..."
End If
List1.AddItem rstData.Fields("DateID").Value & " | " & problemid
rstData.MoveNext
Loop
strmsg = "Treatment Has Been Saved For " & Time
MsgBox strmsg, vbInformation, "Success"
Else
strmsg = "Please enter valid 'Treatment' before saving the record."
MsgBox strmsg, vbExclamation, "Error"
End If
End Sub
Private Sub Command5_Click()
On Error GoTo errRep
List_split = Split(List1.Text, " | ")
SQLstm = "Delete from TreatmentRep"
cn.Execute (SQLstm)
SQLstm = "Insert Into TreatmentRep(PatientID,PatientName,Age,Sex,RegDate,ExpDate,NextVisit,DateID,Treatment) "
SQLstm = SQLstm & "Values ("
SQLstm = SQLstm & "'" & pat_id & "',"
SQLstm = SQLstm & "'" & Text1.Text & "',"
SQLstm = SQLstm & "'" & Text2.Text & "',"
SQLstm = SQLstm & "'" & Text7.Text & "',"
SQLstm = SQLstm & "'" & Text4.Text & "',"
SQLstm = SQLstm & "'" & expiryDate & "',"
SQLstm = SQLstm & "'" & DTPicker1 & "',"
SQLstm = SQLstm & "'" & CDate(List_split(0)) & "',"
SQLstm = SQLstm & "'" & Text6.Text & "')"
cn.Execute (SQLstm)
drTreatmentRep.Refresh
drTreatmentRep.Show
Unload deClinic
Exit Sub
errRep:
If Err.Number = 9 Then
MsgBox ("Kindly select a treatment history for printing.")
End If
End Sub
Private Sub Form_Load()
On Error GoTo ErrHandler
Me.Width = 10335
Me.Height = 6660
Label3.Caption = Label3.Caption & " " & Date
DTPicker1 = DateAdd("d", Date, 15)
SQLstm = "Select PatientID from PatientMaster order by PatientID"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
MsgBox " Total Patient" & "=" & " " & rstData.RecordCount
Do While Not rstData.EOF
Combo1.AddItem rstData.Fields("PatientID").Value
rstData.MoveNext
Loop
rstData.Close
Screen.MousePointer = vbDefault
Exit Sub
ErrHandler:
Screen.MousePointer = vbDefault
Debug.Print Err.Description
End Sub
Private Sub List1_Click()
Dim rstData As New ADODB.Recordset
List_split = Split(List1.Text, " | ")
SQLstm = "Select * from Treatment where PatientID like '" & pat_id & "' and DateID like #" & CDate(List_split(0)) & "#"
Set rstData = cn.Execute(SQLstm)
Do While Not rstData.EOF
problemid = rstData.Fields("Treatment").Value
Text6.Text = problemid
rstData.MoveNext
Loop
date_list = CDate(List_split(0))
End Sub

MODIFY PATIENT
RECORD
Dim cn As New ADODB.Connection
Dim rstData As New ADODB.Recordset
Private Sub Command1_Click()
Dim sConn As String
Dim updateData As Boolean
updateData = False
If IsNumeric(Text9.Text) = False Then
Text9.Text = 0
End If
If Combo1.Text <> " " And Combo1.Text <> "" Then 'Patient ID entered
If Text1.Text <> "" Then 'Name check
If Text2.Text <> "" Then 'Address check
If Text9.Text > 0 Then 'Valid Age
If Left(Combo1.Text, 1) = UCase(Left(Text1.Text, 1)) Then
updateData = True
Else
strmsg = "First Character of 'Name' and Patient ID mismatch."
MsgBox strmsg, vbExclamation, "Error"
Text1.Text = Left(Combo1.Text, 1) & Text1.Text
Text1.SetFocus
End If
Else
strmsg = "Please enter valid 'Age' before updating the record."
MsgBox strmsg, vbExclamation, "Error"
Text9.SetFocus
End If
Else
strmsg = "Please enter 'Address' before updating the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
Else
strmsg = "Please enter 'Name' before updating the record."
MsgBox strmsg, vbExclamation, "Error"
Text1.SetFocus
End If
Else
strmsg = "Please enter 'Patient ID' before updating the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.SetFocus
End If
If updateData = True Then
PatientSex = ""
If optSex(0) = True Then
PatientSex = "M"
Else
PatientSex = "F"
End If
Dim rstData As New ADODB.Recordset
SQLstm = "Update PatientMaster set PatientName='" & Text1.Text & "' where PatientID like '" & Combo1.Text & "'"
conn.Execute (SQLstm)
SQLstm = "Update PatientMaster set PatientAddress='" & Text2.Text & "' where PatientID like '" & Combo1.Text & "'"
conn.Execute (SQLstm)
SQLstm = "Update PatientMaster set Telephone='" & Text3.Text & "' where PatientID like '" & Combo1.Text & "'"
conn.Execute (SQLstm)
SQLstm = "Update PatientMaster set EmailID='" & Text4.Text & "' where PatientID like '" & Combo1.Text & "'"
conn.Execute (SQLstm)
SQLstm = "Update PatientMaster set Age='" & Text9.Text & "' where PatientID like '" & Combo1.Text & "'"
conn.Execute (SQLstm)
SQLstm = "Update PatientMaster set Sex='" & PatientSex & "' where PatientID like '" & Combo1.Text & "'"
conn.Execute (SQLstm)
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo1.Text & "'"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
SavePictureToDB picTmp, rstData, "Image"
rstData.Update
rstData.Close
strmsg = "The Record Has Been Updated For '" & Combo1.Text & "'"
MsgBox strmsg, vbInformation, "Success"
Combo1.Text = " "
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text9.Text = ""
optSex(0) = False
optSex(1) = False
picTmp.Picture = LoadPicture()
End If
End Sub
Private Sub Command2_Click()
Set cn = Nothing
Unload Me
End Sub
Private Sub Command3_Click()
On Error Resume Next
With Me.cmDlg
.Filter = "All Graphic Files |*.Gif;*.Jpg;*.bmp;*.wmf;"
.DialogTitle = "Find Patient Photo"
.ShowOpen
Me.picTmp.Picture = LoadPicture(Me.cmDlg.FileName)
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set cn = Nothing
End Sub
Private Sub Form_Load()
On Error GoTo ErrHandler
Me.Width = 7440
Me.Height = 6015
SQLstm = "Select PatientID from PatientMaster order by PatientID"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Do While Not rstData.EOF
Combo1.AddItem rstData.Fields("PatientID").Value
rstData.MoveNext
Loop
rstData.Close
Exit Sub
ErrHandler:
Debug.Print Err.Description
End Sub
Private Sub Combo1_Click()
On Error Resume Next
Dim rstData As New ADODB.Recordset
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo1.Text & "'"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Text1.Text = rstData.Fields("PatientName").Value
Text2.Text = rstData.Fields("PatientAddress").Value
Text3.Text = rstData.Fields("Telephone").Value
Text4.Text = rstData.Fields("EmailID").Value
Text9.Text = rstData.Fields("Age").Value
If rstData.Fields("Sex").Value = "M" Then
optSex(0) = True
Else
optSex(1) = True
End If
If IsNull(rstData.Fields("Image")) Then
Set picTmp.Picture = Nothing
Else
picTmp.Picture = LoadPicture(rstData!Image)
End If
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = 13 Then 'Enter Pressed
Dim rstData As New ADODB.Recordset
Dim sConn As String
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo1.Text & "'"
Set rstData = cn.Execute(SQLstm)
If rstData.EOF = True Then 'Patient Code not found
strmsg = "Please enter valid 'Patient ID' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.Text = ""
Combo1.SetFocus
Else
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo1.Text & "'"
cn.Open sConn
rstData.Open SQLstm, cn, adOpenKeyset, adLockOptimistic
Text1.Text = rstData.Fields("PatientName").Value
Text2.Text = rstData.Fields("PatientAddress").Value
Text3.Text = rstData.Fields("Telephone").Value
Text4.Text = rstData.Fields("Email").Value
Text9.Text = rstData.Fields("Age").Value
If rstData.Fields("Sex").Value = "M" Then
optSex(0) = True
Else
optSex(1) = True
End If
LoadPictureFromDB picTmp, rstData, "Image"
End If
End If
End Sub
Private Function LoadPictureFromDB(PictControl As Object, _
rs As Object, FieldName As String) As Boolean
Dim sTempFile As String
Dim iFileNum As Integer
Dim lFileLength As Long
Dim abBytes() As Byte
On Error GoTo ErrorHandler
sTempFile = App.Path & "\TempPic.jpg"
If Len(Dir$(sTempFile)) > 0 Then
Kill sTempFile
End If
iFileNum = FreeFile
Open sTempFile For Binary As #iFileNum
lFileLength = LenB(rs(FieldName))
abBytes = rs(FieldName).GetChunk(lFileLength)
Put #iFileNum, , abBytes()
Close #iFileNum
PictControl.Picture = LoadPicture(sTempFile)
Kill sTempFile
LoadPictureFromDB = True
ErrorHandler:
End Function
Private Function SavePictureToDB(PictControl As Object, _
rs As Object, FieldName As String) As Boolean
Dim oPict As StdPicture
Dim sTempFile As String
Dim iFileNum As Integer
Dim lFileLength As Long
Dim abBytes() As Byte
On Error GoTo ErrorHandler
Set oPict = PictControl.Picture
sTempFile = App.Path & "\TempPic.jpg"
SavePicture oPict, sTempFile
iFileNum = FreeFile
Open sTempFile For Binary Access Read As #iFileNum
lFileLength = LOF(iFileNum)
ReDim abBytes(lFileLength)
Get #iFileNum, , abBytes()
rs.Fields(FieldName).AppendChunk abBytes()
Close #iFileNum
On Error Resume Next
Kill sTempFile
SavePictureToDB = True
ErrorHandler:
End Function

DELETE PATIENT
RECORD
Dim cn As New ADODB.Connection
Dim rstData As New ADODB.Recordset
Private Sub Command1_Click()
Dim sConn As String
Dim updateData As Boolean
updateData = False
If IsNumeric(Text9.Text) = False Then
Text9.Text = 0
End If
If Combo1.Text <> " " And Combo1.Text <> "" Then
If Text1.Text <> "" Then
If Text2.Text <> "" Then
If Text9.Text > 0 Then
If Left(Combo1.Text, 1) = UCase(Left(Text1.Text, 1)) Then
updateData = True
Else
strmsg = "First Character of 'Name' and Patient ID mismatch."
MsgBox strmsg, vbExclamation, "Error"
Text1.Text = Left(Combo1.Text, 1) & Text1.Text
Text1.SetFocus
End If
Else
strmsg = "Please enter valid 'Age' before deleting the record."
MsgBox strmsg, vbExclamation, "Error"
Text9.SetFocus
End If
Else
strmsg = "Please enter 'Address' before deleting the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
Else
strmsg = "Please enter 'Name' before deleting the record."
MsgBox strmsg, vbExclamation, "Error"
Text1.SetFocus
End If
Else
strmsg = "Please enter 'Patient ID' before deleting the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.SetFocus
End If
If updateData = True Then
PatientSex = ""
If optSex(0) = True Then
PatientSex = "M"
Else
PatientSex = "F"
End If
rstData.Open "select * from patientmaster where patientid='" & Combo1.Text & "'", conn, adOpenKeyset, adLockOptimistic
If rstData.RecordCount > 0 Then
If MsgBox(" Are You Sure?", vbYesNo) = vbYes Then
rstData.Delete
rstData.Close
conn.Execute "delete from collectionrep where patientid='" & Combo1.Text & "'"
Combo1.RemoveItem Combo1.ListIndex
Combo1.Text = " "
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text9.Text = ""
optSex(0) = False
optSex(1) = False
picTmp.Picture = LoadPicture()
End If
End If
End If
End Sub
Private Sub Command2_Click()
Set cn = Nothing
Unload Me
End Sub
Private Sub Command3_Click()
On Error Resume Next
With Me.cmDlg
.Filter = "All Graphic Files |*.Gif;*.Jpg;*.bmp;*.wmf;"
.DialogTitle = "Find Patient Photo"
.ShowOpen
Me.picTmp.Picture = LoadPicture(Me.cmDlg.FileName)
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set cn = Nothing
End Sub
Private Sub Form_Load()
On Error GoTo ErrHandler
Me.Width = 7440
Me.Height = 6015
SQLstm = "Select PatientID from PatientMaster order by PatientID"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Do While Not rstData.EOF
Combo1.AddItem rstData.Fields("PatientID").Value
rstData.MoveNext
Loop
rstData.Close
Exit Sub
ErrHandler:
Debug.Print Err.Description
End Sub
Private Sub Combo1_Click()
On Error Resume Next
Dim rstData As New ADODB.Recordset
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo1.Text & "'"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Text1.Text = rstData.Fields("PatientName").Value
Text2.Text = rstData.Fields("PatientAddress").Value
Text3.Text = rstData.Fields("Telephone").Value
Text4.Text = rstData.Fields("EmailID").Value
Text9.Text = rstData.Fields("Age").Value
If rstData.Fields("Sex").Value = "M" Then
optSex(0) = True
Else
optSex(1) = True
End If
If IsNull(rstData.Fields("Image")) Then
Set picTmp.Picture = Nothing
Else
picTmp.Picture = LoadPicture(rstData!Image)
End If
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = 13 Then
Dim rstData As New ADODB.Recordset
Dim sConn As String
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo1.Text & "'"
Set rstData = cn.Execute(SQLstm)
If rstData.EOF = True Then
strmsg = "Please enter valid 'Patient ID' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.Text = ""
Combo1.SetFocus
Else
SQLstm = "Select * from PatientMaster where PatientID like '" & Combo1.Text & "'"
cn.Open sConn
rstData.Open SQLstm, cn, adOpenKeyset, adLockOptimistic
Text1.Text = rstData.Fields("PatientName").Value
Text2.Text = rstData.Fields("PatientAddress").Value
Text3.Text = rstData.Fields("Telephone").Value
Text4.Text = rstData.Fields("EmailID").Value
Text9.Text = rstData.Fields("Age").Value
If rstData.Fields("Sex").Value = "M" Then
optSex(0) = True
Else
optSex(1) = True
End If
LoadPictureFromDB picTmp, rstData, "Image"
End If
End If
End Sub
Private Function LoadPictureFromDB(PictControl As Object, _
rs As Object, FieldName As String) As Boolean
Dim sTempFile As String
Dim iFileNum As Integer
Dim lFileLength As Long
Dim abBytes() As Byte
On Error GoTo ErrorHandler
sTempFile = App.Path & "\TempPic.jpg"
If Len(Dir$(sTempFile)) > 0 Then
Kill sTempFile
End If
iFileNum = FreeFile
Open sTempFile For Binary As #iFileNum
lFileLength = LenB(rs(FieldName))
abBytes = rs(FieldName).GetChunk(lFileLength)
Put #iFileNum, , abBytes()
Close #iFileNum
PictControl.Picture = LoadPicture(sTempFile)
Kill sTempFile
LoadPictureFromDB = True
ErrorHandler:
End Function
Private Function SavePictureToDB(PictControl As Object, _
rs As Object, FieldName As String) As Boolean
Dim oPict As StdPicture
Dim sTempFile As String
Dim iFileNum As Integer
Dim lFileLength As Long
Dim abBytes() As Byte
On Error GoTo ErrorHandler
Set oPict = PictControl.Picture
sTempFile = App.Path & "\TempPic.jpg"
SavePicture oPict, sTempFile
iFileNum = FreeFile
Open sTempFile For Binary Access Read As #iFileNum
lFileLength = LOF(iFileNum)
ReDim abBytes(lFileLength)
Get #iFileNum, , abBytes()
rs.Fields(FieldName).AppendChunk abBytes()
Close #iFileNum
On Error Resume Next
Kill sTempFile
SavePictureToDB = True
ErrorHandler:
End Function

FEES MASTER
TABLE
Dim cn As New ADODB.Connection
Dim rstData As New ADODB.Recordset
Private Sub Command1_Click()
Dim addFeesData As Boolean
addFeesData = False
If Text3.Text <> "" Then
If IsNumeric(Text2.Text) = True Then
If Text2.Text >= 0 Then
addFeesData = True
Else
strmsg = "Please give valid 'Amount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
Else
strmsg = "Please give valid 'Amount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
Else
strmsg = "Please give valid 'Description' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text3.SetFocus
End If
If addFeesData = True Then
Dim rstData As New ADODB.Recordset
SQLstm = "Insert into FeesMaster(feesid,Description, Amount) "
SQLstm = SQLstm & "values ('" & Text1.Text & "','" & Text3.Text & "',"
SQLstm = SQLstm & Text2.Text & ")"
conn.Execute (SQLstm)
strmsg = "Record has been added."
MsgBox strmsg, vbInformation, "Success"
Text3.Text = ""
Text2.Text = ""
Text1.Text = Text1.Text + 1
End If
End Sub
Private Sub Command2_Click()
frmModifyFees.Show
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set cn = Nothing
Set rstData = Nothing
End Sub
Private Sub Form_Load()
Dim feesid As Integer
On Error GoTo ErrHandler
Me.Width = 4125
Me.Height = 2970
Dim rstData As New ADODB.Recordset
SQLstm = "Select FeesID from FeesMaster order by FeesID"
rstData.Open SQLstm, conn, adOpenKeyset, adLockOptimistic
Do While Not rstData.EOF
feesid = rstData.Fields("FeesID").Value
rstData.MoveNext
Loop
rstData.Close
Text1.Text = feesid + 1
Exit Sub
ErrHandler:
Screen.MousePointer = vbDefault
Debug.Print Err.Description
Resume Next
End Sub

MODIFY FEES
Dim cn As New ADODB.Connection
Private Sub Form_Unload(Cancel As Integer)
Call CloseDataConnection(cn)
Set cn = Nothing
End Sub
Private Sub Combo1_Click()
Call OpenDataConnection(cn)
Dim rstData As New ADODB.Recordset
SQLstm = "Select * from FeesMaster where Description like '" & Combo1.Text & "' order by FeesID"
Set rstData = conn.Execute(SQLstm)
Do While Not rstData.EOF
Text2.Text = rstData.Fields("FeesID").Value
Text1.Text = rstData.Fields("Amount").Value
rstData.MoveNext
Loop
rstData.Close
Call CloseDataConnection(cn)
End Sub
Private Sub Command1_Click()
Dim modifyData As Boolean
modifyData = False
If Combo1.Text <> "" Then
If IsNumeric(Text1.Text) = True Then
If Text1.Text >= 0 Then
modifyData = True
Else
strmsg = "Please give valid 'Amount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text1.SetFocus
End If
Else
strmsg = "Please give valid 'Amount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text1.SetFocus
End If
Else
strmsg = "Please give valid 'Description' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Combo1.SetFocus
End If
If modifyData = True Then
Call OpenDataConnection(cn)
Dim rstData As New ADODB.Recordset
SQLstm = "Update FeesMaster set Description='" & Combo1.Text & "' where FeesID = " & Text2.Text & ""
Set rstData = conn.Execute(SQLstm)
SQLstm = "Update FeesMaster set Amount=" & Text1.Text & " where FeesID like " & Text2.Text
Set rstData = conn.Execute(SQLstm)
Call CloseDataConnection(cn)
strmsg = "Record has been modified."
MsgBox strmsg, vbInformation, "Success"
Combo1.Text = ""
Text1.Text = ""
Text2.Text = ""
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
If IsNumeric(Text2.Text) = True Then
Call OpenDataConnection(cn)
Dim rstData As New ADODB.Recordset
Dim rstData1 As New ADODB.Recordset
SQLstm = "Select * from Fees where FeesID like " & Text2.Text
Set rstData = conn.Execute(SQLstm)
SQLstm = "Delete From FeesMaster where FeesID like " & Text2.Text
Set rstData1 = conn.Execute(SQLstm)
strmsg = "The Record Has Been Deleted."
Text1.Text = ""
Combo1.RemoveItem Combo1.ListIndex
Text2.Text = ""
MsgBox strmsg, vbInformation, "Success"
Combo1.SetFocus
Combo1.SetFocus
End If
End Sub
Private Sub Form_Load()
On Error GoTo ErrHandler
Me.Width = 4440
Me.Height = 2985
Dim rstData As New ADODB.Recordset
SQLstm = "Select Description from FeesMaster order by FeesID"
Set rstData = conn.Execute(SQLstm)
Do While Not rstData.EOF
Combo1.AddItem rstData.Fields("Description").Value
rstData.MoveNext
Loop
rstData.Close
Exit Sub
ErrHandler:
Screen.MousePointer = vbDefault
Debug.Print Err.Description
End Sub

MEDICINE
PURCHASE
Dim cn As New ADODB.Connection
Private Sub Form_Unload(Cancel As Integer)
Set cn = Nothing
End Sub
Private Sub Command1_Click()
Dim updateData As Boolean
updateData = False
If Text1.Text <> "" Then
If IsNumeric(Text2.Text) = True Then
If Text2.Text > 0 Then
If IsNumeric(Text3.Text) = True Then
If Text3.Text > 0 Then
updateData = True
Else
strmsg = "Please enter 'Correct Amount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text3.SetFocus
End If
Else
strmsg = "Please enter 'Correct Amount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text3.SetFocus
End If
Else
strmsg = "Please enter 'Correct Quantity' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
Else
strmsg = "Please enter 'Correct Quantity' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
Else
strmsg = "Please enter 'Medicine Name' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text1.SetFocus
End If
If updateData = True Then
Dim rstData As New ADODB.Recordset
SQLstm = "Insert into PurchaseRegister(MedicineName, QuantityPurchased, Amount, DateID) "
SQLstm = SQLstm & "values ('" & Text1.Text & "',"
SQLstm = SQLstm & Text2.Text & ","
SQLstm = SQLstm & Text3.Text & ","
SQLstm = SQLstm & "'" & DTPicker1 & "')"
Set rstData = conn.Execute(SQLstm)
strmsg = "Record has been added."
MsgBox strmsg, vbInformation, "Success"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
End Sub
Private Sub Command2_Click()
Set cn = Nothing
Unload Me
End Sub
Private Sub Command3_Click()
frmModifyPurchase.Show
End Sub
Private Sub Form_Load()
On Error GoTo ErrHandler
DTPicker1 = Date
Dim feesid As Integer
Me.Width = 4575
Me.Height = 3510
Exit Sub
ErrHandler:
Debug.Print Err.Description
Resume Next
End Sub

MODIFY
MEDICINE
PURCHASE
Dim cn As New ADODB.Connection
Dim list_nam As String
Private Sub Form_Unload(Cancel As Integer)
Set cn = Nothing
End Sub
Private Sub Command1_Click()
Dim updateData As Boolean
updateData = False
If IsNumeric(Text2.Text) = True Then
If Text2.Text > 0 Then
If IsNumeric(Text3.Text) = True Then
If Text3.Text > 0 Then
strmsg = "Please enter 'Correct Amount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text3.SetFocus
End If
Else
strmsg = "Please enter 'Correct Amount' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text3.SetFocus
End If
Else
strmsg = "Please enter 'Correct Quantity' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
Else
strmsg = "Please enter 'Correct Quantity' before adding the record."
MsgBox strmsg, vbExclamation, "Error"
Text2.SetFocus
End If
If updateData = True Then
Dim rstData As New ADODB.Recordset
split_list = Split(list_nam, ", ")
SQLstm = "update PurchaseRegister set MedicineName='" & Text1.Text & "' where MedicineName like '" & split_list(0) & "' and
QuantityPurchased like " & CInt(split_list(1)) & " and Amount like " & CInt(split_list(2)) & " and DateID like #" & DTPicker1 & "#"
cn.Execute (SQLstm)
SQLstm = "update PurchaseRegister set QuantityPurchased=" & Text2.Text & " where MedicineName like '" & split_list(0) & "' and
QuantityPurchased like " & CInt(split_list(1)) & " and Amount like " & CInt(split_list(2)) & " and DateID like #" & DTPicker1 & "#"
cn.Execute (SQLstm)
SQLstm = "update PurchaseRegister set Amount=" & Text3.Text & " where MedicineName like '" & split_list(0) & "' and
QuantityPurchased like " & CInt(split_list(1)) & " and Amount like " & CInt(split_list(2)) & " and DateID like #" & DTPicker1 & "#"
cn.Execute (SQLstm)
FillTable
strmsg = "The Record Has Been Updated."
MsgBox strmsg, vbInformation, "Success"
End If
End Sub
Private Sub Command2_Click()
Set cn = Nothing
Unload Me
End Sub
Private Sub Command3_Click()
If MsgBox("Are You Sure?", vbOKCancel, "Delete This Entry?") = vbOK Then
Dim rstData As New ADODB.Recordset
split_list = Split(list_nam, ", ")
SQLstm = "delete from PurchaseRegister where MedicineName like '" & Text1 & "' and QuantityPurchased like " & Text2 & " and
Amount like " & Text3 & " and DateID like '" & DTPicker1 & "'"
conn.Execute (SQLstm)
strmsg = "The Record Has Been Deleted."
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
List1.Clear
MsgBox strmsg, vbInformation, "Success"
Text1.SetFocus
End If
End Sub
Private Sub Form_Load()
Dim patientid As Integer
Me.Width = 9030
Me.Height = 5520
Text1.Text = ""
DTPicker1 = Date
FillTable
On Error GoTo ErrHandler
Exit Sub
ErrHandler:
Debug.Print Err.Description
Resume Next
End Sub
Private Sub List1_Click()
list_nam = List1.Text
List_split = Split(List1.Text, ", ")
Text1.Text = List_split(0)
Text2.Text = List_split(1)
Text3.Text = List_split(2)
End Sub
Private Sub DTPicker1_Change()
FillTable
End Sub
Private Sub FillTable()
Dim rstData As New ADODB.Recordset
If Text1.Text <> "" Then
SQLstm = "Select * from PurchaseRegister where DateID like '" & DTPicker1 & "' and MedicineName like '" & Text1.Text & "%'"
Else
SQLstm = "Select * from PurchaseRegister where DateID like '" & DTPicker1 & "'"
End If
Set rstData = conn.Execute(SQLstm)
List1.Clear
Do While Not rstData.EOF
List1.AddItem (rstData.Fields("MedicineName").Value & ", " & rstData.Fields("QuantityPurchased").Value & ", " &
rstData.Fields("Amount").Value)
rstData.MoveNext
Loop
End Sub

FORM ABOUT
Option Explicit
Const READ_CONTROL = &H20000
Const KEY_QUERY_VALUE = &H1
Const KEY_SET_VALUE = &H2
Const KEY_CREATE_SUB_KEY = &H4
Const KEY_ENUMERATE_SUB_KEYS = &H8
Const KEY_NOTIFY = &H10
Const KEY_CREATE_LINK = &H20
Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL

Const HKEY_LOCAL_MACHINE = &H80000002


Const ERROR_SUCCESS = 0
Const REG_SZ = 1 ' Unicode nul terminated string
Const REG_DWORD = 4 ' 32-bit number
Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
Const gREGVALSYSINFOLOC = "MSINFO"
Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
Const gREGVALSYSINFO = "PATH"
Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As
String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName
As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
Private Sub cmdSysInfo_Click()
Call StartSysInfo
End Sub
Private Sub cmdOK_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Caption = "About " & App.Title
lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
lblTitle.Caption = App.Title
Screen.MousePointer = vbDefault
End Sub
Public Sub StartSysInfo()
On Error GoTo SysInfoErr
Dim rc As Long
Dim SysInfoPath As String
If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
Else
GoTo SysInfoErr
End If
Else
GoTo SysInfoErr
End If
Call Shell(SysInfoPath, vbNormalFocus)
Exit Sub
SysInfoErr:
MsgBox "System Information Is Unavailable At This Time", vbOKOnly
End Sub
Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
Dim i As Long
Dim rc As Long
Dim hKey As Long
Dim hDepth As Long
Dim KeyValType As Long
Dim tmpVal As String
Dim KeyValSize As Long
rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey)
If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError
tmpVal = String$(1024, 0)
KeyValSize = 1024
rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
KeyValType, tmpVal, KeyValSize)
If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError
If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then
tmpVal = Left(tmpVal, KeyValSize - 1)
Else
tmpVal = Left(tmpVal, KeyValSize)
End If
Select Case KeyValType
Case REG_SZ
KeyVal = tmpVal
Case REG_DWORD
For i = Len(tmpVal) To 1 Step -1
Conclusion
After Computerization of the whole Clinic. Current
System will work in a more efficient manner saving lot
of manpower. The Primary objective of the Clinic is to
provide the quality patient care.

In view of this computerization of the clinic will leed to


appreciable improvement in the field of Patient care.
Most of the loopholes will be removed by the
computerized system.

The co-ordination between various clinical activities


through computer need to be appreciated .The
software for these modules are so designed that all
information related to the Patient come under a
common umbrella of HMS The various modules in
spite of looking independent are closely associated
with each other. The design of HMS minimizes the
chances of missing any information from the patient
database.
Bibliography

1.Software Engineering ‘A practitioner’s approach’ –


Roger S. Pressman, (McGrawHill International
Edition)

2.Visual Basic 6.0 Super Bible – David Jung, Pierre


Boutquin, John D. Conley, Loren Eidahl, Lowell
Mauer, Jack Purdum (Techmedia)

3.Oracle 8i ‘The Complete Reference’ – Loney Koch


(Tata McGraw Hill)

4.Database System Concepts – Abraham


Silberschatz, Henry F. Korth, S. Sudarshan
(McGrawHill
International Edition)
5 PL/SQL: The Programming Language of Oracle
By
Ivan Bayross.

Vous aimerez peut-être aussi