Sunteți pe pagina 1din 25

PROPOSAL:

Dental Clinic Database Management System

Clinic Management System is a computer software product that organizes all the
activities involved in the management and running of a healthcare facility. It must meet specified
security, technology and functionality standards for managing electronic medical records. It is
created to computerize the old manual operations in most clinics. The primary purpose of this
software is to make patient records data retrieval easy and efficient. Being in the digital form,
patient data can be conveniently shared and accessed by doctors and trusted personnel. It also
means that patient data can be easily backed up, and be protected for confidentiality and from
tampering through access control. Economically, clinics benefit from constant cost savings as a
result of increased productivity and overall efficiency. Essentially, everyone in the clinic benefits
from the system – doctor, nurse, clerk, administrator and the clinic owner – which makes their
lives easy and removes unnecessary human errors from their daily activities.

There are many kinds of clinic database management system but I decided to focus on
Dental Clinic. Some information to be gathered is patient’s name, age, gender, address, contact
number, date of consultation, procedure done, etc.

Proposed by:
______________________
Ayesza Celine G. Peralta

Approved by:
______________________
Macmild Gealogo

Page | 1
DATABASE DESCRIPTION:

The database used in this project is a dental clinic database management system. It can be used to
organize the activities involved between the patient and doctor in a dental clinic. It is consist of
tables that contain all information about the patients, doctors and procedures.

ENTITY RELATIONSHIP DIAGRAM:

Below is the relationship of each table.

Page | 2
TABLE DESCRIPTION:

This database has four tables namely Patients, Procedure, Doctor and the Patient’s History table.

1. The Patients table gives all information about the patients. It consists of the following
columns:

 Patient ID: It is the primary key that uniquely identifies each patient in this table. Its data
type is Text.
 Last Name: It is the last name of the patient. Its data type is Text.
 First Name: It is the first name of the patient. Its data type is Text.
 Age: It is the age of the patient. Its data type is Number.
 Gender: It is the gender of the patient. Its data type is Text.
 Contact Number: It is the contact number of the patient. Its data type is Number.
 Doctor ID: It is the unique id of the patient’s doctor. Its data type is Text.

Page | 3
2. The Procedure table gives all the information about all the procedures. It consists of the
following columns:

 Procedure Code: It is the primary key that uniquely identifies each procedure. Its data
type is Text.
 Procedure Name: It is the name of the procedure. Its data type is Text.
 Cost: It is the cost of the procedure. Its data type is Number.

Page | 4
3. The Doctor table gives all information about the doctors. It consists of the following
columns:

 Doctor ID: It is the primary key that uniquely identifies each doctor. Its data type is Text.
 Last Name: It is the last name of the doctor. Its data type is Text.
 First Name: It is the first name of the doctor. Its data type is Text.
 Schedule: It is the schedule of the doctor. Its data type is Text.
 Time In: It is the time when the doctor is in. Its data type is Date/Time.
 Time Out: It is the time when the doctor is out. Its data type is Date/Time.

Page | 5
4. The Patient’s History table gives all the information about the patient’s clinic visit. It
consists of the following columns:

 Patient ID: It is the foreign key that connects it to the Patients’ table. Its data type is Text.
 Procedure Code: It is the foreign key that connects it to the Procedure table. Its data type
is Text.
 Date of Procedure: It is the date when the procedure is made on the patient. Its data type
is Date/Time.

Page | 6
SQL COMMAND LISTING:

Below are the list of queries and its syntax.

1. Restriction and Projection


1.1 Restriction – this query will display the patients whose age is between 20 and 30.

SELECT [Last Name], Age


FROM Patients
WHERE Age BETWEEN 20 and 30;

1.2 Projection – this query will display only the last name and schedule of the doctor.

SELECT [Last Name], Schedule


FROM Doctor;

2. Arithmetic Expression and Operators – this query will display the procedure name, the
original cost of the procedure, and the original cost added by twenty percent of it.

SELECT [Procedure Name], Cost, (Cost + (Cost*0.20)) AS [New Cost]


FROM [Procedure];

3. Null Value Handling


3.1 Is Null – this query displays the last name of patients which contact number is null or
has no value in it.

SELECT [Last Name], [Contact Number]


