Hospital Management Sample System

Embed Size (px)

Citation preview

  • 8/2/2019 Hospital Management Sample System

    1/89

    A PROJECT REPORT ON

    HOSPITALMANAGEMENTSYSTEM

    SUBMITTED FORTHE PARTIAL FULFILLMENTOF

    BACHELOROF COMPUTERAPPLICATION OF

    JAMIA HAMDARD UNIVERSITY

    UNDER SUPERVISIONOF

    JAY PRAKASH JAY

    SENIORFACULTY (IT) MCA

    SOFTDOT HI-TECH EDUCATIONAL & TRAINING INSTITUTE

    SUBMITTED BY

    ANKUR DIXIT

    REGN. NO.

    SUBMITTED

    TO

    SCHOOL OF DISTANCE EDUCATION

    JAMIA HAMDARD UNIVERSITHY

    KOTTAYAM, KERALA

    THROUGH: CENTRECODE: 1010

    SOFTDOT HI-TECH EDUCATIONAL & TRAINING INSTITUTE

    K-16, SOUTH EX-I, NEW DELHI-110049

    DECLARATION

    1

  • 8/2/2019 Hospital Management Sample System

    2/89

    I here by declare that minor work entitled Hospital Management

    System submitted for BCA (3 years) is my original work carried out by

    me under the guidance of Mr. Jay Prakash Jay for the partial fulfillment

    of the award of the degree of the Bachelor of Computer Applications.

    The matter embodied in this report has not been submitted anywhere else

    for the award of any other degree/ diploma.

    Date: Signature of the candidate

    CERTIFICATE

    2

  • 8/2/2019 Hospital Management Sample System

    3/89

    This is to certify that Arathi Nair M Registration No. 80454 has carried

    out the project work presented in this project report entitled HospitalManagement System for the award of Bachelor of Computer

    Application from Softdot Hi-Tech Educational & Training Institute to be

    submitted to Mahatma Gandhi University under my supervision. The

    work embodied in this report is original. The work has not been

    submitted in part or full to this or any other university for the award of

    any degree or diploma.

    Signature of supervisor

    Name

    Designation

    Organization

    Forwarded by head study centre (with signature, name of head and seal)

    ACKNOWLEDGEMENT

    3

  • 8/2/2019 Hospital Management Sample System

    4/89

    I take this opportunity to express my deep sense of gratitude and

    indebtedness to a humble guide, Mr. Jay Prakash Jay whose help,encouragement and constant critics kept my moral high during my work.

    Without his assistance and guidance, it would have been indeed difficult

    for me to shape up this work.

    I would like to extend my sincere thanks to Mr. Ganesh Kumar,

    Dean, Softdot South Ex. Branch and Ms. Deepika Singh (Faculty) for

    creating the necessary conditions conducive to the initiation and

    completion of the study.

    I am also thankful to all teachers who have taught me,

    improved my capabilities and all faculty members whose inspiration

    gave me a valuable support as because of them I am in a position to

    successfully design my project.

    I extend my acknowledgement to my friends for their co-operation

    and support during this period and for making moments cherished for

    lifetime.

    Last but not the least, I pay my gratitude and reverence to my

    parents for their love, entire moral boosting.

    Above all I thank Almighty God who showered his blessings

    upon me throughout the period of this work.

    Date:

    Place: ARATHI NAIRM

    4

  • 8/2/2019 Hospital Management Sample System

    5/89

    CONTENTS

    1. DECLARATION

    2. CERTIFICATE

    3. ACKNOWLEDGEMENT

    4. INTRODUCTION

    5. WHY C++ IS USED FOR MAKING THIS PROJECT?

    6. SRS (Software Requirement Specification)

    6.1 SOFTWARE REQUIREMENT SPECIFICATION

    6.2 HARDWARE REQUIREMENT SPECIFICATION

    7. SYSTEM ANALYSIS AND DESIGN

    7.1 SYSTEM ANALYSIS AND DESIGN7.2 DFD (Data Flow Diagram)

    7.3 SOFTWARE MODEL

    7.4 FEASIBILITY STUDY

    7.4.1 ECONOMICAL

    7.4.2 TECHNICAL

    7.4.3 LEGAL

    7.4.4 ORGANISATIONAL

    7.4.5 ENVIRONMENTAL

    8. SCHEDULE

    8.1 PERT CHART

    8.2 GANTT CHART

    9. CODING

    10. REPORT/ OUTPUT FORMS

    11. TESTING

    12. FUTURE SCOPE OF THE PROJECT

    13. BIBLIOGRAPHY

    5

  • 8/2/2019 Hospital Management Sample System

    6/89

  • 8/2/2019 Hospital Management Sample System

    7/89

    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 Hospitalsregarding 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 contain

    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.

    Bed Management

    Bed Management means allows hospital authorities to view

    and track the bed occupancy related operations. Bed Management

    governs activities like Bed Enquiry, Bed Census, and Bed Maintenance.

    Patient Record

    7

  • 8/2/2019 Hospital Management Sample System

    8/89

    The patient record is a comprehensive patient care module

    that tracks the episodes of care for all patients and maintains and

    arranges the clinical information including their address.

    It is the central repository for holding the entire medical records of thepatient. It stores data in an organized and structured manner so that a

    clinician or any other clinical user easily accesses clinical data based on

    his role on needs basis.

    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

    8

  • 8/2/2019 Hospital Management Sample System

    9/89

    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

    9

  • 8/2/2019 Hospital Management Sample System

    10/89

    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 thehospital 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.

    Admission List of patient

    Adding Doctors

    Patient Record

    Assigning rooms

    Availability of bed

    Discharge of patient

    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 are easy to handle.

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

    system cant.

    WHY C++ IS USED FOR MAKING THIS PROJECT?

    10

  • 8/2/2019 Hospital Management Sample System

    11/89

  • 8/2/2019 Hospital Management Sample System

    12/89

    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 less bug prone, as C++ uses a stricter syntax and typechecking.

    Data hiding the usage of data by one program part while other programbeing easier to implement with c++.

    12

  • 8/2/2019 Hospital Management Sample System

    13/89

    REQUIREMENT SPECIFICATION

    13

  • 8/2/2019 Hospital Management Sample System

    14/89

    SystemDescription

    AnalysisModel

    DesignModel

    Requirement specifications 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 theculmination 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) toelaborate 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.

    14

  • 8/2/2019 Hospital Management Sample System

    15/89

  • 8/2/2019 Hospital Management Sample System

    16/89

  • 8/2/2019 Hospital Management Sample System

    17/89

    17

  • 8/2/2019 Hospital Management Sample System

    18/89

    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 necessaryimprovements 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.

    18

  • 8/2/2019 Hospital Management Sample System

    19/89

    ZERO LEVEL DATA FLOW DIAGRAM

    \

    19

  • 8/2/2019 Hospital Management Sample System

    20/89

    1st LEVEL DATA FLOW DIAGRAM

    20

  • 8/2/2019 Hospital Management Sample System

    21/89

    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.

    THE WATERFALL MODEL

    21

    COMMUNICATION

    project

    Initiation

    requirementsgathering PLANNING

    Estimating

    SchedulingTracking

    MODELINGAnalysisDesign

    CONSTRUCTION

    Code

    Test

    DEPLOYMENT

    Delivery

    SupportFeedback

  • 8/2/2019 Hospital Management Sample System

    22/89

    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.

    22

    Requirement analysis

    and specification

    Design

    Implementation and

    unit testing

    Integration and system

    Testing

    Operation and

    Maintenance

  • 8/2/2019 Hospital Management Sample System

    23/89

    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 thewhat 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).

    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 isperformed. 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

    23

  • 8/2/2019 Hospital Management Sample System

    24/89

    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:-

    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.

    24

  • 8/2/2019 Hospital Management Sample System

    25/89

    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 necessaryand prudent to evaluate the feasibility of a project at the earliest possible time. Inthe 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 achieve?

    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 thesystem, whether its benefits should substantially exceed its costs, and whether theproject 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 thesystem exists, how difficult it will be to build and whether the firm has enough

    experience using that technology.

    The software made is on C++ which is a very common language, so we can

    get the experienced persons in it very easily.

    25

  • 8/2/2019 Hospital Management Sample System

    26/89

    3. LEGAL FEASIBILITY

    All projects must face legal scrutiny. When an organization either has legalcouncil 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 tobe 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.

    26

  • 8/2/2019 Hospital Management Sample System

    27/89

    SCHEDULING

    Scheduling of a software project does not greatly from scheduling of any

    multitask engineering effort. Therefore, generalized project scheduling tools and

    techniques can be applied with little modification for software projects.ProgramEvaluation and Review technique (PERT) and the critical path

    method (CPM) are two project scheduling methods that can be applied to

    software development. Both technique are driven by information already

    developed in earlier project planning activities.

    Estimated of effort.

    A Decomposition of the product function model and task set.

    Decomposition of tasks.

    Interdependencies among tasks may be defined using a task network. Tasks,

    sometimes called the project work breakdown structure (WBS), are defined for theproduct as a whole or for individual functions.

    Both PERT and CPM provide quantitative tools that allow the software planner

    to (1)Determines the critical path the chain of tasks that determines the duration ofthe project; (2) Establish most likely time estimates for individual tasks by

    applying statistical models; and (3) Calculate Boundary times that define

    window for a particular task.

    PERT CHART

    The program (or project) Evaluation and review Technique (PERT)is a model for a project management designed to analyze and represent the tasks

    involved in completing a given project.

    T=1mo t=3mo

    D F

    T=2moT=3mo

    A E

    B

    T=4mo C T=3mo

    27

  • 8/2/2019 Hospital Management Sample System

    28/89

    PERT model was invented by BOOZ Allen Hamilton, inc. under contract

    of United States Department of Defences US NAVY special projects office in

    1958 as a part of the polaris mobile submarine launched ballistic missile project

    PERT was developed primarily to simplify the planning and scheduling of

    large and complex projects.

    BENEFITS OF PERT

    PERT is useful because of the following reasons:

    Expected project completion time.

    Probability of completion before a specified date.

    Critical path activities that directly impart the completiontime.

    The activities that have stack time and that can lend

    resources to critical path activities. Activity start and end dates.

    LIMITATIONS OF PERT

    Some of PERT Weakness are:-

    The activity time estimates are somewhat subjective and

    depend on judgement. In cases where there is little experience in

    performing an activity, the numbers may be only a guess. In other cases, if the

    person or group performing the activity estimates the time there may bebiasin theestimate.

    Even if the activity times are well-estimated, PERT assumes a

    beta distribution for these time estimates, but the actual distribution may be

    different.

    Even if the beta distribution assumption holds, PERT assumes

    that the portability distribution of the project completion time is same as that of

    the critical path because other parts can become the critical path because otherparts can become the critical path if there is associated are delayed, PERT

    consistently underestimates the expected project completion time.

    STEPS IN PERT PLANING PROGRESS

    PERT planning involves the following steps:-1) Identify the specific activities & milestone.

    2) Determines the proper sequence of the activities.

    3) Construct a network diagram.4) Estimate the time required for each activity.

    28

  • 8/2/2019 Hospital Management Sample System

    29/89

    5) Determine the critical path.

    6) Update the PERT chart as the project progresses.

    GANTT CHART

    A timeline chart, also called Gantt chart is a graphical representation oftime. A Gantt chart is a useful tool for planning & scheduling project.

    A Gantt chart is helpful when monitoring a projects progress.

    PLANNIG AND SCHEDULING

    o A Gantt chart allows you to asses how long a project should

    take.

    o A Gantt chart lays out the order in which tasks need to be carried

    out.o A Gantt chart helps manage the dependencies between tasks.

    MONITORING A PROJECT

    o A Gantt chart allows you to see immediately what should have been achieved

    at a point in time.

    o A Gantt chart allows you to see how remedial action may bring the

    project back on course.

    A Gantt chart is constructed with a horizontal axis representing the total

    time span of the project, broken down into increments (days, weeks or

    months)

    TIMELINE/GANTT CHART

    A figure illustrates the format of a timeline chart. It depicts a part of a software

    project schedule that emphasizes the concept scoping task for a word-processing

    (WPS) software product. All project tasks (for concept scoping) are listed in the

    lefts- hand column. The horizontal bars indicate the duration of each task. Where

    multiple bars occur at the same time on the calendar, task concurrency is implied.The diamonds indicates milestone.

    29

  • 8/2/2019 Hospital Management Sample System

    30/89

    Time in days0 15 30 45 60 75 90 105

    120

    Activity1. v

    1.11.21.31.4

    v2.2.12.22.32.4

    3 v

    4 v

    5 v

    Form Prog Link TestingDesign Design Establishment

    30

  • 8/2/2019 Hospital Management Sample System

    31/89

    31

  • 8/2/2019 Hospital Management Sample System

    32/89

    //**********************************************************

    // PROJECT HOSPITAL MANAGEMENT//**********************************************************

    //**********************************************************// INCLUDED HEADER FILES

    //**********************************************************

    #include

    #include

    #include

    #include #include

    #include

    #include

    ofstream print("PRN");

    void print_title();void print_dashline();

    void print_date();

    void print_time();/////////////////////////

    void title();

    void dashline();

    void date();void time();

    void print_dashline(){

    for(int a=0;a

  • 8/2/2019 Hospital Management Sample System

    33/89

    void print_date()

    {struct dosdate_t d;

    _dos_getdate(&d);

    int day=d.day;

    int month=d.month;

    int year=d.year;

    print

  • 8/2/2019 Hospital Management Sample System

    34/89

    //GETS AND DISPLAYS THE CURRENT TIME

    void time(){

    struct dostime_t t;

    _dos_gettime(&t);// gotoxy(68,3);

    printf("Time: %2d:%02d\n", t.hour, t.minute);

    }

    void dashline()

    {

    for(int a=0;a

  • 8/2/2019 Hospital Management Sample System

    35/89

    int st1, st2 ;

    } ;

    //**********************************************************

    // THIS CLASS CONTROL ALL THE FUNCTIONS RELATED TO PATIENTS//**********************************************************

    class PATIENT{

    public :

    void ADMIT(void) ;

    void DISCHARGE(void) ;void MODIFY(void) ;

    void LIST(void) ;

    void DISPLAY(void) ;

    friend BILL;private :

    //void MODIFY_RECORD(int,int,int,int,int);void DISPLAY_RECORD(int, int) ;

    void DISPLAY_RECORD1(int, int) ; //****MY DIFINE

    void DELETE_RECORD(int, int) ;void PRINT_BILL(void);

    int roomno, bedno, age, dd, mm, yy ,deposite;

    char name[26], address[36], phone[10], sex, disease[16],

    doctor[26] ;} ;

    //**********************************************************

    // THIS CLASS CONTROL ALL THE FUNCTIONS RELATED TO ROOMS

    //**********************************************************

    class ROOM

    {

    public :void ADD_ROOMS(void) ;

    int AVAILABLE(int, int) ;

    int EMPTY(int) ;void CHANGE_STATUS(int, int, char) ;

    void LIST(void) ;

    int ROOMNO() ;int BEDNO(int) ;

    int LAST_ROOMNO(void) ;

    friend BILL;

    private :

    35

  • 8/2/2019 Hospital Management Sample System

    36/89

    int RECORDNO(int, int) ;

    int roomno, bedno ;

    char status ;} ;

    //**********************************************************

    // THIS CLASS CONTROL ALL THE FUNCTIONS RELATED TO DOCTORS

    //**********************************************************

    class DOCTOR

    {

    public :void ADD(void) ;

    void DELETE(void) ;

    void LIST(void) ;

    char *DOCTOR_NAME(int) ;int RECORDS(void) ;

    void DEFAULT(void) ;friend BILL;

    private :

    char name[26] ;} ;

    //**********************************************************

    //CLASS CONTRIL THE BILLING SYSTEM

    //**********************************************************class BILL

    {

    public: int r,n,d,m,y;//friend PATIENT;

    void print_bill()

    { title();PATIENT p;

    p.DISPLAY_RECORD1(r,n);

    }

    };

    //**********************************************************

    // THIS FUNCTION DRAWS THE HORRIZONTAL LINE//**********************************************************

    void LINES :: LINE_HOR(int column1, int column2, int row, char c)

    {

    36

  • 8/2/2019 Hospital Management Sample System

    37/89

  • 8/2/2019 Hospital Management Sample System

    38/89

    l1 = c ;

    l2 = c ;

    }gotoxy(column1,row1) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    39/89

    delay(20) ;

    gotoxy(1,i) ; clreol() ;

    }}

    //**********************************************************

    // THIS FUNCTION CONTROL ALL THE FUNCTIONS IN THE MAIN MENU

    //**********************************************************

    void MENU :: MAIN_MENU(void)

    {

    int ch=0 ;char *options[7]={

    " ADMISSION ",

    " DISCHARGE ",

    " ROOM STATUS "," PATIENT LIST ",

    " PATIENT RECORD "," EDIT ",

    " QUIT "

    } ;while (1)

    {

    st1 = 12 ;

    st2 = 8 ;textmode(C40) ;

    clrscr() ;

    textbackground(WHITE) ;textcolor(BLACK) ;

    gotoxy(13,8) ;

    cprintf("O P T I O N S ") ;textbackground(BLACK) ;

    textcolor(LIGHTGRAY) ;

    ch = CREATE_MENU(options,7,12,11) ;

    textmode(C80) ;clrscr() ;

    if (ch == 0)

    {PATIENT p ;

    p.ADMIT() ;

    }else

    if (ch == 1)

    {

    PATIENT p ;

    39

  • 8/2/2019 Hospital Management Sample System

    40/89

    p.DISCHARGE() ;

    }

    elseif (ch == 2)

    {

    ROOM r ;r.LIST() ;

    }

    elseif (ch == 3)

    {

    PATIENT p ;

    p.LIST() ;}

    else

    if (ch == 4)

    { PATIENT p ;

    p.DISPLAY() ;}

    else

    if (ch == 5)EDIT_MENU() ;

    else

    if (ch == 6)

    break ;}

    }

    //**********************************************************

    // THIS FUNCTION CONTROL ALL THE FUNCTIONS IN THE EDIT MENU//**********************************************************

    void MENU :: EDIT_MENU(void)

    {int ch=0 ;

    char *options[5]={

    " ADD ROOMS "," ADD DOCTOR RECORD ",

    " DELETE DOCTOR RECORD ",

    " RETURN "} ;

    while (1)

    {

    st1 = 14 ;

    40

  • 8/2/2019 Hospital Management Sample System

    41/89

    st2 = 10 ;

    textmode(C40) ;

    clrscr() ;textbackground(WHITE) ;

    textcolor(BLACK) ;

    gotoxy(15,10) ;cprintf("EDIT MENU ") ;

    textbackground(BLACK) ;

    textcolor(LIGHTGRAY) ;ch = CREATE_MENU(options,5,8,13) ;

    textmode(C80) ;

    clrscr() ;

    if (ch == 0){

    ROOM r ;

    r.ADD_ROOMS() ;

    }else

    if (ch == 1){

    DOCTOR d ;

    d.ADD() ;}

    else

    if (ch == 2)

    {DOCTOR d ;

    d.DELETE() ;

    }else

    if (ch == 3)

    break ;}

    }

    //**********************************************************

    // THIS FUNCTION CREATE MENU FOR THE GIVEN OPTIONS

    //**********************************************************

    int MENU :: CREATE_MENU(char *options[], int size, int y, int x)

    {int valid ;

    int n = 0 ;

    char ch1, ch2 ;

    char chr1=219 ;

    41

  • 8/2/2019 Hospital Management Sample System

    42/89

    char c1=24, c2=25 ;

    gotoxy(3,24) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    43/89

    {

    n = 0 ;

    x = x - (size-1) ;}

    else

    { n++ ;

    x++ ;

    }textbackground(WHITE) ; textcolor(BLACK) ;

    gotoxy(y,x) ;

    cprintf("%s",options[n]) ;

    textbackground(BLACK) ; textcolor(LIGHTGRAY) ;gotoxy(st1,st2) ;

    }

    if ((ch1 == 0) && (ch2 == 72))

    { textbackground(BLACK) ; textcolor(LIGHTGRAY) ;

    gotoxy(y,x) ;cprintf("%s",options[n]) ;

    if ( n == 0 )

    {n = size-1 ;

    x = x + (size-1) ;

    }

    else{

    n-- ;

    x-- ;}

    textbackground(WHITE) ; textcolor(BLACK) ;

    gotoxy(y,x) ;cprintf("%s",options[n]) ;

    textbackground(BLACK) ; textcolor(LIGHTGRAY) ;

    gotoxy(st1,st2) ;

    }} while (( ch1 != 13 ) && ( ch2 != 13 )) ;

    return n ;

    }

    //**********************************************************// THIS FUNCTION RETURNS THE CODE OF LAST ROOM NO.

    //**********************************************************

    int ROOM :: LAST_ROOMNO(void)

    43

  • 8/2/2019 Hospital Management Sample System

    44/89

    {

    fstream file ;

    file.open("ROOMS.DAT", ios::in) ;if (file.fail())

    {

    file.close() ;return 0 ;

    }

    int last=0 ;while (file.read((char *) this, sizeof(ROOM)))

    last = roomno ;

    file.close() ;

    return last ;}

    //**********************************************************// THIS FUNCTION ADDS ROOMS TO THE FILE

    //**********************************************************

    void ROOM :: ADD_ROOMS(void)

    {clrscr() ;

    char ch ;

    do

    {gotoxy(5,5) ; clreol() ;

    cout

  • 8/2/2019 Hospital Management Sample System

    45/89

    line.BOX(8,9,42,15,218) ;

    gotoxy(10,10) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    46/89

    int ROOM :: AVAILABLE(int rno, int bno)

    {fstream file ;

    file.open("ROOMS.DAT", ios::in) ;

    int avail=0 ;while (file.read((char *) this, sizeof(ROOM)))

    {

    if (roomno == rno && bedno == bno && status == 'A'){

    avail = 1 ;

    break ;

    }}

    file.close() ;

    return avail ;

    }

    //**********************************************************

    // THIS FUNCTION RETURNS RECORD NO. OF THE GIVEN ROOM AND

    // BED NO.//**********************************************************

    int ROOM :: RECORDNO(int rno, int bno)

    {fstream file ;

    file.open("ROOMS.DAT", ios::in) ;

    int recordno=0 ;while (file.read((char *) this, sizeof(ROOM)))

    {

    recordno++ ;if (roomno == rno && bedno == bno)

    break ;

    }

    file.close() ;return recordno ;

    }

    //**********************************************************

    // THIS FUNCTION DISPLAY THE LIST OF THE ROOMS//**********************************************************

    void ROOM :: LIST(void)

    {

    46

  • 8/2/2019 Hospital Management Sample System

    47/89

    clrscr() ;

    int row = 4, flag ;

    int sta = 0 ;char ch ;

    textbackground(WHITE) ;

    textcolor(BLACK) ;gotoxy(30,1);

    cprintf("ROOM STATUS");

    gotoxy(1,3) ;cprintf("Room no. Bed no. Status Room no. Bed no. Status

    ") ;

    textbackground(BLACK) ;

    textcolor(LIGHTGRAY) ;fstream file ;

    file.open("ROOMS.DAT", ios::in) ;

    if (file.fail())

    { gotoxy(5,10) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    48/89

  • 8/2/2019 Hospital Management Sample System

    49/89

    break ;

    }

    }file.close() ;

    return rno ;

    }

    int ROOM :: BEDNO(int rno){

    fstream file ;

    file.open("ROOMS.DAT", ios::in) ;

    int bno=0 ;while (file.read((char *) this, sizeof(ROOM)))

    {

    if (rno == roomno && status == 'A')

    { bno = bedno ;

    break ;}

    }

    file.close() ;return bno ;

    }

    void ROOM :: CHANGE_STATUS(int rno, int bno, char rstatus)

    {

    fstream file ;file.open("ROOMS.DAT", ios::in) ;

    fstream temp ;

    temp.open("temp.dat", ios::out) ;file.seekg(0,ios::beg) ;

    while (!file.eof())

    {

    file.read((char *) this, sizeof(ROOM)) ;if (file.eof())

    break ;

    if (rno == roomno && bno == bedno){

    status = rstatus ;

    temp.write((char *) this, sizeof(ROOM)) ;}

    else

    temp.write((char *) this, sizeof(ROOM)) ;

    }

    49

  • 8/2/2019 Hospital Management Sample System

    50/89

    file.close() ;

    temp.close() ;

    file.open("ROOMS.DAT", ios::out) ;temp.open("temp.dat", ios::in) ;

    temp.seekg(0,ios::beg) ;

    while (!temp.eof()){

    temp.read((char *) this, sizeof(ROOM)) ;

    if (temp.eof())break ;

    file.write((char *) this, sizeof(ROOM)) ;

    }

    file.close() ;temp.close() ;

    }

    //**********************************************************

    // THIS FUNCTION ADD NAME OF DOCTOR IN THE FILE//**********************************************************

    void DOCTOR :: ADD(void){

    clrscr() ;

    if (RECORDS() >= 20)

    {gotoxy(5,10) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    51/89

  • 8/2/2019 Hospital Management Sample System

    52/89

    void DOCTOR :: LIST(void)

    {int row = 13, col=2, sno=1 ;

    char ch ;

    textbackground(WHITE) ;textcolor(BLACK) ;

    gotoxy(1,11) ; clreol() ;

    cprintf("S.No. Name ") ;textbackground(BLACK) ;

    textcolor(LIGHTGRAY) ;

    fstream file ;

    file.open("DOCTOR.DAT", ios::in) ;while (file.read((char *) this, sizeof(DOCTOR)))

    {

    delay(20) ;

    gotoxy(col,row) ;cout

  • 8/2/2019 Hospital Management Sample System

    53/89

    return records ;

    }

    //**********************************************************

    // THIS FUNCTION RETURNS NAME OF THE DOCTOR//**********************************************************

    char *DOCTOR :: DOCTOR_NAME(int pd){

    fstream file ;

    file.open("DOCTOR.DAT", ios::in) ;

    int i=0 ;while (file.read((char *) this, sizeof(DOCTOR)))

    {

    i++ ;

    if (i == pd)break ;

    }file.close() ;

    return name ;

    }

    //**********************************************************

    // THIS FUNCTION DELETES DOCTOR RECORD IN DOCTOR FILE//**********************************************************

    void DOCTOR :: DELETE(void){

    clrscr() ;

    LIST() ;char t1[5] ;

    int t2, sno ;

    do

    {gotoxy(5,5) ; clreol() ;

    cout

  • 8/2/2019 Hospital Management Sample System

    54/89

    fstream temp ;

    temp.open("temp.dat", ios::out) ;

    file.seekg(0,ios::beg) ;int i=0 ;

    while (!file.eof())

    { file.read((char *) this, sizeof(DOCTOR)) ;

    i++ ;

    if (file.eof())break ;

    if (i != sno)

    temp.write((char *) this, sizeof(DOCTOR)) ;

    }file.close() ;

    temp.close() ;

    file.open("DOCTOR.DAT", ios::out) ;

    temp.open("temp.dat", ios::in) ;temp.seekg(0,ios::beg) ;

    while (!temp.eof()){

    temp.read((char *) this, sizeof(DOCTOR)) ;

    if (temp.eof())break ;

    file.write((char *) this, sizeof(DOCTOR)) ;

    }

    file.close() ;temp.close() ;

    LINES line ;

    line.CLEARDOWN(13,23) ;LIST() ;

    gotoxy(5,7) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    55/89

    rno = r.ROOMNO() ;

    if (rno == 0)

    {gotoxy(5,10) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    56/89

    valid = 0 ;

    gotoxy(5,25) ; clreol() ;

    cout

  • 8/2/2019 Hospital Management Sample System

    57/89

    cout

  • 8/2/2019 Hospital Management Sample System

    58/89

    if (file.fail())

    dr.DEFAULT() ;

    file.close() ;dr.LIST() ;

    do

    { valid = 1 ;

    gotoxy(5,25) ; clreol() ;

    gotoxy(5,24) ; clreol() ;cout

  • 8/2/2019 Hospital Management Sample System

    59/89

    dd = d1 ;

    mm = m1 ;

    yy = y1 ;strcpy(disease,pdisease) ;

    deposite=deposite1; //ENTER BY MYSELF

    strcpy(doctor,pdoctor) ;file.open("PATIENT.DAT", ios::app) ;

    file.write((char *) this, sizeof(PATIENT)) ;

    file.close() ;}

    //**********************************************************// THIS FUNCTION DISPLAYS THE LIST OF THE PATIENTS

    //**********************************************************

    void PATIENT :: LIST(void){

    clrscr() ;int row = 5 , found=0, flag=0 ;

    char ch ;

    textcolor(BLACK+BLINK) ; textbackground(WHITE) ;gotoxy(31,1) ;

    cprintf(" LIST OF PATIENTS ") ;

    textcolor(BLACK) ;

    gotoxy(1,3) ; clreol() ;gotoxy(1,3) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    60/89

    row = 5 ;

    gotoxy(1,25) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    61/89

    cprintf("Room no.: %d",roomno) ;

    gotoxy(60,2) ;

    cprintf("Bed no. : %d",bedno) ;textcolor(LIGHTGRAY) ; textbackground(BLACK) ;

    gotoxy(5,3) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    62/89

    /* cout*/ print

  • 8/2/2019 Hospital Management Sample System

    63/89

    {

    valid = 0 ;

    r.LIST() ;clrscr() ;

    }

    if ((rno < 1 || rno > r.LAST_ROOMNO()) && valid){

    valid = 0 ;

    gotoxy(5,25) ; clreol() ;cout

  • 8/2/2019 Hospital Management Sample System

    64/89

    gotoxy(5,20) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    65/89

    {

    clrscr() ;

    char t1[5], ch ;int rno, bno, valid, t2, t_r_room,d_fee,mis_exp;

    ROOM r ;

    do{

    valid = 1 ;

    gotoxy(5,5) ;cout

  • 8/2/2019 Hospital Management Sample System

    66/89

    gets(t1) ;

    t2 = atof(t1) ;

    bno = t2 ;if (t1[0] == '0')

    return ;

    if (strlen(t1) == 0){

    valid = 0 ;

    r.LIST() ;clrscr() ;

    }

    if ((bno < 1 || bno > 2) && valid)

    {valid = 0 ;

    gotoxy(5,25) ; clreol() ;

    cout

  • 8/2/2019 Hospital Management Sample System

    67/89

    gotoxy(5,23) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    68/89

    valid = 1 ;

    gotoxy(5,5) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    69/89

    if (ch == 'N')

    return ;

    do

    {

    valid = 1 ;clrscr() ;

    gotoxy(29,1) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    70/89

    {

    valid = 0 ;

    gotoxy(5,25) ; clreol() ;cout

  • 8/2/2019 Hospital Management Sample System

    71/89

    r.CHANGE_STATUS(rno,bno,'A') ;

    r.CHANGE_STATUS(rno,bno,'N') ;

    // MODIFY_RECORD(rno,bno,rno,bno,pdoctor) ;gotoxy(5,23) ;

    cout

  • 8/2/2019 Hospital Management Sample System

    72/89

    72

  • 8/2/2019 Hospital Management Sample System

    73/89

    This is the home page.

    73

  • 8/2/2019 Hospital Management Sample System

    74/89

    This

    page is to view the edit options.

    74

  • 8/2/2019 Hospital Management Sample System

    75/89

    Add rooms : This page is to add new rooms in the hospital.

    This shows availability of rooms.

    75

  • 8/2/2019 Hospital Management Sample System

    76/89

    This page is to view the total no. of rooms and bed.

    76

  • 8/2/2019 Hospital Management Sample System

    77/89

    This page is to clarify whether we want to add a doctor or not.

    77

  • 8/2/2019 Hospital Management Sample System

    78/89

    This page is to delete the doctor.

    78

  • 8/2/2019 Hospital Management Sample System

    79/89

    This page is to enter the number of the doctor to be deleted.

    79

  • 8/2/2019 Hospital Management Sample System

    80/89

    This page shows the record after deleting the doctor.

    80

  • 8/2/2019 Hospital Management Sample System

    81/89

    This page shows the admission of a patient in the hospital.

    81

  • 8/2/2019 Hospital Management Sample System

    82/89

    This page shows the complete record of a patient.

    82

  • 8/2/2019 Hospital Management Sample System

    83/89

    This page is to view the patient record.

    83

  • 8/2/2019 Hospital Management Sample System

    84/89

    This page is to view the list of patients.

    84

  • 8/2/2019 Hospital Management Sample System

    85/89

    TESTING

    Testing is the process of executing a program with the intent of findingerrors in software development process, errors can be injected at any stages

    during development. There are various techniques that are used for detecting andeliminating 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 setof 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 withinthe 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 typw of testing can be conducted in parallel for

    multiple components.

    85

  • 8/2/2019 Hospital Management Sample System

    86/89

    Module

    Test Codes

    Interface

    Local data structures

    Boundary ConditionsIndependent paths

    Error handling paths

    The module interface is tested to ensure that information properly flowsinto 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 andblack 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 iscarried 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

    86

  • 8/2/2019 Hospital Management Sample System

    87/89

    11

    3

    1

    processing, test case designs are built after drawing process flow charts and flow

    graphs.

    PROCESS FLOW CHART PROCESS FLOW GRAPH

    LogicalSequence

    Sequenc

    Loop

    LogicalDesign If

    Process

    stop

    Logical design

    Unit

    Terminal case

    While

    Back to the nextElement of data

    In a loop until.

    stop

    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)

    BLACK BOX TESTING

    87

    Sta

    rt

    2

    54

    6

    8

    7

    7

    7

    7

    7

    7

    7

    7

    7

    7

    7

    7

    7

    7

    7

    7

    Stop

    Branching on

    condition

  • 8/2/2019 Hospital Management Sample System

    88/89

  • 8/2/2019 Hospital Management Sample System

    89/89

    The formats of different types of reports can be made to suite the

    requirements.

    BIBLOGRAPHY

    BOOKS:

    1. Roger S Pressman, Software Engineering and practitioners

    Approach, Tata Mc Graw Hill ,6th edition.

    2. Waman S Jawadekar, Software Engineering principles andpractice.

    3. E. Balaguruswamy, Object Oriented Programming through C++

    4. Timothy Budd, An Introduction to Object Oriented

    Programming.

    WEB:

    www.c++projects.com

    www.tatamcgrawhill.comwww.google.co.in

    http://www.tatamcgrawhill.com/http://www.google.co.in/http://www.tatamcgrawhill.com/http://www.google.co.in/