Você está na página 1de 117

PROJECT REPORT ON

HOSPITAL MANAGEMENT SYSTEM

GOLDFIELD INSTITUTE OF TECHNOLOGY & MANAGEMENT


Maharshi Dayanand University, Rohtak June-July 2010

SUBMITTED TO:
Mr.AMIT DUBEY

SUBMITTED BY:
H.NITISH 08/CSE/27

GOLD FIELD INSTITUTE OF TECHNOLOGY & MANAGEMENT

CERTIFICATE
This is to certify that the project report entitled, HOSPITAL MANAGEMENT submitted by the students of computer science is a bonafide record of the work carried out by them under my supervision and is their original work during the project they were found obedient, diligent and disciplined.

Mr. Pradeep (HOD of CSE/IT)

MS. SUPRIYA SINGHA (Project Guide)

ACKNWLEDGEMENT

I would like to thanks to all my guides who really acted as pillars to help my way throughout this project that has led to successful and satisfactory completion of this study of this project. Firstly I would like to thanks my project in charge MR. A.N

MISHRA under whose able guidance and motivation this work has
been performed. The inspiration of the faculty members of the Computer Science Department of G.F.I.T.M, faridabad enabled me to make a thorough study of this subject. Last but not the least, no acknowledgement will be complete without mentioning my family and friends. They have also supported me throughout the development projects.

NAME: H.NITISH ROLL NO. 08/CSE/27

COMPANY PROFILE

NIC, under the Department of Information Technology of the Government of India, is a premier Science and Technology organization, at the forefront of the active promotion and implementation of Information and Communication Technology (ICT) solutions in the government. NIC has spearheaded the eGovernance drive in the country for the last three decades building a strong foundation for better and more transparent governance and assisting the governments endeavor to reach the unreached.

CONTENTS
CHAPTER 1 INTRODUCTION CHAPTER 2 WHY C++ IS USED FOR MAKING THIS PROJECT CHAPTER 3 SRS (SOFTWARE REQIURMENT SPECIFICATION) 3.1 SOFTWARE REQUIRMENT SPECIFICATION 3.2 HARDWARE REQUIRMENT SPECFICATION CHAPTER 4 SYSTEM ANALYSIS AND SOFTWARE DESIGN 24-46 6-10 11-14 15-23

4.1 DFD(DATA FLOW DIGRAM) 4.2 HIERARCHY DIGRAM 4.3 SOFTWARE MODEL 4.4 FEASIBILITY STUDY 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 CHAPTER 5 CHAPTER 6 CHAPTER 7 CHAPTER 8 CHAPTER-9 CODING OUTPUT TESTING CONCLUSION BIBILOGRAPHY ECONOMIC TECHINCAL OPERATIONAL LEGAL ORGANISATIONAL ENVIRONMENTAL 48-94 95-106 107-112 113-115 116-118

CHAPTER-1

INTRODUCTION

ABOUT THE PROJECT

A Hospital Management System is an automated software system that manages the function of a health care. The presented project here is made in view overcoming the problems faced by many Hospitals regarding Maintaining patient records , Recording and keeping of Doctors information, Bed management , Report generation etc. i.e. General HMS Automation. This project can be widely used in any Hospital which contains different departments with various employees having different designations etc. HMS not only provides an opportunity to the hospital to enhance their patient care but also can increase the profitability of the organization. About the Organization A Hospital normally contains information about patient. A hospital management system normally contains the following parts:Patient Admission Patient admission means capturing information of all the patients visiting the hospital and provides record of all the registered patients through a unique patient identification number or room number.

View details of patients It views the details of existing patients by registration number.

Searching process Search the details of patients by city or by blood group. Delete record: Delete the record of patients by registration number.

Our Vision: We shall define ourselves in the cutting edge technology in the coming era. We shall create honest working environment with see-through-glass planning. Our Mission: To create opportunity for growth & self actualization and provide an environment of highly conducive works culture.

OBJECTIVE OF THE PROJECT PROJECT RECORD MAINTENANCE To maintain the proper details of hospital management system provides the following: Admission, list of patients, adding doctors, record of patients, modify details, discharge of patients so on under various provision provided by the management. MAINTAIN FLEXIBILITIES The system should be modified depending on the changing needs of the user such modification should be entire reconstructing on recreation of software. It should also be portable to different computer system. INCREASE PRACTICABILITY The system should be a stable and can be operated by people with average intelligence means it should be user friendly. INCREASE EFFICIENCY This project involves accuracy, timeliness & comprehensiveness of the system output. COST It is desirable to aim for a system with a minimum cost subject to the condition that must satisfy all the requirements. MAINTAIN THE SECURITY This is very important aspect of the design and should cover areas of hardware reliability, physical security of data.

PROPOSED SYSTEM In the proposed system transactions are made at the time of admission of the patient or to get the information from previous records. It is basically a deal between the hospital management and the patient that are included in the system at the time of admission. The full detail about every patient is maintained in the transaction like. Patient Record Details of existing patients Searches the details of patients by city or by blood group Delete the records

ADVANTAGES OF PROPOSED SYSTEM This package is designed by taking all the aspects and need of hospital management system. This system is easy to handle and easy to maintain. The front page of the software provides easy selection of options and thus easy access to the capabilities of the system. The system is also very flexible; the changes required are made in very less time and resources of the user. So, it is very advantages to the user that modification is easy to handle.

The system is capable of printing all the reports timely and accurately which a manual system cant.

10

CHAPTER -2

11

WHY C++ IS USED FOR MAKING THIS PROJECT

12

WHY C++ IS USED FOR MAKING THIS PROJECT? C++ is an ideal programming language for developing professional application for any organization. Object Oriented Programming (OOP) has become the preferred programming approach by the software industries, as it offers a powerful way to cope the complexity of real world problems. C++ is a type of computer language created in 1983 by Bjarne Stroustrip; C++ was designed to serve as an enhanced version of the C programming language. C++ is Objected Oriented Programming language and is considered a high level language. Object oriented programming allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects.

Object - A Data Functions Communication

Object B Data Functions

Object C Functions

Data

The organization of data and functions in object oriented programs is shown in fig. the data of an object can be accessed only the functions associated with that object. However, functions of an object can access the functions of other objects.

13

ADVANTAGES OF C++ New programs would be developed in less time because old code can be reused. Creating and using new data types would be easier in C++ than in C The memory management under C++ would be easier and more transparent. Programs would be fewer bugs prone, as C++ uses a stricter syntax and type checking. Data hiding the usage of data by one program part while other program being easier to implement with c++.

14

CHAPTER-3

15

SOFTWARE REQUIRMENT SPECIFICATION

16

REQUIREMENT SPECIFICATION Requirement specifications are very important part of the software development project. IT requires the understanding of the whole project and its objectives and hence we can say that requirement specification evolves out of the requirement analysis task, which species what is to be done. Both software developer and customer conduct review of a software requirement specification. The software requirement specification is produced at the culmination of the analysis task. Software project constraints: 1. The process should not be too cumbersome to handle. 2. Economically viable. REQUIREMENT ANALYSIS Requirement analysis results in the specification of softwares operational characteristics; indicates softwares interface with other system elements and establishes constraints that software must meet. Requirement analysis allows the software engineer (sometimes called an analyst or modeler in this role) to elaborate on basic requirements established during earlier requirement engineering tasks and build, models that depict user scenario, functional activities, problem classes and their relationships, System and class behavior, and the flow of data as it is transformed. Throughout analysis modeling, the software engineers primary focus is on What objects does the system manipulate. What functions must the system perform? What behavior does the System exhibit. What interfaces are defined. What constraints apply?

OBJECTIVES OF ANALYSIS MODEL To describe what the customer requires. To establish a basis for the creation of a software design. To define a set of requirements that can be validated once the software is built.

System Description

Analysis Model

Design Model

Analysis model bridges the gap between a system- level, description that describes overall system functionality as it is achieved by applying software,

17

hardware, data, human and other System elements and a software design that describes the softwares application architecture, user interface and component level structure.

REQUIREMENT DOCUMENTATION Requirement documentation is very important activity after the requirements elicitation and analysis. This is the way to represent requirements in a consistent format. Requirement documents are called software Requirements Specification (SRS). The SRS is a specification for a particular software product, program or set of programs that performs certain functions in a specific environment. It serves a number of purposes depending on who is writing it. First, the SRS could be written by the customer of a System second, the SRS could be written by developer of the system. The two scenarios establish different purpose and serves as a contract document between customer and developer.

CONSIDERATION FOR PRODUCING A GOOD SRS a) b) c) d) e) f) g) h) Nature of the SRS ; Environment of the SRS ; Characteristics of a good SRS ; Joint preparation of the SRS ; SRS evolution ; Prototyping ; Embedding design in the SRS ; Embedding project requirement in the SRS ;

NATURE OF THE SRS

The SRS is a specification for a particular software product, program , or set of programs that performs certain functions in a specific environment .The SRS may be written by one or more representative of the supplier ,one or more representatives of the customer, or both.

The basic issues that the SRS writer(s) shall address are the following:

18

1) FUNCTIONALITY: What software is supposed to do? 2) EXTERNAL INTERFACES: How does the software interact with people, the Systems hardware, other hardware and other software? 3) PERFORMANCE: What is the speed availability, response time, recovery time, etc of various software functions? 4) ATTRIBUTES: What are the considerations for portability, correctness, maintainability, security, reliability etc? 5) DESIGN CONSTRAINTS IMPOSED ON AN IMPLEMENTATION: Are there any required standards in effect, implementation language, policies for dbase integrity, resource limits, operating environments etc.

ENVIRONMENT OF THE SRS It is important to consider the part that the SRS plays in the total project plan. The software may contain essentially all the functionality of the project or it may be part of a larger system. The SRS has a specific role to play in the software development process, the SRS writer(s) should be careful not to go beyond the bounds of that role. This means the SRS a) Should correctly define all of the software requirements. A software requirement may exit because of the nature of the task to be solved or because of a special characteristic of the project. b) Should not describe any design or implementation details .These should be described in the design stage of the project. c) Should not impose additional constraints of the software. These are properly specified in other documents such as a software quality assurance plan,

19

CHARACTERISTICS OF GOOD SRS An SRS should be a) b) c) d) e) f) g) h) Correct ; Unambiguous ; Complete ; Consistent ; Ranked for importance and stability ; Verifiable ; Modification ; Traceable ;

JOINT PREPARATION OF THE SRS The software development process should begin with supplier and customer agreement on what the completed software must do. This agreement, in the form of the SRS, should be jointly prepared. This is important because usually neither the customer nor the supplier is qualified to write a good SRS alone. Customers usually do not understand the software design and development process well enough to write a usable SRS. Suppliers usually do not understand the customers problem and field of endeavor well enough to specify requirements for a satisfactory system.

