Visual C++ Program for the Implementation of Hospital Management System | IT1253 - Software Engineering Laboratory

ABSTRACT:
The aim of our project is to develop a software for implementing “Hospital management system” using VISUAL C++. The development of this particular project is to perform the formalities / operation in HOSPITAL MANAGEMENT SYSTEM. This project deals with the patient details, type of disease, and maintenance in its process. The customers are instructed in an easy way to feel comfortable with the processing.

REQUIREMENTS ANALYSIS:

SOFTWARE REQUIREMENTS:

    Front End   :    ‘C++’ language.
    Back End   :     File Management System (using Dat files)
    Operating system:    Any Operating System (Window or Linux)

HARDWARE REQUIREMENTS:
    Processor     :     3.06 GHZ operating speed.
    Hard Disk    :      80GB Capacity.
    RAM           :       256MB
    Monitor       :       CRT 17’
    Mouse         :       OPTICAL
    Keyboard    :       Alphanumeric keys.
     The specified hardware requirements are the minimum requirements that are needed to implement in the project.

FUNCTIONAL REQUIREMENTS:

    As mentioned in the requirements, the Hospital Management system involves the following function or process
Hospital Management system consists of four modules. They are
    Module 1: Insert Module
    Module 2: Delete Module
    Module 3: Display Module
    Module 4: Exit
Insert Module :
In this module the user enters the detail of the patient.
Delete Module :
In this module the user deletes the detail of the patient.
Display Module :
This module display the detail of the patient.
Exit:
    In this module the user can quit from the project.

NON FUNCTIONAL REQUIREMENTS:
    It is reliable software. Whenever the user wants to retrieve any information from the database, it returns with the correct information. Provided, the information stored is a correct one. The cost of maintenance of the software is very low. The size of the software is less. This means, it is a portable one. If any request is given, the time taken for the response is low. This makes the software more efficient.

SOURCE CODE:
#include<windows.h>

