Вы находитесь на странице: 1из 24

2010

COMPUTER
APPLICATIONS II-
TERM REPORT
HOSPITAL DATABASE

SUBMITTED TO: MR MUJTABA MEMON

SUBMITTED BY: HIRA KHALIL


SAMIA SHOAIB
SYED ALI RAZA
AYSHA GHANCHI
MAHEEN NABIL GABOL
Computer  Applications  II-­‐Term  Report   2010  

LETTER OF ACKNOWLEDGEMENT

Institute of Business Management

Korangi Creek, Karachi-75190, Pakistan

UAN (9221)111-002-004, Fax: (9221) 509-0968

Http://www.iobm.edu.pk

May 3, 2011

Dear Reader,

It was an honor for us to carry out our term project which was assigned to us by our respected
teacher Mr. MUJTABA MEMON. We would like to thank Mr. MUJTABA MEMON for providing us
the guidance and the skills that helped us in preparing this project. It was a pleasure carrying out
such a term project on a topic so informative and practical.

Thanking You.

Yours sincerely,

Samia Shoaib

Maheen Nabil Gabol

Syed Ali Raza

Hira Khalil

Aysha Ghanchi

2
Computer  Applications  II-­‐Term  Report   2010  

LETTER OF TRANSMITTAL

Institute of Business Management

Korangi Creek, Karachi-75190, Pakistan

UAN (9221)111-002-004, Fax: (9221) 509-0968

Http://www.iobm.edu.pk

May 3, 2011

Mr. Mujtaba Memon

Lecturer,

IOBM

Dear Mr.Mujtaba Memon,

We are presenting this report based on the hospital database. This report contains all the concepts
that were taught to us in the ‘COMPUTER APPLICATIONS 2’. We have tried to cover all the
aspects which were required in the report.

Sincerely yours,

Samia Shoaib

Maheen Nabil Gabol

Syed Ali Raza

Hira Khalil

Aysha Ghanchi

3
Computer  Applications  II-­‐Term  Report   2010  

TABLE OF CONTENT

TABLES........................................................................................................................................... 6  

DESCRIPTION  OF  TABLES................................................................................................................ 7  


DOCTOR  DETAILS ....................................................................................................................................... 7  
OPERATIONAL  DETAILS ............................................................................................................................... 7  
LAB  RECORDS ...........................................................................................................................................  8  
OPERATION .............................................................................................................................................. 8  
PATIENT  ADMISSION  AND  DISCHARGE  DETAILS ................................................................................................. 8  
PATIENT  PERSONAL  DETAILS ......................................................................................................................... 9  
PAYMENT  RECORDS .................................................................................................................................... 9  
PHARMACY  INVENTORY ............................................................................................................................. 10  
PHARMACY  RECORDS ............................................................................................................................... 10  
ROOMS  DETAILS ...................................................................................................................................... 10  
STAFF  DETAILS ........................................................................................................................................ 12  
TREATMENT    DETAILS ................................................................................................................................ 12  
VISITING  DOCTOR  DETAILS ......................................................................................................................... 12  
QUERIES ...................................................................................................................................... 13  
ALL  POSITIVE  LAB  TESTS ............................................................................................................................ 13  
DOCTORS  FROM  DHA .............................................................................................................................. 13  
FEMALE  DOCTORS.................................................................................................................................... 13  
INVESTOR  WITH  50K+  AMOUNT ................................................................................................................ 14  
INVESTORS  WITH  LESS  THAN  20K  AMOUNT ................................................................................................. 14  
MALE  DOCTORS ...................................................................................................................................... 14  
PATIENTS  HAVING  DUE  AMOUNT................................................................................................................ 15  
PATIENTS  NAMED  ALI ............................................................................................................................... 15  
PATIENTS  OF  POLYCYSTIC  OVARIA  SYNDROME  WHO  WERE  CURED .................................................................. 15  
PATIENTS  WHO  STAYED  FOR  MORE  THAN  60  DAYS ...................................................................................... 16  
ROOMS  OCCUPIED  FOR  MORE  THAN  100  DAYS ........................................................................................... 16  
STAFF  EARNING  LESS  THAN  $1000  PER  MONTH ........................................................................................... 16  
STAFF  MORE  THAN  35  YEARS  OLD ............................................................................................................. 17  
TOP  5  INVESTORS .................................................................................................................................... 17  
TOTAL  MEDICINE  COST  PER  PATIENT:.......................................................................................................... 17  
UNSUCCESSFUL  OPERATIONS ..................................................................................................................... 18  
VISITING  DOCTORS  COMING  FROM  DHA  BETWEEN  7:30-­‐10:30 .................................................................... 18  
FORMS............................................................................................................................................... 19  
FORM  SHOWING  DETAILS  OF  THE  DOCTOR:.................................................................................................... 19  
FORM  SHOWING  DETAILS  OF  HOSPITAL  INVESTMENT ....................................................................................... 20  
FORM  SHOWING  PATIENTS  PERSONAL  DETAILS ............................................................................................... 20  

4
Computer  Applications  II-­‐Term  Report   2010  

FORM  SHOWING  STAFF  DETAILS ................................................................................................................... 21  


REPORT .................................................................................................................................................... 21  
RELATIONSHIPS.................................................................................................................................. 22  
E-­‐R  DIAGRAM..................................................................................................................................... 24  

5
Computer  Applications  II-­‐Term  Report   2010  

TABLES
A database is a collection of tables. Table is a kind of matrix formation representing an entity. It
is a collection of attributes representing an entity. These attributes provides further details
regarding the entity involved.

The hospital database consists of the following tables:

 Doctor Details
 Hospital investment
 Lab records
 Operation details
 Patient admission and discharge details
 Patient personal details
 Payment records
 Pharmacy inventory
 Pharmacy records
 Room details
 Staff details
 Treatments details
 Visiting doctors details

6
Computer  Applications  II-­‐Term  Report   2010  

DESCRIPTION OF TABLES
D OCTOR D ETAILS
This tables contains the personal details of the doctors, their addresses, telephone numbers, their
specialization And fee charged by them.

FILED DATA TYPE KEYS INPUT MASK

DR_ID TEXT PRIMARY KEY "DR-"000;;##


DR_NAME TEXT
ADDRESS TEXT
GENDER TEXT
E-MAIL TEXT
FEE CHARGED TEXT
DR SPECILIZATION TEXT

O PERATIONAL D ETAILS
This table contains the records of the patients and the doctors who have operated them and
whether the operation performed was successful or not and the reason why the operation was
conducted.

FIELD DATA TYPES KEYS INPUT MASK


INVESTOR_ID TEXT PRIMARY KEY "INV-"000;;##
INVESTMENT_DESCRIPTION MEMO
INVESTMENT_AMOUNT CURRENCY
INVESTOR_NAME TEXT
INVESTMENT_DATE DATE/TIME

7
Computer  Applications  II-­‐Term  Report   2010  

L AB R ECORDS
This table contains the lab id, patient id, doctor id, the lab test description, patient lab results, lab
test frequency and lab test cost

FIELD DATA TYPE KEYS INPUT TASK


LAB ID TEXT PRIMARY KEY "LAB-"000;;##
PATIENT ID TEXT FOREIGN KEY "PT-"000;;##
DR ID TEXT FOREIGN KEY "DR-"000;;##
LAB TEST TEXT
DESCRIPTION
PATIENT LAB TEXT
RESULTS
LAB TEST NUMBER
FREQUENCY
LAB TEST COST CURRENCY

O PERATION
This table contains the patient id, operation theater id, Dr id, operation reason and operation
results (successful or unsuccessful)

FIELD DATA TYPE KEY INPUT TASK


OPERATION THEATRE ID TEXT PRIMARY KEY "OT-"000;
PATIENT ID TEXT FOREIGN KEY "PT-"000;
DR_ID TEXT FOREIGN KEY "DR-"000;
OPERATION_REASON MEMO
OPERATION_RESULT TEXT

P ATIENT ADMISSION AND DISCHARGE DETAILS


This table contains the records of the patient, their date of admission in the hospital and their data
of discharge and their status after the discharge from the hospital

FIELD DATA TYPE KEY INPUT TASK


SERIAL NUMBER NUMBER PRIMARY KEY
PATIENT ID TEXT FOREIGN KEY "PT-"000;;##
DATE OF DATE/TIME
ADMISSION
DATE OF DATE/TIME
DISCHARGE
STATUS TEXT

8
Computer  Applications  II-­‐Term  Report   2010  

P ATIENT PERSONAL DETAILS


The patient table provides the information related to all the complete detail of the patient. It
contains the information about when did the disease start, when did it end, who was the doctor to
cure, which test were conducted, from which laboratory were they taken, This table contains the
record of all the patients, their address, phone numbers, date of birth, height, weight, etc.

FIELD DAT A TYPE KEY INPUT MASK


PATIENT_ID TEXT PRIMARY KEY "PT-"000;;##
PATIENT_NAME TEXT
PATIENT_ADDRESS TEXT
DOB DATE/TIME
GENDER TEXT
HEIGHT TEXT
WEIGHT TEXT
MOBILE PHONE TEXT 0000\-000\-0000
EMAIL TEXT
DOMAIN FOR EMAIL TEXT

P AYMENT RECORDS
The payment record table shows the record of all the patients who have availed the services of
the hospsital their medicine and lab costs etc and the amount paid by them.

FIELD DAT A TYPE KEY INPUT MASK


PAYMENT_ID TEXT PRIMARY KEY "PY-"000;
PATIENT_ID TEXT FOREIGN KEY “PT-“000;
Medicine_cost CURRENCY
Lab_test_Cost CURRENCY
Amount_paid CURRENCY

9
Computer  Applications  II-­‐Term  Report   2010  

P HARMACY INVENTORY
The pharmacy inventory table shows the details of the medicine that are in stock, how much
quantity was ordered and how much is left with and the details of their date of order and delivery
etc

FIELD DAT A TYPE KEY INPUT MASK


MEDICINE_ID TEXT PRIMARY KEY "MD-"000;;##
Medicine_quantity_Present NUMBER
Medicine_quantity_ordered NUMBER
Medicine_order_date DATE/TIME
Medicine_delivery_date TEXT

P HARMACY R ECORDS
The pharmacy record table shows the record of the medicines that are in the pharmacy, the
number of medicines their types and the cost and which patoent bought it which is shown by the
patients Id number. The patient id acts as the primary key in the data base

FIELD DAT A TYPE KEY INPUT MASK


MEDICINE_ID TEXT PRIMARY KEY "PT-"000;;##
MEDICINE_TYPE TEXT
MEDICINE_AMOUNT NUMBER
MEDICINE_COST CURRENCY
PATIENT_ID TEXT
DATE DATE/TIME

R OOMS DETAILS
The room detail table shows the number of rooms in the hospital, how many rooms are occupied
and how many rooms are vacant and which patient has used the rooms on which date.

FIELD DAT A TYPE KEY INPUT MASK


Room_Id TEXT PRIMARY KEY "RM-"000;;##
Patient_Id TEXT FOREIGN KEY “PT-“000;;##
Date_Of_Admission DATE/TIME
Date_Of_DISCharge DATE/TIME

10
Computer  Applications  II-­‐Term  Report   2010  

11
Computer  Applications  II-­‐Term  Report   2010  

S TAFF D ETAILS
The staff detail table shows the staff details, their occupation and personal details like gender,
date of birth, salary

FIELD DAT A TYPE KEY INPUT MASK


Staff_Id TEXT PRIMARY KEY "PT-"000;;##
Staff_Name TEXT
Staff_Job_Title TEXT
Gender TEXT
DOB DATE/TIME
Staff_Salary(yearly) CURRENCY
Staff_Comments MEMO

T REATMENT DETAILS
The treatment details table shows the dr and the patient id. The diseases that was diagnosed by
the doctor and their results of the treatment that the doctor provided.

FIELD DAT A TYPE KEY INPUT MASK


Treatment_Id TEXT PRIMARY KEY "TT-"000;;##
Patient_id TEXT FOREIGN KEY “PT-“000;;##
Doctor_id TEXT FOREIGN KEY “DR-“000;;##
Disease_Diagnosed DATE/TIME
Treatment_status TEXT

V ISITING DOCTOR DETAILS