FROM Patients
WHERE [Contact Number] IS NULL;

Page | 7
3.2 Is Not Null – this query displays the last name and contact number of patients which have
value.

SELECT [Last Name], [Contact Number]


FROM Patients
WHERE [Contact Number] IS NOT NULL;

3.3 NZ Function – this query displays all the last name and contact number of patients, then
assigns a value in all contact number that is null.

SELECT [Last Name], NZ ([Contact Number], "N/A")


FROM Patients;

4. Aliases
4.1 Column Alias – this query displays the new column name assigned.

SELECT [Procedure Name], Cost, (Cost+ (Cost*0.2)) AS [New Cost]


FROM [Procedure];

4.2 Table Alias – this query displays the new table name assigned.

SELECT P.[Last Name], D.[Last Name]


FROM Patients AS P, Doctor AS D
WHERE D.[Doctor ID]= P.[Doctor ID];

5. Concatenation – this query combines the last and first name of the patients in one column.

SELECT [Last Name] & ", " & [First Name] AS PATIENT
FROM Patients;

Page | 8
6. Comparison Operator – this query displays the last name and age of patients whose age are
greater than or equal to 20.

SELECT [Last Name], Age


FROM Patients
WHERE Age >= 20;

7. Logical Operator
7.1 AND – this query displays the last name, first name and contact number of patients
whose age is greater than 18 and its contact number has value in it.

SELECT [Last Name] & ", " & [First Name] AS Patient, [Contact Number]
FROM Patients
WHERE Age >18 AND [Contact Number] Is Not Null;

7.2 NOT – this query display the procedure name and cost where cost not between 500 and
3000.

SELECT [Procedure Name], Cost


FROM [Procedure]
WHERE Cost NOT BETWEEN 500 and 3000;

7.3 OR – this query displays the last name and age of patients whose age is less than 30 or
has a letter S on its last name.

SELECT [Last Name], Age


FROM Patients
WHERE Age < 30
OR [Last Name] LIKE '*S*';

Page | 9
8. Sorting – this query displays the age and last name of patients from oldest to youngest.

SELECT Age, [Last Name]


FROM Patients
ORDER BY Age DESC;

9. Functions
9.1 Group Function – this query displays the maximum and minimum cost of procedure.

SELECT MAX (Cost) AS [Maximum Cost], Min (Cost) As [Minimum Cost]


FROM [Procedure];

9.2 Single Row Function – this query displays the date of procedure and the date of patient’s
next visit.

