You are on page 1of 71

A PROJECT REPORT

ON

HOSPITAL MANAGEMENT SYSTEM

Submitted in partial fulfillment of the requirement for the degree of

Bachelor of Computer Application (BCA)

By

CHANDRA BHUSHAN VERMA


ENROLL. NO. 2007-301-15
Session – 2007-2010

Under the Supervision of

Mrs.Parul Aggrwal
Department of Computer Science

JAMIA HAMDARD
(HAMDARD UNIVERSITY)
HAMDARD NAGAR, NEW DELHI -110062

1
Certificate

2
DECLARATION

I hereby declare that the minor project work entitled “Hospital Management System”
submitted for the BCA (3rd year course) is my original work carried out by me under the
guidance of Mrs.ParulAggrwal for the partial fulfillment of the award of the degree of the
Bachelor of Computer Application. The matter embodied in this report has not submitted
anywhere else for the award of any other degree/diploma.

Place: Delhi

Signature of the Candidate

3
ACKNOWLEDGEMENT

The project work mentioned in this report, is the result of cumulative efforts over a period
of an entire year in course of which, I have received intellectual support from various
sources. It is my pleasure to express my profound sense of gratitude to all those who have
contributed richly to this project and have been highly instrumental in making this a
success. I am highly indebted to my teacher Mrs.Parur Aggrwal for giving me an
opportunity to work on this project. She has been an invaluable source of guidance and
motivation at all stages of my work.

CHANDRA BHUSHAN VERMA


ENROLL. NO. 2007-301-15

4
ABSTRACT

Hospital Management System is a regulatory framework introduced by the Basel


Committee of hospitality Supervision. Its aim is to improve international capital
supervision. Hospitals have to apply this legislation in order to have a sufficient level of
capital in case of unexpected defaults. There is, however, room for different local
interpretations, given the nature of the new regulatory framework. Hospital can, for
example, make judgments of capital requirements internally if national authorities
approve them. In times of financial crisis it is of great importance that hospital handle
risk correctly. Thus, in the current situation, it is especially interesting to study how the
regulatory framework, aimed to create stability in the financial system, is applied
internally in hospital.

5
TABLE OF CONTENTS

S.NO. CONTENTS PAGE

1 INTRODUCTION. 8

PROBLEM STATEMENT 9

3 FEABSIBILITY STUDY 12

4 HARDWARE AND SOFTWARE 15


SOFTWARE REQIUREMENT

5 SYSTEM REQUIREMENT SPECIFICATION 16

6 DATA FLOW DIAGRAM 17

7 E-R DIAGRAM 20

8 DESIGN OBJECTIVE 22

9 SYSTEM ANALYSIS 24

10 SYSTEM DEVELOPMENT LYFE CYCLE 26

11 DATA BASE TABLE 27

12 CODING 29

13 SNAPSHOTS 56

14 TESTING 67

15 CONCLUSION 69

16 BIBLIOGRAPHY 70

6
S. NO. CONTENTS OF TABLE

1 Login table

2 Room table

3 Staff table

4 Patient table

5 Patient Admit table

7
INTRODUCTION

Hospital Management System is a tool that It provides efficient services to its Patient.
The various types of operations and dealings take places in the Hospital. But we had
undertaken the work of Computerization of Generation of Hospital and Management
which covers the activities related to Patient, Staff etc. & All Types of activities
corresponds to the Doctors, these operations were manually operated by the clerks and
Operator and the operations were really time consuming task to perform. The present
system will help them a lot.

8
PROBLEM SELECTION

One of the most difficult tasks of system analysis is developing a clear, in-depth under- standing
of the problem being investigated, without which it becomes impossible to specify the
requirements for a new project with any accuracy. Several questions should be posed for this.

Some of those may be:


What is the problem?
How complex is it?
What are its likely causes?
Why is it important that the problem be solved?
What are possible solutions to the problem?
What types of benefits can be expected once the problem is solved?

It takes considerable skill to determine the true cause of a systems problem. A systems analyst
might begin to define the problem by determining if the problem can be classified ac- cording to
one or more common types of systems problems. With knowledge of the Common types of
problems, the analyst can diagnose a problem by examining its characteristics.

Organizations usually face problems or have opportunity due to the following:


A new product or plant or branch
A new market or new process
Failure of an existing system
Inefficiency of an existing system
Structural error in the existing system, etc.

For identifying problems/opportunities, we scan the following:


The performance of the system
The information being supplied and its form

9
The economy of processing
The control of the information processing
The efficiency of the existing system
The security of the data and software
The security of the equipment and personnel, etc.

After identification of the problem, it is defined and a general direction or method for solving
this problem is also determined. Then project boundaries are defined. The management
establishes the term of reference as well as the resources to be provided for the project. System
development is an iterative process and the first identifiable stage of it is Problem Definition,
whose final output is Terms of Reference.

Careful analysis of this system suggests a number of different problems:

Problem of Reliability
Current system is not reliable. It seems to vary in quality and results from one month to the,
next. Some times it gives good output, but some times the output is worst.
Problem of Accuracy
There are too many mistakes in reports and calculations.
Problem of timeliness
In the current system the reports and output produced is mostly late and in most of the cases it is
useless because it is not on time.
Problem of Validity
The output and reports mostly contains misleading information. The transactions and
calculations are sometimes not valid.
Problem of Economy
The current system is very costly. We have to spend lots of money in manual filing, calculations
and remembering the information, but still not get the desired results.
Problem of Capacity
The current system is suffering from problem of capacity also. The workload is too much. Few
peoples cannot handle all the working

10
FEASIBLITY ANALYSIS

Feasibility study

11
Many feasibility studies are disillusioning for both users and analysts. First, the study often
presupposes that when the feasibility document is being prepared, the analyst is in a position to
evaluate solutions. Second, most studies tend to overlook the confusion inherent in system
development- the constraints and the assumed attitudes. If the feasibility study is to serve as a
decision document, it must answer three key questions:- :

1. Is there a new and better way to do the job that will benefit the user ?
2. What are the costs and savings of the alternative(s)?
3. What is recommended?

The most successful system projects are not necessarily the biggest or most visible business but
rather those that truly meet user expectations. More projects fail because of inflated expectations
than for any other reason.

Feasibility considerations
Three key considerations are involved in the feasibility analysis:-
Economic, technical, behavioral.
Let's briefly review each consideration and how it relates to the
System efforts.

Depending on the results of the initial investigations, the survey is expanded to a more detailed
feasibility study. A feasibility study is a test of a system proposal according to its workability,
impact on the organization, ability to meet user needs, and effective use of resources.

Type of feasibilities

1. Economic Feasibility

12
Economic analysis is the most frequently used technique for evaluating the effectiveness of a
proposed system. More commonly known as cost / benefit analysis; in this procedure we
determine the benefits and savings that are expected from a proposed system and compare them
with costs. We found the benefits outweigh the costs; we take a decision to design and
implement the new proposed system.