This table shows the record of the doctor who are not available full time at the hospital and they
visit the hospital during which timings of the day and the number of days in the week.

FIELD DAT A TYPE KEY INPUT MASK


Visiting_Doctor_id TEXT PRIMARY KEY "VDR-"000;;##
Visiting_Doctor_Name TEXT
Address TEXT
Gender TEXT
Timings DATE/TIME
Days TEXT

12
Computer  Applications  II-­‐Term  Report   2010  

QUERIES

1. A LL P OSITIVE L AB T ESTS
This query shows the test that were positive when conducted on patients.

SELECT Lab_Records.*, Lab_Records.Patient_Lab_Results

FROM Lab_Records

WHERE (((Lab_Records.Patient_Lab_Results) Like "positive"));

2. D OCTORS F ROM DHA


This query shows the details of the doctor who came from DHA and the fee charged by them

SELECT doctor_details.doctor_id, doctor_details.doctor_name, doctor_details.[E-mail],


doctor_details.[Fee charged per visit], doctor_details.address

FROM doctor_details

WHERE (((doctor_details.address) Like "dha*"));

3. F EMALE D OCTORS
To show the details of all those doctors who are female

SELECT doctor_details.*, doctor_details.gender

FROM doctor_details

WHERE (((doctor_details.gender) Like "female"));

13
Computer  Applications  II-­‐Term  Report   2010  

4. I NVESTOR W ITH 50 K + A MOUNT


To show the details of the sponsers who have invested in the hospital more than 50,000

SELECT Hospital_Investment.*, Hospital_Investment.Investment_Amount

FROM Hospital_Investment

WHERE (((Hospital_Investment.Investment_Amount)>50000));

5. I NVESTORS W ITH L ESS T HAN 20 K A MOUNT


To show the investor details who have invested in the hospital less than 20,000

SELECT Hospital_Investment.*, Hospital_Investment.Investment_Amount

FROM Hospital_Investment

WHERE (((Hospital_Investment.Investment_Amount)<20000));

6. M ALE D OCTORS
To show the the number of doctors based on their gender I;e Male and how many are there.

SELECT doctor_details.*, doctor_details.gender

FROM doctor_details

WHERE (((doctor_details.gender) Like "male"));

14
Computer  Applications  II-­‐Term  Report   2010  

7. P ATIENTS H AVING DUE A MOUNT


To show the details of the patient and the amount which is unpaid by them

SELECT Payment_Records.Patient_Id, Payment_Records.Payment_id,


([Payment_Records].[Medicine_Cost]+[Payment_Records].[Lab_test_cost]-
[Payment_Records].[Amount_Paid]) AS [Amount Left]

FROM Payment_Records

WHERE (((([Payment_Records].[Medicine_Cost]+[Payment_Records].[Lab_test_cost]-
[Payment_Records].[Amount_Paid]))>0));

8. P ATIENTS N AMED A LI
To show the number of patients having the same name ‘ALI’

SELECT patient_personal_details.*, patient_personal_details.patient_name

FROM patient_personal_details

WHERE (((patient_personal_details.patient_name) Like "Ali*"));

9. P ATIENTS O F P OLYCYSTIC O VARIA S YNDROME W HO W ERE


C URED
To show the details of the patient who had the disease polycystic ovarian syndrome and who
were cured

SELECT Treatment_details.Treatment_Id, Treatment_details.Patient_id,


Treatment_details.Doctor_id, Treatment_details.Disease_Diagnosed,
Treatment_details.Treatment_status

FROM Treatment_details

15
Computer  Applications  II-­‐Term  Report   2010  

WHERE (((Treatment_details.Disease_Diagnosed) Like "polycystic ovarian syndrome")


AND ((Treatment_details.Treatment_status) Like "cured"));

10. P ATIENTS W HO S TAYED F OR M ORE T HAN 60 D AYS


To show the details of the patients who stayed at the hospital for more than 60 days

SELECT
DateDiff("d",[Patient_Admission_&_Discharge_Details].[date_of_admission],[Patient_Ad
mission_&_Discharge_Details].[Date_of_discharge]) AS Days,
[Patient_Admission_&_Discharge_Details].*

FROM [Patient_Admission_&_Discharge_Details]

WHERE
(((DateDiff("d",[Patient_Admission_&_Discharge_Details].[date_of_admission],[Patient_A
dmission_&_Discharge_Details].[Date_of_discharge]))>60));

11. R OOMS O CCUPIED F OR M ORE T HAN 100 D AYS


To show rooms that were not vacant and remained occupied for more than 100 days

SELECT Room_details.Room_Id, Room_details.Patient_Id,


DateDiff("d",[Room_details].[Date_Of_Admission],[Room_details].[Date_Of_DIScharge])
AS [Days Occupied]

FROM Room_details

WHERE
(((DateDiff("d",[Room_details].[Date_Of_Admission],[Room_details].[Date_Of_DIScharge
]))>=100));

12. S TAFF E ARNING L ESS T HAN $1000 PER M ONTH


To show salary details of all staff who earns less than 1000 per month

SELECT Staff_Details.*, ([Staff_Details].[Staff_Salary(yearly)]/12) AS [Salary per month]

FROM Staff_Details

WHERE (((([Staff_Details].[Staff_Salary(yearly)]/12))<1000));

16
Computer  Applications  II-­‐Term  Report   2010  

13. S TAFF M ORE T HAN 35 Y EARS O LD


To show the age details of all those staff who are above 35 years old

SELECT Staff_Details.*, DateDiff("yyyy",[Staff_Details].[DOB],Now()) AS Age

FROM Staff_Details

WHERE (((DateDiff("yyyy",[Staff_Details].[DOB],Now()))>35));

14. T OP 5 I NVESTORS
To show the details of the 5 top most investors who sponsored the hospital

SELECT TOP 5 Hospital_Investment.*, Hospital_Investment.Investment_Date

FROM Hospital_Investment

ORDER BY Hospital_Investment.Investment_Date;

15. T OTAL M EDICINE C OST PER P ATIENT :


To show the total amount incurred by each patient on medicines

SELECT Pharmacy_Records.Patient_Id,
([Pharmacy_Records].[Medicine_amount]*[Pharmacy_Records].[medicine_cost]) AS
[Total Cost]

FROM Pharmacy_Records

ORDER BY
([Pharmacy_Records].[Medicine_amount]*[Pharmacy_Records].[medicine_cost]) DESC;

17
Computer  Applications  II-­‐Term  Report   2010  

16. U NSUCCESSFUL O PERATIONS


To show the number of operations that were performed and were unsuccessful

SELECT Operation.*, Operation.Operation_Results

FROM Operation

WHERE (((Operation.Operation_Results) Like "unsuccessful"));

17. V ISITING D OCTORS C OMING F ROM DHA B ETWEEN 7:30-


10:30
To show the number of visitind doctors that visit the hospital between 7:30-10:30

SELECT Visiting_Doctors_Details.Visiting_Doctor_id,
Visiting_Doctors_Details.Visiting_Doctor_Name, Visiting_Doctors_Details.Address,
Visiting_Doctors_Details.Timings

FROM Visiting_Doctors_Details

WHERE (((Visiting_Doctors_Details.Address) Like "dha*") AND


((Visiting_Doctors_Details.Timings) Like "7:30-10:30"));

18
Computer  Applications  II-­‐Term  Report   2010  

FORMS

F ORM S HOWING D ETAILS OF T HE D OCTOR :

19
Computer  Applications  II-­‐Term  Report   2010  

F ORM S HOWING D ETAILS OF H OSPITAL I NVESTMENT

F ORM S HOWING P ATIENTS P ERSONAL D ETAILS

20
Computer  Applications  II-­‐Term  Report   2010  

F ORM S HOWING S TAFF D ETAILS

R EPORT

21
Computer  Applications  II-­‐Term  Report   2010  

RELATIONSHIPS

22
Computer  Applications  II-­‐Term  Report   2010  

23
Computer  Applications  II-­‐Term  Report   2010  

E-R DIAGRAM

ROOM ID ROOMS
PATIENT NAME STATUS
ID

PaHent   Stays   Room  

ADDRESS DATE OF BIRTH DATE OF DATE OF


DISCHARGE ADMISSION

24

Вам также может понравиться