Therefore, the customer and the supplier should work together to produce a well written and completely understood SRS. SRS EVOLUTION The SRS may need to evolve of the development as the software product progresses. It may be impossible to specify some details at the time the project is initiated. Additional changes may ensue as deficiencies, shortcomings, and inaccuracies are discovered in the SRS. Two major considerations in this process in the following: a. Requirements should be specified as completely and thoroughly as is known at the time, even if evolutionary revisions can be foreseen as inevitable. The fact that they are incomplete should be noted. b. A formal change process should be initiated to identify, control, track, and report projected changes. Approved changes in requirement should be incorporated in the SRS in such a way as to 1. Provide an accurate and complete audit trail of changes; 2. Permit the review of current and supersedes portions of the SRS.

20

PROTOTYPING Prototyping is used frequently during the requirements portion of a project. Many tools exist that allow a prototype, exhibiting some characteristics of a system, to be created very quickly and easily. Prototypes are useful for the following reasons: a. The customer may be more likely to view the prototype and react to it than to read the SRS and react to it. Thus, the prototype provides quick feedback. b. The prototype displays unanticipated aspects of the systems behavior. Thus, it produces not only answers but also new questions. This helps reach closure on the SRS. c. An SRS based on a prototype tends to undergo less change during development, thus shortening development time.

EMBEDDING DESIGN IN THE SRS A requirement specifies an externally visible function or attribute of a system .A design describes particular subcomponents of a system and its interfaces with other subcomponents. The SRS writer(s) should clearly distinguish between identifying required design constraints and projecting a specific design. The SRS should specify what functions are to be performed on what to produce what results at what location for whom. The SRS should focus on the services to be performed. The SRS should not normally specify design items such as the following: a. b. c. d. Partitioning the software into modules ; Allocating functions to the modules ; Describing the flow of information or control between modules ; Choosing data structures.

NECESSARY DESIGN REQUIREMENT In special cases some requirements may severely restrict the design. For example, security or safely requirement may reflect directly into design such as the need to; a. Keep certain functions in separate modules ; b. Permit only limited communication between some areas of the programs; c. Check data integrity for critical variables.

21

EMBEDDING PROJECT REQUIRMENTS IN SRS The SRS should address the software product, not the process of producing the software product. Project requirements represent an understanding between the customer and the supplier about contractual matters pertaining to production of software and thus should not be included in the SRS. The normally include items such ass a. Cost b. Delivery schedules; c. Reporting procedures; d. Software development methods; e. Quality assurance; f. Validation and verification criteria; g. Acceptance procedures.

Project requirement are specified in other document, typically in a software development plan, a software quality assurance plan, or a statement of work.

SOFTWARE REQUIREMENT SPECIFICATION STEP I: PRODUCT OVERVIEW AND SUMMARY The project titled Hospital Management System has been prepared for removing the time consuming manual systems. This package is designed by taking all the aspects and need of hospital using system which is very easy to handle and easy to maintain. Basically the purpose of this project is to provide necessary things like individual admission, discharge, availability of rooms etc. to each and every patient in a computerized form, so that no patient has to wait in a long queues for admission and discharge as they did earlier.

STEP II: DEVELOPMENT,OPERATING AND MAINTENANCE ENVIRONMENT The development, operating and maintenance environment of the product consists of the following: SOFTWARES REQUIREMENTS 1. Operating System: - Windows 98, 99, 2000, XP, NT 2. C compiler : - Turbo, Borland

22

HARDWARE REQUIREMENTS SYSTEM TYPE : MEMORY : HARD DISK : PRINTER : STEP III :

Pentium 256 MB 20 GB LASER

FUNCTIONAL REQUIRMENTS Since, the project is prepared on the computerized Hospital Management System and the end user who will use this software must have some basic knowledge. So, a good level of user friendliness is the requirement. STEP IV :

PERFORMANCE REQUIREMENTS The records in it should not overlap and we can able to get the record by providing the room number and somehow the proper security of all the records should be maintained.

STEP V

: EXCEPTIONAL HANDLING

The software must be able to display proper error messages in case if some error encounters. STEP VI : FORESEEABLE MODIFICATIONS AND ENHANCEMENTS This project is very flexible i.e. we can modify it in future in case if some need arises.

23

CHAPTER -4

24

SYSTEM ANALYSIS & DESIGN

25

SYSTEM ANALYSIS

System analysis describes the detailed description of the scenario, and the functioning of the system. The transaction and input/output requirements are also presented. The problems in the current system are discussed and the necessary improvements are recommended.

Systems Development can generally be thought of as having two major components: o System Analysis o System Design System Design: System Design is the process of planning a new business system or one to replace or complement an existing system. But before this planning can be done, we must thoroughly understand the old system and determine how computers can best be used (if at all) to make its operation more effective. System Analysis: System Analysis is the process of gathering and interpreting facts, diagnosing problems, and using the information to recommend improvements to the system.

26

DATA FLOW DIGRAM

27

DATA FLOW DIAGRAM

: Data flow diagram is means of representing a system at any level of details with a graphic network of symbols showing data flows, data processes, and data sources/ destinations.

The DATA FLOW DIAGRAM shows the flow of data or information. It can be partitioned into single processes or functions .Data flow diagrams can be grouped together or decomposed into multiple processes. There can be physical DFD's that represent the physical files and transactions, or they can be business DFD's.

A DFD, also know as "bubble chart", serves the purposes of clarifying system requirements and identifying major transformations that will becomes programs in system design. So it is the starting point of the design phase that functionally decomposes the requirement specification down to the lowest level of details. A DFD consists of a series of bubbles joined by lines .The bubbles represent data transformation and lines represent data flows in the system. The DFD is a representation of various processes and the input and output in each process.

Graphical description of a system's data and how the processes transform the data is known as DATA FLOW DIAGRAM (DFD).

PURPOSE /OBJECTIVE The purpose of data flow diagrams is to provide a semantic bridge between users and systems developers. The diagrams are: Graphical representations that eliminate the need for writing thousands of words ; Logical representations, modeling WHAT a system does, rather than physical model s showing HOW it does it; Hierarchical representations, showing system at any level of details ; and

28

Jargon Less representation, allowing easy understanding and reviewing.

The goal of data flow diagramming is to have a commonly understood model of a system. The diagrams bare the basis of structured system analysis .Data flow diagrams are supported by other techniques of structured systems analysis such as data structure diagrams, data dictionaries and procedure-representing techniques such as decision table and structured English. Data flow diagrams have the objectives of avoiding the cost of: User /developer misunderstanding of a system ,resulting in a need to redo systems or in not using the systems or in not using the system; System inefficiencies because a system get computerized before it gets systematized; Being unable to evaluate system project boundaries or degree of automation, resulting in a project of inappropriate scope.

COMPONENTS OF DATA FLOE DIAGRAMS

Data flow diagrams are composed of the four basic symbols shown below. Any system can be represented at any level of detail by these four symbols

29

The EXTERNAL ENTITY symbol represents sources of data to the system or destinations of data from the system. The DATA FLOW symbol represents movement of data. The PROCESS symbol represents an activity that transforms or manipulates the data.

NAMING CONVENTIONS IN DFD

Each component in a data flow diagram is labeled with a descriptive name. Process names are further identified with a number that will be used for identification purposes. The number assigned to a specific process does not represent the sequence of processes. It is strictly for identification and will take on added value when we study the components that make up a specific process.

The name of data stores, sources and destination are written in capital letters. Process and data flow names have the first letter of each work capitalized.

The names of the processes must clearly explain the actual task being performed in the process.

DEVELOPING A DFD

To be useful and informative, DFD must be drawn properly. In this section we shows, how to draw them: where to start, how to add details to description, how to be consistent in naming items included in the diagrams. The discussion also points out common mistakes that should be avoided.

30

DEVELOPMENT PROCESS

System analysts must first study the current systems, that is, the actual activities and processes that occur. In the terminology of structured analysis, this is the study of physical system. The physical system is translated into logical descriptions that focus on data and processes. It is advantageous to emphasize data and processes in order to focus on actual activities that occur and the resources needed to perform them, rather than on who performs the work.

These are EXAMPLES of physical system details

Department

Copy room or building location

Person

Step number

Files

Procedure

During data flow analysis, these details are evaluated in terms of the logical components of data flows, processes, data stores, origins and destinations.

During the design stages that follow, system requirements are translated into logical design details. Actual construction, such as the programming of computer software, translates logical specifications into physical features and a working information system.

CONTEXT DIGRAM

The context diagram is the top level DFD .It represents a system as a single process with only major inputs and outputs to the system represented as data flows. The source and destination of the data as external are also represented.

31

LEVEL 1 AND HIGHER LEVEL DFD

When we explode the context diagram and break the single process into a number of detailed processes, then 1DFD is created. Further breaking of each process leads to further levels of level DFDs. The numbering convention in the DFD is as follows. In the context diagram, no number is given to processes as only one process exists. In the level 1 DFD, the processes are numbered as 1, 2, and 3. In the next level, the processes are numbered depending on which process has been broken. For example, if process 2 of level 1 DFD level is broken, the processes are numbered as 2.1, 2.2 and so on. The processes are numbered as 3.2.1, 2.3.2.1 and so on as further

levels of DFD are created.

THE RULES OF THUMB IN DRAWING DFDs ARE:

1. Process should be named and numbered for easy reference. Each name should be representative of the process. 2. The direction of flow is from top to bottom and from left to right. Data traditionally flows from the source to the destination, although they may flow back to a source. An alternative way is to repeat the source symbol as a destination. Since, it is used more than once in the DFD, it is marked with a short diagonal in lower right corner. 3. When the process is exploded into lower level details, they are numbered. The sub-levels are numbered on the basis of their parent process number.

4. The names of data stores, sources, destinations must be in capital letters while the names of processes and data flows must start with a capital letter.

32

O LEVEL DFD

ENQUIRY PATIENTFEEDBACK

Infirmary Services

REQUEST REGISTRATION DATAFILE INFORMATION

Figure 6.2

33

1-LEVEL DFD

ENQUIR Y PATIENT FEEDBACK

Infirmary Services

REQUEST DATABASE INFORMATION

SEARCH FOR RECORD

ADD RECORD INFORMATION

DOCTOR

UPDATE SYSTEM

Figure 6.3

34

FLOW CHART (MENU)

START

WELCOME SCREEN Option to OP

Y N N N If OP=2 N Show Patients Detail If N OP=3 Y If OP=1 INSTALL