#include<sqlext.h>
#include<stdio.h>
#define TEST_LEN 50
int main()
{
    int c;
    char ch='y';
    SQLINTEGER  Regno,Wardno;
    SQLCHAR Patientname[TEST_LEN],Admitdate[TEST_LEN],Disease[TEST_LEN];
    HENV hEnv=NULL;
    HDBC hDBC=NULL;
    HSTMT hStmt=NULL;
    UCHAR szSqlStr[]="insert into hosp(Regno,Admitdate,Patientname,Wardno,Disease) values(?,?,?,?,?)";
    UCHAR szSqlStr1[]="delete * from hosp where Regno = ?";
    UCHAR szSqlStr2[]="select * from hosp";
    UCHAR szDSN[SQL_MAX_DSN_LENGTH]="hospital";
    UCHAR *szUID=NULL;
    UCHAR *szPasswd=NULL;
   UCHAR szModel1[128];
    UCHAR szModel2[128];
    UCHAR szModel3[128];
    UCHAR szModel4[128];
    UCHAR szModel5[128];
    SDWORD cbModel1;
    SDWORD cbModel2;
    SDWORD cbModel3;
    SDWORD cbModel4;
    SDWORD cbModel5;
    SDWORD cbtest=SQL_NTS;
    RETCODE retcode;
    do
    {
    printf("=======================================\n");
    printf("HOSPITAL MANAGEMENT SYSTEM");
    printf("\n=======================================\n");
    printf("1.Enter the Patient details \n2.Delete the Patient detail\n3.Display the Patient detail\n");
    printf("entr ur option......\n");
    scanf("%d",&c);
    switch(c)
    {
        case 1:
        printf("\n-----------------------------------------");
        printf("\nEnter the details");
        printf("\n-----------------------------------------");
        printf("\nEnter the Regno:\t");
        scanf("%d",&Regno);
        printf("\nEnter the Admitdate:\t");
        scanf("%s",&Admitdate);
        printf("\nEnter the Patient name:\t");
        scanf("%s",&Patientname);
        printf("\nEnter the Wardno:\t");
        scanf("%d",&Wardno);
        printf("\nDisease:\t");
        scanf("%s",&Disease);
        printf("\n-----------------------------------------");
        SQLAllocEnv(&hEnv);
        SQLAllocConnect(hEnv,&hDBC);
        retcode=SQLConnect(hDBC,szDSN,SQL_NTS,szUID,SQL_NTS,szPasswd,SQL_NTS);
        if(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
        {
            retcode=SQLAllocStmt(hDBC,&hStmt);
            retcode=SQLPrepare(hStmt,szSqlStr,sizeof(szSqlStr));
SQLBindParameter(hStmt,1,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&Regno,0,&Regno);
SQLBindParameter(hStmt,2,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,Admitdate,0,&cbtest);
SQLBindParameter(hStmt,3,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,Patientname,0,&cbtest);
SQLBindParameter(hStmt,4,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&Wardno,0,&Wardno);
SQLBindParameter(hStmt,5,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,Disease,0,&cbtest);
            retcode=SQLExecute(hStmt);
            printf("\n\n Detail is inserted..........");
        }
        break;
    case 2:
        printf("\nDelete the Patient detail\n");
        SQLAllocEnv(&hEnv);
        SQLAllocConnect(hEnv,&hDBC);
        retcode=SQLConnect(hDBC,szDSN,SQL_NTS,szUID,SQL_NTS,szPasswd,SQL_NTS);
        if(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
        {
            retcode=SQLAllocStmt(hDBC,&hStmt);
            retcode=SQLPrepare(hStmt,szSqlStr1,sizeof(szSqlStr1));
SQLBindParameter(hStmt,1,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&Regno,0,&Regno);      
            printf("Enter the Regno\n");
            scanf("%d",&Regno);
            retcode=SQLExecute(hStmt);
            printf("\nDetail has been deleted\n\n");
        }
        break;
    case 3:
        printf("\nDisplay the HOSPITAL MANAGEMENT SYSTEM\n\n");
        SQLAllocEnv(&hEnv);
        SQLAllocConnect(hEnv,&hDBC);
        retcode=SQLConnect(hDBC,szDSN,SQL_NTS,szUID,SQL_NTS,szPasswd,SQL_NTS);
        if(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
        {
            retcode=SQLAllocStmt(hDBC,&hStmt);
            retcode=SQLPrepare(hStmt,szSqlStr2,sizeof(szSqlStr2));
            retcode=SQLExecute(hStmt);
            SQLBindCol(hStmt,1,SQL_C_CHAR,szModel1,sizeof(szModel1),&cbModel1);
            SQLBindCol(hStmt,2,SQL_C_CHAR,szModel2,sizeof(szModel2),&cbModel2);
            SQLBindCol(hStmt,3,SQL_C_CHAR,szModel3,sizeof(szModel3),&cbModel3);
            SQLBindCol(hStmt,4,SQL_C_CHAR,szModel4,sizeof(szModel4),&cbModel4);
            SQLBindCol(hStmt,5,SQL_C_CHAR,szModel5,sizeof(szModel5),&cbModel5);
            retcode=SQLFetch(hStmt);
            printf("Regno\tDate\tPatientname  Wardno\tDisease\n\n");
            while(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
            {
                printf("%s\t%s\t%s\t\t%s\t%s\n",szModel1,szModel2,szModel3,szModel4,szModel5);
                retcode=SQLFetch(hStmt);
            }
        }
        break;
    }
  flushall();
  printf("\nDo u wan to cont (y/n)");
  scanf("%s",&ch);
 }
 while(ch=='y');
 return 0;
}

OUTPUT:

INSERTION:
DISPLAY:
DELETION:
DISPLAY:

CONCLUSION:
             The  project we have done here is “ONLINE SUPERMARKET SYSTEM” using C language.
In this project we have designed a software to implement the customer details that any user can perform
it in a simple and a better way. This way of format helps us to have clear database.
Previous
Next Post »

3 comments

Write comments
aryan jangid
AUTHOR
June 6, 2013 at 1:26 PM delete

hospital management system is use in maintenance of incoming patients/outgoing patients and maintaining the accounting
hospital management software

Reply
avatar
brain guru
AUTHOR
June 10, 2013 at 1:20 PM delete

Thanks for your informative suggestion about Hospital Management Software .

Reply
avatar
Tanay Singh
AUTHOR
September 30, 2013 at 6:16 PM delete

Hey nice post.. I love the way you presented whole story and thanks for sharing such a useful information with us.. Patient Information System software designed to use in Hospitals, Medical Centers, Health Clinics, Chemist Shops and Medial Institutes to make the process of keeping patients all the related information easier & more accessible.
Hospital Management Software

Reply
avatar

If you still didn't find what you're looking for, you can search this website below: