66
Outdoor Patient Doctor’s Booking System Project Report On Outdoor Patient Doctor’s Booking SystemSubmitted By: Group Number:- 04 1. Aniket Shrivastava College – Institute of Technology and Marine Engineering Roll – 09144001049 2. Payel Ghosh College – Future Institute of Engineering and Management Roll – 08148001029 3. Soumya Kanti Ghosh College – Future Institute of Engineering and Management Roll – 08148001039

Project Report - Outdoor Patient Doctor’s Booking System

Embed Size (px)

Citation preview

Page 1: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Project Report

On

“Outdoor Patient Doctor’s Booking System”

Submitted By:

Group Number:- 04

1. Aniket ShrivastavaCollege – Institute of Technology and Marine EngineeringRoll – 09144001049

2. Payel GhoshCollege – Future Institute of Engineering and ManagementRoll – 08148001029

3. Soumya Kanti GhoshCollege – Future Institute of Engineering and ManagementRoll – 08148001039

4. Soumyadeep ChakrabortyCollege – Future Institute of Engineering and ManagementRoll – 08148001003

5. Tridivraj BhattacharyyaCollege – Future Institute of Engineering and ManagementRoll – 08148001023

Page 2: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

CERTIFICATE

This is to certify that Outdoor Patient Doctor’s Booking System embodies the original work done by Aniket Shrivastava of INSTITUTE OF TECHNOLOGY AND MARINE ENGINEERING (2009-2013) with Roll – 09144001049 during this project submission as a partial fulfillment of the requirement for the Globsyn Skills – Summer Training Program.

----------------------------------------------------------

Signature and Seal of Project Coordinator

Page 3: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

CERTIFICATE

This is to certify that Outdoor Patient Doctor’s Booking System embodies the original work done by Payel Ghosh of FUTURE INSTITUTE OF ENGINEERING AND MANAGEMENT (2008-2012) with Roll – 08148001029 during this project submission as a partial fulfillment of the requirement for the Globsyn Skills – Summer Training Program.

----------------------------------------------------------

Signature and Seal of Project Coordinator

Page 4: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

CERTIFICATE

This is to certify that Outdoor Patient Doctor’s Booking System embodies the original work done by Soumya Kanti Ghosh of FUTURE INSTITUTE OF ENGINEERING AND MANAGEMENT (2008-2012) with Roll – 08148001039 during this project submission as a partial fulfillment of the requirement for the Globsyn Skills – Summer Training Program.

----------------------------------------------------------

Signature and Seal of Project Coordinator

Page 5: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

CERTIFICATE

This is to certify that Outdoor Patient Doctor’s Booking System embodies the original work done by Soumyadeep Chakraborty of FUTURE INSTITUTE OF ENGINEERING AND MANAGEMENT (2008-2012) with Roll – 08148001003 during this project submission as a partial fulfillment of the requirement for the Globsyn Skills – Summer Training Program.

----------------------------------------------------------

Signature and Seal of Project Coordinator

Page 6: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

CERTIFICATE

This is to certify that Outdoor Patient Doctor’s Booking System embodies the original work done by Tridivraj Bhattacharyya of FUTURE INSTITUTE OF ENGINEERING AND MANAGEMENT (2008-2012) with Roll – 08148001023 during this project submission as a partial fulfillment of the requirement for the Globsyn Skills – Summer Training Program.

----------------------------------------------------------

Signature and Seal of Project Coordinator

Page 7: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

ACKNOWLEDGEMENT

We are grateful to our teacher and project guide Mr. Gautam Das for the guidance, inspiration and constructive suggestions that helped us in the preparation of this project.

Aniket Shrivastava

Payel Ghosh

Soumya Kanti Ghosh

Soumyadeep Chakraborty

Tridivraj Bhattacharyya

Page 8: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

CONTENTS:-

Brief Description Purpose Scope Goals of propose system