Patients Record

If OP=4 N STOP Figure 6.4

Exit

35

Hospital management system

Request to enter new Requests t o password

Requests to delete a record Requests to search

view details

nnnnnnnNew patient New patient information info. system systemNew patient

View details of patient process

Search process

delete

information system
Accepts registration no. Accepts the details By city By blood group Accepts registration .no

Patient record accepted process

View details of patient

Search by city process

Search by blood group process

Delete record process

Accepts blood group Stores records Accepts city

Patient record database Gives details

Gives details process

user

36

REQUESTS TO ENTIRE NEW PATIENT INFO VIEW DETAILS OF EXITING PATIENT USER SEARCH BY CITY BLOOD GROUP ,DELETE ENTRY HOSPITAL MANAGEMENT SYSTEM

GIVES RESULT

USER
GIVES RESULT

PRINTER

37

HIERARCHY DIAGRAMS

38

HIERARCHY DIGRAMS

The Hierarchy Diagram begins at the Top Level with the Main Module. The Main Module represents a programs main routine and is the highest module that controls the overall logic of the program. The other modules in the Hierarchy Diagram may be considered as Sub Modules of the controlling or main module and they are performed when the Main Module CALLs or PERFORMs them and they then return control to the Main Module when their logic is complete. HOSPITAL MANAGEMENT SYSTEM

NEW PATIENT INFORMATIOM SYSTEM

DETAILS OF EXITING PATIENT

SEARCHING PATIENT

DELETE RECORD

REGISTRATION NUMBER

BY REGISTRATION NUMBER

NAME BLOOD SEX CITY

MARTIAL STATUS ADDRESS

DATE OF BIRTH

BLOOD GROUP

39

SOFTWARE MODEL

40

SOFTWARE MODEL

WATERFALL MODEL Waterfall model sometimes called classic life cycle, suggests a Systematic sequential approach to software development that begins with customer specification of requirements and progresses through planning, modeling, construction and deployment, culminating is on going support of the completed software. The waterfall model is a popular version of the system development life cycle model for software engineering. Waterfall development has distinct goals for each phase of development.

COMMUNICATIO N project Initiation requirements gathering

PLANNING Estimating Scheduling Tracking

MODELING Analysis Design

CONSTRUCTION Code Test

DEPLOYMENT Delivery Support Feedback

THE WATERFALL MODEL

41

PHASES OF WATERFALL MODEL

This model has five phases: Requirement analysis and specification. Design Implementation and unit Testing Integration and system testing. Operation and maintenance. The phases always occur in this order that they do not overlap. The developer must complete each phase before the next phase begins. This model is named Waterfall Model because its diagrammatic representation resembles a cascade of waterfalls.

Requirement analysis and specification Design

Implementation and unit testing Integration and system Testing Operation and Maintenance REQUIREMENT ANALYSIS AND SPECIFICAION PHASE The goal of this phase is to understand the exact requirements of the customer and to documents them properly. This activity is usually executed together with the customer, as the goal is to document all functions, performance and interfacing requirements for the software. The requirements describe the what of a system, not the how. This phase produces a large document, written in a natural language, contains a description of what the System will do without describing how it will be done. The resultant document is known as software requirement specification document (SRS).

42

DESIGN PHASE: The SRS document contains the exact requirements of the customer. The goal of this phase is to transform the requirements specification into a structure that is suitable for implementation in some programming language. Here overall software architecture is defined, and the high level and detailed design work is performed. This work is documented and known as software design description (SDD) document. The information contained in the SDD should be sufficient to begin the coding phase. IMPLEMENTING AND UNIT TESTING PHASE : During this phase, design is implemented. If the SDD is complete, the implementation or coding phase proceeds smoothly, because all the information needed by the software developers is contained in SDD. During testing, the major activities are centered the exam and modification of code. Initially, small modules are tested in isolation from the rest of the software product. The problem that are encountered while testing a module in isolation are solved in this phase and modules are tested after writing some overhead code. INTEGRATION AND SYSTEM TESTING PHASE : This is a very important phase effective testing will contribute to the delivery of higher quality software products, more satisfied users, lower maintenance costs and more accurate and reliable results. Unit testing is used for implementing each independent module correctly, due to which there are less chances that whether the interface between modules are correct, for this reason integration testing is performed. System testing involves the testing of the entire System, where as software is the part of the System. OPERATION AND MAINTENANCE PHASE : Software maintenance is a task that every development group has to face, when the software is delivered to the customers site, installed and is operational. Therefore, release of software inaugurates the operation and maintenance phase of the life cycle. Software maintenance includes error correction, enhancement of capabilities, deletion of obsolete capabilities and optimization. The purpose of this phase is to preserve the value of the software over time MODEL CHOSEN The model chosen for this project is Waterfall Model because of the following reasons:-

43

ADVANTAGES OF WATERFALL MODEL It can serve as a useful process model in situations where requirements are fixed and work is to proceed to completion in a linear manner. Testing is inherent to every phase of the waterfall model. It is a simple and elegant model which can be used in testing projects. It is an enforced disciplined approach It is not costly It is documentation driven, i.e. documentation is produced at every stage.

FEASIBILITY STUDY All the projects are feasible given unlimited resources and infinite time. Unfortunately, the development of a computer based system is more likely to be played by a scarcity of resources and difficult delivery date. It is both necessary and prudent to evaluate the feasibility of a project at the earliest possible time. In the development of the present project, no such limitation was imposed that was not feasible, s all the resources where easily available and time given was sufficient enough. OBJECTIVES OF FEASIBILITY STUDY What are the problems with conventional System? What are the solutions available to overcome these problems? What are the goals and sub goals of the proposed System? What the proposed System would be achieved? Who all should be involved in the administering the System? The benefits, the System will give over the conventional System? The estimated cost of the implementation. The estimated time needed to develop and implement the proposed System?

1. ECONOMIC FEASIBILITY This involves questions such as whether the form can afford to built the system, whether its benefits should substantially exceed its costs, and whether the project has higher priority and profits than other projects that might use the same resources. Since, our project is made on C++ it is not very costly as it is very common available software. We dont need any extra software or hardware requirements or any GUI (Graphic user interface) 2. TECHNICAL FEASIBILITY This involves question such as whether the technology needed for the system exists, how difficult it will be to build and whether the firm has enough experience using that technology.

44

The software made is on C++ which is a very common language, so we can get the experienced persons in it very easily.

3. LEGAL FEASIBILITY All projects must face legal scrutiny. When an organization either has legal council on staff or on retainer, such reviews are typically standard. However, any project may face legal issue after completing too. Our software is legally feasible.

4. ORGANISATIONAL FEASIBILITY This involves question such as whether the System has enough support to be implemented successfully, whether it brings an excessive amount of change, and whether the organization is changing too rapidly to absorb it. Since, it is a very small project its purpose is for submission of BCA (3 year) degree and all the members are equally include for the submission of project. So, there is a good Coordinating among all the members.

5.

ENVIRONMENTAL FEASIBILITY

People are inherently resistant to change and computers have been known to facilitate change. An estimate should be made of how strong a reaction the user staff is likely to have towards the development of a computerized system.

45

CHAPTER -5

46

CODING

47

/* ************************************************** * Project: * * Simulation of hospital Management Software * ************************************************** */ #include<iostream.h> #include<process.h> #include<string.h> #include<conio.h> //for input and output stream regulation //for exit () //for strlen () and strcmp () //for getch () and clrscr ()

class all //declaration for class "all" { private: struct address { int house; char city[30]; char state[30]; char street[30]; char country[30]; }; struct age { int day; int month; int year; }; struct patient_info { age A1; //nested structure inplemented address AD1; //nested structure implemented int sex; int reg_no; int bld_group; char name[50]; int martial_status; }PI[100]; int task; protected: //functions declared void search_menu(); void search_city(); void exit_function(); void search_show_info();

48

void search_blood_group(); void enter_patient_info(); void show_patient_detail(); void after_search_options(); void after_restore(); public: void tasks(); void recycle_bin(); void delete_entry(); void software_detail(); void after_delete_options(); int s_group; int s_choice; int en_del_index; int delete_choice; char ch; char answer; char answer1; char s_city[30]; char exit_answer; char delete_confirm; char after_search_answer; }; //end of class "all" class date //declaration for class "date" { private: int date; int month; int year; public: void enter_date(); void show_date(); }; //end of class "date" class dob //declaration for class "dob" { private: struct dob1 { int date; int month; int year; int rem; }DOB11[100]; public: char birth_answer; void show_date(); void enter_date(); void search_show_date();

49

};

//end of class "dob"

class temp //declaration for class "temp" { public: int m; //temporary variables declared with global scope int i; int j; int k; int d; int e; int f; int rem; int temp; int count; int regis; int index; int entry; int serial; int attempt; int current; int d_index; int ssi_count; int show_count; int delete_show; int search_index; int search_count; int current_year; int delete_count; int search_number; int restore_serial; int delete_attempt; int restore_attempt; int entry_index[100]; int after_search_choice; int after_restore_choice; char enter_now; char restore_confirm; char duplicate_answer; char delete_all_confirm; char restore_all_confirm; char after_search_answer; temp() //constructor for temp invoked { i=0; j=0; d=0; e=0; f=0; serial=0;

50

current=0; d_index=0; ssi_count=0; show_count=0; delete_show=0; delete_count=0; delete_attempt=0; restore_attempt=0; } //end of constructor for temp //destructor for temp invoked }; //end of class "temp" all A1; date D1; dob DOB1; temp T1; //object for class "all" declared //object for class "date" declared //object for class "dob" declared //object for class "temp" declared

void main() //main function { T1.count=0; for(T1.m=1;T1.m<=100;T1.m++) //default index value set to -1 for each entry { T1.entry_index[T1.m]=-1; } cout<<"Welcome to..."<<"\n"; cout<<"\n\n\t\t\t***HOSPITAL MANAGEMENT SOFTWARE***"<<"\n"; cout<<"\t\t\t By Vandana "<<"\n"; D1.enter_date(); A1.tasks(); } //end of main function void all::tasks() { clrscr(); T1.attempt=0; T1.d_index=0; T1.delete_attempt=0; D1.show_date(); cout<<"\n\n\t\t\t***HOSPITAL MANAGEMENT SOFTWARE***"<<"\n"; cout<<"\t\t\t By Nitish "<<"\n"; cout<<"\n\t\t\t ***Hospital Management Tasks***"<<"\n"; cout<<"\t\t\t *******************************"<<"\n"; cout<<"\n\n\tPlease select a task to do...."<<"\n"; cout<<"\n\n\t1. Enter a new patient information "<<"\n"; cout<<"\t2. View detail of existing patient "<<"\n"; cout<<"\t3. Search by city or blood group"<<"\n"; cout<<"\t4. Delete entry "<<"\n"; cout<<"\t5. Recycle Bin "<<"\n"; cout<<"\t6. About "<<"\n"; cout<<"\t7. Exit "<<"\n\n\n";

