Report hospital

  • 506 views
Uploaded on

 

More in: Education , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
506
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
43
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. PROJECT REPORT “Hospital Management System" SUBMITTED IN PARTIAL FULFILLMENT FOR THE DEGREE OF MASTER IN COMPUTER APPLICATIONS MCA-LE (Session 2011-2013) Under The Guidance: Mr. SAVAAB ALI KHAN (Sr.Lecturer) SUBMITTED BY: RACHIT GAUR(11403960488) SUBMITTED TO: KHUSHBU DOULANI (TEAM LEADER) IT DEPTT.-MCMIT
  • 2. Preface Information is a valuable resource to an organization. Computer software provides an efficient means of processing information, and HOSPITAL MANAGEMENT SYSTEM are nowadays becoming increasingly common means by which it is possible to store and retrieve information (regarding hospital) in an effective manner. This book provides comprehensive coverage of fundamentals of HOSPITAL MANAGEMENT SYSTEM. This book is for those who wish a better understanding of relational data modeling, its purpose, its nature, and the standards used in creating relational data model. Relational databases are the most popular database management systems in the world and are supported by a variety of vendor implementations. Majority of the practical tasks in industry require applying relatively not complex algorithms to huge amounts of well-structured data. The efficiency of the application depends on the quality of data organization. Advances in database technology and processing offer opportunities for using information flexibility and efficiently when data is organized and stored in relational structures. The relational DBMS is a success in the commercial market place with respect to business data processing and related applications. This success is a result of cost effective application development combined with high data consistency. The success has led to the use of relational DBMS technology in other application environments requesting its traditional virtues, while at the same time adding new requirements.
  • 3. ACKNOWLEDGEMENT I take this opportunity to express my sincere thanks and deep gratitude towards Mr. SABAB ALI KHAN for his valuable guidance and co-operation in starting this Project successfully. Development of project like “HOSPITAL MANAGEMENT SYSTEM” in JAVA is not a too much difficult task but fairly a puzzle one. This language teaches so much about database programming and new version. This project is a part of our MCA course. I have developed this project with the help of Faculty members of my Institute MCMIT and as such I am extremely grateful to all of them. I am obliged to my project guide Mr. SABAB ALI KHAN
  • 4. TABLE OF CONTENTS (with Page Numbers) INTRODUCTION OBJECTIVES TYPE OF PROJECT REQUIRMENT OF H/W & S/W MODULES OF THE PROJECT TESTING METHOD ER DIAGRAM DFD FUTURE SCOPE AND FURTHET ENHANCEMENT OF THE PROJECT INTRODUCTION/OBJECTIVE  The goal of any system development is to develop and implement the system cost effectively; user-friendly and most suited to the user’s analysis is the heart of
  • 5. the process. Analysis is the study of the various operations performed by the system and their relationship within and outside of the system. During analysis, data collected on the files, decision points and transactions handled by the present system. Different kinds of tools are used in analysis of which interview is common one. The drawback of the existing system is that it is very difficult to retrieve data from case files. It is difficult to handle the whole system manually and it is less accurate and to keep the data in case files for future reference because it may get destroyed. Moreover it is very difficult to retrieve data. Redundancy of data may occur and this may lead to the inconsistency. The manual system is so time-consuming. The proposed system is very easy to operate. Speed and accuracy are the main advantages of proposed system. There is no redundancy of data. The data are stored in the computer’s secondary memories like hard disk, etc. it can be easily receive and used at any time. The proposed system will easily handle all the data and the work done by the existing systems. The proposed systems eliminate the drawbacks of the existing system to a great extent and it provides tight security to data. OBJECTIVE
  • 6. Hospital Management System is powerful, flexible, and easy to use and is designed and developed to deliver real conceivable benefits to hospitals and clinics and more importantly it is backed by reliable and dependable of users Hospital Management System is designed for multi specialty hospitals, to cover a wide range of hospital administration and management processes. It is an integrated end-toend Hospital Management System that provides relevant information across the hospital to support effective decision making for patient care, hospital administration and critical financial accounting, in a seamless flow. Hospital Management System is a software product suite designed to improve the quality and management of clinical care and hospital health care management in the areas of clinical process analysis and activity-based costing. Hospital Management System enables you to develop your organization and improve its effectiveness and quality of work. Managing the key processes efficiently is critical to the success of the hospital helps you manage your processes. TOOLS AND ENVIRONMENT USED HARDWARE REQUIREMENT1. Pentium4 or Above 2. 256 MB RAM(MIN)
  • 7. 3. 1 GB RAM(MAX) 4. 20 GB Hard Disk(MIN) 5. 1.33 MHz speed(MIN) 6. 50 MB(for package itself) 7. Dot Matrix/HP Laser/HP/DeskJet/HP Inkjet Printer 8. Optical Mouse 9. 15’inch Color Monitor Software Requirements:1. WIN XP Operating System 2. WIN 7 Operating System 3. WIN Vista Operating System 4. JDK 1.6 5. ORACLE JAVA Introduction:
  • 8. Java is a new and popular language created by sun Microsystems. The best news about java is that it is object oriented architecture, interpreted, robust, secure, portable, high performance, multithreaded & dynamic language. With java, we can develop a single application i.e. immediately usable on multiple platforms. Imagine the countless hours that will save by being able to develop a single application usable on windows, UNIX & Macintosh system. Java produces two program types’ application & Applet. Applications are standard one & can be run directly from me command line. Applets requires on external program to provide an interface to the user. Java defines data as objects with methods that support the objects. Java is purely objects. Java is purely object oriented & provides abstraction, encapsulation, inheritance & polymorphism. Even a very basic program has a class. Any code written is java is inside a class. Java is tuned to the web, java programs can be built in java, that user’s resource from any other computer. Java is the both interpreted & compiled. The code is complied. The code is compiled with a byte code i.e. binary & platform independent. When a program has to execute the code is fetched into management & interpreted on the user’s machines as on interpreted language, java has simple syntax. When a piece of code is compiled all errors are listed together. A program is executed only when all the errors have been rectified. An interpreter, on the other hand, verifies the code & execution reaches the statement with an error is the error report.
  • 9. Compilation is the process of converting the code into a language that the compiler understands machines language. When compiling a program using a compiler, the compiler checks for syntactical (grammatical) errors. In code and lists all the errors on the screen. The errors are rectified and the program is recompiled to get the machine language code. Java compilers compile the code to a byte code that is understood by the java environment. Byte code is result of compiling a java program this code can be executed on any platform. In other words due to the byte cod compilation processes an interpretation by a browser, java programs can be executed on a variety of hardware and software. The only requirement is that the system should have a java enabled internet browser. A java compiler is written in java and the run time environment, the interpreter is written in c. the java interpreter can execute java code directly on any machine, on which java a interpreter has been installed. A java program can run on any machine that has a java interpreter. The byte code supports connection to multiple databases. Java code is portable. There fore, other people can use programs that you write in java even if they have different machines with different operating system. Due to strong type checking done by java on the user’s machine any changes to the program are tagged as errors and program will not execute, java is there secure. Java programs are comparable in speed to the programs written in other compiler based languages like c and c++. Java is faster than other interpreter based languages like basic sense it is compiled and interpreted.
  • 10. Multithreading is the ability of an application to perform multiple task at same time. For example, when you play game on your computer one task of the program that is handle sound effects and another to handle screen display. A single program accomplishes many tasks, simultaneously. A java program can consists of many modules that are written by many programmers. These modules may undergo many changes. Java makes interconnections between modules and at the run time, which easily avoids the problem caused by the change of the code used program. Java is thus dynamic. A few types of java applications are listed below: Applications that do not use graphical user interface (GUI)-they are similar to traditional programs written in c and c++. Applications using GUI. These applications are used in windows environment. Applets these programs run on a web page and require a java enabled browser like internet explorer or Netscape navigator. Packages-packages are collections of classes that can be shared by applications and applets. They can similar to the libraries provided by other language like c++. Java provides many packages like long and util.
  • 11. RDBMS ORACLE ORACLE DATABASE:ORACLE is a database vendor that uses to design relational database. A database management system, or DBMS, gives the user access to their data and helps them transform the data into information. Oracle allows users to create, update, and extract information from their databases. Compared to a manual filing system, the biggest advantages to a computerized database system are speed, accuracy, and accessibility. A database is a structured collection of data. Data refers to the characteristics of people, things, and events.
  • 12. Oracle stores each data item in its own field. In Oracle, the fields relating to a particular person, thing, or event are bundled together to form a single, complete unit of data, called a record (it can also be referred to as a row or an occurrence). Each record is made up of a number of fields. No two fields in a record can have the same field name. During an Oracle database design project, the analysis of our Business needs identifies all the fields or attributes of interest. If your business needs change over time, you define any additional fields or change the definition of existing fields. ORACLE TABLE Oracle stores records relating to each other in a table. A table is easily visualized as a tabular arrangement of data, not unlike a spreadsheet, consisting of vertical columns and horizontal rows. A table consists of a number of records. The field names of each record in the table are the same, although the field values may differ. Each field occupies one column and each record occupies one row. Each record is a unique entry and is Independent of any other record in the table. After the analysis of the business requirements, the database design team defines the necessary tables. Different tables are created for the various groups of information Related tables are grouped together to form a database.
  • 13. Primary Keys Every table in Oracle has a field or a combination of fields that uniquely identifies each record in the table. This unique identifier is called the primary key, or simply the key. The primary key provides the means to distinguish one record from all the others in a table. It allows the user and the database system to identify, locate, and refer to one particular record in the table. The database design team determines the best candidate field for the primary key. Once a table has been assigned a primary key, Oracle won't allow more than one record in the table with the same value for the primary key. No two Employees can have the same ID number. Relational Databases Sometimes all the information of interest to a business operation can be stored in one table. Oracle makes it very easy to link the data in multiple tables. This is a key feature of a relational database management system, or RDBMS. They store data in two or more tables and enable us to define relationships between the tables. The link between the tables is based on one or more field values common to both tables.
  • 14. Foreign Key Remember that every table in ORACLE has a primary key a field or fields making each record unique. When a field in one table matches the primary key of another table, the field is referred to as a foreign key. A foreign key is a field or a group of fields in one table whose values match those of the primary key of another table. You can think of a foreign key as the primary key of a foreign table. MODULES DOCTOR (INSERT, SELECT, UPDATE, DELETE) PAITEINT (INSERT, SELECT, UPDATE, DELETE) STAFF (INSERT, SELECT, UPDATE, DELETE) BILLING
  • 15. ROOM GENERATING REPORTS
  • 16. TESTING INTRODUCTION Testing is the most important aspect of any project. A web application becomes more crucial since the information is to be viewed by thousands of users. It is essential for developer to make sure that the web presentation work well from technical and well as usability side. We have performed the module level testing and content verification before going for integrity and usability testing. WHITE BOX TESTING
  • 17. White box testing called glass box testing, is a test case design method that uses the control structure to derive test cases. Using white box testing methods the software engineer can derive test cases that Guarantee that all independent paths within a module have been exercised Exercise all logical decisions on their true and false sides Execute all loops at their operational bounds Exercise internal data structure to ensure their validity A reasonable question might be imposed at this juncture: “why spend time and energy worrying about (and testing) logical minutiae when we might better expend effort ensuring that program requirements have been met? Stated another way, why don’t we spend all of our energy on black box tests? The answer lies in nature of software defects. Logical errors and incorrect assumptions are inversely proportional to the probability that a program path will be executed. Errors tend to creep into our work when we design and implement Function, conditions, or control that is out of mainstream. Everyday Processing tends to be well understood while “special case” processing tends to fall into cracks. We often believe that a logical path is not likely to be executed when, infect it may be executed on regular basis.
  • 18. The logical flow of a program is sometimes counterintuitive, meaning that our unconscious assumptions about flow of control and data may lead us to make design errors that are uncovered only once path testing commences. Typographical errors are random. When a program is translated into programming language source code, it is likely that some typing errors will occur. Many will be uncovered by syntax and type checking mechanisms, but others may go undetected until testing begins. It is as likely that a typo will exist on mainstream path. Each of these provides an argument for conducting white box tests. Black box testing is far more likely to uncover them. BLACK BOX TESTING Black box testing also called “behavioral testing”, focuses on the functional requirements for a program. Black box testing is not an alternative to white box techniques. Rather it is a complimentary approach that is likely to uncover a different class of errors than white box methods. Black box testing attempts to find errors in the following categories: Incorrect or missing functions. Interface Error Errors in data stream or external database access. Behavioral or performance errors Initializations or termination errors
  • 19. Unlike white box testing, which is performed early in the testing process, black box testing tends to be applied during later stages of testing. Black box testing purposely disregards control structure; attention is focused on the information domain. Test are designed to answer the following questionsHow is functional validity tested? How is system behavior and performance tested? What classes of input will make good test cases? Is the system particularly sensitive to certain input values? By applying black box techniques we derive a set of test cases that satisfy the following criteriaTest cases that reduce by a count that is greater than one, the number of additional test cases that must be designed to achieve reasonable testing and Test cases that tell us something about the presence or absence of classes of errors, rather than an error associated only with the specific test at hand.
  • 20. ER DIAGRAM
  • 21. About E-R Diagram: The entity –relationship (E-R) data model is based on a perception of real world which consist of basic objects called entities and relationship among these objects. The E-R model was introduced by P.P. Chen. Chen introduced not only E-R model but also a corresponding diagramming technique. E-R diagram is used to represent the entities and their relationship to other entities. It uses some symbols to represent the objects of E-R diagram. Entity: Entity is an object which has its own existence and can be distinguish from other objects. Entity is represented by a set of attributes. An entity is any object, place, person, concept or activity about which an enterprise records data. While diagramming entity is named and represented by a rectangle.
  • 22. Attribute: Attributes are descriptive properties processed by each member of an entity. Attributes are represented through ellipses, labeled with the name of the property. The key attribute are underlined. Relationship: A relationship is an association among several entities. A relationship defines the association of entity type relationship instance is an association of entity instances. There are three types of relationship: One to One relationship One to Many relationships Many to Many relationship E-R Diagram Symbols
  • 23. Entity Relationship Weak relationship
  • 24. Attribute Composite attribute Key attribute
  • 25. Partial key Derived attribute MODULE DETAILS
  • 26. DATA DICTIONARY
  • 27. CLASS DIAGRAM
  • 28. DATA FLOW DIAGRAM DFD (Data Flow Diagram): Data Flow Diagram (abbreviated as DFD) was introduced by De Marco(1978) and Gane and Sarson(1979),and is important tool used by system analysts. A DFD models a system by using external entities from which data flows to process which transform data and creates output data flow which go to other process or external entities or data stores. Stored data may also flow to processes as inputs. The main merit of DFD is that it can provide an overview of what data a system would processes, what transformations of data are done, what data are stored and which stored data is used, and where the result is flow. Symbols Used In DFDs:
  • 29. Four symbols are used in drawing DFDs. A circle is used to depict a process. Process are numbered and given a name. The term bubble is also sometimes used instead of circle. Data flows are represented by a line with an arrow. Arrow shows the direction of flow of data. The name of the data appears next to the line. External entities are represented by rectangles, and are outside the system. Entities supplying data are known as sources and those that consume data are called sinks. Data store is depicted by two lines. Data store stores data. If an arrow points to the store, it indicates operation of writing in the store. If it points away from the store, it indicates operation of reading from the store. Data flow can take place between processes, from A data store to a process, A process to a data store An external entity to a process, or From a process to an external entity. Data flow can’t take place between to a data stores or between two external entities.
  • 30. DFD SYMBOLS Represents Process Represents Data Flow
  • 31. Represents External Entity Represents Data Store 0 LEVEL
  • 32. MODULE DETAILS
  • 33. 1 LEVEL 2 LEVEL
  • 34. CODING import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; import javax.swing.border.*; import java.awt.font.*; import com.sun.java.swing.plaf.motif.*; import com.sun.java.swing.plaf.windows.*; public class desk extends JFrame implements ActionListener { Container con; JMenuBar menubar; JMenu patient,doctor,emp,hospital_record,report,quit; JMenuItem regi,edit1; JMenuItem new_doc,edit2;
  • 35. JMenuItem new_emp,edit3; JMenuItem dio,admit,dis; JMenuItem report1; JMenuItem exit; Dimension sd; JDesktopPane d1; public desk(String currentuser) { super(currentuser); d1=new JDesktopPane(); setContentPane(d1);; con=getContentPane(); con.setLayout(null); con.setBackground(new Color(79,75,63)); sd=Toolkit.getDefaultToolkit().getScreenSize();
  • 36. MotifLookAndFeel mlf=new MotifLookAndFeel(); menuCreation(); } public static void main(String args[]) { desk d=new desk(" CENTRALI S E D H O S P I T A L M A N A G E M E N T S Y S T E M "); Dimension sd=Toolkit.getDefaultToolkit().getScreenSize(); d.setSize(sd.width,sd.height); d.show(); } public void menuCreation() { //-------------------//'menubar' creation //-------------------Dimension sd=Toolkit.getDefaultToolkit().getScreenSize(); menubar=new JMenuBar(); menubar.setBounds(0,0,sd.width+2,25); //menubar.setBorder(new BevelBorder(BevelBorder.RAISED)); con.add(menubar); patient=new JMenu("PATIENT ");
  • 37. menubar.add(patient); patient.setFont(new Font("Arial",Font.BOLD,13)); doctor=new JMenu("DOCTOR "); menubar.add(doctor); doctor.setFont(new Font("Arial",Font.BOLD,13)); emp=new JMenu("EMPLOYEE "); menubar.add(emp); emp.setFont(new Font("Arial",Font.BOLD,13)); hospital_record=new JMenu("HOSPITAL RECORD menubar.add(hospital_record); hospital_record.setFont(new Font("Arial",Font.BOLD,13)); report=new JMenu("REPORT "); menubar.add(report); report.setFont(new Font("Arial",Font.BOLD,13)); quit=new JMenu("QUIT "); menubar.add(quit); quit.setFont(new Font("Arial",Font.BOLD,13)); //PATIENT //------- ");
  • 38. regi = new JMenuItem("New Patient Registration"); edit1 = new JMenuItem("Edit Patient detail"); exit= new JMenuItem("Exit "); //doctor new_doc = new JMenuItem("New Doctor Entry "); edit2 = new JMenuItem("Edit Doctor Detail "); //emp new_emp = new JMenuItem("New Employee Entry "); edit3 = new JMenuItem("Edit Employee Detail "); //hospital dio = new JMenuItem("Diagnosis "); admit = new JMenuItem("Admission "); dis = new JMenuItem("Discharge "); //report report1 = new JMenuItem("Show Bill Detail "); patient.add(regi); patient.add(edit1);
  • 39. doctor.add(new_doc); doctor.add(edit2); emp.add(new_emp); emp.add(edit3); hospital_record.add(dio); hospital_record.add(admit); hospital_record.add(dis); report.add(report1); quit.add(exit); regi.setFont(new Font("Arial",Font.PLAIN,13)); edit1.setFont(new Font("Arial",Font.PLAIN,13)); new_doc.setFont(new Font("Arial",Font.PLAIN,13)); edit2.setFont(new Font("Arial",Font.PLAIN,13)); new_emp.setFont(new Font("Arial",Font.PLAIN,13)); edit3.setFont(new Font("Arial",Font.PLAIN,13));
  • 40. dio.setFont(new Font("Arial",Font.PLAIN,13)); admit.setFont(new Font("Arial",Font.PLAIN,13)); dis.setFont(new Font("Arial",Font.PLAIN,13)); report1.setFont(new Font("Arial",Font.PLAIN,13)); exit.setFont(new Font("Arial",Font.PLAIN,13)); new_doc.addActionListener(this); new_emp.addActionListener(this); regi.addActionListener(this); report1.addActionListener(this); dio.addActionListener(this); dis.addActionListener(this); admit.addActionListener(this); exit.addActionListener(this); menubar.requestFocus(); } public void actionPerformed(ActionEvent event) { if(event.getSource()==new_doc) {
  • 41. doctor obj=new doctor(d1); } else if(event.getSource()==new_emp) { staff obj=new staff(d1); } else if(event.getSource()==regi) { patient obj=new patient(d1); } else if(event.getSource()==admit) { admit obj=new admit(d1); } else if(event.getSource()==report1) { report_1 obj=new report_1(d1); } else if(event.getSource()==dio) { Diagnosis obj=new Diagnosis(d1); } else if(event.getSource()==dis) { bill obj=new bill(d1); }
  • 42. else if(event.getSource()==exit) { System.exit(0); } } } import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.border.*; import java.sql.*; import java.text.*; import java.awt.font.*; import java.util.*; public class admit extends JFrame implements ActionListener
  • 43. { Container c; JInternalFrame frame; JDesktopPane d; JTextField ipdid,date,pid,did,sid,test,dis,treat,ward,room,bed; JComboBox opdid; JButton save,reset,close; public admit(JDesktopPane d) { try { frame=new JInternalFrame("A D M I S S I O N E N T E R Y F O R M ",false,true,false,true); c=frame.getContentPane(); d.add(frame); c.setLayout(null); //Memory Allocation
  • 44. //----------------JLabel lab1=new JLabel("OPD No."); JLabel lab2=new JLabel("Admit Date"); JLabel lab3=new JLabel("OPD No."); JLabel lab4=new JLabel("Patient ID"); JLabel lab5=new JLabel("Doctor ID"); JLabel lab6=new JLabel("Satff ID"); JLabel lab7=new JLabel("Test Name"); JLabel lab8=new JLabel("Disease Name"); JLabel lab9=new JLabel("Treatment"); JLabel lab10=new JLabel("Ward No."); JLabel lab11=new JLabel("Room No."); JLabel lab12=new JLabel("Bed No."); opdid=new JComboBox(); ipdid=new JTextField(10); date=new JTextField(10); pid=new JTextField(10); did=new JTextField(10); sid=new JTextField(10); test=new JTextField(10); dis=new JTextField(10); treat=new JTextField(10); ward=new JTextField(10); room=new JTextField(10);
  • 45. bed=new JTextField(10); save=new JButton("Save",new ImageIcon("save.gif")); reset=new JButton("Reset",new ImageIcon("reset.gif")); close=new JButton("Close",new ImageIcon("close.gif")); lab1.setBounds(10,10,200,20); ipdid.setBounds(150,10,240,20); lab2.setBounds(10,40,200,20); date.setBounds(150,40,240,20); lab3.setBounds(10,70,200,20);opdid.setBounds(150,70,240,20); lab4.setBounds(10,100,200,20); pid.setBounds(150,100,240,20); lab5.setBounds(10,130,200,20);did.setBounds(150,130,240,20); lab6.setBounds(10,160,200,20);sid.setBounds(150,160,240,20); lab7.setBounds(10,190,200,20);test.setBounds(150,190,240,20); lab8.setBounds(10,220,200,20);dis.setBounds(150,220,240,20); lab9.setBounds(10,250,200,20);treat.setBounds(150,250,240,20); lab10.setBounds(10,280,200,20);ward.setBounds(150,280,240,20); lab11.setBounds(10,310,200,20);room.setBounds(150,310,240,20); lab12.setBounds(10,340,200,20);bed.setBounds(150,340,240,20); save.setBounds(50,400,100,35); reset.setBounds(175,400,100,35); close.setBounds(300,400,100,35); c.add(lab1); c.add(lab2); c.add(lab3);
  • 46. c.add(lab4); c.add(lab5); c.add(lab6); c.add(lab7); c.add(lab8); c.add(lab9); c.add(lab10); c.add(lab11); c.add(lab12); c.add(opdid); c.add(date); c.add(ipdid); c.add(pid); c.add(did); c.add(sid); c.add(test); c.add(dis); c.add(treat); c.add(ward); c.add(room); c.add(bed); c.add(save); c.add(reset); c.add(close);
  • 47. frame.show(); frame.setSize(500,500); save.addActionListener(this); reset.addActionListener(this); close.addActionListener(this); opdid.addActionListener(this); get_opdid(); } catch(Exception x) { System.out.println("error..."+x); } } void get_opdid() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:hospital"); Statement st=con.createStatement();
  • 48. ResultSet rs=st.executeQuery("select * from opd"); opdid.removeAllItems(); while(rs.next()) { opdid.addItem(rs.getString(1)); } con.close(); } catch(Exception x) { System.out.println("Connection error..."+x); } } public void actionPerformed(ActionEvent event) { if(event.getSource()==opdid) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:hospital"); PreparedStatement st; st=con.prepareStatement("select * from opd where opd_id=?");
  • 49. ResultSet rs; String str=opdid.getSelectedItem().toString().trim(); st.setString(1,str); rs=st.executeQuery(); if(rs.next()) { pid.setText(rs.getString(2)); did.setText(rs.getString(3)); sid.setText(rs.getString(4)); test.setText(rs.getString(5)); dis.setText(rs.getString(6)); treat.setText(rs.getString(7)); } con.close(); } catch(Exception x) { JOptionPane.showMessageDialog(null,"Sorry!"+"n"+"OPD Information Not Found","Information",JOptionPane.INFORMATION_MESSAGE); System.out.println("Connection error..."+x); } } else if(event.getSource()==save)
  • 50. { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:hospital"); Statement st=con.createStatement(); st.executeUpdate("insert into ipd values('"+ipdid.getText()+"','"+date.getText()+"','"+opdid.getSelectedItem()+"','"+pid.get Text()+"','"+did.getText()+"','"+sid.getText()+"','"+test.getText()+"','"+dis.getText()+"','" +treat.getText()+"','"+ward.getText()+"','"+room.getText()+"','"+bed.getText()+"')"); PreparedStatement st2; String str=opdid.getSelectedItem().toString().trim(); st2=con.prepareStatement("delete * from opd where opd_id=?"); st2.setString(1,str); st2.executeUpdate(); ipdid.setText(" "); date.setText(" "); pid.setText(" "); did.setText(" "); sid.setText(" ");
  • 51. test.setText(" "); dis.setText(" "); treat.setText(" "); ward.setText(" "); room.setText(" "); bed.setText(" "); JOptionPane.showMessageDialog(null,"Hi!"+"n"+" New IPD Information Saved ","Information",JOptionPane.INFORMATION_MESSAGE); } catch(Exception x) { JOptionPane.showMessageDialog(null,"Sorry!"+"n"+"Entered 'IPD ID' allready exist.","Information",JOptionPane.INFORMATION_MESSAGE); System.out.println("Connection error..."+x); } } else if(event.getSource()==reset) { ipdid.setText(" "); date.setText(" "); pid.setText(" "); did.setText(" "); sid.setText(" ");
  • 52. test.setText(" "); dis.setText(" "); treat.setText(" "); ward.setText(" "); room.setText(" "); bed.setText(" "); } else if(event.getSource()==close) { frame.dispose(); } } } import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.border.*; import java.sql.*; import java.text.*; import java.awt.font.*; import java.util.*;
  • 53. public class doctor extends JFrame implements ActionListener { Container c; JInternalFrame frame; JDesktopPane d; JTextField id,name,add,city,phone,qualify,dept,doj ; JButton save,reset,close; public doctor(JDesktopPane d) { try { frame=new JInternalFrame("N E W D O C T O R E N T E R Y F O R M ",false,true,false,true); c=frame.getContentPane(); d.add(frame); c.setLayout(null); //Memory Allocation //-----------------
  • 54. JLabel lab1=new JLabel("Doctor ID"); JLabel lab2=new JLabel("Name"); JLabel lab3=new JLabel("Address"); JLabel lab4=new JLabel("City "); JLabel lab5=new JLabel("Phone"); JLabel lab6=new JLabel("Qualification"); JLabel lab7=new JLabel("Department"); JLabel lab8=new JLabel("Date Of Joining"); id=new JTextField(10); name=new JTextField(10); add=new JTextField(20); city=new JTextField(20); phone=new JTextField(10); qualify=new JTextField(10); dept=new JTextField(10); doj=new JTextField(10); save=new JButton("Save",new ImageIcon("save.gif")); reset=new JButton("Reset",new ImageIcon("reset.gif")); close=new JButton("Close",new ImageIcon("close.gif")); lab1.setBounds(10,10,200,20); id.setBounds(150,10,240,20); lab2.setBounds(10,40,200,20); name.setBounds(150,40,240,20);
  • 55. lab3.setBounds(10,70,200,20); add.setBounds(150,70,240,20); lab4.setBounds(10,100,200,20);city.setBounds(150,100,240,20); lab5.setBounds(10,130,200,20);phone.setBounds(150,130,240,20); lab6.setBounds(10,160,200,20);qualify.setBounds(150,160,240,20); lab7.setBounds(10,190,200,20);dept.setBounds(150,190,240,20); lab8.setBounds(10,220,200,20);doj.setBounds(150,220,240,20); save.setBounds(50,350,100,35); reset.setBounds(175,350,100,35); close.setBounds(300,350,100,35); c.add(lab1); c.add(lab2); c.add(lab3); c.add(lab4); c.add(lab5); c.add(lab6); c.add(lab7); c.add(lab8); c.add(id); c.add(name); c.add(add); c.add(city); c.add(qualify); c.add(phone);
  • 56. c.add(dept); c.add(doj); c.add(save); c.add(reset); c.add(close); frame.show(); frame.setSize(500,500); save.addActionListener(this); reset.addActionListener(this); close.addActionListener(this); } catch(Exception x) { System.out.println("error..."+x); } } public void actionPerformed(ActionEvent event) { if(event.getSource()==save) { try {
  • 57. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:hospital"); Statement st=con.createStatement(); st.executeUpdate("insert into doctor values('"+id.getText()+"','"+name.getText()+"','"+add.getText()+"','"+city.getText()+"','" +phone.getText()+"','"+qualify.getText()+"','"+dept.getText()+"','"+doj.getText()+"')"); id.setText(""); name.setText(""); add.setText(""); city.setText(""); phone.setText(""); qualify.setText(""); dept.setText(""); doj.setText(" "); JOptionPane.showMessageDialog(null,"Hi!"+"n"+" New Doctor Information Saved ","Information",JOptionPane.INFORMATION_MESSAGE); } catch(Exception x) { JOptionPane.showMessageDialog(null,"Sorry!"+"n"+"Entered 'Doctor ID' allready exist.","Information",JOptionPane.INFORMATION_MESSAGE);
  • 58. System.out.println("Connection error..."+x); } } else if(event.getSource()==reset) { id.setText(""); name.setText(""); add.setText(""); city.setText(""); phone.setText(""); qualify.setText(""); dept.setText(""); doj.setText(" "); } else if(event.getSource()==close) { frame.dispose(); } } }
  • 59. import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.border.*; import java.sql.*; import java.text.*; import java.awt.font.*; import java.util.*; public class patient extends JFrame implements ActionListener { Container c; JInternalFrame frame; JDesktopPane d;
  • 60. JTextField id,name,add,sex,age,date ; JComboBox cb; JButton save,reset,close; public patient(JDesktopPane d) { try { frame=new JInternalFrame("N E W P A T I E N T E N T E R Y F O R M ",false,true,false,true); c=frame.getContentPane(); d.add(frame); c.setLayout(null); //Memory Allocation //----------------JLabel lab1=new JLabel("Patient ID"); JLabel lab2=new JLabel("Name"); JLabel lab3=new JLabel("Sex"); JLabel lab4=new JLabel("Age"); JLabel lab5=new JLabel("Address "); JLabel lab6=new JLabel("Date");
  • 61. cb=new JComboBox(); cb.addItem("Male"); cb.addItem("Female"); id=new JTextField(10); name=new JTextField(10); add=new JTextField(20); age=new JTextField(20); date=new JTextField(10); save=new JButton("Save",new ImageIcon("save.gif")); reset=new JButton("Reset",new ImageIcon("reset.gif")); close=new JButton("Close",new ImageIcon("close.gif")); lab1.setBounds(10,10,200,20); id.setBounds(150,10,240,20); lab2.setBounds(10,40,200,20); name.setBounds(150,40,240,20); lab3.setBounds(10,70,200,20);cb.setBounds(150,70,240,20); lab4.setBounds(10,100,200,20); age.setBounds(150,100,240,20); lab5.setBounds(10,130,200,20);add.setBounds(150,130,240,20); lab6.setBounds(10,160,200,20);date.setBounds(150,160,240,20);
  • 62. save.setBounds(50,350,100,35); reset.setBounds(175,350,100,35); close.setBounds(300,350,100,35); c.add(lab1); c.add(lab2); c.add(lab3); c.add(lab4); c.add(lab5); c.add(lab6); c.add(id); c.add(name); c.add(add); c.add(age); c.add(cb); c.add(date); c.add(save); c.add(reset); c.add(close); frame.show(); frame.setSize(500,500); save.addActionListener(this); reset.addActionListener(this);
  • 63. close.addActionListener(this); } catch(Exception x) { System.out.println("error..."+x); } } public void actionPerformed(ActionEvent event) { if(event.getSource()==save) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:hospital"); Statement st=con.createStatement(); st.executeUpdate("insert into patient values('"+id.getText()+"','"+name.getText()+"','"+cb.getSelectedItem()+"','"+age.getText( )+"','"+add.getText()+"','"+date.getText()+"')"); id.setText(""); name.setText(""); add.setText("");
  • 64. age.setText(""); date.setText(""); JOptionPane.showMessageDialog(null,"Hi!"+"n"+" New Patient Information Saved ","Information",JOptionPane.INFORMATION_MESSAGE); } catch(Exception x) { JOptionPane.showMessageDialog(null,"Sorry!"+"n"+"Entered 'Patient ID' allready exist.","Information",JOptionPane.INFORMATION_MESSAGE); System.out.println("Connection error..."+x); } } else if(event.getSource()==reset) { id.setText(""); name.setText(""); add.setText(""); age.setText(""); date.setText(""); }
  • 65. else if(event.getSource()==close) { frame.dispose(); } } } USER INTERFACE DESIGN (SCREEN SNAPSHOT)
  • 66. FUTURE SCOPE & ENHANCEMENT OF PROJECT Due to the limited amount of resources and time, we are planning to restrict our project to demo for now, but later on it can be extended to the whole as live project. It’s a fact that the maintenance costs generally exceed the development costs. Clearly, if we want to reduce the overall cost of software or achieve “global” optimality in terms of cost rather than “local” optimality in terms of development cost only, the goal of development should be reduce the maintenance effort. That is, one of the important objectives of the development project should be to produce software that is easy to maintain. And the process should be such that it ensures this maintainability. BIBILIOGRAPHY
  • 67. software engineering: A practioner’s Approach BY Roger S. Pressman Java -E.Balagurusamy System Analysis and Design: Elias M. AWAD An introduction to data base system : BIPIN C. DESAI