Sunteți pe pagina 1din 194

COMPUTER PROJECT

HOSPITAL MANAGEMENT
SYSTEM

Table of contents:
Definition, investigation and analysis

Problem Definition

Investigation and analysis

Design

23

Nature of the solution

23

Intended benefits

42

Limitations in the new system

43

Software development, programming, testing and installation

49

Development

49

Programming

76

Testing

105

Installation

120

Documentation

122

Systems maintenance manual

122

User manual

164

Evaluation
Discussion of the degree of success

184
184

Users response

188

Evidence

(a) DEFINITION, INVESTIGATION AND


ANALYSIS

(1) PROBLEM DEFINITION:


About the organization:
The FMC (Free Medical Center) is a non-profit hospital run by an non government
organization named SRCM. The hospital has over 15 different departments
including dermatology, ophthalmology, pediatrics, general surgery etc. It also runs
a medicine department to give out medicines to patients. Its staff consists of
doctors who work there on voluntary basis some of whom may be working
temporarily as well as doctors who are paid and work in the hospital on a permanent
basis. The doctors are headed by my client Dr. Ravindran. The hospital was
established in the year 1999 with the objective of providing free medical attention
to the poor and underprivileged people of the nearby area as well as the members
of the NGO SRCM. It is located in Manapakam district, Chennai, India.

Current methods used:


In order to record data such as patient details, a hospital management software is
used. Most other tasks are done manually. A major drawback with the current
system is that the medical history and the previous treatments given to the
patient are not recorded. Also the data entry of the medicine stock of the
medicine department is done manually creating many problems for the medical
center if an error is made.
Each time a new patient enters the hospital, the patients key details such as the
patients name are entered. If the patient is not a new patient, the patients name
is searched by the software after which the patients details are displayed. The
patient is then directed to a doctor who writes down the treatment for the patient
on paper. As the details of the treatment are done manually, it is difficult for the
doctors to access the medical history of the patient.
At the end of every month a report is made showing the total number of patients
for each department, the number of inpatients etc. This data is then used to make
a yearly report which shows the details of the hospital for the year.

The problem:
The hospital management software is used by a nurse who stores very few details
of the patinets. The rest of the data entry such as the treatment details and
medicine stocks are done manually. This makes it very difficult to look for what
treatment was given to the patient on his/her last visit and to keep track of the
medicine stock levels. The gradual increase in the number of patients calls for
change within the current system.
The current system is quite simple but is very inefficient primarily because the
medical histories of the patient are not stored. As this is done manually, it
becomes very difficult to find the required data. Another major problem as
mentioned earlier is keeping track of the medicine stocks. As this is done manually,
there is a possibility for mistakes. It also becomes very easy for the data to get
misplaced.

(2) INVESTIGATION AND ANALYSIS:


Investigation plan:
In order to work out solutions to improve the current system, I have decided to
observe how the current system works. I have also decided to interview the
doctors who work in the hospital. I will also examine the software currently used
and find out what features it lacks. Moreover, I will also see how the data is stored
and how the problems faced are being worked out. This will help me find out the
shortcomings of the current system and I will also get to know where and how
improvement is needed.
To help improve the current situation, I will conduct interviews with the staff of
the hospital. The areas I would concentrate on would be the problems faced by the
way the hospital works, how efficient the current software is and how the current
system could be improved. I will also spend a lot of time in the hospital to see how
the data is recorded and stored. I will also observe how the hospital runs when
there are many patients and note down the drawbacks. This will help me find out
what exactly could be done to improve the current situation.

How the data is recorded:


The system currently in use is a hospital management system. When a new patient
visits the hospital, the details of the patient are recorded by the software. The
fields used to record the data by the software are:

Name: The name of the patient is stored here.

ID: This field stores the patient ID.

Visit number: Shows the visit number of the patient (keeps track of the
total number of visits done by the patient.)

Date of birth*: Stores the patients date of birth. (This field is optional as
many of the patients being uneducated do not know their date of birth.)

Mothers Name: Stores the patients mothers name.

Fathers Name: Stores the patients fathers name.

Sex: Stores the patients gender.

Group: Shows if the patient is a child adult or senior citizen.

Address: Stores the address of the patient.

Other Contact info*: Records the phone number and other contact details.
(This field is optional.)

If the patient has already visited the medical center, his/her name is searched by
the software after which the details of the patient are displayed. After these
details are recorded, the patient is directed to a specific doctor according to the
treatment the patient needs. The doctor then manually enters the details of the
treatment in a receipt. The details recorded here are:

Name: The name of the patient.

ID: The patients visiting ID.

Visit number: Keeps track of number of visits done by the patient to the
hospital.

Department: Shows the department of the doctor.

Treatment: Shows details of the patients treatment (type of illness, details


of the medicine etc).

The hospital uses a book to keep track of the levels of medicine stock. The fields
of entry are:

Name of medicine: The name of the medicine received.

Date received: The date the medicine was received.

Amount of medicine received: The amount of medicine received.

Amount of medicine pending: The amount of medicine yet to be received.

(NOTE: A drawback in this system is that when a patient collects medicines, the
stock levels are not deducted making it difficult to say when the stock will get
depleted.)
The hospital also produces reports at the end of each month and year these
reports help keep track of the progress of the hospital. The hospital uses pi charts
and bar graphs to help represent the statistics. The fields of the report are:

Total patients: Total number of patients treated.

Males: Total number of male patients.

Females: Total number of female patients.

Children: Total number of child patients

Senior citizens: Total number of senior citizen patients.

Inpatients: Total number of patients that were admitted in the hospital for
more than a day.

Lab Tests: Total number of lab tests conducted


8

Surgeries: Total number of surgeries in the hospital (this is further divided


in general surgeries and minor surgeries.)

Moreover, another report is created showing the number of patients for each
department which is submitted at the end of each month and year along with the
report above. The fields contain details of how many patients were admitted for
each department. The fields are:

Psychiatry: Number of patients for the department of Psychiatry.

Dentistry: Number of patients for the department of Dentistry.

Dermatology: Number of patients for the department of Dermatology.

Orthopedic: Number of patients for the orthopedic department.

Ophthalmology: Number of patients for the department of Ophthalmology.

Cardiology: Number of patients for the department of Cardiology.

Pediatrics: Number of patients for the Pediatrics department.

Endocrinology: Number of patients for the department of Endocrinology.

Gastroenterology: Patients for the department of Gastroenterology.

Urology: Number of patients for the department of Urology.

Neurology: Number of patients for the department of Neurology.

Pulmonlolgy: Number of patients for the department of Pulmonlolgy.

General surgery: Number of surgeries conducted.

Other: Number of patients for other departments.

Observation:
As my client already told me, the system shows its weakness when in need for the
medical history of the patient. Also the current system is very slow and there are
some difficulties when the hospital is crowded. Therefore I have decided to
observe how records are taken and stored by the doctors. The results of my
observation are as follows:
1. The system as mentioned earlier is very inefficient when doctors try to
retrieve the medical history of the patient. The doctors have to go through
a huge stack of records to find the information they need. There is also a
possibility that the records are misplaced.
2. A major drawback in the system is the maintenance of stock levels. When a
patient comes to collect medicines, the stock does not automatically get
deducted since the process is done manually. This makes it very hard to
predict when the stock shall get depleted.
3. Another problem is created when the patient asks the doctor for the same
treatment or medicine given to the patient the last time the patient visited
the hospital. Since the details of the treatment given are not stored by the
hospital, the doctor does not know what treatment or medicine was
previously given to the patient.
4. The searching process in the software is quite time consuming. When
searching for a patient a lot of unnecessary details must be entered instead
of a few key details.

10

Interviews:
First interview with doctor in charge:
Anirudh: I would like to know about the current system you use to manage the
hospital.

Doctor: The current system used operates both manually and by software. When
the patient first visits the hospital, his/her personal information is stored in the
software. At the end of each month and at the end of the year, the software
creates a report that shows details such as how many patients visited etc.

Anirudh: Do you have any problem with how the software operates?
Doctor: The main problem here is that most of the features of the software is
not used as we dont have enough manpower and nobody has the time to use the
rest of the features of the software also it is quite complex. Also very important
details such as the patients medical history and treatment details are not entered.

Anirudh: Can you also tell me what tasks do you do manually?


Doctor: Most of the work here is done manually. When the patients details are
entered in the software, the receptionist hands the patient a slip telling the
patient where to go and which doctor shall be treating the patient. The doctor
then writes down the treatment in another slip. The treatment is also recorded in
another slip, this one meant for the hospital. These are then stored in files for
future reference. The patient then goes to the medicine department to collect the
medicine. The medicine stock is also entered in a booklet manually.

Anirudh: Do you have a problem by the way this system works?


Doctor: Yes. There is very little communication between the hospital and the
medicine department, as the doctors do not know how much medicine is left to be
given out to the patient. So when a medicine is depleted, the doctors, thinking that
it is still there prescribe that medicine to the patient hence creating a problem.
Also it is extremely difficult searching through the records for a particular piece
of information.
11

Anirudh: Why do you think a new system is required?


Doctor: When the hospital was new and there were only a few patients, the
present system was pretty good but as the number of patients increased, the
current system became inefficient as there was a lot of time wasted. Also
managing the hospital has become harder due to lack of communication between
the medicine department and the hospital and several other reasons.

Anirudh: What improvements would you like to see in the new system?
Doctor: Firstly, the new system should reduce the number of tasks done
manually. It must be simple and practical I would also like the communication gap
between the medicine department and the hospital to be reduced. Moreover, I
want an effective stock control system to be set up.

Anirudh: I shall contact you shortly after thinking over the possible solutions
for the problems you face.

Doctor: Ok. Thank you.


Analysis of the interview:
After interviewing the doctor, I have concluded that the current system is now
unable to meet the needs of the organization. The main problems are that the
medical information of the patient is not recorded also there is lack of proper
communication between the main hospital and the medicine department and there
is no way to regulate the stock of medicines effectively. The new system must
therefore reduce these problems faced.

12

Interview with one of the doctors of the hospital:


Anirudh: Could you please tell me about the problems you face with the way the
hospital runs?

Doctor: The main problem faced by me is that the details of the treatment I
give is stored in files making it very difficult to search so when a patient comes to
me and tells me that the medicine he/she used last time was effective and he/she
would like more of it I cannot give the same medicine as it takes a lot of time
searching for the treatment details.

Anirudh: What tasks do you do manually?


Doctor: When a patient is sent to me, he has a patient slip. I just write down
the treatment details and make myself a copy (the copy is done manually a
photocopying machine is not used.) to be stored for further use. But this is quite
impractical as it takes a lot of time to search through the records.

Anirudh: Do you think a new system is required?


Doctor: Yes a new system is required. The doctors face many problems as time is
wasted in making two copies in case of the patient slips. Also as I just told you a
better system to store the treatment details must be made.

Anirudh: Thank you for your time doctor. I will work on a solution and contact
you soon.

Analysis of the interview:


The main problem faced by the doctors working in the hospital is that the details
of the treatment is stored in files thus time is wasted in searching for a particular
piece of data. Also time is wasted in creating two copies of the patient slip. The
new system should provide a simple and convenient way for storing treatment
details and an effective way to search for a required piece of data.

13

Interview with the head of the medicine department:


Anirudh: Gould you please tell me how this department runs?
Doctor: When the doctor prescribes the treatment for a patient, the patient
comes here to collect the medicine.

Anirudh: How do you maintain the medicine stocks?


Doctor: This process is done manually. When we receive the medicines, the data
is stored in a book. The information it stores is the name of the medicine, the
amount received, the amount pending and the date.

Anirudh: What are the problems you face with the current system?
Doctor: When a patient collects the medicine, the deduction in the levels of
stock is not done so we dont know when the medicine will get over.

Anirudh: Would you like a change in the current system and if so, what
improvements do you expect?

Doctor: Yes I would changes to be made with the way the system operates. I
would like to see a system that shows us about the levels of medicine stock so that
we know when the stock will get depleted.

Anirudh: Thank you for your time. I will contact you shortly.
Doctor: Ok. Thanks.
Analysis of the interview:
The main problem faced here is that the stock levels are not maintained properly.
The new system will need to have an efficient way to maintain the stock levels and
it must also have a way to alert the doctors when a particular medicine is no longer
available.

14

Interview with the nurse who uses the software:


Anirudh: Could you tell me about the software the hospital uses?
Nurse: The software is used to record the key details of the patient such as his
name, his gender and other contact details. Then at the end of each year, a report
is made.

Anirudh: Could you tell me about the difficulties you face while operating the
software?

Nurse: The software is quite complex and since there is a lack of equipment,
most of the features of the software remain unused. Also sometimes the software
gets hanged and shuts down.

Anirudh: What features of the software are not used?


Nurse: The software contains other options to store details such as the
complaints of the patient, the list of treatments and the list of doctors.

Anirudh: Does it have an option to store the details of the treatment or


regulate the stock of medicine?

Nurse: No. The software does not have these options.


Anirudh: Ok thank you I will work on a solution as soon as possible.
Analysis of the interview:
The problem with the software is that it is too complex and it sometimes crashes.
Also it lacks some features that are needed specifically by the hospital such as a
stock control system and a method to store treatment details.

15

Second interview with doctor in charge:


Anirudh: I worked over possible solutions to the problems you face and I have
concluded that in order to improve the way things work in the hospital, you could
hire more staff. This would make data entry much easier but the main drawback
with this method is that things would still be done manually leaving room for error.
The other thing you could do is buy hardware devices such as a photocopy machine
for the doctors to photocopy the patient receipt also a device could be installed in
the medicine department to keep track of the amount of medicine given out to the
patients. The third solution is to computerize the entire process. This would make
the entire system faster, better and without risks such as the misplacement of
data. The drawback here is the costs involved in setting up new computers but on
the long term, I believe this solution is the best one.

Doctor: If we were to go for the computerized solution, how would you do it?
Anirudh: I observed that the main problems you face are with the medicine
stocks and the treatment details. The new software will be able to effectively
store the treatment details. Moreover, if a piece of data is required, a simple
search should solve the problem. Also the software will contain an easy way to keep
track of the medicine stocks as each time a patient collects a medicine, it only has
to be entered in the software and the stock levels would be modified.

Doctor: I think I will go for computerizing the system as it saves a lot of time
while providing effective ways to solve the problems we face. Also the software
must be able to create monthly and yearly reports.

Anirudh: I will form a requirements specification for you to check as soon as


possible.

Analysis of the interview:


In order to solve the problems faced, the decision has been made to computerize
the system. The computerized system must save time and solve the main problems
the hospital currently faces. It must also be able to make monthly and yearly
reports based on the information collected by the software.
16

How the hospital works (an overview):


START

PATIENT ENTERS
THE HOSPITAL
PATIENT DETAILS
ACCESSED FROM FILE

NO

NEW STOCK OF
MEDICINE ARRIVES

IS THIS THE
PATIENTS FIRST
VISIT

YE

PATIENT DETAILS
ENTERED IN THE
SOFTWARE

VISIT DETAILS
ADDED IN FILE

PATIENT DIRECTED
TO DOCTOR
STOCK ENTERED IN
BOOKLET
TREATMENT WRITTEN IN
PATIENT SLIP

COPY OF PATIENT
SLIP MADE FOR
RECORDS

MEDICINE READY
TO BE GIVEN OUT
PATIENT GOES TO
COLLECT MEDICINE

IS THE MEDICINE AVAILABLE

NO
YE
S
MEDICINE
DEPARTMENT
GIVES OUT
MEDICINE
PATIENT LEAVES
THE HOSPITAL

END

17

Problems with the current system:


The main problem as stated previously is that there is no good method to save the
treatment details. Also there is no effective way to regulate the stock of medicine
in the hospital. As a result several problems are created. Another problem faced is
searching for a particular record. As this process is done manually, the hospital
staff has to go through a huge stack of files and a lot of time is wasted. Other
minor problems are that the time is wasted in making two copies of the patient slip
(one for the patient and the other for the hospital).
The software the hospital uses is very basic and is unable to meet the needs of the
hospital. It lacks certain key features and has many unnecessary features. Also the
software sometimes crashes while searching for a stored record.. Its inability to
store certain fields such as the treatment details creates many problems for the
hospital. It is also not very user friendly and so the hospital does not use most of
its features in order to save time.
The medicine departments main problem is handling the stocks of medicine. As the
system is done manually, when a patient collects medicine, there is no deduction in
the stock levels so the department staff do not know for sure when the stock will
get depleted. There is also a communication gap between the doctors of the
hospital and the medicine department as the doctor has no way of knowing if a
medicine is still available or not.
Additionally, as many of the tasks are done manually, the data can be easily
misplaced and time is unnecessarily wasted.

18

Requirement specification:
As a result of my analysis of the system in use, I can make the following
requirements specification for the new system:

The new system should be easy to use and wastage of time must be reduced.

The current system must be made to be compatible with the current


operating system in use.

The new system should have a good search facility that is simple and has the
ability to show multiple results.

The calculations needed must be done automatically.

The user should be able to add, edit and delete entries easily.

The system must have an effective way to keep account of the medicine
stock levels. Also the doctors must be made aware when a medicine is no
longer available.

The new system must have a way to store details such as the treatment
details and medical histories of patients.

The software must have a reporting function built in to produce various


reports on a monthly and yearly basis.

19

Discussion with chief doctor:


Anirudh: I have drawn up a requirements specification for the new system. You
would need a computer with basic hardware devices like a monitor, a keyboard etc.
For the software part, you would need an operating system like Microsoft Windows
XP. This generally comes with the computer. I will be making the new software
using Microsoft Visual Basic. I have also drawn up a list of alternative solutions for
you to examine.

Doctor: Can you tell me more about how you are going to make the software?
Anirudh: I will make the software using Microsoft Visual Basic. I will include
the features that are missing in the old system such as a method to keep track of
the medicine stock and I will also include a way to store the treatment details.

Doctor: Can you tell me more about Visual Basic?


Anirudh: Visual Basic is make software I will be using this as it provides an easy
way to create forms and to store data. As it works well with Ms Office which
contains software like Ms Access (for databases) and Ms Excel (a spreadsheet
software), I believe it is a good idea to use Visual Basic.

Doctor: Ok. It sounds quite good. You may go ahead with making the software.
However, I have decided that tasks such as entering data into the patient slips are
best left manual.

Analysis of the discussion:


After a discussion with the chief doctor, it was agreed that Visual basic would be
used to develop the system and meet the requirements. However tasks like
entering data into the patient slips will be left manual. The software and hardware
requirements are given below along with the list of alternate solutions.

20

Hardware requirements:
The hardware requirements for the new system include:

Intel Pentium 4 1.6 GHz

Supported motherboard with built in LAN

512 MB RAM

40 GB Hard disk

Keyboard

Monitor

Mouse

Extra Hardware: Extra hardware like writable CDs and Flash Drives will be
required for backups. An inkjet printer would also be useful.

Software requirements:
Microsoft Visual Basic: This software would be used to run the software.
Ms Office Package: The Ms Office package contains software needed for the
hospital management software to run properly. For example it will use the database
feature from Microsoft Access, the tables from Microsoft Excess etc.
Microsoft Windows XP: Microsoft Windows XP professional is one of the most
common operating systems. It is needed as it supports Visual Basic, the program
with which the software will be made.

21

Alternative solutions:
1. Increasing the number of employees
One solution for the problem is to increase the number of employees. This will
make tasks such as data entry and searching for records easier however, the tasks
will still be done manually hence there is still a risk of misplacing records.

2. Buying additional hardware equipment


Buying certain hardware equipment would greatly simplify certain tasks and avoid
wastage of time as the number of tasks done manually would be reduced. For
example a photocopying machine could be brought to avoid making two copies of the
patient slip. However this is not a very good solution as it does not solve all the
problems and it also increases the expenses of the hospital.

3. Spreadsheet software
This software stores data in tabular form and keeps it organized. It is easily
available in the market (it comes in the MS Office package) and is easy to use.
However it is not an ideal solution as many of the problems will remain unsolved.

4. Database software
This software stores data in a database. Database software is easily available in
the market. Microsoft Visual Basic is an example of one such software. Forms can
be easily created using built in tools. It works well with other Ms Office software
such as Access and Excel and hence it can solve many of the problems faced by the
hospital. It could also be used to create a suitable stock control program for the
medicine department.

5. Installing a Local Area Network


Installing a Local Area Network will help bridge the communication gap between
the hospital doctors and the medicine department as stock details could easily be
transmitted over the network hence alerting the doctors when a particular
medicine is exhausted.

22

(b) DESIGN

(1)NATURE OF THE SOLUTION:


Aims and Objectives:
After discussing with my client, it was decided to design a new system in order to
solve the problems faced by the medical center. The software would be developed
using Microsoft Visual Basic. Taking into consideration the observations and
interviews taken, the following list of objectives was set to build the software.

To reduce consumption of time.

To create a third level normalized database.

To make it compatible with most of the common operating systems available


in the market.

To make the software user friendly and easy to use.

To overcome problems faced while searching.

To add features to add, edit and delete records.

To include a stock control feature.

To perform any calculations automatically.

To organize the input and output.

To include a report developing feature that develops reports periodically at


the end of each month and at the end of the year.

23

Data Structures:
(NOTE- The data structures given below are only part of a design the actual data structures may change
based on the needs of the software)

PATIENT DETAILS
Field name

Siz

Data type

Description

Example

e
Patient
Name

15

Text

Name of the patient is entered

Will

Patient ID

Integer

ID of the patient is entered (it is the


unique field that identifies the
patient)

254

Mothers
Name

15

Text

Patients mothers name is entered

Angelina

Fathers
Name

15

Text

Patients fathers name is entered

Brad

Date of Birth

Date/Tim
e

Patients date of birth entered

2/12/2000

Inpatient

Boolean

Says if the patient is living in the


hospital ward or not

Yes

Sex

Boolean

Patients gender is entered

Male

Group

15

Text

Classifies the patient as child, adult


or senior citizen

Child

Address

25

Memo

Address of the patient is entered

123,Abc
street,
XYZ.

Phone
number

10

Alpha
numeric

Contact details added

098793415
36

Data type

Description

Example

DOCTOR DETAILS
Field name

Size

24

Doctor
Name
Doctor ID

15

Text

Name of the doctor is entered

Jonny

Integer

007

Departmen
t
Permanent

15

Text

Boolean

Paid

Boolean

Id of doctor entered (it is the unique


field that identifies the doctor)
The department of the doctor is
entered (Identifies the department)
Does the doctor work on a
temporary basis?
Does the doctor work on a voluntary
basis?

Pediatrics
No
Yes

DEPARTMENT DETAILS
Field name

Size Data type

Description

Example

Department
Name

15

Text

Pediatric
s

Number of
Doctors
Number of
patients

Integer

Integer

The name of the department is


entered (It is a unique field that
identifies the department)
The number of doctors in the
department
Number of patients for the
department

3
2000

MEDICAL HISTORY
Field name

Size

Patient name
Patient ID

15
5

Data
type
Text
Integer

Medical
history
Treatment
details

25

Memo

25

Memo

Last visit

Date/Ti
me

Description

Example

Name of the patient is entered


Patient ID is entered (it is the unique
field that identifies the patient)
Contains the medical history of the
patient
Previous treatments given to patient
is stored

Will
254

Visit Details Stored here

Cold 2/2/2011
PCM
antibioti
c2/3/2011
6/9/2011

WARD DETAILS

25

Field name

Size

Data type

Description

Example

Ward number
Bed number
Patient name

5
5
15

Integer
Integer
Text

1
5
Will

Patient ID

Integer

Inpatient

Boolean

Admitted on

Date/Time

The ward number is entered here


Bed number is entered here
Name of the patient on the
particular bed
ID of the patient (it is the unique
field that identifies the patient)
Checks if the patient is currently
residing in the hospital.
Date of admittance of the patient

254

6/9/201
1

TREATMENT DETAILS
Field name

Size

Data type

Description

Example

Doctor name
Doctor ID

15
5

Text
Integer

Will
254

Patient Name
Patient ID

15

Text
Integer

Treatment

15

Text

Name of the doctor entered here


Doctor ID entered here (it is the
unique field for identifying the
doctor)
Name of the patient entered here
PatientID entered here (it is the
unique field that identifies the
patient)
Treatment entered here

Date

Date/Time

Date of the treatment is entered


here

2/3/2011

James
007
PCM
antibiotic

MEDICINE STOCKS
Field name

Size

Data type

Description

Example

Name
Medicine ID