SELECT [Date of Procedure], FORMAT (DateAdd ('m', 6, [Date of Procedure]), 'dd-


mmm-yy' ) AS [Next Visit]
FROM [Patient's History];

10. Joining – this query displays the patients’ last name joined with the last name of their
respective doctor.

SELECT Patients.[Last Name], Doctor.[Last Name]


FROM Patients, Doctor
WHERE Doctor.[Doctor ID] = Patients.[Doctor ID];

Page | 10
11. Subquery – this query displays the patient id, procedure code and date of procedure whose
procedure code is 1.

SELECT *
FROM [Patient's History]
WHERE [Procedure Code] LIKE
(SELECT [Procedure Code] FROM [Procedure]
WHERE [Procedure Code] = '1');

12. Update – this query updates the age of patient with patient id 10001.

UPDATE Patients
SET Age = 34
WHERE [Patient ID] = "10001";

13. Insert/Add Record – this query allows you to add a record in your table.

INSERT INTO patients ([Patient ID], [Last Name], [First Name], Age, Gender,
[Contact Number], [Doctor ID])
VALUES ([Enter Patient ID:], [Enter Last Name:], [Enter First Name:], [Enter Age:],
[Enter Gender:], [Enter Contact Number:], [Enter Doctor ID :]);

Page | 11
PROGRAM TESTING:

Test Plan:

TEST CASES OBJECTIVE

To check if all null values will have a value


Case 1
declared using the NZ Function.

To check if the query will sort according to


Case 2
descending age.

To check if the query will display the patients’


Case 3
last and first name in one column.

To check if AND logical operator is working


by displaying the patients’ last and first name
Case 4
who meet both the two conditions.

To check if the column name will be replaced


Case 5
by the alias assigned.

Page | 12
Test Cases:

Test case :1
Objectives : To check if all null values will have a value declared using the NZ
Function.
Test Data : SELECT [Last Name], NZ ([Contact Number],"N/A") FROM Patients;
Expected Test Result : All null values will have “N/A” value.
Actual Test Result :

Conclusion : Succeeded. NZ Function added the declared value to all null values.

Page | 13
Test case :2
Objectives : To check if the query will sort according to descending age.
Test Data : SELECT Age, [Last Name] FROM Patients ORDER BY Age DESC;
Expected Test Result : The query will display the age and last name of the patients from oldest to
youngest age.
Actual Test Result :

Conclusion : Succeeded. The age of the patients is sorted by oldest to youngest age.

Page | 14
Test case :3
Objectives : To check if the query will display the patients’ last and first name in one
column using concatenation.
Test Data : SELECT [Last Name] & ", " & [First Name] AS PATIENT
FROM Patients;
Expected Test Result : The query will display the patient’s last name and first name in one
column.
Actual Test Result :

Conclusion : Succeeded. The patient’s last name and first name are displayed in one
column by using concatenation.

Page | 15
Test case :4
Objectives : To check if AND logical operator is working by displaying the patients’
last and first name who meet both the two conditions.
Test Data : SELECT [Last Name] & ", " & [First Name] AS Patient, Age,
[Contact Number] FROM Patients WHERE Age>18 AND
[Contact Number] Is Not Null;
Expected Test Result : The query will display only the patient’s last and first name who’s age is
greater than 18 and has contact number.
Actual Test Result :

Conclusion : Succeeded. Only the patients’ with age greater than 18 and who have contact
numbers are displayed.

Page | 16
Test case :5
Objectives : To check if the column name will be replaced by the alias assigned.
Test Data : SELECT [Procedure Name], Cost, (Cost+ (Cost*0.2)) AS [New Cost]
FROM [Procedure];
Expected Test Result : The last column will display the assigned alias.
Actual Test Result :

Conclusion : Succeeded. The last column is displayed with its alias “New Cost”.

Page | 17
USER MANUAL:

To access the database, the first step to do is to open the Microsoft Access. This can be found
along with other Microsoft Office tools like MS Word and MS Excel. If not available, you can
download it from the web. You can see all the tables, queries and everything about the database.
You can update, add or delete a record.

Page | 18
Update Record query is used to update a column on a record. For example, you want to update
the contact number of a particular patient. To do so, you need to use the update syntax:
UPDATE table name
SET column name = new value
WHERE expression = value;

Shown above is the screenshot of the original contact number of patient 10001.

Page | 19
After updating using the syntax
(UPDATE Patients SET [Contact Number] = 8517234 WHERE [Patient ID] ="10001";),
the contact number of patient 10001 should be updated with the assigned new value of the
contact number. (See screenshot below.)

Page | 20
Insert or Add Record query is used to add a record to your database. The syntax used for adding
record is: INSERT INTO table name (name of columns)
VALUES (Enter + column names);

To add a new record, select the Insert/Add Record query. A dialog box (1) will appear stating
that you will add/append a new record, click Yes. After doing so, you will be asked to enter a
value on every column of a record to be added on the database. After entering all needed data, a
dialog box (2) will appear again confirming the addition of a new record, click Yes. (Refer to
screenshots below)

Dialog box 1

Dialog box 2

Page | 21
This screenshot shows that the record is successfully added to the database. If you want to add
another record, repeat the given steps.

Page | 22
The Delete option allows you to delete a record on your database. If you want to delete a record,
right click beside the row/record you want to delete, and then choose Delete Record. A dialog
box will appear confirming that you are deleting a record. Click Yes. (Refer to screenshots)

Page | 23
This screen shot shows that the record is successfully deleted. If you want to delete another
record, repeat the given steps.

If you want to explore the use of other queries, please refer to SQL Command Listing found on
pages 5-9.

Page | 24
CONCLUSION;

After doing this project, I believe that any database system can really help a lot in different
aspects. For this database, it helped everyone involved, including the staff, doctor and even the
patient. This database system, compared to the old manual one, lessens a big portion of time
consumed in dealing with patient records. On the other hand, improvement is still in need.

Page | 25

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