51

cout<<"\a Enter your task serial : "; cin>>task; switch(task) { case 1:{ A1.enter_patient_info(); break; } case 2:{ A1.show_patient_detail(); break; } case 3:{ A1.search_menu(); break; } case 4:{ A1.delete_entry(); break; } case 5:{ A1.recycle_bin(); break; } case 6:{ A1.software_detail(); break; } case 7:{ A1.exit_function(); break; } default:{ clrscr(); cout<<"\n\n\n\n\n\tInvalid task serial !!!"<<"\n"; cout<<"\tValid options are 1-6 !!!"<<"\n"; cout<<"\tPress any key to return to the main task menu....\a"<<"\n"; getch(); clrscr(); A1.tasks(); } } //end of switch for task } //end of function void date::enter_date() { cout<<"\n\nFirst of all I need the current date ..."<<"\n"; cout<<"\nYear : "; cin>>year;

52

while(year<2000||year>10000) { clreol(); cout<<"\aInvalid input for year !!!"<<"\n"; clreol(); cout<<"Please enter the year correctly : "<<"\n"; cin>>year; } T1.current_year=year; cout<<"Month : "; clreol(); cin>>month; while(month<=0||month>12) //if month is greater then 12 or less then 1 { clreol(); cout<<"\nInvalid input for month !!!"<<"\n"; clreol(); cout<<"Please enter the month correctly : \a"<<"\n"; clreol(); cin>>month; } cout<<"Date : "; clreol(); switch(month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12:{ cin>>date; while(date<1||date>31) //for months with 31 days { cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "<<"\n"; clreol(); cin>>date; } break; } case 2:{ cin>>date; //for february if(year%4==0) { while(date<0||date>29) //for leap year { cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "<<"\n";

53

clreol(); cin>>date; } } else { while(date<0||date>28) //for non-leap year { cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "<<"\n"; clreol(); cin>>date; } } break; } default:{ //for other months with 30 days cin>>date; while(date<1||date>30) { cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "<<"\n"; clreol(); cin>>date; } break; } } } //end of switch //end of function

void date::show_date() { clrscr(); cout<<"Hello....\n It's "; cout<<date; T1.rem=date%10; switch(date) { case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20:{ cout<<"th "; goto over;

54

} } switch(T1.rem) { case 1:{ cout<<"st "; break; } case 2:{ cout<<"nd "; break; } case 3:{ cout<<"rd "; break; } default:{ cout<<"th "; break; } } //end of switch over: //label for jump statement switch(month) { case 1:{ cout<<"January , "; break; } case 2:{ cout<<"February , "; break; } case 3:{ cout<<"March , "; break; } case 4:{ cout<<"April , "; break; } case 5:{ cout<<"May , "; break; } case 6:{ cout<<"June , "; break; } case 7:{ cout<<"July , ";

55

break; } case 8:{ cout<<"August , "; break; } case 9:{ cout<<"September , "; break; } case 10:{ cout<<"October , "; break; } case 11:{ cout<<"November , "; break; } case 12:{ cout<<"December , "; break; } } //end of switch cout<<year<<" \n"; } //end of function void all::enter_patient_info() { clrscr(); if(T1.current==100) //to avoid overflow of data in the database { cout<<"\n\n\n\t Database is full !!! "; cout<<"\n\t Sorry, you cannot enter any more information !!! "; cout<<"\n\t Information of maximum 100 patients can be entered !!!! "; cout<<"\n\t Press any key to return to the main menu....\a "; getch(); A1.tasks(); } answer='y'; if(T1.count==0) { T1.serial=1; } else { T1.i=T1.serial; } for(T1.i=T1.serial;answer=='y'||answer=='Y';T1.i++) {

56

cout<<"\a"; T1.current++; PI[T1.i].reg_no=T1.i; T1.temp=T1.serial; clrscr(); T1.entry_index[T1.i]=1; cout<<"\n\n\t ***ENTERING INFORMATION FOR PATIENT SERIAL NUMBER "<<T1.i<<" ***"<<"\n"; cin.get(ch); cout<<"\nRegistration Number : "<<PI[T1.i].reg_no<<"\n\n"; cout<<"Enter the name of patient : "; clreol(); cin.getline(PI[T1.i].name,50); while(strlen(PI[T1.i].name)==0) { cout<<"\a\nPlease enter a name : "; //if enter is pressed before netering a name cin.getline(PI[T1.i].name,50); cout<<"\n"; } for(T1.k=1;T1.k<T1.serial;T1.k++) //loop to avoid duplicate entries { if(strcmp(PI[T1.i].name,PI[T1.k].name)==0) //if match is found { if(T1.entry_index[T1.k]==0) //if entry is already deleted { continue; } else //if entry still exists { T1.current-=1; //current no. of entries remains same clreol(); cout<<"\n\n\n\tThe patient is already admitted in the hospital !!!"; cout<<"\n\tWant to view info of this registration number in detail (Y/N) : \a"; cin>>T1.duplicate_answer; while(T1.duplicate_answer!='Y'&&T1.duplicate_answer!='y'&&T1.duplic ate_answer!='N'&&T1.duplicate_answer!='n') { cout<<"\n\t\aPlease re enter a correct option (Y/N) : "; cin>>T1.duplicate_answer; } if(T1.duplicate_answer=='y'||T1.duplicate_answer=='Y') { T1.entry_index[T1.i]=-1; T1.regis=T1.k; T1.d_index=1; A1.show_patient_detail(); } else

57

{ A1.tasks(); } } } } //end of "for loop" to prevent duplicate entries cout<<"\nSex ( 1-Male , 2-Female ) : "; clreol(); cin>>PI[T1.i].sex; while(PI[T1.i].sex!=1&&PI[T1.i].sex!=2) { cout<<"\a\nInvalid input for sex of patient !!!"; cout<<"\nSex : "; clreol(); cin>>PI[T1.i].sex; } cout<<"\nMarital status( 1-Married , 2-Single ) : "; clreol(); cin>>PI[T1.i].martial_status; while(PI[T1.i].martial_status<1||PI[T1.i].martial_status>2) { cout<<"\a\nInvalid input for martial status !!!"<<"\n"; cout<<"Enter a valid marital status : "<<"\n"; clreol(); cin>>PI[T1.i].martial_status; } cin.get(ch); clreol(); clreol(); cout<<"\n *** Blood group ***"<<"\n"; clreol(); cout<<" 1. A+ "<<"\n"; clreol(); cout<<" 2. A- "<<"\n"; clreol(); cout<<" 3. B+ "<<"\n"; clreol(); cout<<" 4. B- "<<"\n"; clreol(); cout<<" 5. AB+ "<<"\n"; clreol(); cout<<" 6. AB- "<<"\n"; clreol(); cout<<" 7. O+ "<<"\n"; clreol(); cout<<" 8. O- "<<"\n"; clreol(); cout<<"\nEnter a blood group : "; clreol(); cin>>PI[T1.i].bld_group;

58