15
5

Text
Integer

PCM
110

Quantity

Integer

Name of the medicine is entered


Medicine ID is entered (it is the
unique field that identifies the
medicine)
Quantity of the medicine is entered

500
26

GIVING OUT MEDICINES


Field name

Siz
e
15

Data type

Description

Example

Medicine
Name
Medicine ID 5

Text

Name of medicine

PCM

Integer

110

Patient
Name
Patient ID

15

Text

ID of medicine (it is the unique field that


identifies the medicine)
Name of patient

Integer

254

Amount to
be given
Remaining
stock

Integer

ID of patient (it is the unique field that


identifies the patient)
Amount of medicine to be given

Integer

Amount of medicine still in stock

250

Will

Validation Checks:
In order to ensure that the software works as smoothly as possible, there will be a
number of data validation checks. They are:

Character Checks: These will make sure that the appropriate characters are
used for specified fields. For example the field Patient ID wont allow text
to be entered.

Similarity checks: Checks and compares different fields to see if data is


similar. For example if a patient of age 10 would be a child.

Control Totals: This is done when numeric data needs to be added. For
example total number of patients is the sum of patients treated by all the
departments.

Data type Check: Checks the data type of the input giving an error message
if the data type is not appropriate. For example in an input box where only
27

numeric data is expected, the letter O is entered instead of the number 0,


an error message is shown (This is done in Ms Access in which the database
is created).

File existence Check: Checks that a file with a specified name exists. For
example if the software is asked to collect data from a file named XYZ but
the file does not exist, an error message is shown.

Limit check: Checks if the data is relevant for a particular limit. For example
while making records, if the percentage of patients for dentistry is less
than 0.5% then the patients that were treated by that department come
under the category patients treated in other departments. If the
percentage of patients is above 0.5% then they will come under the category
patients treated by the dentistry department in the pi-chart showing the
patient report. It checks that data should be greater than 0.5% (=>0.5).

Presence Check: Checks for the presence of data in fields. For example if
the name field is blank, an error is shown.

Range Check: Checks that the data lie within a specified range of values, e.g.,
the month of a person's date of birth should lie between 1 and 12

Uniqueness check: Checks that each value in a given field (the key field) is
unique. For example, the ID of a patient must be unique.

28

Entity Relationship diagram:

29

The Screens:
The screens I initially designed for the software are shown below.

The main screen

30

Adding patients

31

Adding doctors
32

Adding departments

Giving Treatment
33

34

Adding new medicine stock

Show doctor details

Show patient details


35

Show departments screen


36

Adding departments

Giving treatment
37

Search Patients

Search medicine

Search Results

38

Notifications

Stock control main screen


39

Stock details screen

How the new software will work:


Another input

40

Input
Display
Error
Any errors

Ye
s

Add patient,
medicine
stock or
new doctor

Displa
y
output

Store new
data in
database

Print
report

Give
treatment to
a patient
Is the medicine
in stock

Ye
s

N
o

Displa
y
Error
modify
database

modify
database

Is the medicine low


in stock

Delete or
edit a
record

Give
medici

Ye
s

Update
notificatio
ns
Execute
search

Modify

Output

Show
results

Modify or
output ?

Initial test plan:

41

A test plan with the expected results was created to be shown to my client in
order for him to get a further idea of how the new system would work.
[Note: This is only an initial test plan that was created to give an idea of how the
system would work. The results are only the expected results. The actual testing of
the software with the required evidence will be covered in the next part of the
documentation.]
TEST

PURPOSE

EXPECTED RESULT

Adding/deleting patients,
doctors or departments

To check if the information is


added/deleted in the database

A new entry should be created in


the database if the subject is
added and the entry should be
deleted from the database if the
subject is deleted
The amount of medicine stock
entered must be added to the
existing amount

Adding medicine stock

To check if stock can be added


in the database

Searching for particular


data

To check if a list of relevant


data is searched from the
database

A drop down list of relevant data


is created from which the user can
choose the necessary item.

Modifying details
(Editing)

To see if the data can be


modified

Any change in data is made and


successfully stored in the
database.

Giving treatment to a
patient

To check if the medicine stock


level reduces when a treatment
is given

The stock level for a particular


medicine reduces when it is given
to a patient as a treatment

42

(2) INTENDED BENIFITS


As the new system was designed to overcome the problems faced by the old
system, it is more efficient and in many ways an improvement considering the
current circumstances.
The intended benefits are:

The Data is easy to access.

The requirements for the software can be easily matched by most modern
day computers.

The hospital attendants need not go through bundles of pages looking for a
record as a search system is provided.

The software does many tasks which were previously done manually such as
keeping track of the patient medical details etc.

New features such as the storing of treatment details, medical histories etc
are added.

The software keeps track of the medicine stocks.

Reports are generated automatically by the software. And analyses the data
in a thorough and precise manner.

If the hospital is running low on medicines, a warning is automatically


generated and the stock details of that medicine is stored in the
notifications page.

As the new system performs tasks faster than the old system, there is more
time available for the hospital staff to take care of the needs of the
patients.

43

The new system will be better suited to handle crowds as the new software
will perform tasks faster giving the hospital staff more time to manage the
crowds.

The problems related to the medicine stocks will be greatly reduced as the
new software generates warnings if a particular medicine is about to get
depleted.

(3) LIMITATIONS IN THE NEW SYSTEM


The limitations:
While the software does fix most of the problems, there are still some limitations
to the new system such as:

The software does not create backups automatically.

Due to financial restrictions, every doctor is not provided with his/her own
computer so recording the treatment details can be a difficult process.

Features such as payroll management etc are not included.

Lack of hospital staff is still a problem in the new system.

As the new software stores many additional details such as the treatment
details and the medicine stock details, it occupies more disc space as
compared to the old software.

The new system does not include any way to monitor individual staff
members.

44

File sizes estimates:


The sizes of the files used were estimated and submitted to the client. The file
size estimates are given below.

PATIENT DETAILS
Field

Type

Description

Example

name

Size
(in bytes)

Patient
Name

String

Name of the patient is


entered

Will

15

Patient
ID

Integer

ID of the patient is entered

254

Mother
s Name

String

Patients mothers name is


entered

Angelina

15

Fathers
Name

String

Patients fathers name is


entered

Brad

15

Date of
Birth

Date/Ti
me

Patients date of birth entered

2/12/2000

Inpatien
t

Boolean

Says if the patient is living in


the hospital ward or not

Yes

Sex

Boolean

Patients gender is entered

Male

Group

Text

Classifies the patient as child,


adult or senior citizen

Child

15

Address

Memo

Address of the patient is


entered

123,Abc
street, XYZ.

25

Phone
number

Alpha
numeric

Contact details added

09879341536

10

Total size of the record in bytes:

110
45

Size of the file consisting of 10000 records:

1100000

DOCTOR DETAILS
Field name
Doctor
Name
Doctor ID

Type
String

Description
Name of the doctor is entered

Example
James

Size
15

Intege
r
String

Id of doctor entered

007

Pediatrics

15

No

Yes

Departme
nt
Permanent Boolea
n
Paid
Boolea
n

The department of the doctor is


entered
Does the doctor work on a temporary
basis?
Does the doctor work on a voluntary
basis?
Total size of the record in bytes:

Size of the file consisting of 10000 records:

DEPARTMENT DETAILS
Field name
Department
Name
Number of
Doctors
Number of
patients

Type
Text

Description
The name of the department is
entered
Intege The number of doctors in the
r
department
Intege Number of patients for the
r
department
Total size of the record in bytes:

Example
Pediatri
cs
3

Size
15

2000

Size of the file consisting of 10000 records:

46

MEDICAL HISTORY
Field name
Patient
name
Patient ID
Medical
history
Treatment
details

Type
Text

Description
Name of the patient is entered

Example
Will

Size
15

Integer
Memo

Patient ID is entered
Contains the medical history
of the patient
Previous treatments given to
patient is stored

5
25

Last visit

Date/Tim Visit Details Stored here


e
Total size of the record in bytes:

254
Cold 2/2/2011
PCM
antibiotic2/3/2011
6/9/2011

Memo

25
8

Size of the file consisting of 10000 records:

WARD DETAILS
Field name
Ward number
Bed number
Patient name

Type
Integer
Integer
Text

Description
The ward number is entered here
Bed number is entered here
Name of the patient on the particular
bed
ID of the patient
Checks if the patient is currently
residing in the hospital.
Date of admittance of the patient

Patient ID
Inpatient

Integer
Boolean

Admitted on

Date/Ti
me
Total size of the record in bytes:

Example
1
5
Will

Size
5
5
15

254

5
1

6/9/201
1

Size of the file consisting of 10000 records:


47

TREATMENT DETAILS
Field name
Doctor name
Doctor ID
Patient Name
Patient ID
Treatment

Type
Text
Integer
Text
Integer
Text

Date

Date/Time

Description
Name of the doctor entered here
Doctor ID entered here
Name of the patient entered here
Patient ID entered here
Treatment entered here

Date of the treatment is entered


here
Total size of the record in bytes:

Example
Will
254
Jonny
007
PCM
antibiotic

Size
15
5
15
5
15

2/3/2011

Size of the file consisting of 10000 records:

MEDICINE STOCKS
Field name
Name
Medicine ID
Quantity

Type
Description
Text
Name of the medicine is entered
Intege Medicine ID is entered
r
Intege Quantity of the medicine is entered
r
Total size of the record in bytes:

Example
PCM
110

Size
15
5

500

Size of the file consisting of 10000 records:


48

GIVING OUT MEDICINES


Field name

Type

Description

Medicine
Text
Name of medicine
Name
Medicine ID Integer ID of medicine (it is the unique field that
identifies the medicine)
Patient
Text
Name of patient
Name
Patient ID
Integer ID of patient (it is the unique field that
identifies the patient)
Amount to
Integer Amount of medicine to be given
be given
Remaining Integer Amount of medicine still in stock
stock
Total size of the record in bytes:

Example

Size

PCM

15

110

Will Smith 15
254

250

Size of the file consisting of 10000 records:

49

As the amount of disc space needed for the new system to work is much larger
than the previous one, a limitation with the new system is the amount of disc space
needed.

(c) SOFTWARE DEVELOPMENT,


PROGRAMMING, TESTING AND
INSTALLATION
(1)Development:
How the new system will work:
The system will be will have one common database connected to many computers.
So when a modification is made in one computer, the database is modified. The
software created using Microsoft Visual Basic forms the front end and the
database created by Microsoft Access comprises of the back end.
The software uses:

Various forms including the patient details form, the stock control form etc.
50

Input screens for adding new records.

Search screens for searching for a particular record.

Output screens for displaying records.

A form that creates reports based on the records collected at the end of
the month.

The database is designed to be a 3rd level normalized database. This is helpful as


changes in records are automatically done when one record is changed.
The database uses:
Tables that are based on the form used by the software including the
patient details table, the doctors table etc.
Entity relationship diagrams.
Various queries that help connect the database.

The database:
The database uses eight files, each having their own data structures and
relationships. These files store the records which are connected to the forms of
the actual software. (The fields are the same as shown in the Design section)

The data structures used in the database:


Patient Details: This stores the details of all patients treated in the hospital.
Design View

51

Datasheet View

Data Structure
Field name

Size

Data type

Description

Example

Patient ID

Number

ID of the patient is entered (Key


field)

254

Patient
Name

15

Text

Name of the patient is entered

Vishnu

Mothers
Name

15

Text

Patients mothers name is


entered

Neha

Fathers

15

Text

Patients fathers name is entered

Inan
52

Name
Date of
Birth

Date/Time Patients date of birth entered

9/9/1999

Sex (Male?)

Yes/No

Patients gender is entered

Male

Group

15

Text

Classifies the patient as child,


adult or senior citizen

Child

Address

25

Memo

Address of the patient is entered

99-B,
karngar,
chennai

Phone.no

10

Number

Contact details added

09879341536

Doctor Details: Stores the details of the doctors of the hospital.


Design View

Datasheet View

53

Data Structure
Field name
Doctor ID
Doctor
Name
Departmen
t
Permanent

Size
5
15

Data type
Number
Text

Description
Id of doctor entered (Key field)
Name of the doctor is entered

Example
1
Anamay

15

Text

Pediatrics

Boolean

Paid

Boolean

The department of the doctor is


entered
Does the doctor work on a
temporary basis?
Does the doctor work on a voluntary
basis?