Conversely, an alternative that was much cheaper than others but with unacceptable impacts
might be considered unacceptable depending on the resources, impacts and others values the
alternative brings with it.

2. Technical Feasibility

This is concerned with specifying equipment and software that will successfully satisfy the user
requirement. The technical needs of the system may vary considerably, but might include:
· The facility to produce outputs in a given time.
· Response time under certain conditions.
· Ability to process a certain volume of transaction at a particular speed.
· Facility to communicate data to distant location.

3. Social feasibility

Social feasibility is a determination of whether a proposed project will be acceptable to the


people or not. This determination typically examines the probability of the project being
accepted by the group directly affected by the proposed system change.

4. Management feasibility

13
It is a determination of whether a proposed project will be acceptable to management. If
management does not accept a project or gives a negligible support to it, the analyst will tend to
view the project as a non-feasible one.

5. Legal feasibility

Legal feasibility is a determination of whether a proposed project infringes on known Acts,


Statutes, as well as any pending legislation. Although in some instances the project might appear
sound, on closer investigation it may be found to infringe on several legal are a word of caution
regarding life cycle activities. We isolate and sequence these activities for learning purposes, but
in real life they overlap and are highly interrelated. For example, when

6. Time feasibility
Time feasibility is a determination of whether a proposed project can be implemented fully
within a stipulated time frame. If a project takes too much time it is likely to be rejecte

14
HARDWARE AND SOFTWARE REQUIREMENT

1. SOFTWARE REQUIREMENT

OPERATING SYSTEM: Windows 98 / 2000 / XP

LANGUAGE USED: C - Language

2. HARDWARE REQUIREMENT

RAM REQUIRED: 128MB

PROCESSOR: Pentium lll

15
SYSTEM REQUIREMENT SPECIFICATION

The function and performance allocated to software as part of system engineering are
refined by establishing a complete information description, a detailed functional and
behavioral description, an indication of performance requirement and design
constraints, appropriate validation criteria, and other data pertinent to requirements.
the outlines of system requirement specification are:

Introduction:
The system requirement specification document forms the basis for the design and
development of the “HOSPITAL MANAGEMENT SYSTEM”. The purpose of this
document is to define all the process involved in addition, viewing, modifying of
passenger record. The requirement of the software relating to the functionality,
interfaces, logical database requirement and various other aspect of the software are
also explicitly defined.

Information Description:
The development of this system assists in the maintenance of the information and to
fulfill the complete software requirement of the package.

Functional Description:
A processing narrative is provided for each function, design constraints are stated
and justified, performance characteristics are stated and diagram is included.

Validation and Criteria:


For successful implementation of the system we should define the performance
bounds, and expected software response. At the time of creating new entry, system
performs different types of validation like user can not overwrite the existing
information, it asks the user, this information already exist and also many feature.

16
DFD FOR USER LOGIN

USER 1 User_id
User Enter Their Password & User_Id for
Opening the application
Accessing User
Information
Invalid Pasword
Validity
Process
User Matched Accessing User
Information

Valid User for Type


Matching

User Type
Invalid User Type
Validity
Process
Matched

17
DFD FOR ROOM

t ROOM

Room details

Data
Validity
Process 1 Patient1
Room not
available

2 Patient2

18
DFD FOR PATIENT

PATIENT
1 Room1

Accessing Patient
Info

Searching Room

Not found

Display Process
Available room

19
ENTITY – RELATIONSHIP DIAGRAM

The entity – relationship (E – R) data model is based on a perception of a real world that
consists of a collection of basic objects, called entities, and of relationships among these
objects. An entity is a thing or objects in the real world that is distinguishable from other
objects. Entities are described in database by a set of attributes.

A relationship is an association among several entities. The set of all entities of the same
type and the set of all relationships of the same type are termed as entity set and
relationship set, respectively.

The overall logical structure (schema) of a database can be expressed graphically by an


E-R Diagram, which is built up from the following components:

 Rectangles, which represents entity sets.

 Ellipses, which represents attributes.

 Diamonds, which represents relationships among entity sets.

 Lines, which link attributes to entity sets and entity sets to relationships.

20
Rent
Age Phon
Address e
Roomtype Name
Roomno
ROOM
Patient
Roomno Admit

Date

Contains Pid
Has

HOSPITAL
MANAGEMENT

Have staff
members

Address

Staff

Staffid

Post
Name

21
DESIGN OBJECTIVE

Desugn is an excat blueprint of what will be built & a basis for the configuration &
content of that blueprint .The primary objective of the design is to deliver the
requirements as specified in the feasibility report. Following objectives should be kept in
mind: -

1. Practicability

The system must be stable & can be operated by people of average intelligence.

2. Efficiency

Good design should be efficient as it should properly use the scare resource of
system. Two of the important such resources are processor time & memory. An
efficient system consumes less processor time & memory.

3. Cost

It is desirable to aim for a system with a minimum cost subject to the condition that it
must satisfy all the requirements.

4. Flexibility

The system should be modifiable depending on the changing needs of the user; Such
modifications should not entail extensive reconstruction or recreation of software. It
should also be portable to different computer systems.

5. Security

This is very important aspect of the design & should cover areas as hardware reliability,
fall back procedures, physical security of data & provision of detection of fraud & abuse.

6. Reliability

22
The end user will normally specify reliability requirements for new system.these
requirements may be expressed in terms of mean time between failures or mean time
to repair or system availability.

7. Correctness

Good design should correctly implement both, all of the explicit requirements
contained in the analysis model and all of the implicit requirements desired by the
customer.

8. Understandability

The design should be a readable, simple, understandable guide for those who generate
code and for those who test and subsequently support the system.

9. Modularity

It aims for composition of a problem into modules which results in reduction of


complexity of the design solution.

10. Completeness

Good design should cover all relevant data structures, modules, external interface and
module interconnection.

11. Consistency

Design should follow consistency through the system. it aims that there is no inherent
inconsistencies in the design.

12. Verifiability

Concerned with how easily the correctness of design canbe checked.

13. Traceabiliy

Design should be traceable. Traceable design aid design verification.

23
SYSTEM ANALYSIS

Systems analysis and design refers to the process of examining a business situation with the
intent of improving it through better procedures and methods. Systems development can
generally be thought of as having two major components: Systems Analysis and Systems Design.
Systems design is the process of planning a new system or replace or complement an existing
system. But before this planning can be done, we must thoroughly understand the existing
system and determine how computers can best be used to make its operation more effective.
Systems analysis, then, is the process of gathering and interpreting facts, diagnosing problems
and using the information to recommend improvement to the system. In brief, we can say that
analysis specifies what the system should do. Design states how to accomplish the objective.