switch(PI[T1.i].bld_group) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:{ break; } default:{ while(PI[T1.i].bld_group!=1&&PI[T1.i].bld_group!=2&& PI[T1.i].bld_group!=3&&PI[T1.i].bld_group!=4&& PI[T1.i].bld_group!=5&&PI[T1.i].bld_group!=6&& PI[T1.i].bld_group!=7&&PI[T1.i].bld_group!=8) { clreol(); cout<<"\aInvalid input !!!"<<"\n"; clreol(); cout<<"Please enter a valid Blood Group : "<<"\n"; clreol(); cin>>PI[T1.i].bld_group; } //end of while break; } } //end of switch cin.get(ch); clreol(); cout<<"\n\n ***ENTERING ADDRESS**"<<"\n\n"; clreol(); cout<<"House number : "; clreol(); cin>>PI[T1.i].AD1.house; while(PI[T1.i].AD1.house<=0) { clreol(); cout<<"\a\nInvalid input for house number !!!"; clreol(); cout<<"\nAgain enter the house number : "; clreol(); cin>>PI[T1.i].AD1.house; } cin.get(ch); clreol(); cout<<"Street : "; clreol(); cin.getline(PI[T1.i].AD1.street,30); while(strlen(PI[T1.i].AD1.street)==0)

59

{ clreol(); cout<<"\a\nPlease enter a street : "; //if enter is pressd before input for street clreol(); cin.getline(PI[T1.i].AD1.street,50); cout<<"\n"; } cout<<"City : "; clreol(); cin.getline(PI[T1.i].AD1.city,30); while(strlen(PI[T1.i].AD1.city)==0) { clreol(); cout<<"\a\nPlease enter a city : "; //if enter is pressd before input for city clreol(); cin.getline(PI[T1.i].AD1.city,50); cout<<"\n"; } cout<<"state : "; clreol(); cin.getline(PI[T1.i].AD1.city,30); while(strlen(PI[T1.i].AD1.city)==0) { clreol(); cout<<"\a\nPlease enter a state : "; //if enter is pressd before input for city clreol(); cin.getline(PI[T1.i].AD1.state,50); cout<<"\n"; }

cout<<"Country : "; clreol(); cin.getline(PI[T1.i].AD1.country,30); while(strlen(PI[T1.i].AD1.country)==0) { clreol(); cout<<"\a\nPlease enter a country : "; //if enter is pressd before input for country clreol(); cin.getline(PI[T1.i].AD1.country,50); cout<<"\n"; } DOB1.enter_date(); cin.get(ch); clreol(); clreol(); cout<<"\n\nWant to enter information for another patient (Y/N) ? "; clreol(); cin>>answer;

60

while(answer!='Y'&&answer!='y'&&answer!='N'&&answer!='n') { clrscr(); cout<<"\a\nPease re-enter a correct option (Y/N) : "; clreol(); cin>>answer; } cout<<"\n"; T1.count++; T1.serial++; } //end of "for loop" for entering information clrscr(); clrscr(); A1.tasks(); } //end of function void dob::enter_date() { clreol(); cout<<"\n\n *** Date of birth ***"<<"\n"; clreol(); cout<<"\nYear : "; clreol(); clreol(); cin>>DOB11[T1.temp].year; while(DOB11[T1.temp].year>T1.current_year) //to ensure that the year of birth { //gets entered correctly clreol(); cout<<"\aInvalid input for year !!!"; cout<<"\nThe date of birth cannot be after the current system date !!! "; cout<<"\nPlease enter the year correctly : "; clreol(); cin>>DOB11[T1.temp].year; cout<<"\n"; } while(DOB11[T1.temp].year<1000) { clreol(); cout<<"Invalid input for year !!! "; clreol(); cout<<"\nThe year of birth must be of 4 digits!!!"; clreol(); cout<<"\nPlease enter the year correctly : \a"; clreol(); cin>>DOB11[T1.temp].year; cout<<"\n"; } while(DOB11[T1.temp].year<1900) { clreol();

61

cout<<"\a\nAre you sure (Y/N) ? "; cin>>birth_answer; cout<<"\n"; while(birth_answer!='Y'&&birth_answer!='y'&&birth_answer!='N'&&birth_ans wer!='n') { clreol(); cout<<"\a\nInvalid input !!! "<<"\n"; clreol(); cout<<"Please enter a correct option (Y/N) : "; cout<<"\n"; clreol(); cin>>birth_answer; } if(birth_answer=='n'||birth_answer=='N') { clreol(); cout<<"\nPlease enter the year again : "; clreol(); cin>>DOB11[T1.temp].year; clreol(); while(DOB11[T1.temp].year>T1.current_year) { clreol(); cout<<"Invalid input for year !!! "; clreol(); cout<<"\nThe date of birth cannot be after the current system date !!! "; clreol(); cout<<"\nPlease enter the year correctly : \a"; clreol(); cin>>DOB11[T1.temp].year; cout<<"\n"; } while(DOB11[T1.temp].year<1000) { clreol(); cout<<"\aInvalid input for year !!! "; clreol(); cout<<"\nThe year of birth must be of 4 digits!!!\a"; clreol(); cout<<"\nPlease enter the year correctly : "; clreol(); cin>>DOB11[T1.temp].year; cout<<"\n"; } } //end of inner while while(birth_answer=='y'||birth_answer=='Y') { goto jump;

62

} //end of inner while } //end of outer while jump: clreol(); cout<<"Month : "; clreol(); cin>>DOB11[T1.temp].month; while(DOB11[T1.temp].month<=0||DOB11[T1.temp].month>12) { clreol(); cout<<"\a\nInvalid input for month !!!"<<"\n"; cout<<"Again enter the month : "; clreol(); clreol(); cin>>DOB11[T1.temp].month; } cout<<"Date : "; clreol(); switch(DOB11[T1.temp].month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12:{ cin>>DOB11[T1.temp].date; //for months with 31 days while(DOB11[T1.temp].date<1||DOB11[T1.temp].date>31) { clreol(); cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "; clreol(); cin>>DOB11[T1.temp].date; cout<<"\n"; } break; } case 2:{ //for february cin>>DOB11[T1.temp].date; if(DOB11[T1.temp].year%4==0) { while(DOB11[T1.temp].date<0||DOB11[T1.temp].date>29) //for leap year { clreol(); cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "; clreol();

63

cin>>DOB11[T1.temp].date; cout<<"\n"; } } else { while(DOB11[T1.temp].date<0||DOB11[T1.temp].date>28) //for nonleap year { clreol(); cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "; clreol(); cin>>DOB11[T1.temp].date; cout<<"\n"; } } break; } default:{ cin>>DOB11[T1.temp].date; //for other months while(DOB11[T1.temp].date<1||DOB11[T1.temp].date>30) { clreol(); cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "; clreol(); cin>>DOB11[T1.temp].date; cout<<"\n"; } break; } } //end of switch clreol(); } //end of function void all::show_patient_detail() { clrscr(); if(T1.d_index==1) { T1.d_index=0; cout<<"\n\n"; goto direct; } if(T1.current==0) { cout<<"\n\n\n"; cout<<"\tDatabase in empty !!!"<<"\n"; cout<<"\tPlease enter some information first. "<<"\n";

64

cout<<"\n\n\tDo you want to enter now (Y/N) : \a"; cin>>T1.enter_now; while(T1.enter_now!='Y'&&T1.enter_now!='y'&&T1.enter_now!='N'&&T1.ente r_now!='n') { cout<<"\a\n\tPlease enter a correct option (Y/N) : "; cin>>T1.enter_now; } if(T1.enter_now=='y'||T1.enter_now=='Y') { A1.enter_patient_info(); } else { A1.tasks(); } } cout<<"\n\t\t****** CURRENT DATEBASE ENTRIES ******\n\n"; cout<<"\t\tRegistration no. Name of patient\n\n"; for(T1.j=1;T1.j<100;T1.j++) { if(T1.entry_index[T1.j]==1) { cout<<"\t\t "<<T1.j<<" "<<PI[T1.j].name<<"\n"; } else { continue; } } cout<<"\n\n\t\tPress 0 to return to main menu.... "; cout<<"\n\n\n\tEnter registration number : "; clreol(); cin>>T1.regis; clrscr(); cout<<"\n\n"; cin.get(ch); if(T1.regis==0) { A1.tasks(); } T1.show_count++; direct: //label for "goto" jump statement if(T1.regis<=0) { T1.attempt++; if(T1.attempt==3) { cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n";

65

cout<<"\tAccess Denied!!! "<<"\n"; cout<<"\tPlease try again later. "<<"\n"; cout<<"\tPress any key to exit to main task menu..."<<"\n"; getch(); clrscr(); A1.tasks(); } cout<<"\n\n\tSorry, invalid registration number !!! "; cout<<"\n\tRegistration number starts from 1 . "; cout<<"\n\n\tPress any key to continue..... \a"; getch(); A1.show_patient_detail(); } if(T1.regis>0&&T1.regis<T1.serial&&T1.entry_index[T1.regis]==0) { cout<<"\n\tSorry, the patient has left the hospital."; T1.attempt++; if(T1.attempt==3) { cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n"; cout<<"\tAccess Denied!!! "<<"\n"; cout<<"\tPlease try again later. "<<"\n"; cout<<"\tPress any key to exit to main task menu..."<<"\n"; getch(); clrscr(); A1.tasks(); } cout<<"\n\tPress any key to continue..."<<"\n"; getch(); } if((T1.regis<0||T1.regis>=T1.serial)&&T1.entry_index[T1.regis]==-1) { T1.attempt++; clreol(); if(T1.attempt!=3) { cout<<"\n\n\tSorry, the registration number is invalid ."<<"\n"; T1.entry=T1.serial-1; if(T1.entry==1) { cout<<"\tOnly 1 record has been added .\n"; } else { cout<<"\tOnly "<<T1.entry<<" records have been added .\n"; } } if(T1.attempt==3) { cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n";

66

cout<<"\tAccess Denied!!! "<<"\n"; cout<<"\tPlease try again later. "<<"\n"; cout<<"\tPress any key to exit to main task menu..."<<"\a\n"; getch(); clrscr(); A1.tasks(); } cout<<"\n\n\n\tPress any key to continue....."; getch(); A1.show_patient_detail(); } if(T1.regis>0&&T1.regis<T1.serial&&T1.entry_index[T1.regis]==1) { T1.attempt=0; clreol(); cout<<"\n\t ***INFORMATION FOR PATIENT REGISTRATION NUMBER "<<T1.regis<<"***\n\n"; clreol(); cout<<"\tName : "<<PI[T1.regis].name<<"\n"; clreol(); cout<<"\tSex : "; clreol(); if(PI[T1.regis].sex==1) { cout<<"Male "<<"\n"; clreol(); } if(PI[T1.regis].sex==2) { cout<<"Female "<<"\n"; clreol(); } cout<<"\tBlood Group : "; clreol(); switch(PI[T1.regis].bld_group) { case 1:{ clreol(); cout<<"A+\n"; break; } case 2:{ clreol(); cout<<"A-\n"; break; } case 3:{ clreol(); cout<<"B+\n"; break;

67

} case 4:{ clreol(); cout<<"B-\n"; break; } case 5:{ clreol(); cout<<"AB+\n"; break; } case 6:{ clreol(); cout<<"AB-\n"; break; } case 7:{ clreol(); cout<<"O+\n"; break; } case 8:{ clreol(); cout<<"O-\n"; break; } } //end of switch clreol(); cout<<"\tDate of birth : "; clreol(); DOB1.show_date(); cout<<"\tMarital Status : "; clreol(); if(PI[T1.regis].martial_status==1) { cout<<"Married "<<"\n"; clreol(); } else { cout<<"Single "<<"\n"; clreol(); } clreol(); cout<<"\n\t **ADDRESS**"<<"\n"; clreol(); cout<<"\n\tHouse no. : "<<PI[T1.regis].AD1.house; clreol(); cout<<"\n\tStreet : "<<PI[T1.regis].AD1.street; clreol();

68

cout<<"\n\tCity clreol();

: "<<PI[T1.regis].AD1.city;

cout<<"\n\tState : "<<PI[T1.regis].AD1.state; clreol(); cout<<"\n\tCountry : "<<PI[T1.regis].AD1.country; clreol(); } T1.d_index=0; clreol(); clreol(); cout<<"\n\n\n\n\tWant to view detail of another patient : "; clreol(); cin>>answer1; while(answer1!='Y'&&answer1!='y'&&answer1!='N'&&answer1!='n') { clreol(); cout<<"\a\tPease re-enter a correct option (Y/N) ? "; clreol(); cin>>answer1; } clrscr(); if(answer1=='Y'||answer1=='y') { A1.show_patient_detail(); } else { A1.tasks(); } } //end of function void dob::show_date() { cout<<DOB11[T1.regis].date; T1.rem=DOB11[T1.regis].date%10; switch(DOB11[T1.regis].date) { case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20:{ cout<<"th "; goto over;

69

} } //end of switch switch(T1.rem) { case 1:{ cout<<"st "; break; } case 2:{ cout<<"nd "; break; } case 3:{ cout<<"rd "; break; } default:{ cout<<"th "; break; } } //end of switch over: switch(DOB11[T1.regis].month) { case 1:{ cout<<"January , "; break; } case 2:{ cout<<"February , "; break; } case 3:{ cout<<"March , "; break; } case 4:{ cout<<"April , "; break; } case 5:{ cout<<"May , "; break; } case 6:{ cout<<"June , "; break; } case 7:{ cout<<"July , ";

70

