You are on page 1of 70

CLINICAL MANAGEMENT SYSTEM FOR

ORTHOPAEDIC

DIVISION

This project report is submitted in partial fulfilment of the Degree of


Bachelor of Science in Business Information Systems Special Degree of
the University of Sri Jayewardenepura.

STUDENT NAME INDEX NO REGISTRATION NO


R.ARTHIKA 11445 69432
N.NEWTON 11426 69422

Department of Information Technology


Faculty of Management Studies and Commerce
University of Sri Jayewardenepura
Gangodawila
Nugegoda

September 2016
Declaration

We do hereby declare that the work reported in this report was/were exclusively
carried out by us under the supervision of Dr (Mrs) Champa Hewagamage. It does not
contain any material previously published or written by another person or myself and
only it describes the results of our own independent work except where due reference
has been made in the text.

………………………………… ..............................................

Date Signature of the candidate

………………………………… ..............................................

Date Signature of the candidate

I endorse the declaration by the candidates.

…………………………………………… Date: ……………………………..

Supervisor,
Dr (Mrs) Champa Hewagamage
Senior Lecturer
Department of Information Technology

i
Abstract
This project report is submitted with the purpose of fulfilling the requirement for the
completion of Business Information Systems (Special) Degree of the University of Sri
Jayewardenepura, an Information Systems Application Development Project has to be
carried out at the first semester of the final year.

With the intention of delivering a complete solution for the existing system and the
manual work performed at the Colombo General Hospital (orthopaedic division), we
have selected the same hospital for the Information System Development Application
Project.

Firstly, a System Analysis was carried out for the purpose of identifying user
requirements of the proposed system. In this phase a feasibility analysis was done to
ensure that the problem is worthwhile to solve. Based on the analysis, System design
was done at different levels of data, processes and user interface design.

Then System Design was realized at the System Development by implementing the
proposed system physically, developing database, user interfaces and code. Then the
solution was tested thoroughly ensuring that the user requirements are met to the best
of possible extent.

Finally, to conclude the study under consideration, it can be recommended that the
department can replace the existing system of manual working with the proposed
system. By computerizing the working environment to resolve lack of accuracy and
difficulty to retrieval of data, more documentation cost, time consuming and over
work load of receptionist and as a future enhancement we can suggest to incorporate
web based system.

ii
Acknowledgement

We take this occasion to thank God, almighty for blessing us with his grace and
taking our Endeavour to a successful culmination. We extend our sincere and heartfelt
thanks to our esteemed supervisor, Dr (Mrs) Champa Hewagamage for providing us
with the right guidance and advice at the crucial junctures and for showing us the right
way. We extend our sincere thanks to beloved tutor Ms.JADKM Perera. We would
like to thank our department other lecturers also.

Finally, we would like to thank my peers in the Department of Information


Technology of University of Sri Jayewardenepura, for sharing their knowledge and
experience regarding the Information Systems Application Project and all the other
individuals who helped us to succeed in this endeavour.

iii
Table of Contents

Declaration ...................................................................................................................... i

Abstract ..........................................................................................................................ii

Acknowledgement ....................................................................................................... iii

Table of Contents .......................................................................................................... iv

List of Tables ................................................................................................................ vi

List of Figures ............................................................................................................... vi

1. Introduction .......................................................................................................... 1

1.1 Background of the project .................................................................................... 2

1.2 Overview of the existing system .......................................................................... 3

1.3 Proposed solution and objective ........................................................................... 5

1.4 Resource required ................................................................................................. 6

1.5 Chapter Overview ................................................................................................ 7

2. System Analysis..................................................................................................... 8

2.1 Introduction to the system analysis ...................................................................... 9

2.2 Analysis of the present system ............................................................................. 9

2.2.1 Problem Analysis ........................................................................................... 9

2.2.2 Requirement analysis for the system ........................................................... 13

2.2.2.1 Functional requirements and Non-functional requirements.................. 14

2.2.2.2 Main Modules ....................................................................................... 16

3. System Design...................................................................................................... 19

3.1 Introduction to the system design ....................................................................... 20

3.2 Data design ......................................................................................................... 21

3.3 Process design .................................................................................................... 22

3.4 User interface design .......................................................................................... 26

iv
4. System Development ........................................................................................... 27

4.1 System development Requirements ................................................................... 28

4.2 Database Development ....................................................................................... 31

4.3 Interface Development ....................................................................................... 34

5. Testing and evaluation ....................................................................................... 40

5.1 Setting up test plan ............................................................................................. 41

5.2 Test Methodology .............................................................................................. 41

5.3 Performance Evaluation ..................................................................................... 43

6. Conclusion and Future work ............................................................................. 44

6.1 Summary ............................................................................................................ 45

6.2 Achievements, Benefits and Limitations ........................................................... 45

6.3 Future Enhancement ........................................................................................... 46

References ................................................................................................................... 47

Appendices .................................................................................................................. 49

Appendix A: Data Tables ........................................................................................... 49

Appendix B: Programming Codes .............................................................................. 52

v
List of Tables

Table 1.1 Hardware Requirements................................................................................. 6


Table 1.2 Software Requirements .................................................................................. 6
Table 4.1 Data dictionary of PRMS ............................................................................ 32
Table 4.2 Data dictionary of DMS .............................................................................. 33
Table 5.1 Test Cases .................................................................................................... 42

List of Figures

Figure 3.1 ER Diagram ............................................................................................... 21


Figure 3.2 Context diagram ........................................................................................ 22
Figure 3.3 Decomposition diagram .............................................................................. 23
Figure 3.4 Level-1 DFD for patient Record Management System ............................. 24
Figure 3.5 Level-1 DFD for Drug Management System ............................................ 25
Figure 3.6 Login page .................................................................................................. 26
Figure 3.7 Home page .................................................................................................. 26
Figure 4.1 Login page .................................................................................................. 34
Figure 4.2 Home page for PRMS ................................................................................ 34
Figure 4.3 Home page for DMS .................................................................................. 35
Figure 4.4 Query doctor details .................................................................................. 35
Figure 4.5 Query drug details ...................................................................................... 36
Figure 4.6 Register new drugs ..................................................................................... 36
Figure 4.7 Query the patient details ............................................................................. 37
Figure 4.8 Add new patient .......................................................................................... 37
Figure 4.9 Enter new drugs .......................................................................................... 38
Figure 4.10 View stock details..................................................................................... 38
Figure 4.11 Clinic Schedule form ................................................................................ 39
Figure 4.12 Drug category maintenance form ............................................................. 39

vi
List of Abbreviation

CGH Colombo General Hospital


DMS Drug Management System
PRMS Patient Record Management System
No Number
OPD Out Patient Department
RAM Random Access memory
ROL Re-Order Level
GB Giga byte
GHz Giga hertz
GRN Good received note
IS Information system
HDD Hard Disk Drive

vii
viii
CHAPTER 1

1. Introduction
1.1. Background of the project
1.2. Overview of the existing system
1.3. Proposed system & objectives
1.4. Resource required
1.5. Chapter overview

1
1.1 Background of the project
Colombo General Hospital is a unique hospital in Sri Lanka in many ways such as
being the final referral centre of the country, largest hospital of Sri Lanka and the
south East Asia.

It has a bed capacity of 3404 and over 7000 dedicated health staff in providing
uninterrupted service to the whole nation. For a single given month, more than 5000
Major and Minor surgeries done.

CGH has 18 well equipped Intensive Care Units and 17 High Dependency Units
located at each major care providing sectors such as Surgical Department and Medical
Department. There are 19 surgical theatres under operation. While some operation
theatres are dedicated for certain surgical specialities, some are in operation 24 hours
per day.

In 2013 the hospital provided care for 240,000 in-ward patients and 2 million out
patients and clinic patients. CGH features many Medical sub specialities in Health
care and most of these specialities are only available at CGH.

There are many divisions in the CGH such as Diabetic clinic, Eye clinic, orthopaedic
clinic etc. But scope of our system focuses on orthopaedic division of CGH.

The hospital currently following manual based Clinical Management System that the
administration and patients have to maintain books to keep clinical information like
patient information, appointment details and prescription, surgery performed and test
details. This manual system lead to duplication and loss of data and information, lack
of security in accessing confidential data and information and lot of time consuming
in day to day clinical operations. Those problems lead to in efficiency and
ineffectiveness of the service.

In CGH orthopaedic division, there will be two types of patients. One is from
Colombo area, another one is out station patient. If it is the Colombo patient, OPD
doctor will check the patient and will do essential test and patient will be sent to the
orthopaedic division in case of any seriousness. If any seriousness found orthopaedic
doctor will admit the patient to the ward otherwise patient will be treated in a normal
manner and he will be asked to come back if any check-up will be needed.

2
In case of Colombo patients, orthopaedic division can perform various tests,
scheduling for surgery and booking operations and discharge of patient and drug
administering.

Some severe complications cannot be handled by other hospitals. If it is the case


patient will be sent to the CGH orthopaedic division. The respective hospital will
inform to the CGH.

When we having the discussion with the hospital staff and when analysing we could
identify that prevailing situation of CGH (orthopaedic division) is noticed that the
unavailability of the records of the patients is a significant drawback in the existing
system. Unavailability of the historical details of a patient will cause problems in their
subsequent reviews pertaining to a particular illness / disease. This will weaken the
ability of deciding on the treatment to be prescribed by the doctor. Simply this is an
issue area due to the lack of information which is considered as a strategic resource in
the business perspective.

1.2 Overview of the existing system


CGH (Orthopaedic Division) is a government hospital which provides medical
services to patients. In addition to medical services they provide OPD facilities, out
station patient consultancy, drug administration.

It provides a 24 hours service and it consist of 5 wards for female, male, children.
Staffs consist of 15 OPD doctors and 15 orthopaedic specialists. There are 40 nurses
and sufficient amount of minor staff.

As mentioned above the CGH (Orthopaedic Division) provides many services to


patient but for the software development purpose we have chosen patient record
management and drug management activities related to orthopaedic division as the
issue area to be resolved.

However, Orthopaedic Division is managed with conventional manual methods and


this has been impacting negatively on the effective resource utilisation and overall
efficiency of the overall hospital. The manual method of managing and administering

3
patient records and drug management activities are obviously not effective as it is
attributed to different challenges.

The orthopaedic division currently following manual based Clinical Management


System that the administration and patients are have to maintain books to keep
clinical information such as patient information, appointment details and prescription
etc. This manual system lead to duplication and loss of data and information, lack of
security in accessing confidential data and information and lot of time consuming in
day to day clinical operations. Finally those problems lead to inefficiency and
ineffectiveness of the service. Even though more patients are getting clinical service,
they use manual based system for the clinical management.

The aim of this project is develop a computer based Clinical Management System for
CGH (orthopaedic division) which is the government hospital in Colombo, Sri Lanka.

Following problems have noticed with the orthopaedic division due to the manual
way of clinical information handling:

 Time Consumption
 Less of accuracy
 Difficulties in record management
 Human errors
 Misuse of inventory
 Excessive paper work
 Data lose

4
1.3 Proposed solution and objective

The aim of this project is develop a computer based Clinical Management System for
orthopaedic division of CGH. This system focus on maintaining medical records of
patient, appointment scheduling ,keep track of symptoms, disease of patient and
medical tests performed, medicine prescription and drug administration.

Scope of our project within the total hospital system focuses on the medical aspects
within the total hospital system. This will not have any mechanism for billing and
invoicing since Colombo general hospital is a government hospital.

We will develop a computer based Clinical Management System for overcoming the
problems that are being faced by the current manual system. Objective of our project
is to eradicate the problems which are faced by current manual system and provide a
satisfactory service to the System users and also increase the efficiency and
effectiveness of the service by providing computer based Clinical Management
System.

Our new system has the main concern on reducing the waiting time of patient, when
doing above mentioned function manually, it would take considerable time. But it
would not take much time if it is done by the computer based system, further more
proposed system will reduce the data redundancy, increase the accuracy and reliability
of data and reduce the work load of the employees.

All the information will be electronically recorded and made available. As well as it
will eliminate the files carry from one place to another. Even the medical details of a
patient will be made available to doctor at any time.

The system has a unique approach to tracking information and report generation
which is vital in data handling. This makes the proposed system more robust, more
reliable and efficient. Entire scope of the system comprises of several functions for
patient Record management and drug management.

The first module of the proposed system provides solution for the difficulty faced in
the patient management. It maintains the patient basic information, appointment
scheduling, keep track of symptom, test details, prescribed medicine details and if

5
there are any seriousness found system will able to send the patient with ward request
form to the ward.

The second module of the proposed system provides solution for the difficulty faced
in the drug management in pharmacy. These modules should be able to keep track of
medicine details, supplier details, purchase order details, Give notification for the
ROL and expired dates to the pharmacist.

The objectives of this system aim to minimize the drawbacks of existing system.
 Computerize the process and the operation
 Increase the reliability and the data accuracy of the system and the procedures
 Eliminate the data redundancy
 Eliminate the data and information loss while working
 Reduce the delay in making decision due to various manual works
 Reduce the human errors and mistakes
 Ultimately increase the efficiency and effectiveness of the whole operation
and the process

1.4 Resource required


Hardware Requirements
Processor Intel Pentium IV 2.4 GH or above
Clock Speed 500MHz
Hard Disk 320 GB hard disk space
RAM 2 GB of RAM
Printer 3 inch Impact Dot Receipt Printer / Epson
FX-890 Dot Matrix Printer
Monitor SVGA COLOR
Table 1.1 Hardware Requirements

Software Requirements
Operating System Ms Windows 7, Windows XP
Front end VB.net framework
Back end SQL server management studio 2008
Other software Ms word 2007
Ms Visio 2013
Crystal Report 13.0.5 version
Table 1.2 Software Requirements

6
1.5 Chapter Overview

Chapter 1 elaborates the background of the project, overview of the existing system
proposed system & objectives and resource required.

Chapter 2 will cover the System Analysis phase of the proposed system. This will
flow through the analysis of the existing system, methodology and identified user
requirements for the proposed system.

Chapter 3 will discuss the System Design phase for the proposed system. This will
cover System Design, Data Design and Process Design and User Interface Design.

Chapter 4 will discuss the System Development phase including System


development requirement in terms of database and interface development.

Chapter 5 will discuss regarding the Testing and Evaluation of the system. This
will include test plan, test methodology and evaluation of the system.

Chapter 6 will finally discuss the Conclusion and Future Development for the
proposed system. This will summarize and, realizations of the project objectives,
limitations and future enhancements.

7
CHAPTER 2

2. System Analysis
2.1. Introduction to the system analysis
2.2. Analysis of the present system
2.2.1. Problem Analysis
2.2.2. Requirement Analysis
2.2.2.1. Functional & Non-functional Requirements
2.2.2.2. Main Modules

8
2.1 Introduction to the system analysis
System analysis is the most important stage in developing system. Systems analysis is
a process of collecting factual data, understanding the processes involved, identifying
problems and recommending feasible suggestions for improving the functionality of
the system. This involves studying the business processes, entity relationships
gathering operational data, understand the information flow, finding out bottlenecks
and evolving solutions for overcoming the weaknesses of the existing system so as to
achieve the organizational goals in an effective and efficient manner. System Analysis
also includes decoupling of complex processes that make up the entire system,
identification of data store and manual processes to build complex system easily.

Studying of business problems, recommending improvements and specifying of


business requirements as a solution is carried out in the system analysis stage. At
beginning it is expected to understand the existing system and the operation of the
orthopaedic division of CGH, latter a suitable solution is proposed to replace the
existing system.

Therefore this chapter explains the analysis of the present system and describes the
requirements for the proposed System. Further it analyses the data requirements and
the process modelling for the entire solution with the support of software tools.

2.2 Analysis of the present system

2.2.1 Problem Analysis


Most of the patient comes from the direct recommendation of the OPD to the
orthopaedic division. Each and every patient who comes to the orthopaedic division
should register him/herself in the counter as the orthopaedic patient.

Currently patient record maintenance is running manually. Hospital Management


maintains the patient details, appointment details in the paper files and these are being
written manually every day. So it causes inefficiency in their operation.

9
Based on the collected details through conversation, it has been noted that hospital
receptionist look-up the patient files for the patients who came before and get the
relevant details and if it is new patient, Receptionist write the details in a file and
issue a doctor appointment form, So it consumes time and causes delay in writing and
retrieving the details of patient, until the receptionist complete this task patient has to
wait about 2-3 minutes whereas new patient has to wait 4-5 minutes based on the
observation, Paper files are stored in a store room due to this receptionist undergoes
pressure by handling the manual work such as patient details recording and so on.

Patient visits to the hospital with disease. There are multiple symptoms can be
identified for one disease, one or more test can be performed, multiple medication can
be prescribed. If the each patient has severe disease which could not be cured using
medicine prescription, that patient will be admitted to the ward.

There is no mechanism to record the symptoms identified for each patient. So this will
reduce the doctor’s ability to identify the actual disease quickly. Based on the
conversation, he said that particular patient will visit to the hospital with multiple
symptoms which is the cause of one particular disease. Most of the time, doctor will
not be able to identify the disease in the first visit of patient. The patient should come
for the continuous consultation and based on the analysis of observed symptom he/she
will finalize the disease. Therefore there should be a mechanism to keep track of the
symptom identified for each patient. Because non availability of symptom detail
reduce the doctor’s ability to identify the disease quickly.

Once the doctor examines the patient with symptom if he/she is not clear about the
disease he/she will suggest the patient to do some test. In the present context, the test
performed to each person is manually recorded in files. If the doctor wants to review
them he/she should refer many files as well as many records. At the same time there is
no mechanism available to them to see the test result once the patient loss the test
report. It will make the doctor to prescribe the test again and patient will give the
sample again and print the test report again. It will make the system to be very slow
and less efficient. Therefore there should be proper and systematic way to record all
the test result where the doctor can be viewed that even though patient has lost the test
report.

10
After the patient has been examined with the symptoms and test reports, doctor will
prescribe the medicine. For each patient there are multiple medicines can be
prescribed and one medicine can be prescribed multiple patients. There are no records
available to keep track of the medicine prescribed to each patient. It reduces the
doctor’s ability to prescribe medicine due to the non-availability of the medicine
which has been already prescribed for each patient.

Based on the conversation with the doctor, he told that most of the doctor prescribes
generic medicine and the pharmacy will provide the brand available in the prescribed
generic medicine.

If the patient has any severe disease/symptom he/she will be admitted to the ward.
There are 5 wards each ward consist of 14 beds. In this case doctor will give the ward
request form and the patient will be allocated to the ward. Sometimes doctor may
allocate the occupied beds for the patient. This will make some conflicts between
patients and the head-nurse of the ward and this will consumes massive amount of
time as well.

It is really difficult for the newly practicing pharmacist to identify whether the doctor
prescribes generic or brand name of drug. There are no ways to show the pharmacist
the generics and brands under a generic name. Purchase order placing and receiving
the ordered stocks with GRN are manually recorded with the supplier details.
Prescribed medicines are entered in the Issue Register and at the end of month they
are deducted from total stock available and pharmacist will assess for the ROL. There
are huge mismatches between physical stock available and the stock availability based
on the ledgers.

Some medicine becomes out of stocks quickly without pharmacist knowledge because
there are no automatic ROL assessment system. At the same time the orthopaedic
division as a whole is not be in the position to satisfy the customer needs in a timely
manner.

Pharmacist must perform monthly review to identify the expired medicine since there
is no mechanism to notify the expired stocks.

11
Current system has many drawbacks and issues. The identified issues are as
follow:

 Time Consumption
It takes too much time to write the patient details to give registration No at the counter
and it take much time for doctors to write the medicine prescription, test prescription
due to the non-availability of previous information.

 Less of accuracy
Manual system might result measurement, calculation and specification errors and
non-conformance to standards.

 Difficulties in record management


Current system causes Data redundancy, difficulty in data update, difficulty in data
recovery, difficulties in generating information, vulnerability to manipulations/human
error.
 Human errors
Human errors have been cited as primary or contributing factor to the inefficiency of
the systems. Current system involves too much human intervention which leads to
high number of errors and mistakes in the process.

 Misuse of inventory
Timely updating of inventory register is not taking place in the current system
regarding drugs as results the possibility of misuse of inventory happens in the
pharmacy.

 Excessive paper work


From Patient registration to drug issuing, all the activities are being done manually,
therefore over time, handling of the paper files becomes cumbersome and untidy.
 Data lose
Some information may be missed or omitted intentionally or unintentionally, this will
lead to data and information loss without getting accurate summary details

12
2.2.2 Requirement analysis for the system

Requirement Analysis is careful assessment of the needs that a system should fulfil. It
should include requirements of the system based on current and foreseen conditions
which maybe internal operations or external market. Further it should contain details
of the features which will satisfy the stakeholder expectations. In addition it includes
how the system is to be constructed.

According to scope of our project administration of the CGL (orthopaedic division),


we have identified four user level such as Receptionist, doctor, lab-Assistant,
pharmacist and administrator level.

Receptionist level

He/she is the person who maintains the patient details and register new patient. As
well as he/she will be able to appoint the doctor based on the patient requirement at
the required date. At the end he/she should be able to print Doctor Appointment form
to the patient.

Doctor Level

Doctor will be able to see the patient history including patient personal details, patient
appointment detail, patient diagnosis details and medicine prescription to know the
current health condition of the patient. After that he/she will deal with doctor
channelling where doctor will add the basic medical information such as pulse rate,
temperature, blood pressure. Finally Doctor will issue medicine prescription, test
prescription if required. If any seriousness found, doctor will admit the patient to the
ward.

Lab-Assistant

Lab-Assistant will perform the test based on the test prescription issued by the doctor
and he/she will print the test report.

13
Pharmacist

Pharmacist plays a main role to manage the drug in the orthopaedic division. He/she
will order for drugs from various suppliers such as osu-sala. And he/she will add them
to the inventory. Based on the medicine prescription he/she will issue medicine. At
the end of each month, he/she assess for ROL, Expired drugs. If necessary he/she will
reorder the drugs based on the requirement.

Administrator level

He/she will be able to handle the login system and has the full access of the system.

2.2.2.1 Functional requirements and Non-functional requirements

Functional requirements

Functional requirements refers to the functionality that the system is expected to have
while Non-functional requirements define the overall qualities or attributes of the
resulting system. Non-functional requirements place restrictions on the product being
developed, the development process, and specify external constraints that the product
must meet.

Patient Record Management system

 Patient detail maintenance

 Appointment scheduling

 Keep track of symptoms

 Keep track of the prescribed medicine for each patient

 Test prescription & keep track of the test performed with test results

 Allocate ward and bed to patient

 Report generation

14
Drug Management System

 Keep track of all drugs available.

 Keep track of all suppliers

 Place the order.

 Record on drug received.

 Issue of drugs

 Return the expired drugs

 Assess the ROL of the drugs

Non-functional requirements

Non-functional requirements are not directly concerned with the specific functions
delivered by the system.

 Accessibility

Proposed system will be accessible by the intended users for the intended purpose.

 Extensibility

In future it is potential to in- patient module become as an integrated module in the


system, further it is expected to develop as a web based system.

 Maintainability

This system will ensure following,


   Correct defects or their cause

   Prevent unexpected breakdowns

   Maximize efficiency, reliability, and safety

   Meet new requirements,

   Make future maintenance easier

Cope with a changed environment

15
 Security

For this purpose we have created a user name and password protection for all staff to
enter the proposed system. It will keep the data confidentiality of the patients and
other staff details. And it will show the functions which is allowed for the particular
user groups.

E.g. Pharmacist will not be able to see symptom details of the patient.

 User friendly
The system also modified according to their requirement. It is very much user friendly
to them because their requirement is included in the system design and will be
efficient in data handling.

2.2.2.2 Main Modules

 Patient Record management system

 Patient detail maintenance

 Allow the receptionist to register new patient and assign patient


registration no
 Allow to update, delete the existing patient details.
 Allow to check whether patient has already registered.
 Appointment Scheduling
 Show the doctor schedule and the already appointed patient for
that doctor.
 If appointments are available, this will allow the receptionist to
appoint the doctor.
 Print doctor appointment form

16
 Keep track of the symptom

 Allow doctor to choose the symptom from the pre-defined list


rather typing

 Allow to save all the symptom of the patient.

 Allow the doctor to add if any further symptom identified.

 Keep track of the prescribed medicine for each patient

 Allow the doctors to save the medicine prescribed for each


patient and add, delete update the prescribed medicine details

 Print the medicine prescription.

 Test prescription & keep track of the test performed with test
results

 Allow the doctor to print Test prescription and save the details
about the prescribed test details

 Test result of the patient also made available and based on this
the system will able to print the test report.

 Allocate ward and bed to patient

 Allow to provide the details about which beds are unoccupied


in a ward
 Print the ward request form for the admission.

 Report Generation

E.g. Symptom identified for particular patient over a period

Test performed by each patient over a period

17
 Drug management System

 Keep track of all drugs available


 It will electronically store all the drugs available in the store and
this will allow the pharmacist to add, delete, and update the drug
details.

 Keep track of all suppliers


 It will electronically store all the supplier details and this will allow
the pharmacist to add, delete, and update the drug details.

 Place the order.


 According to the selected suppliers purchase order should be able
to place by specifying the drug name, drug code, quantity, supplier
code. Add the order details, delete, and update the records also will
be done.

 Record on drug received.


 When supplier sends drugs to the stores it should update the
inventory levels.

 Issue of drugs
 Medicine is issued based on the prescription from the patient. Once
the pharmacist issues the medicine it should reduce the stock as
well.

 Return the expired drugs


 Expired drugs are returned the expired drugs returned and system
should give the notification. Inventory will be physically sent to
supplier. System should able to update the record of stock
available.

 Assess the ROL of the drugs


 If the drugs have been reached to the predefined ROL it should
give the automatic notification to the pharmacist to reorder the
drugs.

18
CHAPTER 3

3. System Design
3.1. Introduction to the system design
3.2. Data design
3.3. Process design
3.4. User interface design

19
3.1 Introduction to the system design

System design is an attempt towards creation of a new system. This phase focuses on
the detailed implementation of the system. System design has two phases: logical
design and physical design.

During logical design phase, we describe inputs (sources), outputs (destinations),


databases (data sores) and procedures (data flows) all in a format that meets the uses
requirements and also specifies the user needs and at a level that virtually determines
the information flow into and out of the system and the data resources. Hence, the
logical design is done through data flow diagrams and database design.

The logical design is followed by physical design or coding. Physical design produces
the working system by defining the design specifications, which tell the programmers
exactly what the candidate system must do. Then we wrote necessary programs that
accept input from the user, perform necessary processing on accepted data through
call and produce the required report on a hard copy or display it on the screen.

System design is the specification or construction of a technical solution in digital


visual format for the business requirements identified in the requirement gathering
and system analysis process in the inception phase.

20
3.2 Data design
ERD for clinical management system of orthopedic division

Appoinment
Patient
PK AppointmentNo
PK patient_RegNo TestPrescription
dateOfAppointment
title PK TestPrescNo
disease has
firstName dateOfTestPerformed
doctorComments
has
lastName has Comments
FK patient_RegNo Test
gender FK TestCode
can be admitted FK DoctorCode PK TestCode
has
age has
FK DoctorCode
TestName
telNo

guardianName
Prescription

PatientAdmission PK PrescriptionNo

PK AdmissionNo
dateOfPrescription
Appoinment_symtom
FK patient_RegNo symtom
FK medicineNo
Doctor PK FK AppointmentNo
dateOfAdmission has PK symtomNo
quantity
PK DoctorCode PK FK symtomNo
dischargeDate frequency symtomName

FK wardNo FullName
comments
admit
FK DoctorCode Address
FK AppointmentNo
has
TelNo

email
Medicine Order
qualification
PK medicineNo PK OrderNo

medicineName dateOfOrder
Ward
has
strenth quantityOrdered
PK wardNo has
route has FK SupplierNo
wardName supply
form FK medicineNo
Supplier
stock status
PK SupplierNo
ROL Order_Medicine

SupplierName PK FK OrderNo
FK SupplierNo

Address PK FK medicineNo

contactNo

Figure 3.1 ER Diagram

21
3.3 Process design

Context diagram for clinical Management System of orthopedic division

Patient Detail
Patient Symptom detail

ROL notification
0 Expired medicine detail
Appointment
Clinical Management
form Ordered medicine detail
System
Medicine Prescription
Test prescription
Ward request form

Supplier Detail Supplier


Medicine details

Figure 3.2 Context diagram

22
Decomposition diagram of clinical management System orthopedic division

Figure 3.3 Decomposition diagram

23
Level-1 DFD for patient Record Management System of orthopedic division

1.1 Patient DS-1


Patient Detail Register the patient Patient_Files
Patient Detail & Patient_RegNo
Patient_RegNo & Assign
Patient_RegNo
DS-2
Doctor Details Doctor_Files
1.2
Appointment Patient Detail
Appoint the Doctor
Form Appointment Details DS-3
& Print Appointment
form Appointment_Files

DS-4
1.3 Symptom Detail Symptom_Files
Check the patient &
Examine Patient Appointment Details
Symptom
Ward request form
symptom
details
Test prescription 1.4 DS-5
Add requirement for test
Test prescription
test & Generate Test Detail
Files
prescription

1.5
Medicine Prescription Check the patient
Serious disease
with symptoms
DS-6
Patient admission Admitted_patient
files Details 1.6
Record & Admit the
patient to the ward
DS-7
Prescription
Normal Disease
1.7
Print and prescribe Prescribed
Medicine Prescription Medicine details

Figure 3.4 Level-1 DFD for patient Record Management System

24
Level-1 DFD for Drug Management System of orthopedic division

Supplier details DS-1


2.1
supplier Supplier & medicine details Supplier
Register the supplier details
Files
supplier &
medicine medicine details

Re-Ordered medicine details 2.2


Check for the ROL & Medicine &Stock level details
DS-3 Ordered medicine place the order
Order files Details
DS-2
Issued medicine details
2.3 Medicine
Ordered medicine Receive ordered Updated Medicine detail files
medicine

Patient prescription details 2.4


Issue medicine
prescribed
Returned medicine
details
2.5
Check and send Expired medicine details
expired medicine

Figure 3.5 Level-1 DFD for Drug Management System

25
3.4 User interface design

Figure 3.6 Login page

Figure 3.7 Home page

26
CHAPTER 4

4. System Development
4.1. System development Requirements
4.2. Database Development
4.3. Interface development

27
4.1 System development Requirements
The process of creating and maintaining information systems is called system
development. This diagram shows system development involves five components of
an information system. In addition to technical knowledge, it requires business
knowledge and management skills also.

We have identified the hardware requirements specifically in Chapter 1.Software


requirements for system development is focused in this chapter detail. In order to
develop the software a programming platform or language is needed. We chose
Visual Studio and Visual Basic.NET.

Microsoft Visual Studio

Microsoft Visual Studio is an integrated development environment (IDE) from


Microsoft. It is used to develop computer programs for Microsoft Windows, as well
as web sites, web applications and web services. Visual Studio uses Microsoft
software development platforms such as Windows API, Windows Forms, Windows
Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce
both native code and managed code.

Visual Studio includes a code editor supporting IntelliSense (the code completion
component) as well as code refactoring. The integrated debugger works both as a
source-level debugger and a machine-level debugger. Other built-in tools include a
forms designer for building GUI applications, web designer, class designer, and
database schema designer. It accepts plug-ins that enhance the functionality at almost

28
every level—including adding support for source-control systems (like Subversion)
and adding new toolsets like editors and visual designers for domain-specific
languages or toolsets for other aspects of the software development lifecycle (like the
Team Foundation Server client: Team Explorer).
Visual Studio supports different programming languages and allows the code editor
and debugger to support (to varying degrees) nearly any programming language,
provided a language-specific service exists. Built-in languages include C, C++ and
C++/CLI (via Visual C++), VB.NET (via Visual Basic .NET), C# (via Visual C#),
and F# (as of Visual Studio 2010). Support for other languages such as Python, and
Ruby among others is available via language services installed separately. It also
supports XML/XSLT, HTML/XHTML, JavaScript and CSS. Java (and J#) were
supported in the past.

Most of Visual Studio editions are commercial; the only exceptions are Visual Studio
Express and Visual Studio Community which are freeware. In addition, .NET
Framework SDK includes a freeware command-line compiler called vbc.exe. Mono
also includes a command-line VB.NET compiler. We have chosen Visual Studio
Express as it is free version.

Visual Basic .NET

Visual Basic .NET (VB.NET) is a multi-paradigm, high level programming language,


implemented on the .NET Framework. Microsoft launched VB.NET in 2002 as the
successor to its original Visual Basic language. Although the ".NET" portion was
dropped in 2005, this article uses "Visual Basic .NET" to refer to all Visual Basic
languages releases since 2002, in order to distinguish between them and the classic
Visual Basic. Along with Visual C#, it is one of the two main languages targeting the
.NET framework. Microsoft's integrated development environment (IDE) for
developing in Visual Basic .NET language is Visual Studio.

29
Monitor - SCGA COLOR

Short for Super VGA, a set of graphics standards designed to offer


greater resolution than VGA. SVGA supports 800 x 600 resolution, or 480,000 pixels.
The SVGA standard supports a palette of 16 million colors, but the number of colors
that can be displayed simultaneously is limited by the amount of
video memory installed in a system. One SVGA system might display only 256
simultaneous colors while another displays the entire palette of 16 million colors. The
SVGA standards are developed by a consortium of monitor and graphics
manufacturers called VESA.

Processor- Intel Pentium IV


Pentium 4 was a line of single-core central processing units (CPUs)
for desktops, laptops and entry-level servers introduced by Intel on November 20,
2000and shipped through August 8, 2008. They had a seventh-generation x86 (32-bit)
microarchitecture, called Net Burst, which was the company's first all-new design
since the introduction of the P6 microarchitecture of the Pentium Pro CPUs in 1995.
Net Burst differed from P6 (Pentium III, II, etc.) by featuring a very deep instruction
pipeline to achieve very high clock speeds. Intel claimed that Net Burst would allow
clock speeds of up to 10 GHz in future chips; however, severe problems with heat
dissipation (especially with the Prescott Pentium 4) limited CPU clock speeds to a
much lower 3.8 GHz.In 2004, the initial 32-bit x86 instruction set of the Pentium
4 microprocessors was extended by the 64-bit x86-64 set.

HDD

A hard disk drive (HDD), hard disk, hard drive or fixed disk is a data storage
device used for storing and retrieving digital information using one or more rigid
rapidly rotating disks (platters) coated with magnetic material. The platters are paired
with magnetic arranged on a moving actuator arm, which read and write data to the
platter surfaces. Data is accessed in a random manner, meaning that
individual blocks of data can be stored or retrieved in any order and not
only sequentially. HDDs are a type of non-volatile memory, retaining stored data even
when powered off.
The primary characteristics of an HDD are its capacity and performance. Capacity is
specified in unit prefixes corresponding to powers of 1000: a 1-terabyte (TB) drive
has a capacity of 1,000 gigabytes (GB; where 1 gigabyte = 1 billion bytes). Typically,

30
some of an HDD's capacity is unavailable to the user because it is used by the file
system and the computer operating system, and possibly inbuilt redundancy for error
correction and recovery. Performance is specified by the time required to move the
heads to a track or cylinder (average access time) plus the time it takes for the desired
sector to move under the head (average latency, which is a function of the
physical rotational speed in revolutions per minute), and finally the speed at which the
data is transmitted (data rate).

4.2 Database Development

SQL Server 2008 was used to develop the database of our system, the most popular
SQL database management system. This is a relational database management system
developed by Microsoft as database server. It is a software product with the primary
function of storing and retrieving data as requested by other software application-
which may run on the same computer or on other computer across a network
(including the internet).

31
Data dictionary of patient Record management system

Field Data type Description


Patient_RegNo Int(10) Unique no for each patient
Title Varchar(10) Tile of the patient (Mr/Miss/Mrs)
First name Varchar(30) First name of the patient
Last name Varchar(30) Last name of the patient
Gender Varchar(10) Gender of the patient (male/female)
Age Int(10) Age of the patient today
TelNo Int(10) Telephone no of each patient
Guardian_Name Varchar(30) Guardian /parents name
Appointment_No Int(10) Unique no for each appointment taken
dateOfAppoinment date Date in which appointment has taken
place
doctorComments Varchar(100) comments given by doctor for the
appointment
DoctorCode Int(10) Unique no for each doctor
TestCode Int(10) Unique no for each test
TestName Varchar(10) Name of test available within the
orthopaedic division
AdmissionNo Int(10) Unique no for each patient admission to
ward
dateOfAdmission date Date in which admission has taken place
Dischargedate date Date in which patient should discharged
wardNo Int(10) Unique no for each ward
WardName Varchar(30) Name of the wards
prescriptionNo Int(10) Unique no for each prescribed medicine
dateofPrescription date Date in which prescription issued
Quantity Int(5) Quantity of medicine for each
time(morning /evening /night)

Table 4.1 Data dictionary of PRMS

32
Data dictionary of Drug management system

Field Data type Description

medicineNo Int(10) Unique no for each medicine

medicineName Varchar(30) Name of each medicine

Strength Varchar(10) Strength of each medicine (50g/25g)

Route Varchar(15) How to insert the medicine into body


(through mouth or etc)
Form Varchar(15) Whether the medicine is in the form of
injection / pills /capsule etc
Stock Int(15) Stock available to each medicine

ROL Int(15) Predefined ROL for each medicine

supplierNo Int(10) Unique no for each supplier

Suppliername Varchar(15) Name of the supplier

contactNo Varchar(10) Contact no of the supplier

Address Varchar(15) Address of the supplier

orderNo Int(10) Unique no for each order

dateofOrder date Date of order placed

quantityOrdered Int(10) Quantity medicine ordered

Status Varchar(15) Whether order is received or not

Table 4.2 Data dictionary of DMS

33
4.3 Interface Development
For development of interfaces also Visual Basic.Net is used

Figure 4.1 Login page

Figure 4.2 Home page for PRMS

34
Figure 4.3 Home page for DMS

Figure 4.4 Query doctor details

35
Figure 4.5 Query drug details

Figure 4.6 Register new drugs

36
Figure 4.7 Query the patient details

Figure 4.8 Add new patient

37
Figure 4.9 Enter new drugs

Figure 4.10 View stock details

38
Figure 4.11 Clinic Schedule form

Figure 4.12 Drug category maintenance form

39
CHAPTER 5

5. Testing and evaluation


5.1. Setting up test plan
5.2. Test Methodology
5.3. Performance Evaluation

40
5.1 Setting up test plan
Testing is done in order to align the product with the user. The functionalities and
functions are tested in order to improve the quality of the product and improve the
functionalities of the product too. The testing plan defines the items to be tested and
the functions are selected bases on the importance of the functions, and the risk of the
functions on the users view point.

Testing was done as part of the development process, and not at the end of the whole
process. Testing should be done throughout the development process not at the end.
Because changes in the interface design and process of interface navigations are
difficult at the end. The test cases were designed corresponding with the data flow and
level zero diagram descriptions. They were executed manually and the results were
recorded. The bugs identified were corrected and tested again.

5.2 Test Methodology


Under these testing approaches four main test types have been used to test this
system.
 Concept testing – concept testing is used to check the compatibility of the
concepts used in the system and the concepts in the actual business process.

 Unit testing – This type of testing has used white box testing approach to test
each and every critical units (i.e. functions, algorithms, etc...) built in the
system individually.

 Integration testing - After integrating the components together which are


tested using the unit testing the entire integrated component is tested again.
Both black box and white box testing approaches have used for this testing
type.

 Interface testing – Interface testing has used to test each and every
component in the GUIs against their intended purpose.
In the testing process of this system both black box testing and white box testing have
been used. White box testing is mostly carried out while the coding is taking place.
Each statement, conditions and decision structures test soon after finishing the coded.

41
The purpose of using white box testing for this system is that White box testing
enables to identify the small bugs that could be created by the mistakes of coding and
due to the errors in the decision logics, and it enables the developers to prevent those
errors before integrating the recently developed contents together with the system.
Black box testing has used once after a particular functionality is completed
A set of random values used for the testing and the errors and bugs which are
generated is identifies and fixed. The number of defects that is uncovered by the test
cases and test data is decrease gradually with the number of testing iterations
performed. In the initial iterations large number of bugs uncovered and most of those
errors are moderate interims of the importance. The causes of these defects could be
identified by using white box testing

1.0 User Login

ID User Name Input Expected Output Status


1.1 Get Username, Retrieve Pass
username
password username and
and
password. password
1.2 Validate and Username, Display error Pass
verify username password
message if the
and password
username or
password is
invalid or empty
1.3 Give Designation Identify the user Pass
authentication
type and
customize the
page according
to the user

Table 5.1 Test Cases

42
5.3 Performance Evaluation
Performance evaluation was done using sample test cases for certain functions as
follows. Through this testing and evaluation process we could identify the issue in the
system and could evaluated each of the module’s performance based on its testing
process. Also the performance of each module was evaluated how fast we can retrieve
the information from the database and how effective and efficient the modules to do
certain function.

Several corrections were made in the results processing and report generating in the
results module based on the test results of the tests carried out at each modules at the
unit testing level. In the other levels the system has performed as intended by
fulfilling the identified requirements of the users.

43
CHAPTER 6

6. Conclusion and Future work


6.1. Summary
6.2. Achievements, Benefits and Limitations
6.3. Future enhancements

44
6.1 Summary
We could observe a high demand among hospital for the hospital facilities and other
hospital services in order get the maximum benefit of available resources. Information
system plays major role in all aspect of the organization, especially in the orthopaedic
division of CGH, it is one of the major ways to increase the effectiveness and the
efficiency of any process or operation. Orthopaedic division is a major department in
the every hospital which provides many services, typically the entire process are done
manually which results more inefficiency in the operation, as such it was required to
establish an IS to manage and control the operation through which it is expected to
achieve the desired goals of the entire project.

6.2 Achievements, Benefits and Limitations


There are set of objectives mentioned in the chapter1 under the aims and objectives to
achieve other than the functional and non-functional requirements of the system.
Followings are the justification of the achievement of those aims and objectives.

 Computerized system

Two main functions (PRMS,DMS functions) of the orthopaedic division of CGH is


computerized and the manual works are eliminated and manual record maintenance
are reduced, more time taking process and time delay are eliminated therefore
Information is more reliable and the human errors and the mistakes are reduced.

 Manage and Share Information

System provides the user accounts for the employees who are involved in the system
to maintain their information by creating their own profiles/user accounts. And also
information sharing is much easier.

45
 Data redundancy and Data loss is avoided

Data redundancy and the data loss due to manual works are eliminated and avoided by
having the strong database environment with SQL Server 2008 and also Information
retrieval is also much easier.

Limitation
There are not more limitations in this system as all the functions and the operations
are performed with the automated environment but the real implementation of the
system is not assured.

6.3 Future Enhancement


The system has been developed to satisfy all the requirements of the client. The
proposed system can be enhanced by adding more features, which would increase the
interaction with the users. Enhancements that can be made in the future are suggested
below.

 The can be developed as web based system using which patient can be able to
register, schedule the appointment via online. This will reduce the workload of
the employees as well.

 Many other modules can be integrated such as OPD, other clinical modules
such as diabetic clinic, Eye clinic etc. to serve the all requirements of overall
CGH.

46
References
https://en.wikipedia.org/wiki/Microsoft_SQL_Server#SQL_Server_2008

https://www.youtube.com/watch?v=tcmmCcMs8yU

https://www.youtube.com/watch?v=3l6bciTAC7Q

https://www.youtube.com/watch?v=eOYZpYtLs9Y

https://www.google.lk/search?hl=en&site=imghp&tbm=isch&source=hp&biw=1366&bih=66
7&q=hospital+icon&oq=hospital+icon&gs_l=img.3..0l10.1305.6053.0.7419.13.9.0.4.4.0.180.
1313.0j9.9.0....0...1ac.1.64.img..0.13.1337.kAcuAqBZlTA#hl=en&tbm=isch&q=hospital+ico
n.icon+file&imgrc=mvBBSg2hUXaGbM%3A

https://msdn.microsoft.com/enus/library/system.data.sqlclient.sqlconnection%28v=vs.
110%29.aspx

https://www.youtube.com/results?search_query=sql+connection+vb

https://www.youtube.com/watch?v=TpKcAmaaBts

https://www.youtube.com/watch?v=kbWjjKJ-mPI

https://www.youtube.com/watch?v=hvSvEXxVCFA

https://www.youtube.com/watch?v=qPqLUxAUvXM

https://www.youtube.com/watch?v=hBBmYnIT5XI

http://www.a1vbcode.com/app-5890.asp

http://www.a1vbcode.com/app-5890.asp

https://www.youtube.com/watch?v=t8yxq7gBRKg

https://www.youtube.com/watch?v=zKaK29Y44jQ

http://searchsoftwarequality.techtarget.com/definition/systems-development-life-cycle

https://en.wikipedia.org/wiki/Visual_Basic_.NET

47
https://www.daniweb.com/programming/software-
development/threads/437537/background-image-in-vb-net-form
http://www.webopedia.com/TERM/S/SVGA.html
https://en.wikipedia.org/wiki/Hard_disk_drive

48
Appendices

Appendix A: Data Tables

49
50
51
Appendix B: Programming Codes
Database Connection

Imports System
Imports System.IO
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports System.Web

Public Class SqlConn


Public SQLCon As New SqlConnection With {.ConnectionString = "Data
Source=SONY-PC\SQLSERVER;Initial Catalog=HOS0101T;Integrated
Security=True"}
Public SQLCmd As New SqlCommand
Public SQLDA As New SqlDataAdapter
Public Builder As New SqlCommandBuilder
Public SQLDS As New DataSet
Public Params As New List(Of SqlParameter)
Public RecordCount As Integer
Public Exception As String
Public Param As New List(Of SqlParameter)

Public Function HasConnection() As Boolean

Try
SQLCon.Open()

SQLCon.Close()
Return True
Catch ex As Exception
MsgBox(ex.Message)
Return False
End Try
End Function

Public Sub RunQuery(Query As String)


'RESET QUERY STATISTICS
RecordCount = 0
Exception = ""

Try
SQLCon.Open()
'CREATE COMMAND
SQLCmd = New SqlCommand(Query, SQLCon)
'FILL DATASET
SQLDA = New SqlDataAdapter(SQLCmd)

52
SQLDS = New DataSet
RecordCount = SQLDA.Fill(SQLDS)

'LOAD PARAMETERS INTO SQL COMMAND


Param.ForEach(Sub(p) SQLCmd.Parameters.Add(p))
'clear parameter list
Param.Clear()

SQLCon.Close()

Catch ex As Exception
MsgBox(ex.Message)

End Try
'MAKE SURE CONNECTION IS CLOSED
If SQLCon.State = ConnectionState.Open Then
SQLCon.Close()
End If
End Sub

Public Sub AddParam(Name As String, value As Object)


Dim NewParam As New SqlParameter(Name, value)
Param.Add(NewParam)
End Sub
End Class

53
DisplayPatientlFrm Class

Imports Microsoft.VisualBasic
Public Class DisplayPatientlFrm

Private SQL As New SqlConn


Private SQLManger As New SQLDbManager

Dim patientstatus As String


Dim uname As String

Public Sub CreatePatient()


SQLManger.AddPatient(txtPatientRegNo.Text, txtTitle.Text, txtFirstName.Text,
txtMiddleName.Text, txtFLastName.Text, txtFullName.Text, CombocountyCode.Text,
CombxIDtype.Text, txtNicNo.Text, DatetimeBdate.Text.ToString, CombXPatienttYPE.Text,
txtage.Text, DtpRegdate.Text.ToString, txtProfession.Text, CombxGender.Text,
txtAddress.Text, CombxPstatus.Text, txtTelNo.Text, uname)
End Sub

Private Sub BtnUpdate_Click(sender As Object, e As EventArgs) Handles


BtnUpdate.Click
Dim UpdateCmd As String = "UPDATE M01_PATIENT SET PATIENT_REG_NO='"
& txtPatientRegNo.Text & "', TITLE='" & txtTitle.Text & "',FIRST_NAME='" &
txtFirstName.Text & "',LAST_NAME='" & txtFLastName.Text & "',MIDDLE_NAME='" &
txtMiddleName.Text & "',FULL_NAME='" & txtFullName.Text & "', COUNTRY_CODE='"
& CombocountyCode.Text & "',ID_TYPE='" & CombxIDtype.Text & "',ID_NUMBER='" &
txtNicNo.Text & "',ADDRESS1='" & txtAddress.Text & "',PHONE_NO='" &
TextphoneNo.Text & "',BIRTH_DATE='" & DatetimeBdate.Text & "',AGE_YEARS='" &
txtage.Text & "',PROFESSION='" & txtProfession.Text & "',GENDER='" &
CombxGender.Text & "',REG_DATE='" & DtpRegdate.Text & "',PATIENT_STATUS='" &
CombxPstatus.Text & "',PATIENT_TYPE='" & CombXPatienttYPE.Text & "'WHERE
PATIENT_REG_NO ='" & txtPatientRegNo.Text & "'"

If SQLManger.DataUpdate(UpdateCmd) = 0 Then
MsgBox("The specified Patient could not be found")

Else
MsgBox("Update Data Successfully Changed!!!")

'clean up fields
txtTitle.Clear()
txtFirstName.Clear()
txtMiddleName.Clear()
txtFLastName.Clear()
txtFullName.Clear()
CombocountyCode.Items.Clear()
txtAddress.Clear()
TextphoneNo.Clear()
DatetimeBdate.Refresh()
txtage.Refresh()
txtProfession.Clear()
CombxGender.Items.Clear()

54
DtpRegdate.Refresh()
txtNicNo.Clear()
CombxPstatus.Items.Clear()
CombxIDtype.Items.Clear()
CombXPatienttYPE.Items.Clear()
txtPatientRegNo.Enabled = True
txtPatientRegNo.Focus()

Me.Close()
QueryThePatient.Show()

End If
End Sub

Private Sub DisplayPatientlFrm_Load(sender As Object, e As EventArgs) Handles


MyBase.Load

SQL.RunQuery("SELECT * FROM M01_PATIENT WHERE PATIENT_REG_NO ='"


& txtPatientRegNo.Text & "'")

Try
If SQL.RecordCount >= 0 Then
txtPatientRegNo.Text =
SQL.SQLDS.Tables(0).Rows(0)("PATIENT_REG_NO").ToString
txtTitle.Text = SQL.SQLDS.Tables(0).Rows(0)("TITLE").ToString
txtFirstName.Text = SQL.SQLDS.Tables(0).Rows(0)("FIRST_NAME").ToString
txtFLastName.Text = SQL.SQLDS.Tables(0).Rows(0)("LAST_NAME").ToString
txtMiddleName.Text =
SQL.SQLDS.Tables(0).Rows(0)("MIDDLE_NAME").ToString
txtFullName.Text = SQL.SQLDS.Tables(0).Rows(0)("FULL_NAME").ToString
CombocountyCode.Text =
SQL.SQLDS.Tables(0).Rows(0)("COUNTRY_CODE").ToString
DatetimeBdate.Text = SQL.SQLDS.Tables(0).Rows(0)("BIRTH_DATE").ToString
txtage.Text = SQL.SQLDS.Tables(0).Rows(0)("AGE_YEARS").ToString
txtProfession.Text = SQL.SQLDS.Tables(0).Rows(0)("PROFESSION").ToString
CombxGender.Text = SQL.SQLDS.Tables(0).Rows(0)("GENDER").ToString
DtpRegdate.Text = SQL.SQLDS.Tables(0).Rows(0)("REG_DATE").ToString
CombxPstatus.Text =
SQL.SQLDS.Tables(0).Rows(0)("PATIENT_STATUS").ToString
CombxIDtype.Text = SQL.SQLDS.Tables(0).Rows(0)("ID_TYPE").ToString
CombXPatienttYPE.Text =
SQL.SQLDS.Tables(0).Rows(0)("PATIENT_TYPE").ToString
End If
Catch ex As Exception
End Try
End Sub

Private Sub BtnDelete_Click(sender As Object, e As EventArgs) Handles BtnDelete.Click


If MsgBox("Do You Really Wish to Delete PatinetId : '" & txtPatientRegNo.Text & "'
AND FULL_NAME='" & txtFullName.Text & "'?", MsgBoxStyle.YesNo) =
MsgBoxResult.Yes Then
SQLManger.DataUpdate("DELETE FROM M01_PATIENT WHERE
PATIENT_REG_NO ='" & txtPatientRegNo.Text & "'")
MsgBox("Update Data Successfully Changed!!!")

55
Me.Close()
QueryThePatient.Show()
End If
End Sub

Private Sub BtnReturn_Click(sender As Object, e As EventArgs) Handles BtnReturn.Click


Me.Close()
QueryThePatient.Show()
End Sub

Private Sub Btnadd_Click_1(sender As Object, e As EventArgs) Handles Btnadd.Click


If txtAddress.Text <> "" And txtage.Text <> "" And txtFullName.Text <> "" And
TextphoneNo.Text.Length = 10 Then

CreatePatient()

ElseIf txtFullName.Text = "" Then


Me.ErrorProviderNameRF.SetError(Me.txtFullName, "Please enter the data")

ElseIf txtAddress.Text = "" Then


Me.ErrorProviderAddressRF.SetError(Me.txtAddress, "Please enter the data")

ElseIf txtage.Text = "" Then


Me.ErrorProviderAgeRF.SetError(Me.txtage, "Please enter the data")

End If
End Sub

Private Sub btnclear_Click(sender As Object, e As EventArgs) Handles btnclear.Click


'clean up fields

txtTitle.Clear()
txtFirstName.Clear()
txtMiddleName.Clear()
txtFLastName.Clear()
txtFullName.Clear()
CombocountyCode.Items.Clear()
txtAddress.Clear()
TextphoneNo.Clear()
DatetimeBdate.Refresh()
txtage.Refresh()
txtProfession.Clear()
CombxGender.Items.Clear()
DtpRegdate.Refresh()
txtNicNo.Clear()
CombxPstatus.Items.Clear()
CombxIDtype.Items.Clear()
CombXPatienttYPE.Items.Clear()
txtPatientRegNo.Enabled = True
txtPatientRegNo.Focus()
End Sub

56
Private Sub TextphoneNo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
TextphoneNo.KeyPress
'THE FOLLOWING IS ALL THE SPECIAL CHARRACTORS THAT WE DON'T
WANT ON OUR PHONENUMBERS
Dim DisallowedChar As String = ",<.>?/;:'@~#}{][=+-_)(%$^*!"

'DISALLOW ALL THE ALPHABERTS


If Char.IsLetter(e.KeyChar) = True Then
e.Handled = True
MsgBox("Phone Numbers Must be NUMBERS only!!!")

TextphoneNo.BackColor = Color.Red
TextphoneNo.ForeColor = Color.White

'CHECK IF ONE OF THE CHARACTER THAT WE DISALLOWED IS ENTERED


ElseIf DisallowedChar.Contains(e.KeyChar.ToString.ToLower) Then
e.KeyChar = ChrW(0)
e.Handled = True
MsgBox("Phone Numbers Must be NUMBERS only!!!")

TextphoneNo.BackColor = Color.Red
TextphoneNo.ForeColor = Color.White

Else
'IF CHARACTERS ENTERED IS NUMBERS

TextphoneNo.BackColor = Color.White
TextphoneNo.ForeColor = Color.Black

End If
End Sub

Private Sub txtage_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


txtage.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("Age should be numeric")
End If
End Sub

Private Sub txtTitle_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


txtTitle.KeyPress
If Asc(e.KeyChar) < 65 Or Asc(e.KeyChar) > 90 And Asc(e.KeyChar) < 97 Or
Asc(e.KeyChar) > 122 Then
e.Handled = True
MessageBox.Show("you can only input letters")
End If
End Sub

Private Sub txtMiddleName_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles txtMiddleName.KeyPress

57
If Asc(e.KeyChar) < 65 Or Asc(e.KeyChar) > 90 And Asc(e.KeyChar) < 97 Or
Asc(e.KeyChar) > 122 Then
e.Handled = True
MessageBox.Show("you can only input letters")
End If
End Sub

Private Sub txtFLastName_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


txtFLastName.KeyPress
If Asc(e.KeyChar) < 65 Or Asc(e.KeyChar) > 90 And Asc(e.KeyChar) < 97 Or
Asc(e.KeyChar) > 122 Then
e.Handled = True
MessageBox.Show("you can only input letters")
End If
End Sub

Private Sub txtFullName_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


txtFullName.KeyPress
If Asc(e.KeyChar) < 65 Or Asc(e.KeyChar) > 90 And Asc(e.KeyChar) < 97 Or
Asc(e.KeyChar) > 122 Then
e.Handled = True
MessageBox.Show("you can only input letters")
End If
End Sub

Private Sub txtProfession_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


txtProfession.KeyPress
If Asc(e.KeyChar) < 65 Or Asc(e.KeyChar) > 90 And Asc(e.KeyChar) < 97 Or
Asc(e.KeyChar) > 122 Then
e.Handled = True
MessageBox.Show("you can only input letters")
End If
End Sub

Private Sub txtFirstName_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


txtFirstName.KeyPress
If Asc(e.KeyChar) < 65 Or Asc(e.KeyChar) > 90 And Asc(e.KeyChar) < 97 Or
Asc(e.KeyChar) > 122 Then
e.Handled = True
MessageBox.Show("you can only input letters")
End If
End Sub
End Class

58
DrugMaintenanceFrm class

PublicClassDrugMaintenanceFrm
Private SQL AsNewSqlConn
Private SQLDB AsNewSQLDbManager

PrivateSubLoadGrid()
'show all records in datagrid view sorted by
SQL.RunQuery("SELECT * FROM P01_BRAND_MEDICINE ORDER BY DRUG_CODE
ASC")

IfString.IsNullOrEmpty(SQL.Exception) Then
DGVmedicineMaster.DataSource = SQL.SQLDS.Tables(0)
DGVmedicineMaster.Rows(0).Selected = True

DGVmedicineMaster.Columns("CATEGORY_CODE").Width = 120
DGVmedicineMaster.Columns("CATEGORY_NAME").Width = 180
DGVmedicineMaster.Columns("DESCRIBTION").Width = 350

SQL.SQLDA.UpdateCommand =
NewSqlClient.SqlCommandBuilder(SQL.SQLDA).GetUpdateCommand
' SQL.SQLDA.DeleteCommand = New
SqlClient.SqlCommandBuilder(SQL.SQLDA).GetDeleteCommand
EndIf
EndSub

PrivateSubDrugMaintenanceFrm_Load(sender AsObject, e AsEventArgs)


HandlesMyBase.Load
LoadGrid()
EndSub

PrivateSubGetMedicineColoumn()
'SHOW ALL COLOUMN IN COMBOBOX
SQL.RunQuery("SELECT
DRUG_CODE,BRAND_NAME,CATEGORY_CODE,GENERIC_NAME FROM
P01_BRAND_MEDICINE")
IfString.IsNullOrEmpty(SQL.Exception) Then
ForEach DC AsDataColumnInSQL.SQLDS.Tables(0).Columns
ComBxSearch.Items.Add(DC.ToString)
Next
EndIf
EndSub

59
PrivateSubTextSearch_TextChanged(sender AsObject, e AsEventArgs)
HandlesTextSearch.TextChanged
'DRUGCODE IN TEXTBOX
IfComBxSearch.Text = "DRUG_CODE"Then
SQL.RunQuery("SELECT
DRUG_CODE,BRAND_NAME,CATEGORY_CODE,GENERIC_NAME,STRENGTH,RO
UTE,FORM FROM P01_BRAND_MEDICINE WHERE DRUG_CODE LIKE
'%"&TextSearch.Text&"%'")

IfString.IsNullOrEmpty(SQL.Exception) Then
DGVmedicineMaster.DataSource = SQL.SQLDS.Tables(0)
EndIf
EndIf
'BRANDNAME IN TEXTBOX
IfComBxSearch.Text = "BRAND_NAME"Then
SQL.RunQuery("SELECT
DRUG_CODE,BRAND_NAME,CATEGORY_CODE,GENERIC_NAME,STRENGTH,RO
UTE,FORM FROM P01_BRAND_MEDICINE WHERE BRAND_NAME LIKE
'%"&TextSearch.Text&"%'")

IfString.IsNullOrEmpty(SQL.Exception) Then
DGVmedicineMaster.DataSource = SQL.SQLDS.Tables(0)
EndIf
EndIf

'CATEGORYCODE IN TEXTBOX
IfComBxSearch.Text = "DRUG_CODE"Then
SQL.RunQuery("SELECT
DRUG_CODE,BRAND_NAME,CATEGORY_CODE,GENERIC_NAME,STRENGTH,RO
UTE,FORM FROM P01_BRAND_MEDICINE WHERE DRUG_CODE LIKE
'%"&TextSearch.Text&"%'")

IfString.IsNullOrEmpty(SQL.Exception) Then
DGVmedicineMaster.DataSource = SQL.SQLDS.Tables(0)
EndIf
EndIf

'GENERICNAME IN TEXTBOX
IfComBxSearch.Text = "GENERIC_NAME"Then
SQL.RunQuery("SELECT
DRUG_CODE,BRAND_NAME,CATEGORY_CODE,GENERIC_NAME,STRENGTH,RO
UTE,FORM FROM P01_BRAND_MEDICINE WHERE GENERIC_NAME LIKE
'%"&TextSearch.Text&"%'")

IfString.IsNullOrEmpty(SQL.Exception) Then
DGVmedicineMaster.DataSource = SQL.SQLDS.Tables(0)
EndIf
EndIf
EndSub

60
PublicSubGetCatecoryName()
'QUERY CATEGORY NAME FROM CATEGORY TABLE

SQL.RunQuery("SELECT CATEGORY_NAME FROM dbo.P04_CATEGORY")


'IF RECORDS ARE FOUND, ADD THEM TO COMBO BOX
IfSQL.RecordCount> 0 Then
ForEach r AsDataRowInSQL.SQLDS.Tables(0).Rows
ComBxCategory.Items.Add(r("CATEGORY_NAME"))
Next

'SET THE COMBO BOX TO FIRST RECORD


ComBxCategory.Items.Insert(0, "---Select Category---")
EndIf
EndSub

PublicSubGetGenericName()
'QUERY CATEGORY NAME FROM CATEGORY TABLE
SQL.RunQuery("SELECT GENERIC_NAME FROM P04_MEDICATION WHERE
CATEGORY= ")

'IF RECORDS ARE FOUND, ADD THEM TO COMBO BOX


IfSQL.RecordCount> 0 Then
ForEach r AsDataRowInSQL.SQLDS.Tables(0).Rows
ComBxCategory.Items.Add(r("GENERIC_NAME"))
Next

'SET THE COMBO BOX TO FIRST RECORD


ComBxCategory.Items.Insert(0, "---Select GENERIC_NAME---")
EndIf
EndSub

PublicSubCreateDrug()
'ADD DRUGS TO DATABASE
SQLDB.AddDrugMaster(txtDrugId.Text, txtBrandName.Text, ComBxCategory.Text,
txtRoute.Text, txtstrenth.Text, txtform.Text, txtGenericName.Text, txtComponent.Text,
txtdescription.Text)
EndSub

61

You might also like