No
Yes

Department Details: This stores the details of the hospitals departments


Design View

54

Datasheet View

Data Structure
Field name

Size Data type

Description

Example

Department
Name
Doctor ID
Number of
Doctors
Current Date

15

Text

5
5

Number
Number

Psychiat
ry
2
3

Date/Time

The name of the department is


entered (Key field)
Id of the doctor is entered here
The number of doctors in the
department
Stores the present date.

Number of
patients

Number

Number of patients for the


department

2/2/201
2
15

55

Medical History: Stores the medical history of patients


Design View

Datasheet view

Data structure
Field name

Size

Patient ID
Medical
history
Treatment
Records

5
25

Data
type
Number
Memo

25

Memo

Last visit

Date/Ti

Description

Example

Patient ID is entered here


Contains the medical history of the
patient
Previous treatments given to patient
is stored

254
Cold 2/2/2011
PCM
antibioti
c2/3/2011
6/9/2011

Visit Details Stored here

56

me
Ward details: Stores information about patients currently staying in the hospital.
Design View

Datasheet View

Data Structure
Field name

Size

Data type

Description

Example

Ward number

Integer

Bed number
Patient ID
Inpatient

5
5
1

Integer
Integer
Boolean

Date of
Admission

Date/Time

The ward number is entered here


(Key Ffeld)
Bed number is entered here
ID of the patient entered here
Checks if the patient is currently
residing in the hospital.
Date of admittance of the patient

5
7
yes
6/9/201
1

57

Treatment details: Stores the treatment details of a patient.


Design View

Datasheet View

Data Structure
Field name

Size

Data type

Description

Example

Patient ID
Doctor ID
Medicine ID

5
5
5

Integer
Integer

Patient ID entered here


Doctor ID entered here
Medicine ID entered here

1
1
1

Date of
Treatment

Date/Time

Date of the treatment is entered


here

2/3/2011

Integer

58

Stock details: Stores the details of the medicines used by the hospital.
Design View

Datasheet View

Data Structure
Field name

Size

Data type

Description

Example

Medicine ID

Integer

110

Name
Quantity

15
5

Text
Integer

Medicine ID is entered (it is the


unique field that identifies the
medicine)
Name of the medicine is entered
Quantity of the medicine is entered

PCM
500
59

Giving out Medicines: This table holds the records of what medicine is given to
which patient (Medicine Transaction).
Design View

Datasheet View

60

Data Structure
Field name

Siz
e
Medicine ID 5

Data type

Description

Example

Integer

110

Patient ID

Integer

Amount to
be given
Remaining
stock

Integer

ID of medicine (it is the unique field that


identifies the medicine)
ID of patient (it is the unique field that
identifies the patient)
Amount of medicine to be given

Integer

Amount of medicine still in stock

250

254
4

61

The entity relationship diagram:

62

The software:
The software will act as the front end of the new system. The software will be
installed on many computers which will share a common database so that when
changes are done on one system, the database will get updated automatically. A
few functions the software can perform are:
1. Navigation: The software can navigate from one form to another.
2. Adding, deleting and editing records: The software will be able to manipulate
the data in the database.
3. Searching: The software will be able to search for specific data.
4. Reports: The software will be able to create reports based on the data
within the database.
The software will consist of various forms that will be able to handle the data.
Although the form screens are similar to the ones designed initially, I have made a
few changes to lessen the number of forms in order to make the software a little
simpler.

63

The Screens
After some discussion with my client, it was decided to make some changes to the
screens. The new screens designed are given below.

The main screen

64

Add patient screen

65

The Patient Details and search screen

66

The Stock management screen

The Add Stock screen

67

The Medicine Details and search screen

68

The Department Details and search screen

(Note: This screen does

not lead to another screen to add a new department. In order to do add a department, clear the
text boxes, add the required details and click the add button. This is done because new
departments are added very rarely.)

69

The Doctor Details and search screen

(Note: This screen does not lead to

another screen to add a new doctor. In order to do add a doctor, clear the text boxes, add the
required details and click the add button.)

70

Giving Treatment

The Medical History screen

71

The Help screen

72

How the screens work


The software consists of various forms that can be accessed by clicking the
buttons on the main screen. Pressing the

button on the top right corner of the

screen leads to the main screen again. The working and functions of the screens
are explained below.
1. The Main screen: This is the main screen of the software. Its function is to
link the different software screens and direct the user to the required screen.
2. The Add patient screen: Its function is to add new patients. On filing the
text boxes, to add a patient in the database, the user must press the Add
button. The Cancel button leads to the main screen.
3. The Patient Details and Search screen: The main function of this screen is
to search specific patients and to view the patient details. It consists of five
buttons-Show patient details, Delete, Edit, Previous and Next. The functions of
these buttons are explained below.

Show Medical History button: This leads to the Medical History Screen.

Delete button: Pressing this deletes the patient the user is currently
viewing

Edit button: This button exists to make changes to the records. To do so,
go to the patient on whose record changes are to be made. Make the
changes in the text boxes and click the button to make the changes.

Previous and Next buttons: Pressing these will go to the previous/next


records in the database.

To search a patient, enter the first letter of the patients name in the input
box. For example it is A, all the patients whose names begin with the letter
A will be displayed in a drop down list. On entering the next letter (for
example n) the drop down list will display all the names starting with letters
An. Once the patient is selected from the list, his/her details are shown in
the screen.
73

4. The Stock Section screen forms the main navigation screen for adding stocks,
finding out what medicines have been exhausted etc. Like the main screen, its
function is to link the different software screens and direct the user to the
required screen.
5. The Add Stock screen: Its function is to add new medicines or add stock for
existing medicines. It consists of 3 buttons:

Add Stock button: This button adds stock for an already existing medicine.

Add Medicine button: This button adds a new medicine in the database.

Back: This button goes back to the Stock Section screen.

6. The Stock Details and Search screen: The main function of this screen is to
search specific medicines and to view the stock details. It consists of four
buttons- Delete, Edit, Previous and Next. The functions of these buttons are
explained below.

Delete button: Pressing this deletes the medicine record the user is
currently viewing

Edit button: This button exists to make changes to the records. To do so,
make the changes in the text boxes and click the edit button to make the
changes.

Previous and Next buttons: Pressing these will go to the previous/next


records in the database.

The procedure for searching is the same as that described in Patient details and
search (Look above).
7. The Departments screen: The main function of this screen is to add
departments and to view the department details. It consists of five buttons- Add,
Delete, Edit, Previous and Next. The functions of these buttons are explained
below.

Add button: This adds a new department. To add a department, fill in the
details and click Add
74

Delete button: Pressing this deletes the record the user is currently viewing

Edit button: This button exists to make changes to the records. To do so,
make the changes in the text boxes and click the edit button to make the
changes.

Previous and Next buttons: Pressing these will go to the previous/next


records in the database.

The procedure for searching is the same as that described in Patient details and
search (Look above).
8. The Doctors screen: The main function of this screen is to add doctors and to
view the doctor details. It consists of five buttons- Add, Delete, Edit, Previous and
Next. The functions of these buttons are explained below.

Add button: This adds a new doctor. To add a doctor, fill in the details and
click Add

Delete button: Pressing this deletes the record the user is currently viewing

Edit button: This button exists to make changes to the records. To do so,
make the changes in the text boxes and click the edit button to make the
changes.

Previous and Next buttons: Pressing these will go to the previous/next


records in the database.

The procedure for searching is the same as that described in Patient details and
search (Look above).
9. The Giving Treatment screen: When the doctors of the hospital prescribe a
medicine to a patient, the patient is given a slip. The patient then goes to the
medicine counter to take that medicine. This screens function is to deduct the
stock whenever a patient is given a medicine.
Whenever a patient is given a medicine, the medicine name is entered. A drop down
box offering suggestions in displayed as the name of the medicine is entered. The

75

quantity of the medicine to be given is then entered. On pressing Give, the stock
of the medicine entered is reduced in the database.
10. The Medical History screen: This displays the medical history of the patient.
It is accessed through the Patient Details screen. Whenever the doctor
prescribes a treatment, he enters the treatment in this screen.
11. The Help screen: This screen provides a step by step guide on how to operate
the software. It consists of several help topics clicking these topics shows how to
perform the selected task.

76

Connecting the software to the database:


In order to connect the software to the database, I have used a feature in
Microsoft Visual basic called Data Environment. Using this allows the user to
connect the Visual Basic software with an Ms Access database. The screenshot
below shows the data environment connecting the software with the database.

77

(2)Programming:
Programming used in the software:
The programming in the software includes coding to navigate from one form to
another, database programming etc.
The programming used in the software is given below.

The Main screen:


The main screen uses coding that helps navigate to other screens. In addition it
also uses coding that displays the system time. The buttons shown below lead to
different forms. The form has been labeled to show clearly the programming used.

78

1. Clicking this navigates to the Add Patient form and then closes the main
screen.

The programming used:


Private Sub Command1_Click()
Add_Patient.Show
Unload Me
End Sub

2. Clicking this navigates to the Give treatment form then closes the main
screen.

The programming used:


Private Sub Command2_Click()
Give_treatment.Show
Unload Me
End Sub

3. Clicking this navigates to the Patient Details and search form then closes
the main screen.

The programming used:


Private Sub Command3_Click()
Patient_Details.Show
Unload Me
End Sub
79

4. Clicking this navigates to the Stock management form then closes the main
screen.

The programming used:

Private Sub Command4_Click()


Stock_Main.Show
Unload Me
End Sub

5. Clicking this navigates to the Departments form then closes the main
screen.

The programming used:


Private Sub Command5_Click()
Departments.Show
Unload Me
End Sub

6. Clicking this navigates to the Doctors form then closes the main screen.

The programming used:


Private Sub Command6_Click()
Doctors.Show
Unload Me
End Sub
80

7. Clicking this navigates to the Help form then closes the main screen.

The programming used:


Private Sub Command7_Click()
Help.Show
Unload Me
End Sub

8. Clicking this creates a report

The programming used:


Private Sub Command3_Click()
DataReport2Show
End Sub

9. Clicking this quits the project

The programming used:


Private Sub Command9_Click()
Unload Me
End Sub

81

10. This enables the system date to be shown

The programming used:


Private Sub Form_Load()
Dim date1 As Date
date1 = DateValue (Now)
Label1.Caption = date1
End Sub
11. This enables the system time to be shown

The programming used:


Private Sub Form_Load()
Dim time1 As Date
time1 = TimeValue (Now)
Label2.Caption = time1
End Sub

82

The Add Patient screen:

1. Clicking this adds a new patient

The programming used:


Private Sub Command1_Click()
DataEnvironment1.rsPatient_Details.AddNew
End Sub

83

2. Clicking this exits the form and goes to the main screen

The programming used:


Private Sub Command2_Click()
Main.Show
Unload Me
End Sub

84

The Patient Details screen:

1. Clicking this updates any changes made to the database

The programming used:


Private Sub Command1_Click()
DataEnvironment1.rsPatient_Details.Update
End Sub

85

2. Clicking this deletes the entry being viewed

The programming used:


Private Sub Command2_Click()
DataEnvironment1.rsPatient_Details.Update
End Sub

3. Clicking this goes to the next entry

The programming used:


Private Sub Command1_Click()
DataEnvironment1.rsPatient_Details.MoveNext
If DataEnvironment1.rsPatient_Details.EOF Then
DataEnvironment1.rsPatient_Details.MoveFirst
End If
End Sub

4. Clicking this goes to the previous entry

The programming used:


Private Sub Command2_Click()
DataEnvironment1. rsPatient_Details.MovePrevious
If DataEnvironment1. rsPatient_Details.BOF Then
DataEnvironment1. rsPatient_Details.MoveLast
86

End If
End Sub
5. Clicking this goes to the Medical History screen

The programming used:


Private Sub Command2_Click()
Medical_History.Show
Unload Me
End Sub

87

The Stock main screen:

1. Clicking this navigates to the Add Stock form and then closes the main
screen.

The programming used:


Private Sub Command1_Click()
Add_Stock.Show
Unload Me
End Sub

88

2. Clicking this navigates to the Medicine details form then closes the main
screen.

The programming used:


Private Sub Command2_Click()
Medicine_Details.Show
Unload Me
End Sub

3. Clicking this creates a report of medicines that must be reordered

The programming used:


Private Sub Command3_Click()
DataEnvironment1.Stock_Details ("Y")
DataReport1.Show
End Sub

4. Clicking this navigates to the Main screen form then closes the main
screen.

The programming used:


Private Sub Command4_Click()
Main.Show
Unload Me
89

End Sub

5. Clicking this exits the software

The programming used:


Private Sub Command5_Click()
Unload Me
End Sub

The Add Stock screen:

90

1. Clicking this adds new stock of an existing medicine. It the medicine does
not exist, a new record is created for that medicine.

The programming used:


Private Sub Command1_Click()
Dim nam1 As String
Dim p as Integer
p=0
DataEnvironment1. rsStock_Details.MoveFirst
nam1 = InputBox("Enter medicine name")
While Not DataEnvironment1. rsStock_Details.EOF
If nam1 = DataEnvironment1. rsStock_Details ("Medicine Name") Then
p=p+1
Call pro // A function pro is called
Exit Sub
End If
DataEnvironment1. rsStock_Details.MoveNext
Wend
If p = 0 Then
Msgbox (Error: Not found)
End If
End Sub

91

Private Sub pro() // This is the function that was called earlier
Dim q As Integer
q = InputBox("Enter the quantity to procure")
DataEnvironment1. rsStock_Details ("Stock) = DataEnvironment1.
rsStock_Details ("Stock") + q
If DataEnvironment1. rsStock_Details ("Stock") >= 10 Then
DataEnvironment1. rsStock_Details ("Reorder") = "N"
DataEnvironment1. rsStock_Details.Update
End If
End Sub

2. Clicking this goes to the main stock screen

The programming used:


Private Sub Command2_Click()
Stock_Main.Show
Unload Me
End Sub

92

The Medicine details screen:

1. Clicking this updates any changes made to the database

The programming used:


Private Sub Command1_Click()
DataEnvironment1.rsStock_Details.Update
End Sub

2. Clicking this deletes the entry being viewed

The programming used:


Private Sub Command2_Click()
DataEnvironment1. rsStock _Details.Update
End Sub
93

3. Clicking this goes to the next entry

The programming used:


Private Sub Command1_Click()
DataEnvironment1. rsStock _Details.MoveNext
If DataEnvironment1. rsStock _Details.EOF Then
DataEnvironment1. rsStock _Details.MoveFirst
End If
End Sub

4. Clicking this goes to the previous entry

The programming used:


Private Sub Command2_Click()
DataEnvironment1. rsStock _Details.MovePrevious
If DataEnvironment1. rsStock _Details.BOF Then
DataEnvironment1. rsStock _Details.MoveLast
End If
End Sub

94

The Departments screen:

1. Clicking this adds a new department

The programming used:


Private Sub Command1_Click()
DataEnvironment1.rsDepartment_Details.Update
End Sub

2. Clicking this updates any changes made to the database

The programming used:


Private Sub Command1_Click()
DataEnvironment1. rsDepartment _Details.Update
95

End Sub

3. Clicking this deletes the entry being viewed

The programming used:


Private Sub Command2_Click()
DataEnvironment1. rsDepartment _Details.Update
End Sub

4. Clicking this goes to the next entry

The programming used:


Private Sub Command1_Click()
DataEnvironment1. rsDepartment _Details.MoveNext
If DataEnvironment1. rsDepartment _Details.EOF Then
DataEnvironment1. rsDepartment _Details.MoveFirst
End If
End Sub

5. Clicking this goes to the previous entry

The programming used:


Private Sub Command2_Click()
DataEnvironment1. rsDepartment _Details.MovePrevious
If DataEnvironment1. rsDepartment _Details.BOF Then
96

DataEnvironment1. rsDepartment _Details.MoveLast


End If
End Sub

The Doctors screen:

1. Clicking this adds a new doctor

The programming used:


Private Sub Command1_Click()
DataEnvironment1.rsDoctor_Details.Update
End Sub

97

2. Clicking this updates any changes made to the database

The programming used:


Private Sub Command1_Click()
DataEnvironment1. rsDoctor _Details.Update
End Sub

3. Clicking this deletes the entry being viewed

The programming used:


Private Sub Command2_Click()
DataEnvironment1. rsDoctor _Details.Update
End Sub

4. Clicking this goes to the next entry

The programming used:


Private Sub Command1_Click()
DataEnvironment1. rsDoctor _Details.MoveNext
If DataEnvironment1. rsDoctor _Details.EOF Then
DataEnvironment1. rsDoctor _Details.MoveFirst
End If
End Sub

98

5. Clicking this goes to the previous entry

The programming used:


Private Sub Command2_Click()
DataEnvironment1. rsDoctor _Details.MovePrevious
If DataEnvironment1. rsDoctor _Details.BOF Then
DataEnvironment1. rsDoctor _Details.MoveLast
End If
End Sub

The Medical History screen:

99

1. Clicking this adds additional information to the medical histoey and


treatment details

The programming used:


Private Sub Command1_Click()
DataEnvironment1.rsMedical_History.Update
End Sub

2. Clicking this updates any changes made to the patients medical history or
the treatment details

The programming used:


Private Sub Command1_Click()
DataEnvironment1. rsMedical_History.Update
End Sub

3. Clicking this goes back to the Patient Details screen

The programming used:


Private Sub Command1_Click()
Patient_Details.Show
Unload Me
End Sub
100

The Give Treatment screen:

1. Clicking this goes back to the Main screen

The programming used:


Private Sub Command1_Click()
Main.Show
Unload Me
End Sub
2. Clicking this reduces stock of the medicine given to the patient

The programming used:


Private Sub Command2_Click()
Dim nam As String
DataEnvironment1.rsStock_Details.MoveFirst
nam = InputBox("Enter medicine name")
While Not DataEnvironment1. rsStock_Details.EOF

101

If nam = DataEnvironment1. rsStock_Details ("Medicine Name") Then


p=p+1
Call give // A function give is called
Exit Sub
End If
DataEnvironment1. rsStock_Details.MoveNext
Wend
If p = 0 Then
MsgBox "Item not found"
DataEnvironment1. rsStock_Details.MoveFirst
End If
End Sub

Private Sub give() // This is the function that was called earlier
Dim g As Integer
g = InputBox("Quantity of Medicine")
k = DataEnvironment1. rsStock_Details ("Stock")
If (k - g) <= 10 Then
MsgBox ("It will exceed reorder level : please give less")
DataEnvironment1. rsStock_Details ("Reorder") = "Y"
DataEnvironment1. rsStock_Details.Update
Exit Sub
102

End If
If DataEnvironment1. rsStock_Details ("Stock") < g Or
DataEnvironment1. rsStock_Details ("Stock") <= 10 Then
MsgBox "Sorry not possible"
Exit Sub
End If
If DataEnvironment1. rsStock_Details ("Stock") <= 10 Then
MsgBox "Reorder level reached"
DataEnvironment1. rsStock_Details ("Reorder") = "Y"
DataEnvironment1. rsStock_Details.Update
Exit Sub
End If
DataEnvironment1. rsStock_Details ("Stock") =

DataEnvironment1.

rsStock_Details ("Stock") - g
DataEnvironment1. rsStock_Details.Update
End Sub

103

Programming used in the database:


The database too uses programming in the form of queries. The Queries are used
mainly for searching for a specific item in the database.
In the department details table:
QUERY USED
SELECT [Department Details].Department_Name, [Department Details].[Doctor
ID], [Department Details].Number_of_doctors, [Department
Details].Current_date, [Department Details].Number_of_Patients
FROM [Department Details]
WHERE ((([Department Details].Department_Name)=[Enter department name?]));
In the doctor details table:
QUERY USED
SELECT [Doctor Details].Doctor_ID, [Doctor Details].Doctor_Name, [Doctor
Details].Department_Name, [Doctor Details].[Parmanent?], [Doctor Details].[Paid?]
FROM [Doctor Details]
WHERE ((([Doctor Details].Doctor_Name)=[Enter doctor name?]));
In the giving out medicines table:
QUERY USED
SELECT [Giving out medicines].Medicine_ID AS [Giving out
medicines_Medicine_ID], [Giving out medicines].Patient_ID, [Giving out
medicines].Amount_Given, [Giving out medicines].Remaining_Stock, [Stock
Details].Medicine_ID AS [Stock Details_Medicine_ID], [Stock
Details].Medicine_Name
FROM [Stock Details] INNER JOIN [Giving out medicines] ON [Stock Details].
[Medicine_ID] = [Giving out medicines].[Medicine_ID]

104

WHERE ((([Stock Details].Medicine_Name)=[Enter medicine name?]));

In the medical history table:


QUERY USED
SELECT [Medical History].Patient_ID AS [Medical History_Patient_ID], [Medical
History].Medical_History, [Medical History].Treatment_Records, [Medical
History].Last_Visit, [Patient Details].Patient_ID AS [Patient Details_Patient_ID],
[Patient Details].Patient_Name
FROM [Patient Details] INNER JOIN [Medical History] ON [Patient Details].
[Patient_ID] = [Medical History].[Patient_ID]
WHERE ((([Patient Details].Patient_Name)=[Enter patient name?]));
In the patient details table:
QUERY USED
SELECT [Patient Details].Patient_ID, [Patient Details].Patient_Name, [Patient
Details].Date_of_Birth, [Patient Details].[Mother's_Name], [Patient Details].
[Father's_Name], [Patient Details].Sex, [Patient Details].Group, [Patient
Details].Address, [Patient Details].Phone_Number
FROM [Patient Details]
WHERE ((([Patient Details].Patient_Name)=['ENTER PATIENT_NAME?']));
In the stock details table:
QUERY USED
SELECT [Stock Details].Medicine_ID, [Stock Details].Medicine_Name, [Stock
Details].Quantity
FROM [Stock Details]
105

WHERE ((([Stock Details].Medicine_Name)=[Enter medicine name?]));


In the treatment details table:
QUERY USED
SELECT [Treatment Details].Patient_ID AS [Treatment Details_Patient_ID],
[Treatment Details].Doctor_ID, [Treatment Details].Medicine_ID, [Treatment
Details].Date_of_Treatment, [Patient Details].Patient_ID AS [Patient
Details_Patient_ID], [Patient Details].Patient_Name
FROM [Patient Details] INNER JOIN [Treatment Details] ON [Patient Details].
[Patient_ID] = [Treatment Details].[Patient_ID]
WHERE ((([Patient Details].Patient_Name)=[Enter patient name?]));
In the ward details table:
QUERY USED
SELECT [Ward Details].Patient_ID AS [Ward Details_Patient_ID], [Ward
Details].Ward_Number, [Ward Details].Bed_Number, [Ward Details].[Inpatient?],
[Ward Details].Date_of_Admission, [Patient Details].Patient_ID AS [Patient
Details_Patient_ID], [Patient Details].Patient_Name
FROM [Patient Details] INNER JOIN [Ward Details] ON [Patient Details].
[Patient_ID] = [Ward Details].[Patient_ID]
WHERE ((([Patient Details].Patient_Name)=[Enter patient name?]));

106

(3)SOFTWARE TESTING:
Testing strategy:
Before implementing the system, various tests will be performed to check if the
software is free from errors will be able to meet the needs of the user. The
system will be tested extensively to make sure that there is a very small chance of
errors.
In the tests, any type of data valid or invalid will be input into the software to
check if we get the desired output. The software is tested with normal, abnormal
and extreme data to make sure that the software works properly in all possible
conditions.
Normal Data: Normal valid data is entered to check if it is accepted or not.
Extreme data: Data out of range is entered to check if the validations apply or not.
Abnormal Data: Invalid data is entered to check if it is rejected by the system.

107

Test Plan:
Note: the processes of adding, deleting, editing and searching have the same procedure and coding
for patients, doctors, departments and medicines so adding, deleting, editing and searching
patients, doctors, departments and medicines are just one test instead of four tests .
TEST

PURPOSE

Adding/deleting
patients, doctors,
medicines and
departments

To check if the
information is
added/deleted in the
database

Editing details of
patients, doctors,
medicines and
departments

To check if any
necessary changes
can be made.

Searching for a
patient, doctor,
medicine or
department

To check if a list of
relevant data is
searched from the
database

Adding new stock


for an existing
medicine

To see if the stock


can be added into the
database.

Giving treatment
to a patient

To check if the
medicine stock level
reduces when a
treatment is given

EXPECTED
RESULT
A new entry should
be created in the
database if the
subject is added
and the entry
should be deleted
from the database
if the subject is
deleted
Any changes made
are updated into
the database.

ACTUAL
RESULT
Records were
added and deleted
successfully

A drop down list of


relevant data is
created from which
the user can
choose the
necessary item.
The new stock is
added to the
already existing
stock.

Records could be
searched from the
database

The stock level for


a particular
medicine reduces
when it is given to a
patient as a
treatment

Stocks were
subtracted
successfully

Changes were
successfully made
and stored in the
database

Stocks were
added to already
existing stock
automatically

EXPLANATION
The software was
correctly
connected to the
database and the
coding used was
correct

The software was


correctly
connected to the
database and the
coding used was
correct
The software was
correctly
connected to the
database and the
coding used was
correct
The software was
correctly
connected to the
database and the
coding used was
correct
The software was
correctly
connected to the
database and the
coding used was
correct

108

Creating a report
of medicines that
need to be
reordered

To check if a report
can be made showing
a list of medicines
that need to be
reordered.

A report showing
the relevant data is
created.

The report was


successfully
generated

Creating a report
showing the
number of
patients for each
department.

To check if a report
is created showing
the number of
patients for each
department

A report showing
the relevant data is
created

The report was


not created
successfully

Searching for a
record in the
database

To check if searching
for records is
possible in the
database

The record will be


searched
successfully

The search is
successful

The software was


correctly
connected to the
database and the
coding used was
correct
The treatment
details table was
not linked to the
departments table
and so the report
couldnt be made.
The software was
correctly
connected to the
database and the
coding used was
correct

109

The evidence:
The evidence for the tests is provided below.
TEST 1:
Adding a record- Normal data

110

Adding a record- Extreme data

111

Adding a record- Abnormal Data

112

Deleting a record

Test result: The normal and extreme data was accepted by the software unlike the
abnormal data which was rejected by the software.

TEST 2:
113

Editing a record

Test result: The changes to the records were made successfully.

TEST 3:
114

Searching for a record

Test result: Records appear in a drop down list. On typing a name, the user is
automatically directed to the name in the list. Clicking the name grants access to
the details of the particular record.

TEST 4:
115

Checking if new stock can be added


Before adding stock:

While adding the stock:

After adding the stock:

Test result: Additions in the stock was done automatically by the software.

TEST 5:
116

Checking if stock will decrease each time the medicine is given to a patient
Before giving medicine:

While giving the medicine:

After giving the medicine:

Test result: Reductions in the stock levels were done automatically by the
software.

117

TEST 6:
Checking if a report will be generated showing the list of exhausted medicines

Test result: A report was successfully generated.

TEST 7:
118

Checking if a report will be generated showing the number of patients that have
been treated by each department.

Test result: The required report could not be made.

TEST 8:
119

Checking if records can be searched from the database.

Test result: The record was searched successfully.

Correcting the errors:

120

The only error found in the software was in Test 7 where the required report
couldnt be generated. This has now been corrected. A pi chart and a bar graph
were used in the report. This was done using the inbuilt features of Visual Basic.

(4)INSTALLATION:
121

User training:
The doctors and staff were familiar with the use of computers so the only user
training required was getting used to the new software. I have tried to make the
new software similar to the old software as the staff would be comfortable in
using the new software. I will spend some time explaining the new system to the
staff of the hospital as part of the user training.

Installation:
For the installation, the only thing required was specifying the address of the
database of the new system in the source code. An executable file was then made.
The software is now ready for implementation.
While the head doctor and management have not agreed to immediately change the
system, they have agreed to try the new system. If it manages to meet the
expectations of the staff, there will be a system changeover. The stock
management system that I have included in the software will be implemented
immediately.
The steps for installing the software are:

Copy the source code to the required computer

Copy the database to the required computer

Specify the location of the database in the new computer

Create an executable file

Run the software

User acceptance:
122

The head doctor and other hospital staff were present during the software
testing. The staff frequently told me what features could be included and where
improvements could be done. For evidence, pictures have been included in the
documentation with me discussing the software with the various staff of the
hospital.

(d) Documentation
123

(1) SYSTEMS MAINTENANCE MANUAL:


Hardware requirements:
The hardware required to support the software is very basic and most of it is
found on most modern day computers. The minimum hardware requirements for the
new system are:

Intel Pentium 4, 1.8 GHz

Supporting motherboard with built in LAN

512 Mb RAM

At least 1 Gb free hard drive space (for records stored in the database)

Mouse

Keyboard

Monitor
Inkjet Printer
Extra hardware such as writable CDs or Flash Drives is needed for taking backup.

Software requirements:

124

The software requirements for the new system are very basic and are easily found
on most computers. They are:

Microsoft Access: This software is used to design the database used in the
new system. It is widely available and comes along with the Microsoft Office
package.

Microsoft Windows XP Operating System: This is one of the most common


operating systems and is found on most modern day computers.

Data structures used:


Patient Details: This stores the details of all patients treated in the hospital.
Design View

Datasheet View

125

Data Structure
Field name

Size

Data type

Description

Example

Patient ID

Number

ID of the patient is entered (Key


field)

254

Patient
Name

15

Text

Name of the patient is entered

Vishnu

Mothers
Name

15

Text

Patients mothers name is


entered

Neha

Fathers
Name

15

Text

Patients fathers name is entered

Inan

Date of
Birth

Date/Time Patients date of birth entered

9/9/1999

Sex (Male?)

Yes/No

Patients gender is entered

Male

Group

15

Text

Classifies the patient as child,


adult or senior citizen

Child

Address

25

Memo

Address of the patient is entered

99-B,
karngar,
chennai

Phone.no

10

Number

Contact details added

09879341536

126

Doctor Details: Stores the details of the doctors of the hospital.


Design View

Datasheet View

Data Structure
Field name
Doctor ID
Doctor
Name
Departmen
t
Permanent

Size
5
15

Data type
Number
Text

Description
Id of doctor entered (Key field)
Name of the doctor is entered

Example
1
Anamay

15

Text

Pediatrics

Boolean

Paid

Boolean

The department of the doctor is


entered
Does the doctor work on a
temporary basis?
Does the doctor work on a voluntary
basis?

No
Yes

127

Department Details: This stores the details of the hospitals departments


Design View

Datasheet View

128

Data Structure
Field name

Size Data type

Description

Example

Department
Name
Doctor ID
Number of
Doctors
Current Date

15

Text

5
5

Number
Number

Psychiat
ry
2
3

Date/Time

The name of the department is


entered (Key field)
Id of the doctor is entered here
The number of doctors in the
department
Stores the present date.

Number of
patients

Number

Number of patients for the


department

2/2/201
2
15

Medical History: Stores the medical history of patients


Design View

129

Datasheet view

Data structure
Field name

Size

Patient ID
Medical
history
Treatment
Records

5
25

Data
type
Number
Memo

25

Memo

Last visit

Date/Ti
me

Description

Example

Patient ID is entered here


Contains the medical history of the
patient
Previous treatments given to patient
is stored

254
Cold 2/2/2011
PCM
antibioti
c2/3/2011
6/9/2011

Visit Details Stored here

Ward details: Stores information about patients currently staying in the hospital.
Design View

130

Datasheet View

Data Structure
Field name

Size

Data type

Description

Example

Ward number

Integer

Bed number
Patient ID
Inpatient

5
5
1

Integer
Integer
Boolean

Date of
Admission

Date/Time

The ward number is entered here


(Key Field)
Bed number is entered here
ID of the patient entered here
Checks if the patient is currently
residing in the hospital.
Date of admittance of the patient

5
7
yes
6/9/201
1

Treatment details: Stores the treatment details of a patient.


Design View

131

Datasheet View

Data Structure
Field name

Size

Data type

Description

Example

Patient ID
Doctor ID
Medicine ID

5
5
5

Integer
Integer

Patient ID entered here


Doctor ID entered here
Medicine ID entered here

1
1
1

Date of
Treatment

Date/Time

Date of the treatment is entered


here

2/3/2011

Integer

Stock details: Stores the details of the medicines used by the hospital.
Design View

132

Datasheet View

Data Structure
Field name

Size

Data type

Description

Example

Medicine ID

Integer

110

Name
Quantity

15
5

Text
Integer

Medicine ID is entered (it is the


unique field that identifies the
medicine)
Name of the medicine is entered
Quantity of the medicine is entered

PCM
500

Giving out Medicines: This table holds the records of what medicine is given to
which patient (Medicine Transaction).
Design View
133

Datasheet View

Data Structure
Field name

Siz
e
Medicine ID 5

Data type

Description

Example

Integer

110

Patient ID

Integer

Amount to
be given
Remaining
stock

Integer

ID of medicine (it is the unique field that


identifies the medicine)
ID of patient (it is the unique field that
identifies the patient)
Amount of medicine to be given

Integer

Amount of medicine still in stock

250

254
4

134

Records used:
The records used are as follows.
1. Add Patient/Patient Details: once a patient is added, his/her details are stored
in the record.

135

The details are then stored in the form of a record in the Patient_Details table in
the database. As the Patient Details screen is connected to the Patient_Details
table in the database, the record can be viewed in the Patient Details screen.

136

137

2. Add Medicine/Stock, give treatment and medicine details screens: Once a


medicine or medicine stock is added, the details are stored in the record.

The details can be viewed in the Stock Details screen which is connected to the
Stock_Details table.

138

When a medicine is given to a patient, the stock levels are automatically reduced in
the database.

139

3. Doctor details screen: Doctors can be added/deleted and their details can be
viewed in this screen.

140

4. Department details screen: Departments can be added/deleted and their details


can be viewed in this screen.

141

4. Medical history and treatments: The doctor can access the patients medical
history from the patient details screen. The treatment records and the patients
medical background is shown in this screen.

The details are recorded in the database.

142

Programming algorithms:
Coding is used in the software mainly to navigate between forms and connect forms
to the tables in the database. The algorithm used in the programming is shown
below.
To show a specific form

Algorithm used:
On the event button is clicked;//When a button like Doctors is clicked
(Form name) .Show; //The Doctors form is opened
Unload me; //The current form is closed

Explanation:
When a button for example the Doctors button on the main screen is
clicked, the Doctor Details form is opened up and the Main Form is closed.

Example:
Private Sub Command7_Click()
Doctors.Show
Unload Me
End Sub

143

To navigate to the next record stored in the database

Algorithm used:
On event button is clicked; //When the Next button is clicked
Dataenvironment1.rs (Name of command) .MoveNext; /* the data
environment accesses the next record with the help of a command that is
created to connect the software to one particular table in the database */
If Dataenvironment1.rs (Name of command).EOF Then; /* An if condition is
set asking the program to check if the record is the last record in the
database. If this is true then the instruction continues in the next line.
Dataenvironment1.rs (Name of command) .MoveFirst; /* If the condition is
true then the pointer moves to the first record.
End If; //The if condition is ended.

Explanation:
When the Next button is clicked, the program checks if the record that is
being viewed is the last record. If the condition is true, then the pointer
moves to the first entry and the first entry is displayed. If the condition is
false, then the next entry stored in the database is displayed.

Example:
Private Sub Command1_Click()
DataEnvironment1. rsStock _Details.MoveNext
If DataEnvironment1. rsStock _Details.EOF Then
DataEnvironment1. rsStock _Details.MoveFirst
End If
End Sub

144

To navigate to the previous record stored in the database

Algorithm used:
On event button is clicked; //When the Previous button is clicked
Dataenvironment1.rs (Name of command) .MovePrevious; /* the data
environment accesses the previous record with the help of a command that
is created to connect the software to one particular table in the database */
If Dataenvironment1.rs (Name of command).BOF Then; /* An if condition is
set asking the program to check if the record is the first record in the
database. If this is true then the instruction continues in the next line.
Dataenvironment1.rs (Name of command) .MoveLast; /* If the condition is
true then the pointer moves to the last record.
End If; //The if condition is ended.

Explanation:
When the Previous button is clicked, the program checks if the record that
is being viewed is the first record. If the condition is true, then the pointer
moves to the last entry and the last entry is displayed. If the condition is
false, then the previous entry stored in the database is displayed.

Example:
Private Sub Command2_Click()
DataEnvironment1. rsStock _Details.MovePrevious
If DataEnvironment1. rsStock _Details.BOF Then
DataEnvironment1. rsStock _Details.MoveLast
End If
End Sub

145

To add an entry in one of the tables in the database

Algorithm used:
On event button is clicked;
Dataenvironment1.rs (Name of commamd).AddNew; /* Adds the record in
the database */

Explanation:
When the required button (the add button) is clicked, the data input in the
input screed is stored in the form of a record in the database.

Example:
Private Sub Command1_Click()
DataEnvironment1.rsPatient_Details.AddNew
End Sub

To update an entry stored in the database

Algorithm used:
On event button is clicked;
Dataenvironment1.rs (Name of commamd).Update; /* Adds the record in the
database */

Explanation:
When the edit/update button is clicked, the data present in the input boxes
is stored in the database replacing the data that was already stored in the
record.

Example:
Private Sub Command1_Click()
146

DataEnvironment1.rsMedical_History.Update
End Sub
To delete an entry stored in the database

Algorithm used:
On event button is clicked;
Dataenvironment1.rs (Name of commamd).Delete; /* Deletes the record
from the database */

Explanation:
When the delete button is clicked, the record that is currently being
displayed is deleted from the database.

Example:
Private Sub Command1_Click()
DataEnvironment1.rsPatient_Details.Delete
End Sub

147

Adding a value to an existing value in the database (Adding stock)

Algorithm used:
On event button is clicked;
Declare nam as string;
Declare p as integer with value 0;
DataEnvironment1.rs (Name of command).MoveFirst;/* The pointer is moved
to the first entry in the database*/
Input medicine name in string nam;/*An input box asks the name of the
medicine whose stock is to be added. The data is stored in string nam*/
While Not DataEnvironment1.rs (Name of command). EOF;/* While condition
set up to search for the required record*/
If nam = DataEnvironment1.rs (Name of command)(Name of field) Then;/*
An if condition is set stating that if the name of the record stored in the
given table in the database is the same as the string nam then the next
instruction is carried out.*/
Change p to 1; // If the field is found, the value of p is changed to 1 //
Call function pro;/*If the condition above is true then the function pro is
called*/
Exit program;//After the pro function is called, the program is stopped//
Else; // If the condition set is false then//
DataEnvironment1.rs (Name of command). MoveNext; /*The pointer moves
to the next record in the database*/
End While; //The while condition is ended//
If p = 0 then display message Record not found;/* If the record is not
found, the value of p will be 0. After all the records are compared with nam
148

and there is still no match, p will remain 0 and an error message will be
displayed*/
Exit;//The program is shut down//
THE FUNCTION PRO
Declare q as integer;
Input number to be added and store in q;
Dataenvironment1.rs (Name of command)(Field name) =
Dataenvironment1.rs (Name of command)(Field name) + add;/*The field in
the given record is added by the value stored in integer q*/
DataEnvironment1. Rs(Name of command).Update; /*The table is updated
and the now increased value is saved*/

Explanation:
When the button is clicked, the user is asked to type in the medicine name.
The pointer is moved to the first entry of the relevant table of the
database. The program then checks if the name that was input matches with
the name of the field. If it matches, a function is called and the program
ends. If there is no match then the pointer moves to the next record and
the process is repeated.
Once the function is called, the user is asked to input the quantity to be
added. When this is done, the quantity already in the database is added to
the quantity entered by the user. The new value is then stored and the
database is updated.

Example:
Private Sub Command1_Click()
Dim nam1 As String
DataEnvironment1. rsStock_Details.MoveFirst

149

nam1 = InputBox("Enter medicine name")


While Not DataEnvironment1. rsStock_Details.EOF
If nam1 = DataEnvironment1. rsStock_Details ("Medicine Name") Then
Call pro
p=p+1
Exit Sub
End If
DataEnvironment1. rsStock_Details.MoveNext
Wend
If p = 0 Then
Msgbox (Record not found)
End If
End Sub
THE FUNCTION PRO
Private Sub pro()
Dim q As Integer
q = InputBox("Enter the quantity to procure")
DataEnvironment1. rsStock_Details ("Stock) = DataEnvironment1.
rsStock_Details ("Stock") + q
End If
End Sub

150

Subtracting a value from an existing value in the database (Reducing stock)

The algorithm
On event button is clicked;
Declare nam as string;
Declare p as integer with value 0;
DataEnvironment1.rs (Name of command).MoveFirst;/* The pointer is moved
to the first entry in the database*/
Input medicine name in nam; // medicine name is stored in nam
While Not DataEnvironment1.rs (Name of command). EOF;/* While condition
set up to search for the required record*/
If nam = DataEnvironment1.rs (Name of command)(Name of field) Then;/*
An if condition is set stating that if the name of the record stored in the
given table in the database is the same as the string nam then the next
instruction is carried out.*/
Change value of p to 1; /* If the medicine is found, the value of p is changed
to 1*/
Call function give;/*If the condition above is true then the function give is
called*/
Exit program;//After the give function is called, the program is stopped//
Else; // If the condition set is false then//
DataEnvironment1.rs (Name of command). MoveNext; /*The pointer moves
to the next record in the database*/
End While; //The while condition is ended//
If p = 0 then display message Record not found;/* If the record is not
found, the value of p will be 0. After all the records are compared with nam
151

and there is still no match, p will remain 0 and an error message will be
displayed*/
Exit;//The program is shut down//
THE FUNCTION GIVE
Declare g, k as Integer;
Input quantity to be subtracted and store in g;
k = DataEnvironment1.rs (Name of command)(Name of field);
If (k g) < 10 Then;// Checks if difference is less than 10
Display message Stock is low. Transaction not possible;/*If the difference
is less than 10, the transaction is not possible as very little amount of the
object (the stock) will remain*/
Exit;//The program is then stopped//
Else If g > k Then;/*Checks if the amount to be deducted is greater than
the existing amount*/
Display message Error: Quantity exceeds amount in stock; /*If the
condition is true then an error message is displayed as the remaining value
will be negative*/
Exit;//The program is then stopped//
Else;
DataEnvironment1.rs (Name of command)(Name of field) =
DataEnvironment1.rs (Name of command)(Name of field) g; /*If the value
is lesser than the existing value and the difference is greater than 10 then
the transaction takes place and the value is deducted*/
End If;
DataEnvironment1.(Name of command).Update; /*The database is then
updated with the new value*/
152

Exit;

Explanation:
To reduce a value from the database, the user is asked to input the name of
the medicine. If it is found, the function give is called. If not, an error
message is displayed.
The give function is responsible for the transaction. It first checks if the
difference will be lesser than 10 as if it is lesser than 10 there will be a very
little quantity remaining. It then checks if the value to be reduced is lesser
than the original value if so, an error message is shown. If the conditions are
met then the value is deducted and the database is updated.

Example
Private Sub Command2_Click()
Dim nam As String
DataEnvironment1.rsStock_Details.MoveFirst
nam = InputBox("Enter medicine name")
While Not DataEnvironment1. rsStock_Details.EOF
If nam = DataEnvironment1. rsStock_Details ("Medicine Name") Then
p=p+1
Call give
Exit Sub
End If
DataEnvironment1. rsStock_Details.MoveNext
Wend
If p = 0 Then
153

MsgBox "Item not found"


DataEnvironment1. rsStock_Details.MoveFirst
End If
End Sub
THE FUNCTION GIVE
Private Sub give()
Dim g As Integer
g = InputBox("Quantity of Medicine")
k = DataEnvironment1. rsStock_Details ("Stock")
If (k - g) <= 10 Then
MsgBox ("It will exceed reorder level : please give less")
DataEnvironment1. rsStock_Details ("Reorder") = "Y"
DataEnvironment1. rsStock_Details.Update
Exit Sub
End If
If DataEnvironment1. rsStock_Details ("Stock") < g Or
DataEnvironment1. rsStock_Details ("Stock") <= 10 Then
MsgBox "Sorry not possible"
Exit Sub
End If
If DataEnvironment1. rsStock_Details ("Stock") <= 10 Then
MsgBox "Reorder level reached"

154

DataEnvironment1. rsStock_Details ("Reorder") = "Y"


DataEnvironment1. rsStock_Details.Update
Exit Sub
End If
DataEnvironment1. rsStock_Details ("Stock") =

DataEnvironment1.

rsStock_Details ("Stock") - g
DataEnvironment1. rsStock_Details.Update
End Sub

155

Queries used:
Queries are used in the database for the purpose of searching for records. The
queries used for the tables are given below.
In the department details table:
DESIGN VIEW

QUERY USED
SELECT [Department Details].Department_Name, [Department Details].[Doctor
ID], [Department Details].Number_of_doctors, [Department
Details].Current_date, [Department Details].Number_of_Patients
FROM [Department Details]
WHERE ((([Department Details].Department_Name)=[Enter department name?]));
WHAT THE QUERY DOES

156

When the query is run, the user is asked the name of the department to be
searched. The query then searches the department details table to find a match
and shows the specified record (see test 8 in the software testing). If the name
does not exist, nothing is shown.

In the doctor details table:


DESIGN VIEW

QUERY USED
SELECT [Doctor Details].Doctor_ID, [Doctor Details].Doctor_Name, [Doctor
Details].Department_Name, [Doctor Details].[Parmanent?], [Doctor Details].[Paid?]
FROM [Doctor Details]
WHERE ((([Doctor Details].Doctor_Name)=[Enter doctor name?]));
WHAT THE QUERY DOES
157

The user is prompted to enter the name of the doctor after which the doctors
details are shown.

In the giving out medicines table:


DESIGN VIEW

QUERY USED
SELECT [Giving out medicines].Medicine_ID AS [Giving out
medicines_Medicine_ID], [Giving out medicines].Patient_ID, [Giving out
medicines].Amount_Given, [Giving out medicines].Remaining_Stock, [Stock
Details].Medicine_ID AS [Stock Details_Medicine_ID], [Stock
Details].Medicine_Name
FROM [Stock Details] INNER JOIN [Giving out medicines] ON [Stock Details].
[Medicine_ID] = [Giving out medicines].[Medicine_ID]
WHERE ((([Stock Details].Medicine_Name)=[Enter medicine name?]));
158

WHAT THE QUERY DOES


This table does not have the field medicine name since it is very hard to
remember the ID of all the medicines, the table is connected to the stock details
table which has the field medicine name. By doing this, the medicine name can be
searched up from the stock details table. The ID of the medicine is then matched
with the medicine ID in the giving out medicines table and the details in the giving
out medicines table is displayed.

159

In the medical history table:


DESIGN VIEW

QUERY USED
SELECT [Medical History].Patient_ID AS [Medical History_Patient_ID], [Medical
History].Medical_History, [Medical History].Treatment_Records, [Medical
History].Last_Visit, [Patient Details].Patient_ID AS [Patient Details_Patient_ID],
[Patient Details].Patient_Name
FROM [Patient Details] INNER JOIN [Medical History] ON [Patient Details].
[Patient_ID] = [Medical History].[Patient_ID]
WHERE ((([Patient Details].Patient_Name)=[Enter patient name?]));
WHAT THE QUERY DOES
Since the table does not have the field Patient Name, it is connected to the table
patient details. This way, the name of the patient can be searched and the data
stored in the medical history can be accessed.
160

In the patient details table:


DESIGN VIEW

QUERY USED
SELECT [Patient Details].Patient_ID, [Patient Details].Patient_Name, [Patient
Details].Date_of_Birth, [Patient Details].[Mother's_Name], [Patient Details].
[Father's_Name], [Patient Details].Sex, [Patient Details].Group, [Patient
Details].Address, [Patient Details].Phone_Number
FROM [Patient Details]
WHERE ((([Patient Details].Patient_Name)=['ENTER PATIENT_NAME?']));
WHAT THE QUERY DOES
The user is prompted to enter the name of the patient after which the details of
the patient is shown from the patient details table.

161

In the stock details table:


DESIGN VIEW

QUERY USED
SELECT [Stock Details].Medicine_ID, [Stock Details].Medicine_Name, [Stock
Details].Quantity
FROM [Stock Details]
WHERE ((([Stock Details].Medicine_Name)=[Enter medicine name?]));
WHAT THE QUERY DOES
The user is prompted to enter the name of the medicine. The medicine is then
searched from the table and the record that matches the medicine name is
displayed.

162

In the treatment details table:


DESIGN VIEW

QUERY USED
SELECT [Treatment Details].Patient_ID AS [Treatment Details_Patient_ID],
[Treatment Details].Doctor_ID, [Treatment Details].Medicine_ID, [Treatment
Details].Date_of_Treatment, [Patient Details].Patient_ID AS [Patient
Details_Patient_ID], [Patient Details].Patient_Name
FROM [Patient Details] INNER JOIN [Treatment Details] ON [Patient Details].
[Patient_ID] = [Treatment Details].[Patient_ID]
WHERE ((([Patient Details].Patient_Name)=[Enter patient name?]));
WHAT THE QUERY DOES
The table is connected to the patient details table. This way the name of the
patient can be searched from the patient details table and the details stored in
the treatment details table can be accessed.
163

In the ward details table:


DESIGN VIEW

QUERY USED
SELECT [Ward Details].Patient_ID AS [Ward Details_Patient_ID], [Ward
Details].Ward_Number, [Ward Details].Bed_Number, [Ward Details].[Inpatient?],
[Ward Details].Date_of_Admission, [Patient Details].Patient_ID AS [Patient
Details_Patient_ID], [Patient Details].Patient_Name
FROM [Patient Details] INNER JOIN [Ward Details] ON [Patient Details].
[Patient_ID] = [Ward Details].[Patient_ID]
WHERE ((([Patient Details].Patient_Name)=[Enter patient name?]));
WHAT THE QUERY DOES
The table is connected to the patient details table. This way the name of the
patient can be searched from the patient details table and the details stored in
the ward details table can be accessed.
164

System diagrams:
Navigation in the software:
Patient
report

Help
screen
Main Menu

Add Patient

Patient details
and search
Medical
History and

Give
treatment

Add Stock

Medicine
stocks

Medicine
details

Doctors

Departmen
ts

Stock
report

Entity Relationship diagram:

165

Software overview:
Hospital
manageme
nt system
Patients

Doctors

Add Patient

Add Doctor

View
details

View
details

View
details

Search

Search

Search

Edit/Delete
record

Edit/Delete
record

Departmen
ts
Add
Department

Edit/Delete
record

Medicines

Medicin
es

Reports

Help

Stock

Add
Medicine

Add Stock

Search

View
details

Patient
report
Stock
report

Edit/Delete
record

System Maintenance
The software does not require a lot of maintenance. To ensure that loss of data is
minimal, backups should be taken regularly. Also the locations of the database must
not be changed as the location specified originally will be different from the new
location of the database. Other than that, the only maintenance required is to
ensure that all the computer hardware works properly. Entering wrong data must
be avoided as the entry will be stored in the database and a complete check of the
database can be very time consuming.

166

(2) USER MANUAL:

SOFTWARE MANUAL
Table of contents:
1. Installing the software
2

2. How to start the software


3

3. Using the software


5

4. Glossary
20

167

(1) INSTALLING THE SOFTWARE:


Installing the software is an extremely easy process. The steps for installing the
software are:

Copy the source code to the required computer

Copy the database to the required computer

Specify the location of the database in the new computer

Create an executable file on the desktop

Run the software

168

(2) HOW TO START THE SOFTWARE:


In order to open the software, double click the software icon on the desktop as
shown.

169

Once this is done, the following screen will appear. It is the main screen of the
software.

The software is now open and is ready for use.

170

(3) USING THE SOFTWARE:


Adding a patient:
To add a patient, click on the Add Patient button on the main screen. The following
screen appears.

Fill in the required details and click the Add button. The details of the patient are
now added to a database.

171

Viewing the patient details and searching a patient:


To view the patient details and search for a patient click the Search patient
button the following screen shows up.

The previous and next buttons will show the previous and next entries respectively.
As the entry shown above is the first entry, on clicking Previous, the last entry
will be shown. Similarly, when the last entry is being displayed and the Next
button is clicked, the first entry will be shown.

172

To search for a patient, type the name of the patient in the input box. A list will be
displayed with the matching names.

173

Editing/deleting a record:
To edit a record, make the changes on the record and press the Edit button. The
changes made will be stored in the database.
To delete a record, press the delete button. The record will be deleted
permanently from the database. For example on deleting Vis The next record
SAS becomes the first record.

174

Adding a department:
To add a department click the Departments button on the main screen. The
following screen appears.

Here departments can be added, department details can be viewed and records can
be added or deleted. To add a department, click the add button. On clicking the
add button, the boxes clear out and the new data input in the boxes is stored in
the database.

175

Viewing the department details and searching for a


department:
The previous and next buttons will show the previous and next entries respectively.
As the entry shown above is the first entry, on clicking Previous, the last entry
will be shown. Similarly, when the last entry is being displayed and the Next
button is clicked, the first entry will be shown.
To search for a department, type the name of the department in the input box. A
list will be displayed with the matching names shown.

Editing/deleting a record:
To edit a record, make the changes on the record and press the Edit button. The
changes made will be stored in the database.
To delete a record, press the delete button. The record will be deleted
permanently from the database.

176

Adding a doctor:
To add a doctor click the Doctors button on the main screen. The following screen
appears.

Here doctors can be added, doctor details can be viewed and records can be added
or deleted. To add a doctor, click the add button. On clicking the add button, the
boxes clear out and the new data input in the boxes is stored in the database.

177

Viewing the doctor details and searching for a doctor:


The previous and next buttons will show the previous and next entries respectively.
As the entry shown above is the first entry, on clicking Previous, the last entry
will be shown. Similarly, when the last entry is being displayed and the Next
button is clicked, the first entry will be shown.
To search for a doctor, type the name of the doctor in the input box. A list will be
displayed with the matching names shown.

Editing/deleting a record:
To edit a record, make the changes on the record and press the Edit button. The
changes made will be stored in the database.
To delete a record, press the delete button. The record will be deleted
permanently from the database.
178

Giving treatment to patients:


To give treatment to patients click on the Give Treatment button on the main
screen. The following form appears.

The medicine is typed in the first box. As the medicine is typed, a suggestion list is
shown showing medicines with similar names

Once the medicine is selected, type the quantity and press Give. The quantity
given is then reduced from the database. This transaction may not occur if the
stock level is very low (for example when only 5 of the medicines are left).

179

Adding new medicine stock:


On the main screen click the button Stock section doing this will take you to the
following screen.

Here click on the Add New Stock button. The following screen appears.

Fill in the details and click Add. If the medicine does not exist in the database, a
new medicine with the given name is created.
180

Viewing the medicine details and searching for a medicine:


On the Stock Section screen, press the Search Medicine button. The screen that
appears is as follows.

The previous and next buttons will show the previous and next entries respectively.
As the entry shown above is the first entry, on clicking Previous, the last entry
will be shown. Similarly, when the last entry is being displayed and the Next
button is clicked, the first entry will be shown.

181

To search for a medicine, type the name of the medicine in the input box. A list will
be displayed with the matching names shown.

Editing/deleting a record:
To edit a record, make the changes on the record and press the Edit button. The
changes made will be stored in the database.
To delete a record, press the delete button. The record will be deleted
permanently from the database.

182

Creating a report of exhausted medicines or medicines to


be reordered:
To create a report of the exhausted medicines or the medicines that has to be
reordered, click the button Exhausted Medicines on the main screen. On clicking
this, a report is generated.

183

Creating a patient report:


To create a patient report, click on the Create Report button on the main screen.
A report is generated showing the patient report as shown.

184

Using the help section in the software:


A help section has been provided in the software that explains how to use the
software. To go to the help section, press the Help button on the main screen.
Clicking on the help topics displays the instruction relevant to that particular topic.

185

(3) GLOSSARY:
1. Data: It is a given piece of information

2. Database: A structured collection of records that is stored in a computer

3. Desktop: This is the main screen of the computer system

4. Executable file: An application that can be directly executed to perform a


task or a group of tasks on a computer

5. Input box: An area where data is input through the keyboard

6. Record: A group of relevant data that forms a single entry in a database

7. Source code: The program code entered by the user instructing the
computer to perform a specific task.

186

(e) Evaluation

(1) DISCUSSION OF THE DEGREE OF


SUCCESS:
The new system is currently in use by the medical center and I have received a lot
of positive feedback. My client informs me that it is in many ways a better system
and time consumption has greatly reduced although the staff had taken some time
to initially get used to the system, they are now able to operate it with ease.
In order to evaluate the degree of success in matching the clients expectations, I
had prepared a questionnaire and also had an interview with my client, the head
doctor of the medical center. I also discussed the original objectives that I had
previously set up with my client and other staff of the medical center in order to
determine how well I had managed to solve the problems faced. The overall results
were quite satisfactory.
I have recorded parts of my discussions with the various hospital staff regarding
the objectives I had originally set up. As these discussions were done with a large
number of people (my client, other doctors, the nurses, the hospital administrators
etc) I have noted only the key parts of these discussions below.

187

Response of the staff and management:


Objective 1: To reduce time consumption.
General response: Although it took some time for the staff of the hospital to
adjust with the new system, it is now being used efficiently. The time of staff
members is greatly saved and the hospital is better suited to manage large
amounts of people and treat them effectively.
Conclusion: The new software has met the needs of this objective although
originally adjusting to the new system was a problem.

Objective 2: To create a third level normalized database.


As most of the staff do not know details about managing databases, I asked them
if there were any errors in record modification (editing, adding and deleting).
General response: The data can be manipulated without errors taking place.
Conclusion: The needs of this objective are met.

Objective 3: To make it compatible with most of the common operating


systems available in the market.
No discussion was held for this objective as it runs properly in the computers of
the hospital (the operating system used is Windows XP professional). I have also
tested it on the new windows operating system Windows 7 where the software
works properly.

Objective 4: To make the software user friendly and easy to use.


188

General response: Although initially there were some problems adjusting to the
new system, the software is now being used efficiently. When asked why there was
a problem initially, the response was that the design was very different to the
previous software.
Conclusion: The software takes some time for getting used to also the forms could
have been designed to be a little more attractive. However, this is not a problem
now.

Objective 5: To overcome problems faced while searching.


General response: As a searching system has been included to search the database,
this is a success.
Conclusion: The needs of this objective are met.

Objective 6: To add features for adding editing and deleting records.


General response: Records can be added, edited and deleted successfully with the
help of the software.
Conclusion: The needs of this objective are met.

Objective 7: To include a stock control feature.


General response: The stock control feature greatly improved the way things
worked. As this part was done manually and there was no way to regulate the stock
details. Previously, it was very difficult for the staff to keep track of the
medicines and at times the patient had to be sent back to the doctor as the doctor
had prescribed a medicine that had already been depleted.
Conclusion: The needs of this objective are met.

189

Objective 8: To perform calculations automatically.


This part has been checked in the module Software development, programming,
testing and implementation without errors (in the stock module). Also it seems to
be working properly as of now.

Objective 9: To organize input and output


General response: The input/output is fairly well organized due to the various input
screens. Also the output messages are generated when necessary.
Conclusion: The needs of the objective are met.

Objective 10: To develop a feature that generates reports.


General response: This is basically the same as the reports generated by the
previous software.
Conclusion: There was no actual improvement in the case of this objective.

For evidence pictures are provided with the documentation.

190

(2) USERS RESPONSE:


The staff of the hospital was interviewed extensively and the general feedback
was positive. To evaluate the response to the software, I had prepared a
questionnaire for the staff of the hospital.

The questionnaire:
1. Is there a noticeable difference between the old and new system that was
implemented?
2. Does the new system help manage crowds better?
3. As of now are there any problems faced in the working of the software?
4. Where does the software need improvement?
5. Is the software easy to use and is it fast enough when the hospital is
crowded?
The general response:
The general response was positive. There was a noticeable difference between the
old and new systems and the new system was better suited while dealing with
crowds. The software needed improvement in its design although most of the staff
said this was not a big issue.

Improvements and extensions:


The software and database system could be improved a lot more but as of now I
am satisfied with the current system. I believe the hospital is now running more
smoothly than before and many things that the hospital couldnt keep track of such
as the medicine stocks are now being properly managed.
Although overall the system performance is quite satisfactory, I think the data
analyzing part is not very efficient. For possible improvements, I have given the
191

hospital the source code as well as the actual executable file. This way I believe
the hospital can make optimum use of my software.

(f) EVIDENCE
The evidence provided consists of pictures taken when I was showing the software
to my client.
1. The hospital:

192

2. Collecting data and analysing the system used:

193

3. Interviews with the staff of the hospital:

194

S-ar putea să vă placă și