Functional Requirement Software/Hardware Required Entity Relationship Diagram Data Table and View Descriptions Data Flow Diagram Screen Shots Code Data Validations Future Enhancement References

Page 9: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Brief Description

1. Purpose• The Software is for the automation of Outdoor Patient Doctor’s Appointment System.• It maintains single level of user:-

Operator Level• The Software includes:-i) Maintaining Patient Details.ii) Maintaining Doctor Details.iii) Providing details of availability of doctors.iv) Providing appointment details for each doctor and patient.v) Bill generationvi) Providing Income Details of a particular centre.

2. ScopeIt can be used in any Clinic for maintaining outdoor patient doctor’s appointment details.

3. Goals of proposed system

a. Planned approach towards working: - The working in the organization will be well planned and organized. The data will be stored properly in data stores, which will help in retrieval of information as well as its storage.

b. Accuracy: - The level of accuracy in the proposed system will be higher. All operation would be done correctly and it ensures that whatever information is coming from the center is accurate.

c. Reliability: - The reliability of the proposed system will be high due to the above stated reasons. The reason for the increased reliability of the system is that now there would be proper storage of information.

Page 10: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

d. No Redundancy: - In the proposed system utmost care would be that no information is repeated anywhere, in storage or otherwise. This would assure economic use of storage space and consistency in the data stored.

e. Immediate retrieval of information: - The main objective of proposed system is to provide for a quick and efficient retrieval of information. Any type of information would be available whenever the user requires.

f. Immediate storage of information: - In manual system there are many problems to store the largest amount of information.

g. Easy to Operate: - The system should be easy to operate and should be such that it can be developed within a short period of time and fit in the limited budget of the user.

Page 11: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Functional RequirementsDescriptions of Data:-

The software can be used to maintain all the general details for a doctor or a patient in separate databases as well as the appointment details for each.

It can also be used to maintain the final bill information paid by the patient.

Descriptions of Operations:-

At the beginning the operator for each centre logs into the respective centre details using their user id and password.

For each patient, the operator is able to save/update his/her details. It also keeps track of the details of doctors attending the clinic. When a patient comes up and requests an appointment with a certain

doctor the software searches for that doctor’s availability for that centre. If available the software instantly proceeds to set an appointment for the patient within the available time.

The software can list the details of various appointments already set. It also provides an interface for the operator to add new doctors who will be attending the centre henceforth.

Last but not the least the software generates the bill for a particular customer and also keeps track of it in a database and thus provides total income details of a centre to the management.

Description of Users:-

The system is available for all the operators in each centre. They can input, edit and even use the interfaces for viewing purposes.

Page 12: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Description of Menu:-The software needs to be accessed by opening the welcome form which directs the user to login. After login, the user is able to access the menu at the top of the window with which they are able to manage all details regarding patients, doctors, appointments and bill. The details of the menu are – New-> This menu contains two sub-divisions which allow us to add

details for a new patient or a doctor by accessing the respective form. The New Patient menu also allows us to set the appointment by checking the availability of the desired doctor.

Doctor Availability-> This menu allows the user to check the availability of a desired doctor or even by category.

Search/Update-> This menu directs the user to an interface from where he/she can access the details of existing patients or doctors respectively and make changes as necessary.

Appointment-> This menu allows the operator to book an appointment for the patient for a specific doctor which also has the auto-fill feature incorporated.

Records-> This menu direct us to three different interfaces which provide the details of income of a particular doctor within a particular period as well as the total income of a centre on a day. It also provides details about all appointments of a centre on a particular day.

Bill->This provides an interface to generate the billing information for a customer and also saves it for later use by the management.

Centre-> This menu provide details of each centre including their location and contact number which can be provided to patients on query.

Page 13: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Software/Hardware Required

Hardware Requirements

Processor RAMDisk Space

Virtual Memory

Pentium IV or higher (minimum

200 Mhz)

512 MB (recommended)

1.5 GBDouble the amount