The selection process should be viewed as a project and a project team should be formed with
the help of m

1. Requirements analysis The first step in selection understands the user's requirements
within the framework of the organization’s objectives and the environment in which the system
is being installed.

2. System specifications System specifications must be clearly defined. These specifications


must reflect the actual applications to be handled by the system and include system objectives,
flowcharts, input-output requirements, file structure and cost.

3. Request for proposal After the requirement analysis and system specifications have been
defined, a request for proposal is prepared and sent to selected vendors for bidding.

4. Evaluation and validation The evaluation phase ranks various vendor proposals and
determines the one best suited to the user's requirements. It looks into items such as price,
availability and technical support. System validation ensures that the vendor can, in fact, match
his/her claims, especially system performance.

24
5. Vendor selection This step determines the vendor with the best combination of reputation,
reliability, service record, training, delivery time, lease/finance terms. The selected vendors are
invited to give a presentation of their system. The system chosen goes through contract
negotiations before implementation.

25
SYSTEM DEVELOPMENT LIFE CYCLE

Software development is a complex process so we divide the process in a small module.


These modules are called system development phases. These phases are combinedly
known as system development life cycle. These linear cycle phases are given below: -

i. Recognition of Needs It includes preliminary survey and initial investigation by


personnel interviews and questionnaires.

ii. System Analysis Detailed evaluation of present system and data collection is done.
The various reports and documents used are studied in detail. After that the
interview of various levels of management is carried out. The DFD. Data dictionary,
Menu chart are the tools used for it.

iii. System Desigh It involves general and detailed design specification, output, input
files, files, program construction plans, all these details are submitted to user and got
signed.

iv. System Construction It involves implementation of total construction plan i.e.


coding. It is done in a language i.e. known to user, analyst and programmer.

v. Testing Each and every input and output program is executed separately and tested
for bugs. Whole of the system is executed and test data is prepared and is fed in to
the system and the output reports are compared with the parameters.

vi. Implementation It checks that users requirement are fulfilled or not. Response time
is checked and finally the user manual is prepared and is submitted.

26
DATABASE TABLE

All the tables, sequences, triggers are stored in database for storing the information about
entrance test made by the users.
Following are the tables:

Login Table
Loginname Text
Password Text

Room Table
Room no AutoNumber
Room type Text
Rent per day Number

Staff Table
Staff id AutoNumber
Name Text
Age Number
Dateofjoining Date
Qualificateion Text
Address Text
Phone Text
Dept Text
Salary Number

Patient Table

Patientid AutoNumber
Name Text
Fname Text

27
Address Text
Age Number
PhoneNo Text
Roomno Number

PatientAdmit Table
Formno AutoNumber
Date Date
PatientId Number
Roomno Number
Staffid Number
Adv.amount Number
Remarks Text

28
CODING

#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<string.h>
#include<process.h>
#include<graphics.h>

void pass ();


void welcome();
void hospital();
void docmenu();

void patmenu();
void menu();
void patientmenu();
void patentry();
void showPat();
void modPat();
void patRel();

void doctorMenu();
void getdoc ();
void showDoc();
void deldoc();
void modDoc();