break; } case 8:{ cout<<"August , "; break; } case 9:{ cout<<"September , "; break; } case 10:{ cout<<"October , "; break; } case 11:{ cout<<"November , "; break; } case 12:{ cout<<"December , "; break; } } //end of switch cout<<DOB11[T1.regis].year<<" \n"; } //end of function void all::software_detail() { clrscr(); cout<<"\n\n\n\t\t\t ***SOFTWARE DETAILS***\n"; cout<<"\n\n\tDeveloper :Nitish "<<"\n"; cout<<"\tProgramming Language : C++ "<<"\n"; cout<<"\tCompiler version : Borland 5.02 "<<"\n"; cout<<"\tAim : Simulation of Hospital Management Software"<<"\n"; cout<<"\n\tHope you like it..."<<"\n"; cout<<"\n\n\tThank You for trying this program. "<<"\n"; cout<<"\a\n\n\n\tPress any key to return to the main task menu......."<<"\n"; getch(); A1.tasks(); } //end of function void all::search_menu() { T1.ssi_count=0; if(T1.current==0) { clrscr(); cout<<"\n\n\n";

71

cout<<"\tDatabase in empty !!!"<<"\n"; cout<<"\tPlease enter some information first. "<<"\n"; cout<<"\n\n\tDo you want to enter now (Y/N) : \a"; cin>>T1.enter_now; while(T1.enter_now!='Y'&&T1.enter_now!='y'&&T1.enter_now!='N'&&T1.ente r_now!='n') { cout<<"\a\n\tPlease enter a correct option (Y/N) : "; cin>>T1.enter_now; } if(T1.enter_now=='y'||T1.enter_now=='Y') { A1.enter_patient_info(); } else { A1.tasks(); } } T1.search_number=0; clrscr(); clreol(); cout<<"\n\n\t\t ***SEARCH MENU***"<<"\n"; clreol(); cout<<"\n\n\t\t 1. Search by city "<<"\n"; clreol(); cout<<"\t\t 2. Search by blood group "<<"\n"; clreol(); cout<<"\t\t 3. Return to main menu "<<"\n"; clreol(); cout<<"\n\n\t Enter your choice : \a"; clreol(); cin>>s_choice; cin.get(ch); cout<<"\n\n\n"; clrscr(); switch(s_choice) { case 1:{ T1.search_index=1; clreol(); cout<<"\n\n\t\t***SEARCHING BY CITY***\n"; clreol(); cout<<"\n\n\tEnter city : "; clreol(); cin.getline(s_city,30); clreol(); cout<<"\n\n\n"; while(strlen(s_city)==0) //if enter is pressed before input for city

72

{ clreol(); cout<<"\n\tPlease enter a city : \a"; clreol(); cin.getline(s_city,30); } A1.search_city(); break; } case 2:{ T1.search_index=2; clreol(); cout<<"\n\n\t\t***SEARCHING BY BLOOD GROUP***\n"; clreol(); cout<<"\n\n\t\t ***BLOOD GROUP MENU***\n\n"; clreol(); cout<<"\t1. A+ "<<"\n"; clreol(); cout<<"\t2. A- "<<"\n"; clreol(); cout<<"\t3. B+ "<<"\n"; clreol(); cout<<"\t4. B- "<<"\n"; clreol(); cout<<"\t5. AB+ "<<"\n"; clreol(); cout<<"\t6. AB- "<<"\n"; clreol(); cout<<"\t7. O+ "<<"\n"; clreol(); cout<<"\t8. O- "<<"\n"; clreol(); cout<<"\n\n Enter the serial of your required group : "; clreol(); cin>>s_group; while(s_group!=1&&s_group!=2&&s_group!=3&&s_group!=4&& s_group!=5&&s_group!=6&&s_group!=7&&s_group!=8) { cout<<"\n"; cout<<"\tInvalid search criteria !!!"<<"\n"; cout<<"\tValid serials are 1 to 8."<<"\n"; cout<<"\tEnter a valid blood group : \a"; cin>>s_group; } cout<<"\n\n\n"; A1.search_blood_group(); break; } case 3:{ A1.tasks();

73

break; } default:{ clreol(); cout<<"\a\n\n Invalid search criteria !!!"<<"\n"; clreol(); cout<<" Valid options are 1 and 2 !!!"<<"\n"; clreol(); cout<<" Press any key to return to the main searching menu....."<<"\n"; clreol(); getch(); A1.search_menu(); break; } } //end of switch } //end of function void all::search_city() { T1.search_count=0; T1.search_number++; clrscr(); cout<<"\n\n\n"; for(T1.index=1;T1.index<T1.serial;T1.index++) { if((strcmp(PI[T1.index].AD1.city,s_city))==0) { if(T1.entry_index[T1.index]==0) { continue; } if(T1.search_count==0) { cout<<"\t\tRegistration no. Name of patient\n\n"; } clreol(); cout<<"\n\t\t "<<T1.index<<"\t\t"<<PI[T1.index].name; clreol(); T1.search_count++; } } clreol(); if(T1.search_number==1) { cout<<"\a\n\n\n\t\t Search is complete !!! "<<"\n"; clreol(); if(T1.search_count==0) { cout<<"\t\t No result found !!!"<<"\n\n\n"; cout<<"\t\t Press any key to continue.....";

74

getch(); A1.after_search_options(); } if(T1.search_count>1) { cout<<"\t\t "<<T1.search_count<<" results found !!! "<<"\n\n\n"; } if(T1.search_count==1) { cout<<"\t\t "<<T1.search_count<<" result found !!! "<<"\n\n\n"; } } if(T1.search_number==1) { clreol(); cout<<"\n\n\t\tWant to view in detail : "; cin>>after_search_answer; while(after_search_answer!='y'&&after_search_answer!='Y'&&after_search_ans wer!='N'&&after_search_answer!='n') { cout<<"\a\n\n\t\tPlease enter a correct option ."; cout<<"\n\t\tDo you want to view in detail : "; cin>>after_search_answer; } if(after_search_answer=='y'||after_search_answer=='Y') { cout<<"\n\n\n\t\tWhich registration number : "; cin>>T1.index; A1.search_show_info(); } else { A1.after_search_options(); } } else { cout<<"\n\n\n\t\tWhich registration number : "; cin>>T1.index; A1.search_show_info(); } } //end of function void all::search_blood_group() { T1.search_count=0; T1.search_number++; clrscr(); cout<<"\n\n\n";

75

for(T1.index=1;T1.index<T1.serial;T1.index++) { if(s_group==PI[T1.index].bld_group) { if(T1.entry_index[T1.index]==0) { continue; } if(T1.search_count==0) { cout<<"\t\tRegistration no. Name of patient\n\n"; } clreol(); cout<<"\n\t\t "<<T1.index<<"\t\t"<<PI[T1.index].name; clreol(); T1.search_count++; } } clreol(); if(T1.search_number==1) { cout<<"\a\n\n\n\t\t Search is complete !!! "<<"\n"; clreol(); if(T1.search_count==0) { cout<<"\t\t No matching result found !!!"<<"\n\n\n"; cout<<"\t\t Press any key to continue....."; getch(); A1.after_search_options(); } if(T1.search_count>1) { cout<<"\t\t "<<T1.search_count<<" results found !!! "<<"\n\n\n"; } if(T1.search_count==1) { cout<<"\t\t "<<T1.search_count<<" result found !!! "<<"\n\n\n"; } } if(T1.search_number==1) { clreol(); cout<<"\n\n\t\tWant to view in detail : "; cin>>after_search_answer; while(after_search_answer!='y'&&after_search_answer!='Y'&&after_search_ans wer!='N'&&after_search_answer!='n') { cout<<"\a\n\n\t\tPlease enter a correct option ."; cout<<"\n\t\tDo you want to view in detail : ";

76

cin>>after_search_answer; } if(after_search_answer=='y'||after_search_answer=='Y') { cout<<"\n\n\n\t\tWhich registration number : "; cin>>T1.index; A1.search_show_info(); } else { A1.after_search_options(); } } else { cout<<"\n\n\n\t\tWhich registration number : "; cin>>T1.index; A1.search_show_info(); } } //end of function void all::search_show_info() { T1.ssi_count++; clrscr(); cout<<"\n\n"; if(T1.index<=0) { if(T1.ssi_count==3) { clrscr(); cout<<"\n\n\tYou have entered wrong choice 3 times!!!!"; cout<<"\n\tPress any key for more options......\a"; getch(); A1.after_search_options(); } cout<<"\n\n\tSorry, invalid registration number !!!"; cout<<"\n\tRegistration number starts from 1 "; cout<<"\n\tPress any key to continue.........\n"; getch(); switch(T1.search_index) { case 1:{ A1.search_city(); break; } case 2:{ A1.search_blood_group(); break; }

77

} //end of switch } if(T1.entry_index[T1.index]==0) { if(T1.ssi_count==3) { clrscr(); cout<<"\n\n\tYou have entered wrong choice 3 times!!!!"; cout<<"\n\tPress any key for more options......\a"; getch(); A1.after_search_options(); } cout<<"\n\n\tSorry, the patient has left the hospital ."<<"\n"; cout<<"\tPress any key to continue ....\a"<<"\n"; getch(); switch(T1.search_index) { case 1:{ A1.search_city(); break; } case 2:{ A1.search_blood_group(); break; } } //end of switch } if(T1.entry_index[T1.index]==-1||T1.index>=T1.serial) { if(T1.ssi_count==3) { clrscr(); cout<<"\n\n\tYou have entered wrong choice 3 times!!!!"; cout<<"\n\tPress any key for more options......\a"; getch(); A1.after_search_options(); } cout<<"\n\n\t\tSorry, the registration number in invalid ."<<"\n"; T1.entry=T1.serial-1; if(T1.entry==1) { cout<<"\t\tOnly 1 record has been added .\n"; } else { cout<<"\t\tOnly "<<T1.entry<<" records have been added .\n"; } cout<<"\t\tPress any key to continue....\a"<<"\n"; getch(); switch(T1.search_index)

78

{ case 1:{ A1.search_city(); break; } case 2:{ A1.search_blood_group(); break; } } //end of switch } clreol(); cout<<"\n"; T1.ssi_count=0; cout<<"\n\t ***INFORMATION FOR PATIENT REGISTRATION NUMBER "<<T1.index<<"***\n\n"; clreol(); cout<<"\tName : "<<PI[T1.index].name<<"\n"; clreol(); cout<<"\tSex : "; clreol(); if(PI[T1.index].sex==1) { cout<<"Male "<<"\n"; clreol(); } if(PI[T1.index].sex==2) { cout<<"Female "<<"\n"; clreol(); } cout<<"\tBlood Group : "; clreol(); switch(PI[T1.index].bld_group) { case 1:{ clreol(); cout<<"A+\n"; break; } case 2:{ clreol(); cout<<"A-\n"; break; } case 3:{ clreol(); cout<<"B+\n"; break; }

79