of RAM

Software Requirements

Operating System

Architecture Database Network Protocol

Windows XP, Windows 7,

Windows 2000 with SP 1 or

higher

32 or 64 bit Oracle 10gTCP/IP,TCP/IP with SSL, Named Pipes

Page 14: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Entity Relationship Diagram

Centre

Category

Patient

DoctorAppointment

M

N

1

N

Bill

N

1

N

1

Has

For

Fees to be

paid

N 1

Has

DoctorDetailsRetrieve

Of

N

1

1

N

Contact

Bid

Date

Dname

Address

Contact

Cid Location

DateTime Appointed

Pid

PName

Address Contact

Did

DayTime of Availability

Page 15: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Data Table and View Descriptions

1. BCURE_USERS TABLE:-

Field Name Data Type Constraints DescriptionU_ID VARCHAR2 Primary Key User Name

U_PASS VARCHAR2 Login PasswordU_DESIG VARCHAR2 Designation

C_ID NUMBERForeign Key

(C_ID of Centre)

Centre ID

2. CENTRE TABLE:-

Field Name Data Type Constraints DescriptionCEN_ID NUMBER Primary Key Centre ID

CEN_LOC VARCHAR2 LocationC_ID NUMBER Centre ID

3. PATIENT TABLE:-

Field Name Data Type Constraints DescriptionP_ID NUMBER Primary Key Patient ID

P_NAME VARCHAR2 Patient NameP_ADDR VARCHAR2 Address

P_CONTACT NUMBER Contact NumberP_GEN VARCHAR2 GenderP_AGE NUMBER Age

Page 16: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

4. CATEGORY TABLE:-

Field Name Data Type Constraints DescriptionCAT_ID NUMBER Primary Key Category ID

CAT_NAME VARCHAR2 Category Name

FEES NUMBERFees for Doctors of that Category

5. DOCTOR TABLE:-

Field Name Data Type Constraints DescriptionD_ID NUMBER Primary Key Doctor ID

D_NAME VARCHAR2 Doctor NameD_ADDR VARCHAR2 Address

D_CONTACT

NUMBER Contact Number

D_GEN VARCHAR2 GenderD_AGE NUMBER Age

D_CATID NUMBERForeign Key (CAT_ID of Category)

Category ID

Page 17: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

6. DOC_DETAILS TABLE:-

Field Name Data Type Constraints Description

D_ID NUMBER

Primary Key

Foreign Key

(D_ID of Doctor)

Doctor ID

C_ID NUMBER

Foreign Key

(CEN_ID of

Centre)

Centre ID

D_DAY VARCHAR2 Day of VisitD_TIME NUMBER Starting Time

D_HOURS NUMBERHours of

VisitD_CATID NUMBER Category ID

7. APPOINTMENT TABLE:-

Field Name Data Type Constraints Description

D_ID NUMBER

Primary Key

Foreign Key

(D_ID of Doctor)

Doctor ID

P_ID NUMBER

Foreign Key

(P_ID of Patient)

Patient ID

A_DATE DATE Appointment

Page 18: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

DateC_ID NUMBER Centre ID

A_TIME NUMBERAppointment

Time8. BILL TABLE:-

Field Name Data Type Constraints DescriptionB_ID NUMBER Primary Key Bill ID

CEN_ID NUMBERForeign Key (CEN_ID of

Centre)Centre ID

B_DATE DATE Bill Date

P_ID NUMBERForeign Key

(P_ID of Patient)

Patient ID

P_NAME VARCHAR2 Patient Name

D_ID NUMBERForeign Key

(D_ID of Doctor)

Doctor ID

D_NAME VARCHAR2 Doctor Name

FEES NUMBER

Total Amount Paid Including

Tax and Discount

9. APPO_VIEW:-

Field Name Data Type Description TableD_NAME VARCHAR2 Doctor Name Doctor

PatientAppointment