void main ()
{
char ch;
pass ();
welcome();
menu();
hospital();
patmenu();
docmenu();
getch();
}
void pass()
{
char pass[10];
int x;
int ctr, in=0;
while(in<3)
{
ctr=0;
clrscr();
gotoxy(20,13);

29
printf("Please Enter the password --> ");
while(1)
{
x=getch();
if(x==13) break;
pass[ctr]=(char)x;
printf("*");
ctr++;
if(ctr>9) break;
}
gotoxy(10,18);
printf("Verifing , Plz Wait ");
for(x=0;x<10;x++)
{
delay(200);
printf(".") ;
}
if(strncmpi(pass,"VERMA",5)!=0)
{
in++;
gotoxy(45,3);
printf("Sorry , Wrong password,");
gotoxy(4,23);
printf("Press any key to contd........");
getch();
}
else
{ gotoxy(4,23);
printf("RIGHT,Press any key to cont.....");
getch();
break;
}
}
if(in==3)
{
clrscr();
gotoxy(20,15);
printf("Sorry you can't open this project, Try later
");
gotoxy(5,23);
printf("Press any key for exit");
getch();

}
}

void welcome()
{
int gd=DETECT,gm,x,y;
clrscr();
initgraph(&gd,&gm,"c:\\tc\\bgi");
setcolor(LIGHTRED);

30
rectangle(70,30,570,150);sound(5000);delay(1000);nosound();
settextstyle(SCRIPT_FONT,HORIZ_DIR,9);
setcolor(LIGHTCYAN);
moveto(110,8);
outtext("WELCOME");
sound(2000);delay(1000);nosound();
settextstyle(BOLD_FONT,HORIZ_DIR,2);
setcolor(LIGHTBLUE);
moveto(50,160);
outtext("HOSPITIAL MANAGEMENT SYSTEM");
sound(1000);delay(1000);nosound();
setcolor(YELLOW);
line(50,210,595,210);
sound(3000);delay(1000);nosound();
settextstyle(SMALL_FONT,HORIZ_DIR,8);
setcolor(LIGHTCYAN);
moveto(270,260);
outtext("DEVELOPED BY . . .");
sound(600);delay(1000);nosound();
settextstyle(BOLD_FONT,HORIZ_DIR,3);
setcolor(LIGHTGREEN);
moveto(300,330);
outtext("C.B Verma & Ammar Naqi");
sound(400);delay(1000);nosound();
settextstyle(SIMPLEX_FONT,HORIZ_DIR,3);
setcolor(LIGHTMAGENTA);
moveto(150,400);
outtext("PRESS ANY KEY TO CONTINUE .....");
getch();
closegraph();
}

void menu()
{
char ch;
union REGS i,o;
int gd=DETECT,gm,x,y;
initgraph(&gd,&gm,"c:\\tc\\bgi");
settextstyle(BOLD_FONT,HORIZ_DIR,1);
setcolor(LIGHTGREEN);
moveto(130,5);
outtext("M");
setcolor(LIGHTRED);
moveto(152,5);
outtext("A");
setcolor(LIGHTBLUE);
moveto(172,5);
outtext("I");
setcolor(LIGHTCYAN);
moveto(182,5);
outtext("N");

31
setcolor(LIGHTBLUE);
moveto(226,5);
outtext("M");
setcolor(YELLOW);
moveto(248,5);
outtext("E");
setcolor(LIGHTCYAN);
moveto(270,5);
outtext("N");
setcolor(LIGHTGREEN);
moveto(292,5);
outtext("U");
setcolor(WHITE);
moveto(130,28);
outtext("*************");
setcolor(LIGHTRED);
rectangle(100,80,345,250);
settextstyle(BOLD_FONT,HORIZ_DIR,1);
setcolor(LIGHTCYAN);
moveto(120,80);
outtext("HOSPITIAL ( H )");
settextstyle(BOLD_FONT,HORIZ_DIR,1);
setcolor(LIGHTGREEN);
moveto(120,120);
outtext("DOCTOR ( D )");
setcolor(BROWN);
settextstyle(BOLD_FONT,HORIZ_DIR,1);
setcolor(LIGHTBLUE);
moveto(120,160);
outtext("PATIENT ( P )");
settextstyle(BOLD_FONT,HORIZ_DIR,1);
setcolor(YELLOW);
moveto(120,200);
outtext("EXIT ( X )");
settextstyle(SMALL_FONT,HORIZ_DIR,8);
setcolor(LIGHTCYAN);
moveto(120,373);
outtext("ENTER YOUR CHOICE ....");
gotoxy(55,25);
do
{
gotoxy(54,25);
printf(" ");
gotoxy(54,25);
ch=getche();
printf("%c",ch);
getch();
if(ch=='h'||ch=='H'||ch=='d'||ch=='D'||ch=='p'||
ch=='P'||ch=='x'||ch=='X')
break;
}
while(1);

32
closegraph();
if(ch=='d'||ch=='D')
{
docmenu();
}
if(ch=='x' || ch=='X')
exit(0);
if(ch=='p'|| ch=='P')
patmenu();
if(ch=='h' || ch=='H')
hospital();
}

void hospital()
{

int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
settextstyle(BOLD_FONT,HORIZ_DIR,1);
setcolor(LIGHTGREEN);
moveto(50,1);
outtext("INFORMATION OF HOSPITAL");
setcolor(LIGHTRED);
moveto(50,30);
outtext("---------------------");
settextstyle(SMALL_FONT,HORIZ_DIR,5);
setcolor(LIGHTBLUE);
moveto(2,80);
outtext("NAME OF THE HEAD : DR. PRANAV
SINHA(MBBS,MD,FRCS(London)) ");
moveto(2,110);
outtext("NUMBER OF BEDS : 400 ");
moveto(2,140);
outtext("NUMBER OF DEPARTMENTS : 6 ");
moveto(2,170);
outtext("NAME OF THE DEPARTMENTS :
MEDICINE,SURGURY,CARDIOLOGY,");
moveto(200,200);
outtext(" RADIOLOGY,GYNOCOLOGY,ORTHOPEDIX ");
setcolor(LIGHTGREEN);
moveto(20,430);
outtext("Press any key to continue.........");
getch();
closegraph();
exit(0);
}

struct patient
{
int pno;
char name[30];
int age;

33
char add[40];
char date[20];
char sex[10];
char blood[20];
char disease[20];
};
FILE *f ,*temp;
struct patient p,ptemp;

void patmenu()
{
char pass[10];
int x;
int ctr, in=0;
while(in<3)
{
ctr=0;
clrscr();
gotoxy(20,13);
printf("Please Enter the password --> ");
while(1)
{
x=getch();
if(x==13) break;
pass[ctr]=(char)x;
printf("*");
ctr++;
if(ctr>9) break;
}
gotoxy(10,18);
printf("Verifing , Plz Wait ");
for(x=0;x<10;x++)
{
delay(100);
printf(".") ;
}
if(strncmpi(pass,"verma",5)!=0)
{
in++;
gotoxy(45,3);
printf("Sorry , Wrong password,");
gotoxy(4,23);
printf("Press any key to contd........");
getch();
}
else
break;
}
if(in==3)
{
clrscr();

34
gotoxy(20,15);
printf("Sorry u can't enter in doctor department ");
gotoxy(5,23);
printf("Press any key for main menu");
getch();
exit(0);
}
else
{
patientmenu();
}
}
void patientmenu()
{
int ch,dch;
clrscr();
printf("\n\t\t\t PATIENT MENU\n\t\t\t *************");
printf("\n\n\n\t\t\tENTER RECORD [E]");
printf("\n\n\t\t\tCHECK RECORD [C]");
printf("\n\n\t\t\tDELETE RECORD [D]");
printf("\n\n\t\t\tMODIFY RECORD [M]");
printf("\n\n\t\t\tQUIT [Q]");
printf("\n\n\n\n\n\t\t\tENTER YOUR CHOICE .... ");
while(1)
{
gotoxy(47,19);
printf(" ");
gotoxy(47,19);
ch=getche();
getch();
if(ch=='e'||ch=='E'||ch=='c'||ch=='C'||ch=='d'||ch=='D'||
ch=='m'||ch=='M'||ch=='q'||ch=='Q')
break;
}
if(ch=='e'|| ch=='E')
{
while(1)
{
patentry();
gotoxy(5,23);
printf("ENTER ANOTHER ENTRY (N for exit): ");
dch=getche();
if(dch=='n'||dch=='N')
{
patientmenu();
}
else
getch();
}
}
if(ch=='m' || ch=='M')
modPat();

35
if(ch=='d' || ch=='D')
patRel();
if(ch=='q' || ch=='Q')
exit(0);
if(ch=='c' || ch=='C')
showPat();
}
void patentry()
{
int no;
int flag=0;
clrscr();
fclose(f);
f = fopen("c:\\pat.dat","a");
fclose(f);
gotoxy(30,2);
printf("PATIENT ENTRY FORM");
gotoxy(10,4);
printf("ENTER PATIENT NUMBER : ");
gotoxy(10,6);
printf("ENTER PATIENT NAME : ");
gotoxy(10,8);
printf("ENTER PATIENT AGE : ");
gotoxy(10,10);
printf("ENTER ADDRESS : ");
gotoxy(10,12);
printf("DATA OF ADMIT(DD-MM-YY) : ");
gotoxy(10,14);
printf("ENTER SEX : ");
gotoxy(10,16);
printf("ENTER BLOODGROUP : ");
gotoxy(10,18);
printf("ENTER DESEASE : ");
gotoxy(40,4) ;
scanf("%d",&p.pno);
fclose(temp);
temp=fopen("c:\\pat.DAT","r");
while(1)
{
fread(&ptemp,sizeof(ptemp),1,temp);
if(feof(temp)) break;
if(p.pno == ptemp.pno)
{
flag=1;
}
}
fclose(temp);
if(flag==1)
{
gotoxy(5,23);
printf("Patient number allready exist Enter another
number ");

36
getch();
patentry();
}
fflush(stdin);
gotoxy(40,6);
gets(p.name);
fflush(stdin);
gotoxy(40,8);
scanf("%d",&p.age);
fflush(stdin);
gotoxy(40,10);
gets(p.add);
fflush(stdin);
gotoxy(40,12);
fflush(stdin);
gets(p.date);
gotoxy(40,14);
scanf("%s",p.sex);
fflush(stdin);
gotoxy(40,16);
scanf("%s",p.blood);
fflush(stdin);
gotoxy(40,18);
gets(p.disease);
fflush(stdin);
fclose(f);
f=fopen("c:\\pat.DAT","a");
fwrite(&p,sizeof(p),1,f);
fclose(f);
}
void showPat()
{
int flag=0,no,ch,ctr=0;
char name[20];
top:
clrscr();
printf("\n\n\n\n\n\n\t\t\t\tPatient's Report
Menu\n\n");
printf("\n\n\t\t\t1. All Patient's Report");
printf("\n\n\t\t\t2. Particular Patient's Report");
printf("\n\n\t\t\t3. Access Record by Disease");
printf("\n\n\t\t\t4. Back to Prev Menu");
printf("\n\n\t\tPlz enter your choice --> ");
scanf("%d",&ch);

if(ch==1)
{
fclose(f);
f=fopen("c:\\pat.DAT","r");
ctr=0;
page :
clrscr();

37
printf("\n\t\t\t\tPATIENT'S REPORT");
printf("\n
ÉÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍÍÍËÍÍ
ÍÍÍÍÍÍÍÍÍË");
printf("\n º PATNO º NAME º ADDRESS
º AGE ºB.Gr.º SEX º DISEASE º");
printf("\n
ÌÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÍÍÎÍÍ
ÍÍÍÍÍÍÍÍ͹");
while(1)
{
fread(&p,sizeof(p),1,f);
if(feof(f)) break;
ctr++;
if((ctr%14)==0)
{
printf("\n
ÈÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÍÍÊÍÍ
ÍÍÍÍÍÍÍÍͼ");
printf("\npress any key for next
page");
getch();
goto page;
}
printf("\n º%5d º %-13sº %-17sº%-5dº
%-4sº %-6sº %-9s
º",p.pno,p.name,p.add,p.age,p.blood,p.sex,p.disease);
}
printf("\n
ÈÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÍÍÊÍÍ
ÍÍÍÍÍÍÍÍͼ");
printf("\n\n%d rows selected",ctr);

fclose(f);
getch();
goto top;
}
if(ch==2)
{
clrscr();
gotoxy(20,13);
printf("PLZ ENTER PATIENT NUMBER TO DISPLAY
--> ");
scanf("%d",&no);
fclose(f);
f=fopen("c:\\PAT.DAT","r");
while(1)
{
fread(&p,sizeof(p),1,f);
if(feof(f)) break;
if(p.pno==no)
{

38
flag=1;
clrscr();
printf("\n\n\n\t\t\tDATA OF
PATIENT : %s",strupr(p.name));
printf("\n\n\n\t\t PATIENT
NUMBER :- %d",p.pno);
printf("\n\n\t\t PATIENT NAME
:- %-20s",strupr(p.name));
printf("\n\n\t\t PATIENT ADDRESS
:- %-20s",strupr(p.add));
printf("\n\n\t\t PATIENT AGE
:- %-5d",p.age);
printf("\n\n\t\t DATE OF
ADMISSION :- %-20s",strupr(p.date));
printf("\n\n\t\t PATIENT SEX
:- %-15s",strupr(p.sex));
printf("\n\n\t\t BLOOD GROUP
:- %-20s",strupr(p.blood));
printf("\n\n\t\t PATIENT DISEASE
:- %-20s",strupr(p.disease));
}
}
gotoxy(5,25);
if(flag==0)
printf("Patient not exist ,press any
key to contd....");
else
printf("Press any key to
contd............");
getch();
goto top;
}
if(ch==3)
{
clrscr();
fclose(f);
f=fopen("c:\\pat.DAT","r");
fflush(stdin);
printf("\n\n\n\n\n\n\n\t\t\tENTER PATIENT'S
DISEASE : ");
gets(name);
ctr=0;
ppage:
clrscr();
printf("\n\t\t\t\tPATIENT'S REPORT");
printf("\n
ÉÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍÍÍËÍÍ
ÍÍÍÍÍÍÍÍÍË");
printf("\n º PATNO º NAME º ADDRESS
º AGE ºB.Gr.º SEX º DISEASE º");

39
printf("\n
ÌÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÍÍÎÍÍ
ÍÍÍÍÍÍÍÍ͹");
while(1)
{
fread(&p,sizeof(p),1,f);
if(feof(f)) break;
if(strcmpi(p.disease,name)==0)
{
ctr++;
if((ctr%14)==0)
{
printf("\n
ÈÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÍÍÊÍÍ
ÍÍÍÍÍÍÍÍͼ");
printf("\npress any key for
next page");
getch();
goto page;
}
printf("\n º%5d º %-13sº %-17sº
%-5dº %-4sº %-6sº %-9s
º",p.pno,p.name,p.add,p.age,p.blood,p.sex,p.disease);
}
}
printf("\n
ÈÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÍÍÊÍÍ
ÍÍÍÍÍÍÍÍͼ");
printf("\n\n%d rows selected",ctr);
fclose(f);
getch();
goto top;
}
if(ch==4)
patientmenu();
}
void patRel()
{
int pno;
int flag=0;
clrscr();
gotoxy(20,13);
printf("ENTER PATIENT NUMBER FOR RELIEF : ");
scanf("%d",&pno);
fclose(f);
f=fopen("c:\\pat.DAT","r");
temp=fopen("c:\\pattemp.dat","w");
while(1)
{
fread(&p,sizeof(p),1,f);
if(feof(f)) break;
if(p.pno == pno)

40
{
flag=1;
}
else
{
fwrite(&p,sizeof(p),1,temp);
}
}
fclose(f);
fclose(temp);
if(flag==0)
{
gotoxy(5,23);
printf("Patient not found ,press any key to contd....
");
}
else
{
gotoxy(5,23);
printf("Patient Relief , Press any key to
contd.....");
f=fopen("c:\\pat.DAT","w");
temp=fopen("c:\\pattemp.dat","r");
while(f)
{
fread(&p,sizeof(p),1,temp);
if(feof(temp)) break;
fwrite(&p,sizeof(p),1,f);
}
fclose(temp);
fclose(f);
}
getch();

patientmenu();

}
void modPat()
{
int no,flag=0,quit=0;
int gd=DETECT,gm,x,y;
int ch;
clrscr();
gotoxy(20,13);
printf("ENTER PATIENT NUMBER TO MODIFY --> ");
scanf("%d",&no);
modRec:
fclose(f);
fclose(temp);

f=fopen("c:\\pat.DAT","r");
temp= fopen("c:\\pattemp.dat","w");

41
while(1)
{
fread(&p,sizeof(p),1,f);
if(feof(f)) break;
if(p.pno != no)
{
fwrite(&p,sizeof(p),1,temp);
}
else
{
clrscr();
initgraph(&gd,&gm,"c:\\tc\\bgi");
printf("\n\n\t\t\tDATA OF PATIENT :
%s\n\n",strupr(p.name));
printf("\n\n PATIENT NUMBER :- %-
5d",p.pno);
printf("\n PATIENT NAME :- %-
20s",strupr(p.name));
printf("\n PATIENT AGE :- %-
4d",p.age);
printf("\n PATIENT ADDRESS :- %-
20s",strupr(p.add));
printf("\n PATIENT SEX :- %-
12s",p.sex);
printf("\n ADMISSION DATE :- %-
20s",strupr(p.date));
printf("\n BLOOD GROUP :- %-
10s",strupr(p.blood));
printf("\n PATIENT DISEASE :- %-
20s",strupr(p.disease));
printf("\n\n\n\tENTER YOUR CHOICE .... ");
setcolor(LIGHTBLUE);
rectangle(70,300,500,400);
settextstyle(SMALL_FONT,HORIZ_DIR,5);
setcolor(LIGHTGREEN);
moveto(80,310);
moveto(220,310);
outtext("NAME [N]");
moveto(390,310);
outtext("AGE [A]");
moveto(80,340);
outtext("ADDRESS [R]");
moveto(220,340);
outtext("ADMISSION_DATE [D]");
moveto(390,340);
outtext("SEX [S]");
moveto(80,370);
outtext("BLOOD_GROUP [B]");
moveto(220,370);
outtext("DISEASE [I]");
moveto(390,370);
outtext("QUIT [Q]");

42
gotoxy(30,16);
ch=getch();
closegraph();
if(ch=='n'||ch=='N')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER NAME :-
");
gets(p.name);
fflush(stdin);
}
else if(ch=='a'||ch=='a')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER AGE :
");
scanf("%d",&p.age);
fflush(stdin);
}
else if(ch=='r'||ch=='R')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER
ADDRESS : ");
fflush(stdin);
gets(p.add);
}
else if(ch=='d'||ch=='D')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER
ADMISSION_DATE (dd-mm-yy) : ");
fflush(stdin);
gets(p.date);
}
else if(ch=='s'||ch=='S')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER SEX :
");
scanf("%s",p.sex);
fflush(stdin);
}
else if(ch=='b'||ch=='B')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER BLOOD
GROUP : ");
scanf("%s",p.blood);
fflush(stdin);
}
else if(ch=='i'||ch=='I')

43
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER
DISEASE : ");
fflush(stdin);
gets(p.disease);
fflush(stdin);
}
else if(ch=='q'||ch=='Q')
{
quit=1;
}
fwrite(&p,sizeof(p),1,temp);
flag=1;
}
fread(&p,sizeof(p),1,f);
}
fclose(f);
if(flag==0)
{
printf("Patient not found Enter another number
\n");
getch();
patientmenu();
}
fclose(temp);
f=fopen("c:\\pat.DAT","w");
temp=fopen("c:\\pattemp.dat","r");
while(1)
{
fread(&p,sizeof(p),1,temp);
if(feof(temp)) break;
fwrite(&p,sizeof(p),1,f);
}
fclose(f);
fclose(temp);
if(quit==1)
patientmenu();
if(flag==1)
goto modRec;
}

struct doctor
{
int dno;
char dname[30],dadd[40];
long int dphone;
char dbirth[15],dsex[8],dquali[30],dspecial[30],djoin[15];
};

struct doctor d,dtemp;

44
void docmenu()
{
char pass[10];
int x;
int ctr, in=0;
while(in<3)
{
ctr=0;
clrscr();
gotoxy(20,13);
printf("Please Enter the password --> ");
while(1)
{
x=getch();
if(x==13) break;
pass[ctr]=(char)x;
printf("*");
ctr++;
if(ctr>9) break;
}
gotoxy(10,18);
printf("Verifing , Plz Wait ");
for(x=0;x<10;x++)
{
delay(100);
printf(".") ;
}
if(strncmpi(pass,"YADAV",5)!=0)
{
in++;
gotoxy(45,3);
printf("Sorry , Wrong password,");
gotoxy(4,23);
printf("Press any key to contd........");
getch();
}
else
break;
}
if(in==3)
{
clrscr();
gotoxy(20,15);
printf("Sorry u can't enter in doctor department ");
gotoxy(5,23);
printf("Press any key for main menu");
getch();
exit(0);
}
else
{

45
doctorMenu();
}
}

void doctorMenu()
{
char ch,dch;
clrscr();
printf("\n\t\t\t DOCTOR MENU\n\t\t\t ************");
printf("\n\n\n\t\t\tENTER RECORD [E]");
printf("\n\n\t\t\tCHECK RECORD [C]");
printf("\n\n\t\t\tDELETE RECORD [D]");
printf("\n\n\t\t\tMODIFY RECORD [M]");
printf("\n\n\t\t\tQUIT [Q]");
printf("\n\n\n\n\n\t\t\tENTER YOUR CHOICE .... ");
do
{
gotoxy(47,19);
printf(" ");
gotoxy(47,19);
ch=getche();
getch();
if(ch=='e'||ch=='E'||ch=='c'||ch=='C'||ch=='d'||
ch=='D'||ch=='m'||ch=='M'||ch=='q'||ch=='Q')
break;
}
while(1);
if(ch=='e'||ch=='E')
{
while(1)
{
getdoc();
gotoxy(5,23);
printf("ENTER ANOTHER ENTRY (Y/N): ");
dch=getche();
if(dch=='n'||dch=='N')
{
doctorMenu();
}
else
getch();
}
}
if(ch=='m'||ch=='M')
{
modDoc();
}
if(ch=='D'||ch=='d')
{
deldoc();
}
if(ch=='c'||ch=='C')

46
{
showDoc();
}
if(ch=='q' || ch=='Q')
exit(0);
}
void getdoc()
{
int no;
int flag=0;
clrscr();
temp=fopen("c:\\doc.DAT","a");
fclose(temp);
gotoxy(30,2);
printf("DOCTOR ENTRY FORM");
gotoxy(10,4);
printf("ENTER DOCTOR NUMBER : ");
gotoxy(10,6);
printf("ENTER DOCTOR NAME : ");
gotoxy(10,8);
printf("ENTER ADDRESS : ");
gotoxy(10,10);
printf("ENTER PHONE NUMBER : ");
gotoxy(10,12);
printf("ENTER DOB (dd-mm-yy) : ");
gotoxy(10,14);
printf("ENTER SEX : ");
gotoxy(10,16);
printf("ENTER QUALIFICATION : ");
gotoxy(10,18);
printf("ENTER SPECIALIZATION : ");
gotoxy(10,20);
printf("ENTER DOJ (dd-mm-yy) : ");
gotoxy(40,4) ;
scanf("%d",&d.dno);
fclose(temp);
temp=fopen("c:\\doc.DAT","r");
while(1)
{
fread(&dtemp,sizeof(dtemp),1,temp);
if(feof(temp)) break;
if(d.dno == dtemp.dno)
{
flag=1;
}
}
fclose(temp);
if(flag==1)
{
gotoxy(5,23);
printf("Doctor number allready exist Enter another
number ");

47
getch();
getdoc();
}
fflush(stdin);
gotoxy(40,6);
gets(d.dname);
fflush(stdin);
gotoxy(40,8);
gets(d.dadd);
fflush(stdin);
gotoxy(40,10);
scanf("%ld",&d.dphone);
gotoxy(40,12);
scanf("%s",d.dbirth);
fflush(stdin);
gotoxy(40,14);
scanf("%s",d.dsex);
fflush(stdin);
gotoxy(40,16);
gets(d.dquali);
fflush(stdin);
gotoxy(40,18);
gets(d.dspecial);
fflush(stdin);
gotoxy(40,20);
scanf("%s",d.djoin);
fflush(stdin);
fclose(f);
f=fopen("c:\\doc.DAT","a");
fwrite(&d,sizeof(d),1,f);
fclose(f);
}
void showDoc()
{
int flag=0,no,ch,ctr=0;
char dsp[20];
top:
clrscr();
printf("\n\n\n\n\n\n\t\t\t\tDoctor's Report
Menu\n\n");
printf("\n\n\t\t\t1. All Doctor's Report");
printf("\n\n\t\t\t2. Particular Doctor's Report");
printf("\n\n\t\t\t3. Access Record by Specilization");
printf("\n\n\t\t\t4. Back to Prev Menu");
printf("\n\n\t\tPlz enter your choice --> ");
scanf("%d",&ch);
if(ch==1)
{
fclose(f);
f=fopen("c:\\doc.DAT","r");
ctr=0;
page :

48
clrscr();
printf("\n\t\t\t\tDOCTOR'S REPORT");
printf("\n
ÉÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍËÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍË");
printf("\n º DOCNO º NAME º ADDRESS
º PH_NO º SEX º SPECILIZATIONº");
printf("\n
ÌÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÎÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ͹");
while(1)
{
fread(&d,sizeof(d),1,f);
if(feof(f)) break;
ctr++;
if((ctr%14)==0)
{
printf("\n
ÈÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÊÍÍ
ÍÍÍÍÍÍÍÍÍÍÍͼ");
printf("\npress any key for next
page");
getch();
goto page;
}
printf("\n º%5d º %-13sº %-17sº%-
10ldº %-7sº %-12s
º",d.dno,d.dname,d.dadd,d.dphone,d.dsex,d.dspecial);
}
printf("\n
ÈÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÊÍÍ
ÍÍÍÍÍÍÍÍÍÍÍͼ");
printf("\n\n%d rows selected",ctr);
fclose(f);
getch();
goto top;
}
if(ch==2)
{
clrscr();
gotoxy(20,13);
printf("PLZ ENTER DOCTOR NUMBER TO DISPLAY
--> ");
scanf("%d",&no);
fclose(f);
f=fopen("c:\\doc.DAT","r");
while(1)
{
fread(&d,sizeof(d),1,f);
if(feof(f)) break;
if(d.dno==no)
{

49
flag=1;
clrscr();
printf("\n\n\t\t\t\nDATA OF
DOCTOR : %s",d.dname);
printf("\n\n\t\t DOCTOR
NUMBER :- %d",d.dno);
printf("\n\n\t\t
NAME :- %-20s",strupr(d.dname));
printf("\n\n\t\t
ADDRESS :- %-20s",strupr(d.dadd));
printf("\n\n\t\t
PHONE_NO :- %ld",d.dphone);
printf("\n\n\t\t DATE OF
BIRTH :- %-20s",strupr(d.dbirth));
printf("\n\n\t\t
SEX :- %-20s",strupr(d.dsex));
printf("\n\n\t\t
QUALIFICATION :- %-20s",strupr(d.dquali));
printf("\n\n\t\t
JOIN_DATE :- %-20s",strupr(d.djoin));
printf("\n\n\t\t
SPECILIZATION :- %-20s",strupr(d.dspecial));
}
}
gotoxy(5,25);
if(flag==0)
printf("Doctor not exist ,press any
key to contd....");
else
printf("Press any key to
contd............");
getch();
goto top;
}
if(ch==3)
{
clrscr();
fclose(f);
ctr=0;
f=fopen("c:\\doc.DAT","r");
fflush(stdin);
printf("\n\n\n\n\n\n\n\t\t\tENTER DOCTOR'S
SPECILIZATION : ");
gets(dsp);
clrscr();
printf("\n\t\t\t\tDOCTOR'S REPORT");
printf("\n
ÉÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍËÍÍ
ÍÍÍÍÍÍÍÍÍÍÍÍË");
printf("\n º DOCNO º NAME º ADDRESS
º PH_NO º SEX º SPECILIZATIONº");

50
printf("\n
ÌÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÎÍÍ
ÍÍÍÍÍÍÍÍÍÍÍ͹");
while(1)
{
fread(&d,sizeof(d),1,f);
if(feof(f)) break;
if(strcmpi(d.dspecial,dsp)==0)
{
printf("\n º%5d º %-13sº %-17sº
%-10ldº %-7sº %-12s
º",d.dno,d.dname,d.dadd,d.dphone,d.dsex,d.dspecial);
ctr++;
}
}
printf("\n
ÈÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÊÍÍ
ÍÍÍÍÍÍÍÍÍÍÍͼ");
printf("\n\n%d rows selected",ctr);
fclose(f);
getch();
goto top;
}
if(ch==4)
doctorMenu();
}
void deldoc()
{
int dno;
int flag=0;
clrscr();
gotoxy(20,13);
printf("ENTER DOCTOR NUMBER FOR DELETE : ");
scanf("%d",&dno);
fclose(f);
f=fopen("c:\\doc.DAT","r");
temp=fopen("c:\\doctemp.dat","w");
while(1)
{
fread(&d,sizeof(d),1,f);
if(feof(f)) break;
if(d.dno == dno)
{
flag=1;
}
else
{
fwrite(&d,sizeof(d),1,temp);
}
}
fclose(f);
fclose(temp);

51
if(flag==0)
{
gotoxy(5,23);
printf("Doctor not found ,press any key to contd....
");
}
else
{
gotoxy(5,23);
printf("Record Deleted , Press any key to
contd.....");
f=fopen("c:\\doc.DAT","w");
temp=fopen("c:\\doctemp.dat","r");
while(f)
{
fread(&d,sizeof(d),1,temp);
if(feof(temp)) break;
fwrite(&d,sizeof(d),1,f);
}
fclose(temp);
fclose(f);
getch();
doctorMenu();
}
}
void modDoc()
{
int no,flag=0,quit=0;
int gd=DETECT,gm,x,y;
int ch;
clrscr();
gotoxy(20,13);
printf("ENTER DOCTOR NUMBER TO MODIFY --> ");
scanf("%d",&no);
modRec:
fclose(f);
f=fopen("c:\\doc.DAT","r");
temp= fopen("c:\\doctemp.dat","w");
while(1)
{
fread(&d,sizeof(d),1,f);
if(feof(f)) break;
if(d.dno != no)
{
fwrite(&d,sizeof(d),1,temp);
}
else
{
clrscr();
initgraph(&gd,&gm,"c:\\tc\\bgi");
printf("\n\t\t\tDATA OF DOCTOR :
%s\n\n",d.dname);

52
printf("\n DOCTOR NUMBER :- %d",d.dno);
printf("\n NAME :- %-
20s",strupr(d.dname));
printf("\n ADDRESS :- %-
20s",strupr(d.dadd));
printf("\n PHONE_NO :-
%ld",d.dphone);
printf("\n DATE OF BIRTH :- %-
20s",strupr(d.dbirth));
printf("\n SEX :- %-
20s",strupr(d.dsex));
printf("\n QUALIFICATION :- %-
20s",strupr(d.dquali));
printf("\n JOIN_DATE :- %-
20s",strupr(d.djoin));
printf("\n SPECILIZATION :- %-
20s",strupr(d.dspecial));
printf("\n\n\n\tENTER YOUR CHOICE .... ");
setcolor(LIGHTBLUE);
rectangle(70,300,520,430);
settextstyle(SMALL_FONT,HORIZ_DIR,5);
setcolor(LIGHTGREEN);
moveto(80,320);
outtext("NAME [N]");
moveto(220,320);
outtext("ADDRESS [R]");
moveto(390,320);
outtext("BIRHT_DATE [D]");
moveto(80,360);
outtext("SEX [S]");
moveto(220,360);
outtext("PHONE_NO [P]");
moveto(390,360);
outtext("QUALIFICATION [Q]");
moveto(80,400);
outtext("SPECILIZATION [T]");
moveto(220,400);
outtext("JOINING_DATE [J]");
moveto(390,400);
outtext("EXIT [X]");
gotoxy(30,16);
ch=getch();
closegraph();
if(ch=='n'||ch=='N')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER NAME :-
");
gets(d.dname);
fflush(stdin);
}
else if(ch=='r'||ch=='R')

53
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER
ADDRESS : ");
gets(d.dadd);
fflush(stdin);
}
else if(ch=='d'||ch=='D')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER DATE OF
BIRTH (dd-mm-yy): ");
scanf("%s",d.dbirth);
}
else if(ch=='s'||ch=='S')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER SEX :
");
scanf("%s",d.dsex);
}
else if(ch=='p'||ch=='P')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER PHONE
NUMBER : ");
scanf("%ld",&d.dphone);
}
else if(ch=='q'||ch=='Q')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER
QUALIFICATION : ");
gets(d.dquali);
fflush(stdin);
}
else if(ch=='t'||ch=='T')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER
SPECILIZATION : ");
gets(d.dspecial);
fflush(stdin);
}
else if(ch=='j'||ch=='J')
{
clrscr();
printf("\n\n\n\n\n\n\n\tENTER JOINING
DATE (dd-mm-yy) : ");
scanf("%s",d.djoin);
}
else if(ch=='x'||ch=='X')

54
{
quit=1;
}
fwrite(&d,sizeof(d),1,temp);
flag=1;
}
fread(&d,sizeof(d),1,f);
}
fclose(f);
if(flag==0)
{
printf("Doctor not found Enter another number
\n");
getch();
doctorMenu();
}
fclose(temp);
f=fopen("c:\\doc.DAT","w");
temp=fopen("c:\\doctemp.dat","r");
while(1)
{
fread(&d,sizeof(d),1,temp);
if(feof(temp)) break;
fwrite(&d,sizeof(d),1,f);
}
fclose(f);
fclose(temp);
if(quit==1)
doctorMenu();
if(flag==1)
goto modRec;
doctorMenu();
}

SNAPSHOTS

55
56
57
58
59
60
61
62
63
64
65
TESTING

66
During system testing, the system is used experimentally to ensure that the software
does not fail, specific test data are input for processing and results examined. It is
desirable to discover any surprises before the organization implements the system &
depends on it.

Testing Objectives

1. Testing is a process of executing a program with the intent of finding an error.

2. A good test case is one that has a high probability of finding an undiscovered
error.

3. A successful test is one that uncovers an undiscovered error.

4. Testing Principles

 All tests should be traceable to customer’s requirements.

 Test should be planned long before the testing begins.

 Testing should begin “in the small” & progress towards “in the large”.

 Exhaustive Testing is not possible.

 To be most effective, an independent third party should conduct testing.

White Box Testing

It is also known as glass box testing and internal testing. It is a test case design method
that uses a control structure of the procedural design to derive test cases. Using white box
testing methods, software engineer can derive test cases that: -

1. Guarantee that all independent paths within the module have been exercised at
least once.

2. Exercised all logical decisions on their true & false sides.

3. Execute all loops at their boundaries & within their operational bounds.

4. Exercise internal data structures to ensure their validity.

67
Black Box Testing

It is also called behavioral testing & external testing. It focuses in the functional
requirements of the software i.e. it enables the software engineer to derive sets of input
conditions that will fully exercise all functional requirements for a program. It is not an
alternative to white box techniques. Rather it is a complementary approach that is likely
to uncover a different class of errors than white box methods.

Black Box testing attempts to find errors in the following categories: -

1. Incorrect or missing functions.

2. Interface errors.

3. Errors in data structures.

4. Behavior or performance errors.

5. Initialization & termination errors.

Activity network for system testing:-

1. prepare test plan

2. specify conditions for user acceptance testing

3. prepare test data for program testing

4. Prepare test data for transaction path testing.

5. Plan user training

6. Compile/assemble programs

7. Prepare job performance helps.

8. Prepare operational documents.

68
CONCLUSION

After having completed this project, We felt that it was an excellent learning experience
as I deal with a real life project that give a oppurtunity to working for the students to
make their test more easy, while working on this project I got a good exposure to the
sharp programming skills and the various programming techniques while coding for this
system I was exposed to the vast knowledge about the strength and weakness of VB
language.

A part from this I have been able to appreciate the hardwork of programmers spent in
developing such a system the most important realization was the amount of cooperation,
dedication, hardwork and team spirit that goes into making of a successful project.

69
BIBLIOGRAPHY

The following are the books references that have been studied in the duration of making
of this project.

 OOP WITH C++ BY BALAGURUSAMY


 SYSTEM ANALYSIS AND DESIGN BY V.RAJARAMAN
 SOFTWARE ENGINEERING BY K.K. AGRAWAL

WEB REFRENCES
www.microsoft.com

70
71

You might also like