case 4:{ clreol(); cout<<"B-\n"; break; } case 5:{ clreol(); cout<<"AB+\n"; break; } case 6:{ clreol(); cout<<"AB-\n"; break; } case 7:{ clreol(); cout<<"O+\n"; break; } case 8:{ clreol(); cout<<"O-\n"; break; } } //end of switch clreol(); cout<<"\tDate of birth : "; clreol(); DOB1.search_show_date(); cout<<"\tMartial Status : "; clreol(); if(PI[T1.index].martial_status==1) { cout<<"Married "<<"\n"; clreol(); } else { cout<<"Single "<<"\n"; clreol(); } cout<<"\n\t **ADDRESS**"<<"\n"; clreol(); cout<<"\n\tHouse no. : "<<PI[T1.index].AD1.house; clreol(); cout<<"\n\tStreet : "<<PI[T1.index].AD1.street; clreol(); cout<<"\n\tCity : "<<PI[T1.index].AD1.city; clreol();

80

cout<<"\n\tState : "<<PI[T1.index].AD1.state; clreol(); cout<<"\n\tCountry : "<<PI[T1.index].AD1.country; clreol(); clreol(); clreol(); cout<<"\n\n\n\tWant to view info of another patient within search results (Y/N) ? "; cin>>after_search_answer; while(after_search_answer!='Y'&&after_search_answer!='y'&&after_search_ans wer!='N'&&after_search_answer!='n') { cout<<"\a\n\tPlease enter a correct option (Y/N) : "; cin>>after_search_answer; } if(after_search_answer=='y'||after_search_answer=='Y') { switch(T1.search_index) { case 1:{ A1.search_city(); break; } case 2:{ A1.search_blood_group(); break; } } //end of switch } else { A1.after_search_options(); } } //end of function void dob::search_show_date() { cout<<DOB11[T1.index].date; T1.rem=DOB11[T1.index].date%10; switch(DOB11[T1.index].date) { case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:

81

case 19: case 20:{ cout<<"th "; goto over; } } //end of switch switch(T1.rem) { case 1:{ cout<<"st "; break; } case 2:{ cout<<"nd "; break; } case 3:{ cout<<"rd "; break; } default:{ cout<<"th "; break; } } //end of switch over: switch(DOB11[T1.index].month) { case 1:{ cout<<"January , "; break; } case 2:{ cout<<"February , "; break; } case 3:{ cout<<"March , "; break; } case 4:{ cout<<"April , "; break; } case 5:{ cout<<"May , "; break; } case 6:{ cout<<"June , ";

82

break; } case 7:{ cout<<"July , "; break; } case 8:{ cout<<"August , "; break; } case 9:{ cout<<"September , "; break; } case 10:{ cout<<"October , "; break; } case 11:{ cout<<"November , "; break; } case 12:{ cout<<"December , "; break; } } //end of switch cout<<DOB11[T1.index].year<<" \n"; clreol(); } //end of function void all::after_search_options() { clrscr(); clreol(); cout<<"\n\n\n\n\t\tWHAT DO U WANT TO DO NOW ?"<<"\n"; clreol(); cout<<"\t\t1. Search again "<<"\n"; clreol(); cout<<"\t\t2. Return to main task menu "<<"\n"; clreol(); cout<<"\n\tEnter your choice : "; clreol(); clreol(); cin>>T1.after_search_choice; clreol(); cout<<"\n"; switch(T1.after_search_choice) { case 1:{

83

T1.ssi_count=0; A1.search_menu(); break; } case 2:{ T1.ssi_count=0; A1.tasks(); break; } default:{ clreol(); cout<<"\a\n\n\tInvalid option requested !!!"<<"\n"; clreol(); cout<<"\tPress any key to return to the main searching menu..."<<"\n"; clreol(); getch(); A1.search_menu(); break; } } //end of switch } //end of function void all::delete_entry() { clrscr(); if(T1.current==0) { cout<<"\n\n\n"; cout<<"\tDatabase in empty !!!"<<"\n"; cout<<"\tPlease enter some information first. "<<"\n"; cout<<"\n\n\tDo you want to enter now (Y/N) : \a"; cin>>T1.enter_now; while(T1.enter_now!='Y'&&T1.enter_now!='y'&&T1.enter_now!='N'&&T1.ente r_now!='n') { cout<<"\a\n\tPlease re-enter a correct option (Y/N) : "; cin>>T1.enter_now; } if(T1.enter_now=='y'||T1.enter_now=='Y') { A1.enter_patient_info(); } else { A1.tasks(); } } cout<<"\n\t\t ***CURRENT DATABASE ENTRIES***\n\n"; cout<<"\t\tRegistration no. Name of patient\n\n";

84

for(T1.j=1;T1.j<T1.serial;T1.j++) { if(T1.entry_index[T1.j]==0) { continue; //to ignore deleted items } if(T1.entry_index[T1.j]==1) { T1.delete_show++; cout<<"\t\t "<<T1.j<<" "<<PI[T1.j].name<<"\n"; } } if(T1.delete_show==0) { clrscr(); cout<<"\n\tDatabase is currently empty!!!\a"; cout<<"\n\tPress any key to continue...."; getch(); A1.tasks(); } cout<<"\n\n\tPress 0 to return to main menu and 101 to delete all entries... "; cout<<"\n\n\n\tWhich registration no. to delete ? "; cin>>en_del_index; if(en_del_index==101) { cout<<"\n\tWarning : You are about to delete all entries !!!\a"; cout<<"\n\tAre you sure you want to do this : "; cin>>T1.delete_all_confirm; while(T1.delete_all_confirm!='Y'&&T1.delete_all_confirm!='y'&&T1.delete_all_ confirm!='N'&&T1.delete_all_confirm!='n') { cout<<"\n\tSorry, wrong input !!!"; cout<<"\n\tPlease enter a valid choice (Y/N) : \a"; cin>>T1.delete_all_confirm; } if(T1.delete_all_confirm=='y'||T1.delete_all_confirm=='Y') { for(T1.f=1;T1.f<=100;T1.f++) { if(T1.entry_index[T1.f]==1) { T1.current--; T1.entry_index[T1.f]=0; } } cout<<"\n\n\tAll entries have been succesfully deleted!!!"; cout<<"\n\tPress any key to return to the main menu...\a"; getch(); A1.tasks();

85

} else { cout<<"\n\tNo entries have been deleted."; cout<<"\n\tPress any key for more options...."; getch(); A1.after_delete_options(); } } if(en_del_index==0) { clrscr(); A1.tasks(); } if(en_del_index>0&&en_del_index<T1.serial&&T1.entry_index[en_del_index]= =1) { T1.delete_attempt=0; cout<<"\n\n\tAre you sure you want to delete entry "<<en_del_index<<" (Y/N) ? "; cin>>delete_confirm; while(delete_confirm!='Y'&&delete_confirm!='y'&&delete_confirm!='N'&&dele te_confirm!='n') { clreol(); cout<<"\a\n\tPease re-enter a correct option (Y/N) ? "; clreol(); cin>>delete_confirm; } if(delete_confirm=='y'||delete_confirm=='Y') { T1.entry_index[en_del_index]=0; //entry now deleted. index value set to 0 T1.current--; cout<<"\n\tEntry succesfully deleted.\n"; cout<<"\tPress any key to continue.....\a"; getch(); A1.after_delete_options(); } else { T1.entry_index[en_del_index]=1; //entry not deleted. default index value(1) kept cout<<"\n\tEntry not deleted "; cout<<"\n\tPress any key to continue......."; getch(); A1.after_delete_options(); } }

86

if(en_del_index>0&&en_del_index<T1.serial&&T1.entry_index[en_del_index]= =0) { T1.delete_attempt++; if(T1.delete_attempt==3) { cout<<"\n\n\tSorry, you have entered wrong registration number 3 times. "; cout<<"\n\tAccess denied !!!"; cout<<"\n\tPlease try again later !!!"; cout<<"\n\tPress any key to return to the main task menu....\a"; getch(); A1.tasks(); } cout<<"\n\n\tSorry, the patient has already left the hospital ."<<"\n"; cout<<"\n\tPress any key to continue...\a"<<"\n"; getch(); A1.delete_entry(); } else { T1.delete_attempt++; if(T1.delete_attempt==3) { cout<<"\n\n\tSorry, you have entered wrong registration number 3 times. "; cout<<"\n\tAccess denied !!!"; cout<<"\n\tPlease try again later !!! "; cout<<"\n\tPress any key to return to the main task menu....\a"; getch(); A1.tasks(); } cout<<"\n\n\tSorry, Invalid registration number ."<<"\a\n"; T1.entry=T1.serial-1; if(T1.entry==1) { cout<<"\tOnly 1 record has been added .\n"; } else { cout<<"\tOnly "<<T1.entry<<" records was added and "<<T1.current<<" are present .\n"; } cout<<"\tPress any key to continue..."<<"\n"; getch(); A1.delete_entry(); } clrscr(); } //end of function void all::after_delete_options()

87

{ clrscr(); cout<<"\n\t\tWHAT DO YOU WANT TO DO NOW ?"; cout<<"\n\t\t1. Delete more entries "; cout<<"\n\t\t2. Return to main menu "<<"\n"; cout<<"\n\t\tPlease enter your choice : "; cin>>delete_choice; while(delete_choice!=1&&delete_choice!=2) { cout<<"\a\n\n\tSorry, wrong choice ."; cout<<"\n\tValid choices are 1 and 2. "; cout<<"\n\tPlease re-enter your choice : "; cin>>delete_choice; } switch(delete_choice) { case 1:{ A1.delete_entry(); break; } case 2:{ A1.tasks(); break; } } //end of switch } //end of function void all::recycle_bin() { clrscr(); T1.delete_count=0; if(T1.serial==0) { cout<<"\n\n\n"; cout<<"\tDatabase in empty !!!"<<"\n"; cout<<"\tPlease enter some information first. "<<"\n"; cout<<"\n\n\tDo you want to enter now (Y/N) : \a"; cin>>T1.enter_now; while(T1.enter_now!='Y'&&T1.enter_now!='y'&&T1.enter_now!='N'&&T1.ente r_now!='n') { cout<<"\a\n\tPlease enter a correct option (Y/N) : "; cin>>T1.enter_now; } if(T1.enter_now=='y'||T1.enter_now=='Y') { A1.enter_patient_info(); } else

88

{ A1.tasks(); } } cout<<"\n\t\t ****** DELETED ENTRIES ******\n\n"; cout<<"\t\tRegistration no. Name of patient\n\n"; for(T1.d=1;T1.d<T1.serial;T1.d++) { if(T1.entry_index[T1.d]==0) { cout<<"\t\t "<<T1.d<<" "<<PI[T1.d].name<<"\n"; T1.delete_count++; } else { continue; } } if(T1.delete_count==0) { T1.delete_count=0; clrscr(); cout<<"\n\n\n\tNo entry is currently in recycle bin."; cout<<"\n\tPress any key to return to the main menu...\a"; getch(); A1.tasks(); } cout<<"\n\n\tPress 0 to return to main menu and 101 to restore all items... "; cout<<"\n\n\n\tWhich item to restore : "; cin>>T1.restore_serial; if(T1.restore_serial==0) { clrscr(); A1.tasks(); } if(T1.restore_serial==101) { cout<<"\n\n\tAre you sure you want to restore all the entries : "; cin>>T1.restore_all_confirm; while(T1.restore_all_confirm!='Y'&&T1.restore_all_confirm!='y'&&T1.restore_a ll_confirm!='N'&&T1.restore_all_confirm!='n') { cout<<"\n\n\tPlease re-enter a corrent option : "; cin>>T1.restore_all_confirm; } if(T1.restore_all_confirm=='y'||T1.restore_all_confirm=='Y') { for(T1.e=1;T1.e<=100;T1.e++) {

89

if(T1.entry_index[T1.e]==0) { T1.current++; T1.entry_index[T1.e]=1; } } cout<<"\n\tAll deleted items have been succesfully restored."; cout<<"\n\tPress any key to return to the main menu..."; getch(); clrscr(); A1.tasks(); } else { cout<<"\n\n\tNo entry has been restored."; cout<<"\n\tPress any key to view the recycle bin...\a"; getch(); clrscr(); A1.recycle_bin(); } } if(T1.entry_index[T1.restore_serial]==0) { T1.restore_attempt=0; cout<<"\n\tAre you sure you want to restore entry "<<T1.restore_serial<<" : "; cin>>T1.restore_confirm; while(T1.restore_confirm!='Y'&&T1.restore_confirm!='y'&&T1.restore_confirm! ='N'&&T1.restore_confirm!='n') { clreol(); cout<<"\n\n\tInvalid input !!! "; cout<<"\n\tPease re-enter a correct option (Y/N) : \a"; clreol(); cin>>T1.restore_confirm; } if(T1.restore_confirm=='Y'||T1.restore_confirm=='y') { T1.current++; T1.delete_count=0; T1.entry_index[T1.restore_serial]=1; //index value set to 1 cout<<"\n\tEntry succesfully restored!!!"; cout<<"\n\tPress any key to continue....\a"; getch(); A1.after_restore(); } else { cout<<"\n\tEntry not restored!!!"; //index value kept 0 cout<<"\n\tPress any key to continue...\n\a";

90

getch(); A1.after_restore(); } } if(T1.entry_index[T1.restore_serial]==1) { T1.restore_attempt++; if(T1.restore_attempt==3) { clrscr(); cout<<"\n\n\tYou have unsuccesfully tried to restore 3 times."; cout<<"\n\tPress any key to return to the main task menu..."; A1.tasks(); } cout<<"\n\tThe entry is already present in the database."; cout<<"\n\tPress any key to continue..."; getch(); A1.recycle_bin(); } if(T1.restore_serial<0||T1.restore_serial>100||T1.entry_index[T1.restore_serial]= =-1) { T1.restore_attempt++; if(T1.restore_attempt==3) { clrscr(); cout<<"\n\n\tYou have unsuccesfully tried to restore 3 times."; cout<<"\n\tPress any key to return to the main task menu..."; getch(); A1.tasks(); } cout<<"\n\tInvalid serial number"; cout<<"\n\tPress any key to continue..."; getch(); A1.recycle_bin(); } } //end of function void all::after_restore() { clrscr(); cout<<"\n\n\n\t\tWHAT DO YOU WANT TO DO NOW? "; cout<<"\n\t\t1. Restore more entries "; cout<<"\n\t\t2. Return to main manu "; cout<<"\n\n\t\tPlease enter your choice : "; cin>>T1.after_restore_choice; switch(T1.after_restore_choice) { case 1:{

91

A1.recycle_bin(); break; } case 2:{ A1.tasks(); break; } default:{ cout<<"\n\n\n\tSorry, wrong choice "; cout<<"\n\tValid choices are 1 and 2 "; cout<<"\n\tPress any key to continue......"; getch(); A1.after_restore(); } } } //end of function void all::exit_function() { clrscr(); if(T1.serial==0) { cout<<"\n\n\n\n\tYou have not used the software."; cout<<"\n\tIt is recommended that you do not exit."; cout<<"\n\tPress any key to continue......\a"; getch(); clrscr(); cout<<"\n\n\n\tAre you sure you want to exit (Y/N) ? "; cin>>exit_answer; while(exit_answer!='Y'&&exit_answer!='y'&&exit_answer!='N'&&exit_answer! ='n') { clreol(); cout<<"\n\n\tInvalid input !!! "; cout<<"\n\tPease re-enter a correct option (Y/N) : \a"; clreol(); cin>>exit_answer; } if(exit_answer=='y'||exit_answer=='Y') { cout<<"\a"; exit(0); } else { A1.tasks(); } } cout<<"\n\n\n\t\t\t ***SOFTWARE DETAILS***\n";

92

cout<<"\n\n\tDeveloper :Nitish"<<"\n"; cout<<"\tProgramming Language : C++ "<<"\n"; cout<<"\tCompiler version : Borland 5.02 "<<"\n"; cout<<"\tAim : Simulation of Hospital Management Software"<<"\n"; cout<<"\n\tHope you like it..."<<"\n"; cout<<"\n\n\tThank You for trying this program. "<<"\n"; cout<<"\n\n\n\tPress any key to continue........"<<"\n"; getch(); clrscr(); cout<<"\n\n\n\tAre you sure you want to exit (Y/N) ? "; cin>>exit_answer; while(exit_answer!='Y'&&exit_answer!='y'&&exit_answer!='N'&&exit_answer! ='n') { clreol(); cout<<"\n\n\tInvalid input !!! "; cout<<"\n\tPease re-enter a correct option (Y/N) : \a"; clreol(); cin>>exit_answer; } if(exit_answer=='y'||exit_answer=='Y') { cout<<"\a"; exit(0); } else { A1.tasks(); } } //end of function

93

CHAPTRER-6

94

OUTPUT

95

96

97

98

99

100

101

102

103

104

105

CHAPTER-7

106

TESTING

107

TESTING Testing is the process of executing a program with the intent of finding errors in software development process, errors can be injected at any stages during development. There are various techniques that are used for detecting and eliminating errors but no method is perfect because most of the verification methods of earlier phases are manual. During testing, the program to be tested is executed with a test case is evaluate to determine if the program is performing as expected. Testing is a set of activities that can be planned in advance and conducted systematically. Its a process of analyzing a software item to detect the difference between existing and required conditions (i.e. bugs) and to evaluate the features of the software items.

Test case designs are constructed for each path and for all logical decisions, and boundary values conditions. There are four paths in the process flow and therefore four test case designs would be built to test path processing. A test case will test whether logical decisions are made through condition testing and on that result whether control of process moves to the appropriate branch. The white-box testing can be applied to the operations defined for a class basis path, loop testing, or data flow techniques can help to ensure that every statement in an operation has been tested. However, the concise structure of many class operations causes some to argue that the effort applied to white box testing might be better redirected to tests at a class level. Black box testing methods are as appropriate for Object Oriented System as they are for Systems developed using conventional Software engineering methods. UNIT TESTING Unit testing focuses verification effort on the smallest unit of software design the software component or module. Using the component level design description as a guide, important control paths are tested to uncover errors within the boundary of the module. The relative complexity of tests and the errors those tests uncover is limited by the constrained scope established for unit testing. The unit test focuses on the internal processing login and data structures within the boundaries of a component. This type of testing can be conducted in parallel for multiple components.

108

Module

Interface Local data structures Boundary Conditions Independent paths Error handling paths

Test Codes

The module interface is tested to ensure that information properly flows into and out of the program unit under test local data structures are examined to ensure that data stored temporarily maintains its integrity during all steps an algorithm execution. All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at once. For unit testing two testing techniques are applied: white box testing and black box testing. WHITE BOX TESTING White box testing, sometimes called glass box testing, uses the flow and control structure of the process to derive the test case design white box testing is carried out to test whether . a) All paths in a process are correctly operational. b) All logical decisions are executed with true or false conditions. c) All loops are executed with their limit values tested. d) To ascertain whether input data structure specifications are tested and then used for other processing. In order to handle complexities of unit level processing, test case designs are built after drawing process flow charts and flow graphs.

109

PROCESS FLOW CHART Logical Sequence


Start

PROCESS FLOW GRAPH

7 7

Sequence

Loop 1 1 2 7 stop 3 1 4 Logical design 7 7 While 7 6 8 Stop Back to the next Element of data In a loop until. 7 7 7 7 7 7 7 Unit Terminal case 5 Logical Design

If 7 Branching on condition

Process 7 7

Analysis of process flow chart reveals following process paths: Start -1 7 stop Start 1 -2 3 -3 4 - 8 stop Start 1 2 3 6 - 1 (Loop) Start 1 2 3 5 1 (Loop)

Stop

BLACK BOX TESTING Black box testing is also called behavioral testing, concentrates on functions and features of the software. Black box testing is not an alternative to white box testing, but is complementary to it. Black box testing confirms whether for a give valid input, the software executes correctly to produce the required results. Black box testing discovers errors that are not revealed by white box testing. The errors discovered through black box testing are:-

110

Incorrect function Missing function Interface errors not able to receive or send the data to other Systems. Incorrect pre conditions resulting into incorrect function processing Incorrect terminal conditions not responding to stoppage or continues to execute the function. Erroneous processing even though data structure is not correct.

111

CHAPTER-8

112

CONCLUSION

113

CONCLUSION As a student of B.TECH 5th sem I have done this project according to my level of technical knowledge and expertise but in future this project can be enhanced by using advanced technology so that it can become more user friendly and technically advanced besides that more functionalities can also be given to the software.

114

CHAPTER-9

115

BIBILOGRAPHY

116

BIBLOGRAPHY

BOOKS: 1. Roger S Pressman, Software Engineering and practitioners Approach, Tata Mc Graw Hill ,6th edition. 2. Waman S Jawadekar, Software Engineering principles and practice. 3. E. Balaguruswamy, Object Oriented Programming through C++ 4. Timothy Budd, Programming. An Introduction to Object Oriented

WEB: www.c++projects.com www.tatamcgrawhill.com www.google.co.in

117

Você também pode gostar