(DOCTOR.D_ID = APPOINTMENT.D_ID

P_NAME VARCHAR2 Patient NameC_ID NUMBER Centre ID

A_DATE DATE Appointment Date

Page 19: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

AndPATIENT.P_ID =

APPOINTMENT.P_ID)A_TIME VARCHAR2

Appointment Time

10. DOC_VIEW:-

Field Name Data Type Description TableD_NAME VARCHAR2 Doctor Name DOC_DETAILS

CENTRE(CEN_ID = C_ID)

P_NAME VARCHAR2 Patient NameC_ID NUMBER Centre ID

A_DATE DATEAppointment

Date

A_TIME VARCHAR2Appointment

Time

Page 20: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Data Flow Diagram

Reports

Appointment Details

Provides

Bill Details

Provides

Provides Details

Doctor

Provides Details

Patient

All Details

Manages

Outdoor Patient Doctor’s Booking

System

Admin

Patient

Doctor

Billing Operator

Appointment Operator

Management

Level 0 DFD

Page 21: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

DuplicityFor

Check

Creates Bill

AppointmentCreates

Patient

Doctor

Operator

Provides Personal Details

Provides Bill

Details

Provides Appointment

Details

Management

Level 1 DFD

Page 22: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Patient

Doctor

Operator

Provides Personal Details

Provides Appointment

Details

Check for Duplicity

Provides Bill

Details

Creates Appointment

Creates Bill

Management

Level 2 DFD

Page 23: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Screen Shots

1. Will provide details for specific centre based on user login.

Page 24: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

2. Doctor Details (Personal and Visiting) available on same page. Auto Generation of ID also available.

Page 25: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

3. Patient Personal Details, Appointment availability and doctor details available on same page. Also prevents booking in same slot.

Page 26: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

4. Auto-fill appointment form, by loading details from New Patient form.Can also be accessed from the New Patient interface.

5. List of appointments for specific date for specific centre.

Page 27: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

6. Able to display “invalid” option on input of invalid date or if all slots are filled up for a particular date. Displays Yes on availability of slots.

Page 28: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

7. Doctor details can be retrieved by specifying category when specific doctor is unknown.

8. Details of specific doctor can be retrieved.

Page 29: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

9. Availability of slots for a particular doctor can be viewed and booking can be done from the same page

10.Alert for input of time outside working hours.

Page 30: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

11. Alert on providing duplicate doctor, patient, category and bill ID

Page 31: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

12.Can track income details for specific doctor by date as well as that of a doctor within a specified period.

Page 32: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

13.Easy to use bill generator for user convenience. Complete auto-fill. Only choose the patient according to date.

Page 33: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Code

1. /*****Login Button*****/

LOGIN:DECLARE v_actpass varchar2(10); v_givenpass varchar2(10); v_alertval integer;Begin select u_pass into v_actpass from bcure_users where u_id = :NAME; v_givenpass := :PASSWORD; IF v_givenpass = v_actpass THEN :global.u_id := :NAME; SELECT c_id INTO :global.v_cen FROM bcure_users WHERE u_id = :NAME; IF :global.u_id = 'admin' THEN call_form('K:\BECURE\ADMIN\MENU_FORM_ADM'); ELSE call_form('K:\BECURE\USER\MENU_FORM'); END IF; ELSE v_alertval := show_alert('ALERT_WRONGPASS'); IF v_alertval = 88 THEN

Page 34: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

clear_form; ELSE exit_form; END IF; END IF;

EXCEPTION WHEN NO_DATA_FOUND THEN v_alertval := show_alert('ALERT_WRONGUSER'); IF v_alertval = 88 THEN clear_form; ELSE exit_form; END IF;End;

2. /*****Close/Exit Button*****/

exit_form;

3. /*****Clear/Reset Button*****/

clear_form;

4. /*****Update/Modify/Save Button*****/

commit_form;

Page 35: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

5. /*****GENERATE ID Button*****/DECLARE

v_docid doctor.d_id%TYPE;

BEGINSELECT max(d_id) INTO v_docidFROM doctor;

:DOCTOR.D_ID := v_docid + 1;EXCEPTION WHEN NO_DATA_FOUND THEN :DOCTOR.D_ID := 1; WHEN OTHERS THEN :DOCTOR.D_ID := 1;END;

6. /***** Doctor Save Button*****/ADD DOCTOR:DECLARE

v_alert_val number(3);BEGINIF (:DOC_DETAILS.D_TIME>8.00 and :DOC_DETAILS.D_TIME<10.00) THEN

v_alert_val := SHOW_ALERT('ALERT_WORKING_HOUR');

clear_form;END IF;go_block('DOCTOR');commit_form;clear_form;END;

7. /*****Patient Save Button*****/

Page 36: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

PATIENT SAVE:DECLARE

v_dup_app BOOLEAN;v_alert_val number(3);

BEGIN

IF (:APPOINTMENT.A_TIME>=8.00 and :APPOINTMENT.A_TIME<10.00) THEN

v_alert_val := SHOW_ALERT('ALERT_WORKING_HOUR');

clear_form;END IF;

v_dup_app := dup_appo(:APPOINTMENT.A_TIME,:APPOINTMENT.D_ID,:APPOINTMENT.A_DATE);

IF v_dup_app THENv_alert_val := SHOW_ALERT('ALERT_DUPAPP');

END IF;EXCEPTION

WHEN NO_DATA_FOUND THEN GO_BLOCK('Patient');

commit_form; clear_form;

WHEN OTHERS THEN v_alert_val := SHOW_ALERT('ALERT_DUPAPP');

END;

8. /*****Search Button*****/execute_query;

Page 37: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

9. /***** Key_Next_Item Trigger*****/ID KEY_NEXT_ITEM TRIGGER:DECLARE

v_dup_did BOOLEAN;v_alert_val number(3);

BEGINv_dup_did := dup_did(:DOCTOR.D_ID);IF v_dup_did THEN

v_alert_val := SHOW_ALERT('ALERT_DUPDID');IF v_alert_val = 88 THEN

clear_form;END IF;

END IF;EXCEPTION

WHEN NO_DATA_FOUND THEN next_item;WHEN OTHERS THEN

next_item;END;

10. /*****Bill Generate Button *****/DECLARE

Page 38: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

v_catid doctor.d_catid%TYPE;v_docfees category.fees%TYPE;v_amount category.fees%TYPE;v_totamount category.fees%TYPE;v_chk BOOLEAN;

BEGIN

SELECT d_catid INTO v_catidFROM doctorWHERE d_id=:D_ID;

SELECT fees INTO v_docfeesFROM categoryWHERE cat_id=v_catid; v_chk := chk_bill(:D_ID,:P_ID);

v_amount := v_docfees; :TEXT_FEES := v_docfees; IF v_chk = TRUE THEN v_amount := v_docfees - (v_docfees*0.1); :TEXT_DISCOUNT := 10; ELSE :TEXT_DISCOUNT := 0.0; END IF; v_totamount := v_amount + (v_amount*12.5/100); :FEES := v_totamount; EXCEPTION

Page 39: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

WHEN NO_DATA_FOUND :FEES := v_totamount;END;

11. /*****Check Bill for Discount Function*****/CREATE OR REPLACE FUNCTION chk_bill (v_did IN bill.d_id%TYPE,v_pid IN bill.p_id%TYPE)RETURN BOOLEANAS

v_found BOOLEAN ;v_temp1 bill.d_id%TYPE;v_temp2 bill.p_id%TYPE;CURSOR billcursor (v_docid number,v_patid number) ISSELECT v_docid,v_patid FROM dualWHERE (v_docid in (SELECT distinct d_id FROM bill)

AND v_patid in (SELECT distinct p_id FROM bill));BEGIN

OPEN billcursor(v_did,v_pid);FETCH billcursor into v_temp1,v_temp2;IF billcursor%FOUND THEN

v_found := TRUE ;ELSE

v_found := FALSE ;END IF;CLOSE billcursor;

RETURN v_found;

END chk_bill;

Page 40: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

12. /*****Doctor Income Generate Button*****/ DECLARE v_incm number(8); v_pno number(5); v_fee number(5);BEGIN

FOR C IN (select distinct doctor.d_id docid,d_name from doctor,doc_details where doctor.d_id =doc_details.d_id and c_id= :global.v_cen order by d_name)

LOOP:TEXT_NAME := C.d_name ;:TEXT_DID := C.docid ;SELECT count(p_id) INTO v_pnoFROM appointmentWHERE d_id = :TEXT_DID AND a_date=:TEXT_DATE

AND c_id = :global.v_cen;

SELECT fees INTO v_feeFROM doctor,categoryWHERE doctor.d_catid = category.cat_idAND doctor.d_id = :TEXT_DID;:TEXT_INCOME := (v_pno * v_fee);

:global.position := 1;

EXIT;END LOOP;

EXCEPTION WHEN NO_DATA_FOUND THEN :TEXT_INCOME := 0;

Page 41: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

:global.position := 1; WHEN OTHERS THEN :TEXT_INCOME := 0;

:global.position := 1;END;

13. /*****Doctor Previous Button*****/DECLARE

curr integer := 0 ;v_fee number(5);v_pno number(5);

BEGINFOR C IN (select distinct doctor.d_id

docid,d_name,d_age,d_gen from doctor,doc_details where doctor.d_id =doc_details.d_id and c_id= :global.v_cen order by d_name)

LOOP IF (curr = (:global.position - 1)) THEN :TEXT_NAME := C.d_name ; :TEXT_DID := C.docid ; SELECT count(p_id) INTO v_pno FROM appointment WHERE d_id = :TEXT_DID AND

a_date=:TEXT_DATE AND c_id = :global.v_cen;

SELECT fees INTO v_fee FROM doctor,category WHERE doctor.d_catid = category.cat_id AND doctor.d_id = :TEXT_DID;

Page 42: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

:TEXT_INCOME := (v_pno * v_fee); :global.position := :global.position - 1; EXIT; END IF; curr := curr +1 ;END LOOP;

EXCEPTIONWHEN NO_DATA_FOUND THEN :TEXT_INCOME := 0; :global.position := :global.position + 1;WHEN OTHERS THEN :TEXT_INCOME := 0; :global.position := :global.position + 1;

END;

14. /*****Doctor Next Button*****/DECLARE

curr integer := 0 ;v_pno number(5);v_fee number(5);

BEGINFOR C IN (select distinct doctor.d_id docid,d_name from

doctor,doc_details where doctor.d_id =doc_details.d_id and c_id= :global.v_cen order by d_name)

LOOP IF (curr = (:global.position + 1)) THEN :TEXT_NAME := C.d_name ; :TEXT_DID := C.docid ; SELECT count(p_id) INTO v_pno

Page 43: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

FROM appointment WHERE d_id = :TEXT_DID AND

a_date=:TEXT_DATE AND c_id = :global.v_cen;

SELECT fees INTO v_fee FROM doctor,category WHERE doctor.d_catid = category.cat_id AND doctor.d_id = :TEXT_DID; :TEXT_INCOME := (v_pno * v_fee);

:global.position := :global.position + 1; EXIT; END IF; curr := curr +1 ;END LOOP;

EXCEPTIONWHEN NO_DATA_FOUND THEN :TEXT_INCOME := 0; :global.position := :global.position + 1;WHEN OTHERS THEN :TEXT_INCOME := 0; :global.position := :global.position + 1;

END;15. /*****Doctor Total Fees by Date*****/

DECLAREv_pno number(5);v_fee number(5);v_dname doctor.d_name%TYPE;

BEGINSELECT count(p_id) INTO v_pno

Page 44: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

FROM appointmentWHERE d_id = :TEXT_DID AND (a_date

BETWEEN :TEXT_SDATE AND :TEXT_EDATE) AND c_id = :global.v_cen;

SELECT fees,d_name INTO v_fee,v_dnameFROM doctor,categoryWHERE doctor.d_catid = category.cat_idAND doctor.d_id = :TEXT_DID;

:TEXT_DNAME := v_dname;:TEXT_INCOME := (v_pno * v_fee);

EXCEPTION WHEN NO_DATA_FOUND THEN :TEXT_INCOME := 0;

:global.position := 1; WHEN OTHERS THEN :TEXT_INCOME := 0;

:global.position := 1;END;

Data Validations

1. /*****Function for checking duplicate patient ID*****/create or replace FUNCTION dup_pid (v_pid number)RETURN BOOLEANIS

Page 45: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

v_flag BOOLEAN; v_expid number(8);

BEGIN SELECT p_id INTO v_expid FROM patient WHERE p_id = v_pid; IF SQL%FOUND THEN v_flag := TRUE; ELSE v_flag := FALSE; END IF;

RETURN v_flag;END dup_pid;

2. /*****Function for checking duplicate doctor ID*****/create or replace FUNCTION dup_did (v_did number)RETURN BOOLEANIS v_flag BOOLEAN; v_exdid number(8); BEGIN

Page 46: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

SELECT d_id INTO v_exdid FROM doctor WHERE d_id = v_did; IF SQL%FOUND THEN v_flag := TRUE; ELSE v_flag := FALSE; END IF;

RETURN v_flag;END dup_did;

3. /*****Function for checking duplicate category ID*****/create or replace FUNCTION dup_catid (v_catid number)RETURN BOOLEANIS v_flag BOOLEAN; v_excat number(3); BEGIN SELECT cat_id INTO v_excat FROM category WHERE cat_id = v_catid; IF SQL%FOUND THEN v_flag := TRUE; ELSE v_flag := FALSE; END IF;

Page 47: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

RETURN v_flag;END dup_catid;

4. /*****Function for checking duplicate bill ID*****/create or replace FUNCTION dup_bid (v_bid number)RETURN BOOLEANIS v_flag BOOLEAN; v_exbid number(8); BEGIN SELECT b_id INTO v_exbid FROM bill WHERE b_id = v_bid; IF SQL%FOUND THEN v_flag := TRUE; ELSE v_flag := FALSE; END IF;

RETURN v_flag;END dup_bid;

BEGINif dup_bid(106) = true thendbms_output.put_line('true');else

Page 48: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

dbms_output.put_line('false');end if;END;

5. /*****Function for prevention of appointment in booked slot*****/create or replace FUNCTION dup_appo (v_time number,v_did number,v_date date)RETURN BOOLEANIS v_flag BOOLEAN; v_extime number(4,2); BEGIN SELECT a_time INTO v_extime FROM appointment WHERE d_id = v_did and a_date=v_date and a_time=v_time; IF SQL%FOUND THEN v_flag := TRUE; ELSE v_flag := FALSE; END IF;

RETURN v_flag;END dup_appo;

BEGINif dup_appo(7.30,120,'15-JUL-11') = true thendbms_output.put_line('true');else

Page 49: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

dbms_output.put_line('false');end if;END;

Future Enhancement

The software can become an integral part of the clinic management with further development –

Adding a few more details like medicine shop can transform the system to a basic patient management system.

Apart from that it can also be used as a base for developing the entire clinic management system which can range from staff to tests done on patients as well as equipments and medicine.

Page 50: Project Report - Outdoor Patient Doctor’s Booking System

Outdoor Patient Doctor’s Booking System

Reference

1. http://sqlzoo.net/ 2. http://forums.oracle.com/ 3. http://www.java2s.com/