Hospital Management System Project Report
Hospital Management System Project Report
Hospital Management System Project Report
Introduction
1.1 Project Background
The project HealthCare Management App is a mobile application developed for the android devices in which the patients details is stored in the server side database. The project contains a server application, which is the hospital website and is accessible only by the hospital administrator. The mobile application is the client side, developed in android and it is designed for doctors and patients. The prevalent functionality of the application is to provide medical experts and patients with a mobile user interface for managing healthcare information more securely. The retrieval of patient health records and patient-related medical data are easier through this app. The user can get the overview about the services provided by an hospital through this app. Users can also get navigation support to reach the hospital and can view the hospital on the map. Users can also make request for appointments. The application provides a practical, user friendly interface, so that its users can retrieve information about the hospital. The application provides several information about the hospital, navigation guide to the hospital, make appointment for consultation and other information on doctors and products. The application also includes patients DICOM format. DICOM files can be exchanged between two entities that are capable of receiving image and patient data in DICOM format. All DICOM images needed to be securely exchanged over network. Doctors or patients can view patient's medical files etc. on their tablet even if they are far from their clinic, sitting at home and if patients are at separate facilities. Out-patient medication administration has been identified as the most error-prone procedure in modern healthcare. Under or over doses due to erratic in-takes, drug-drug or drug-food interactions caused by un-reconciled prescriptions and the absence of in-take enforcement and monitoring mechanisms have caused medication errors to become the common cases of all medical errors. Most medication administration errors were made when patients bought different prescribed and over-the-counter medicines from several drug stores and use them at home without little or no guidance. Elderly or chronically ill patients are particularly susceptible to these mistakes.
This app is designed to help patients avoiding these mistakes. It can remind its users to take the correct medicines on time. The app is equipped with user friendly interfaces to help its users to recognize the proper medicines and obtain the correct instructions of taking these drugs. Electronic hospital management utilizing Web Services connectivity and Android OS support the described functionalities.
A controller can send commands to the model to update the model's state (e.g., editing a document). It can also send commands to its associated view to change the view's presentation of the model (e.g., by scrolling through a document).
A model notifies its associated views and controllers when there has been a change in its state. This notification allows the views to produce updated output, and the controllers to change the available set of commands. A passive implementation of MVC omits these notifications, because the application does not require them or the software platform does not support them.
2. System Analysis
2.1 Identification of Need
System analysis is the detailed study of the various operations performed by the system and their relationships within and outside the system. First we should identify what is the need of the proposed system. In existing system, all patient related activities are done manually. If we need to access any of our medicine details or reports, files etc., we have to visit the hospital. If we are far away, it is not possible. This application provides a way to connect the users with the hospital through the mobile. A person having android mobile or tablet can access personal medical information and can download files. Also users get all the details about hospital, doctor availability, bookings etc. through the mobile. The prevalent functionality of the application is to provide medical experts and patients with a mobile user interface for managing healthcare information more securely. Problems with conventional system are lack of immediate retrieval of patients medical information and details, about hospital facilities, services, departments, doctors etc. The user can register in the site through the mobile and then login at any time. He can view or download related test reports, patient details report, prescription and billing reports as per his requirements. Also the patients can initiate chat with the doctors in the hospital and get advices without going to the hospital.
The detail of the software was collected, which helped in analysing the requirements for the system and helped me to get interacted with existing scenario.
Analysis of the existing software together with the former helped in detecting the kind of flexibility that a buyer and a developer would be looking for and their expectation of the new system.
Initial investigation provided the basis for designing and was followed by the feasibility analysis.
Technical Feasibility The assessments of technical feasibility centers on the existing system and to what extend it can support the proposed addition. This was based on an outline design of system requirements in turns of input files, programs, procedures and staff. It involves financial considerations to accommodate technical enhancements. Behavioural Feasibility People are inherently resistant to change and computers have been known to facilitate change. An estimate should be made about the reaction of the user staff towards the development of a computerized system. Computer installations have something to do with turnover, transfers and change in job status. The introduction of a candidate system requires special effort to educate, sell and train the staff for conducting the business.
Often project planning is ignored in favour of getting on with the work. However, many people fail to realise the value of a project plan in saving time, money and many problems.
A project is successful when the needs of the stakeholders have been met. A stakeholder is anybody directly, or indirectly impacted by the project. As a first step, it is important to identify the stakeholders in your project. It is not always easy to identify the stakeholders of a project, particularly those impacted indirectly. Examples of stakeholders are:
The project sponsor. The customer who receives the deliverables. The users of the project outputs. The project manager and project team.
Once you understand who the stakeholders are, the next step is to find out their needs. The best way to do this is by conducting stakeholder interviews. Take time during the interviews to draw out the true needs that create real benefits. Often stakeholders will talk about needs that aren't relevant and don't deliver benefits. These can be recorded and set as a low priority. The next step, once you have conducted all the interviews, and have a comprehensive list of needs is to priorities them. From the prioritized list, create a set of goals that can be easily measured. A technique for doing this is to review them against the SMART principle. This way it will be easy to know when a goal has been achieved. Once you have established a clear set of goals, they should be recorded in the project plan. It can be useful to also include the needs and expectations of your stakeholders. This is the most difficult part of the planning process completed. It's time to move on and look at the project deliverables. Using the goals you have defined in step 1, create a list of things the project needs to deliver in order to meet those goals. Specify when and how each item must be delivered. Add the deliverables to the project plan with an estimated delivery date
The amount of effort (hours or days) required to complete the task. The resource who will carry out the task.
Once you have established the amount of effort for each task, you can work out the effort required for each deliverable, and an accurate delivery date. Update your deliverables section with the more accurate delivery dates. At this point in the planning, we choose to use a software package such as Microsoft Project to create your project schedule. Input all of the deliverables, tasks, durations and the resources who will complete each task.
A common problem discovered at this point, is when a project has an imposed delivery deadline from the sponsor that is not realistic based on our estimates. If discover this is the case, must contact the sponsor immediately. The options you have in this situation are:
Renegotiate the deadline (project delay). Employ additional resources (increased cost). Reduce the scope of the project (less delivered).
Java The Java programming language is a high-level language that can be characterized by all of the following buzzwords:
In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into class files by the javac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes the machine language of the Java Virtual Machine(JavaVM). The java launcher tool then runs application with an instance of the Java Virtual
Machine.Because the Java VM is available on many different operating systems, the same .class files are capable of running on Microsoft Windows, the Solaris Operating System (Solaris OS), Linux, or Mac OS. A platform is the hardware or software environment in which a program runs. Most platforms can be described as a combination of the operating system and underlying hardware. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms. The Java platform has two components:
The Java Virtual Machine The Java Application Programming Interface (API)
Java Development Toolkit The Java Development Kit (JDK) is an implementation of either one of the Java SE, Java EE or Java ME platforms released by Oracle Corporation in the form of a binary product aimed at Java developers on Solaris, Linux, Mac OS X or Windows. Since the introduction of Java platform, it has been by far the most widely used Software Development Kit (SDK). On November 17, 2006, Sun announced that it would be released under the GNU General Public License (GPL), thus making it free software. This happened in large part on May 8, 2007, when Sun contributed the source code to the OpenJDK. Android Android is a Linux-based operating system designed primarily for touch screen mobile devices such as smartphones and tablet computers. Initially developed by Android, Inc., whom Google financially backed and later purchased in 2005, Android was unveiled in 2007 along with the founding of the Open Handset Alliance: a consortium of hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices. The first Android-powered phone was sold in October 2008. Android is open source and Google releases the code under the Apache License. This open source code and permissive licensing allows the software to be freely modified and distributed by device manufacturers, wireless carriers and enthusiast developers. Additionally, Android has a large community of developers writing applications ("apps") that extend the functionality of devices, written primarily in a customized version of the Java programming language. These factors have allowed Android to become the world's most widely used smart phone platform and the software of choice for technology companies who require a low-cost, customizable, lightweight operating system for high tech devices without developing one from scratch. As a result, despite being primarily designed for phones and tablets, it has seen additional applications on televisions, game, consoles and other electronics. Android's open nature has further encouraged a large community of developers and enthusiasts to use the open source code as a foundation for community-driven projects, which add new features for advanced users or bring Android to devices which were officially released running other operating systems.
Android SDK Android software development is the process by which new applications are created for the Android operating system. Applications are usually developed in
the Java programming language using the Android Software Development Kit, but other development tools are available. As of April 2011, more than 200,000 applications have been developed for Android, with over 3 billion downloads. The Android platform has also grown to become a favourite among mobile developers The Android software development kit (SDK) includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. Currently supported development platforms include computers running Linux (any modern desktop Linux distribution), Mac OS X 10.5.8 or later, Windows XP or later. The officially supported integrated development
environment (IDE) is Eclipse using the Android Development Tools (ADT) Plug-in, though developers may use any text editor to edit Java and XML files then use command line tools (Java Development Kit and Apache Ant are required) to create, build and debug Android applications as well as control attached Android devices (e.g., triggering a reboot, installing software package(s) remotely). Enhancements to Android's SDK go hand in hand with the overall Android platform development. The SDK also supports older versions of the Android platform in case developers wish to target their applications at older devices. Development tools are downloadable components, so after one has downloaded the latest version and platform, older platforms and tools can also be downloaded for compatibility testing. Android applications are packaged in .apk format and stored under /data/app folder on the Android OS (the folder is accessible only to root user for security reasons). APK package contains .dex files (compiled byte code files called Dalvik executable), resource files, etc.
Netbeans IDE NetBeans is an integrated development environment (IDE) for developing primarily with Java, but also with other languages, in particular PHP, C/C++, and HTML5. It is also an application platform framework for Java desktop applications and others. The Netbeans IDE is written in Java and can run on Windows, OS X, Linux, Solaris and other platforms supporting a compatible JVM. Most developers recognize the NetBeans IDE as the original free Java IDE. It is that, and much more! The NetBeans IDE provides support for several languages (PHP, JavaFX, C/C++, JavaScript, etc.) and frameworks. Eclipse Indigo Eclipse is a multi-language software development environment comprising a workspace and an extensible plug-in system. It is written mostly in Java. It can be used to develop applications in Java and, by means of various plug-ins, other programming languages including Ada, C, C++, COBOL, Fortran, Haskell, Perl, PHP, Python, R, Ruby (including Ruby on Rails framework). The initial codebase originated from IBM Visual Age. The Eclipse SDK (which includes the Java development tools) is meant for Java developers. Users can extend its abilities by installing plug-ins written for the Eclipse Platform, such as development toolkits for other programming languages, and can write and contribute their own plug-in modules. The Eclipse Platform uses plug-ins to provide all functionality within and on top of the runtime system, in contrast to some other applications, in which functionality is hard coded. The Eclipse SDK includes the Eclipse Java development tools (JDT), offering an IDE with a built-in incremental Java compiler and a full model of the Java source files. This allows for advanced refactoring techniques and code analysis. The IDE also makes use of a workspace, in this case a set of metadata over a flat filespace allowing external file modifications as long as the corresponding workspace "resource" is refreshed afterwards.
Problem Evaluation & Synthesis Requirements analysis is the process of determining user expectations for a new or modified product. These features, called requirements, must be quantifiable, relevant and detailed. In software engineering, such requirements are often called functional
specifications. Requirements analysis is an important aspect of project management. This is the most important part of software developing. This step entails acquiring all the facts concerning the problem specification such as identifying the desired result determining what information is needed to produce these results and figuring out what process must be carried out to proceed to get the accurate result.
Windows / Linux
Java, JSP, Android MySQL, SQLite Eclipse, NetBeans IDE JDK 1.6 or later
3. System Modelling
3.1 Design Methodology
Data Flow Diagram (DFD) A Data Flow Diagram (DFD) or a Bubble chart is a network that describes the flow of data and processes that change, or transform data throughout the system. This network is constructed by using a set of symbols that do not imply a physical implementation. It is a graphical tool for structured analysis of system requirements DFD models a system by using external entities from which data flows to a process ,which transfer the data and creates, output-data-flows which go to other external entities or files .data in files many to processes as inputs. Data Flow Diagram can be hierarchically organized, which help in partitioning and analyzing large systems. As a first step, one Data Flow Diagram can depict an entire system, which gives the system overview. It is called context Diagram of level 0 DFD. The Context Diagram can be further expanded. The successive expansion of a Data Flow Diagram from the context diagram to those giving more details is known as leveling of Data Flow Diagram. Thus a top down approach is used, starting with an overview and then working out the details. The main merit of Data Flow Diagram is that it can provide an overview of system requirements, what data a system would process, what transformation of data are done, what files are used, and where the results flow. Basic DFD symbols 1. Arrow
A data flow is a route, which enables packets travel form one point to another. Data may flow from a source to a processor and from data store or process. An arrow line depicts the flow, with arrow head pointing in the direction of the flow. 2. Circle
A process represents transformation where incoming data flows are changed into outgoing data flows.
3.
Open Rectangle
A data store is a repository of data that is to be stored for use by a one or more process may be as simple as buffer or queue or sophisticated as relational database. They should have clear names. If a process merely uses the content of store and does not alter it, the arrowhead goes only from the store to the process. If a process alters the details in the store then a double -headed arrow is used. 4. Rectangle
A source or sink is a person or part of an organization which enter or receives information from the system but is considered to be the contest of data flow model.
DFD
Level 0/ Context Level
Level 1 [ADMIN]
Level 1 [DOCTOR]
Level 1 [PATIENT]
Level 2.2[PATIENT]
Level 2.1[DOCTOR]
2. Table Name : tbl_doctors Primary key : doctor_id Foreign Key : dept_id Description : To store doctors details
Field Name doctor_id doctor_name doctor_email doctor_phone doctor_address dept_id doctor_qualification doctor_designation doctor_photo
Data Type int varchar(30) varchar(30) varchar(13) varchar(250) Int varchar(50) varchar(50) varchar(250)
Description Doctor id Doctor name Doctor email Doctor phone Doctor address Department id Doctor qualification Doctor designation Doctor photo
3. Table Name : tbl_patient Primary key : patient_id Description : To store patient details
Description Patient id Patient name Patient email Patient phone Patient address Patient date of birth
4. Table Name : tbl_booking Primary key : booking_no Foreign key : patient_id, doctor_id Description : To store booking details
Description Booking number Patient id Doctor id Booking visiting time Booked date Booking date Booking time
5. Table Name : tbl_avail Foreign key : doctor_id Description : To store doctors availability details
Field Name doctor_id avail_date avail_days avail_mrngtime avail_mtime_book avail_evetime avail_etime_book avail_drstatus
Data Type int date varchar(100) varchar(20) int varchar(20) int int
Description Doctor id Available date Available week days Available morning time No. of bookings in morning Available evening time No. of bookings in evening Available doctor status
6. Table Name : tbl_services Primary key : service_id Description : To store service details
7. Table Name
: tbl_details
Field Name patient_id doctor_id details_report details_xray details_ctscan details_ultrascan details_mri details_medicine details_remark details_time details_date details_bill
8. Table Name : tbl_chat Primary key : chat_id
Data Type varchar(10) int varchar(250) varchar(250) varchar(250) varchar(250) varchar(250) varchar(250) varchar(50) time date varchar(100)
Description Patient id Doctor id Medical report Details of X-ray Details of CT-scan Details of Ultra scan Details of MRI Details of medicine Remarks Time Date Bill details
Description Chat id Patient/ Doctor email Patient/ Doctor email Message of chat Chat date
9. Table Name : tbl_medicine Primary key : med_id Foreign key : patient_id Description : To store medicine details
Field Name med_id patient_id med_drug med_quantity med_datefrom med_dateto med_schedule med_days med_status medicine_dateadded
Data Type int varchar(10) varchar(150) varchar(50) date date varchar(10) int int date
Description Medicine ID Patient id Medicine name Quantity of medicine Date from Date to Medicine Schedule Days Medicine status for remainder Medicine added date
10. Table Name : tbl_dept Primary key : dept_id Description : To store department details
11. Table Name : tbl_feedback Primary key :feedback_id Foreign key : patient_id Description : To store feedback details
3.3
Web forms
Mobile Interfaces
Login
Doctor Home
Patient details
DICOM image
Chat Details
Other settings
Patient login
Patient Home
Department details
Doctor Details
Report file
Downloading file
Service Details
Booking Details
Feedback
Other services
Reminder
View patient id
Patient Registration
Forgot password
4. System Design
4.1 Module Descriptions
Module Description There are two modules in this project: - Server - Client Server Application Login / Doctor Registration The server side has access to only authorized staff from hospital such as System Admin or Pharmacist or Lab Technician. He / she can add the details of Doctors' and register them. Patients' Database Creation / Updation The server side user must add and update patients' database i.e. add patients' information such as DICOM files, test reports, medicine prescription, bills, visiting history etc. Doctors' Database Creation / Updation The server side user must add and update the availability of each doctor. Add / update consulting hours, specialization, etc. Hospital Database Management The admin should add and update the hospital information, services, departments etc. Android Client Application Login / Patient Registration The client side system i.e. our android application has two users - patient and doctor. Patients can register and login. Doctors' can login using the data provided to them from the system handler at server side.
View Hospital Details and Doctors' List : In this module the patient can view hospital details such as services, specialties, doctors' list, emergency call number and other contact details.
Book Doctor Appointment or Other Hospital Services : The patient can view availability of doctors and can book an appointment if they find a suitable time slot to visit hospital or attain other services.
View Medical Information Files : The patient can view various medical files and data such as DICOM files, test reports, medicine prescription, bills, visiting history etc. Also doctors have access to such information related to their patients. He can make necessary changes or edits to them if needed.
Doctor - Patient Interaction : The patient can have live interaction with the doctor if he/she is available currently in the system. He/she can seek assistance or help from them.
Medicine In-Take Reminder : The app also reminds the user about prescribed medicines by keeping in synchronize with his prescription updated in the database and providing notification or alerts.
4.5
Output Design
Outputs are the most important and direct source of information to the user and to the
department. Intelligent output design will improve the systems relationship with the user and help
much in decision-making. Outputs are also used to provide a permanent hard copy of the results for later uses. The forms used in the system are shown in the appendix. Computer out output is the most important and direct source of information the user. Efficient, intelligible output design should improve the systems relationship with the user and help in decision making. A major form of output is a hard copy from printer. Printout should be designed around the output requirements of the user. The output devices to consider the event on factors such as compatibility of the device with the system, responds time requirements, expected print quality and number of copies needed.
4.6
of software application programming in the area of human-computer interaction. Its goal is to enhance the efficiency and ease of use for the underlying logical design of a stored program, a design discipline known as usability. Methods of user-centered design are used to ensure that the visual language introduced in the design is well tailored to the tasks. The visible graphical interface features of an application are sometimes referred to as "chrome" or "Gui".Typically, the user interacts with information by manipulating visual widgets that allow for interactions appropriate to the kind of data they hold. The widgets of a well-designed interface are selected to support the actions necessary to achieve the goals of the user. A model-view-controller allows for a flexible structure in which the interface is independent from and indirectly linked to application functionality, so the GUI can be easily customized. This allows the user to select or design a different skin at will, and eases the designer's work to change the interface as the user needs evolve. Good user interface design relates to the user, not the system architecture. Large widgets, such as windows, usually provide a frame or container for the main presentation content such as a web page, email message or drawing. Smaller ones usually act as a user-input tool.
5. Coding
PrintWriter out = response.getWriter(); try { /* TODO output your page here out.println("<html>"); out.println("<head>"); out.println("<title>Servlet DrReg</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet DrReg at " + request.getContextPath () + "</h1>"); out.println("</body>"); out.println("</html>"); */ } finally { out.close(); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP <code>POST</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter writer = response.getWriter(); String fileName = null; String fileKey = null; HashMap<String, String> itemMap = new HashMap<String, String>(); //Processing file upload ////////////////////////////////////////// DiskFileItemFactory fileItemFactory = new DiskFileItemFactory(); fileItemFactory.setSizeThreshold(5 * 1024 * 1024); File fileLocation = File.createTempFile("MyCMS", "UploadedFile"); fileItemFactory.setRepository(fileLocation); ServletFileUpload fileUpload = new ServletFileUpload(fileItemFactory); try { List items = fileUpload.parseRequest(request); for (Object object : items) { FileItem item = (FileItem) object; if (item.isFormField()) {
fileKey = item.getFieldName();
fileName = item.getString();
String root = getServletContext().getRealPath("/"); File path = new File(root + "/uploads"); if (!path.exists()) { boolean status = path.mkdirs(); }
File file = new File(path + "/" + item.getName()); fileKey = item.getFieldName(); fileName = item.getName(); itemMap.put(fileKey, fileName); try { item.write(file); } catch (Exception e) { e.printStackTrace(System.out); } } } } catch (FileUploadException ex) { Logger.getLogger(DrReg.class.getName()).log(Level.SEVERE, null, ex); } try { String name = itemMap.get("txtdrname"); String email = itemMap.get("txtdremail"); String phone = itemMap.get("txtdrph");
String address = itemMap.get("txtdraddr"); String pwd = itemMap.get("txtdrpwd"); String dept = itemMap.get("txtdept"); String qualification = itemMap.get("txtdrqfn"); String designation = itemMap.get("txtdrdest"); String photo = itemMap.get("file"); String id1 = DBHealth.seldeptID(dept); int count = DBHealth.getCount("SELECT COUNT(*) FROM tbl_doctors WHERE doctor_email='" + email + "'");
String sql = "insert into tbl_doctors (doctor_name,doctor_email,doctor_phone,doctor_address,dept_id,doctor_qualificatio n, doctor_designation,doctor_photo) values ('" + name + "','" + email + "','" + phone + "','" + address + "','" + id1 + "','" + qualification + "','" + designation + "','" + photo + "')"; + String sql1 = "insert into tbl_login (login_uname,login_pwd,login_status) values ('" email + "','" + pwd + "','1')"; DBHealth obj = new DBHealth(); if (obj.insertdrreg(sql)) { if (obj.insertlogin(sql1)) { response.sendRedirect("doctorreg_1.jsp"); } } writer.print("<script>alert('Insert Successfully');window.location='doctorreg_1.jsp' </script>"); response.sendRedirect("doctorreg_1.jsp"); }
} catch (Exception ex) { System.out.println("Error Insert"); ex.printStackTrace(); } writer.write(""); } /** * Returns a short description of the servlet. * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
package health.db; import com.mysql.jdbc.Connection; import com.mysql.jdbc.Statement; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger;
public class DBHealth { private static Connection con; private static Statement st1 = null; public static int getCount(String query) { int count = 0; try { ResultSet rs = st1.executeQuery(query); while (rs.next()) { count = rs.getInt(1); } } catch (SQLException ex) { Logger.getLogger(DBHealth.class.getName()).log(Level.SEVERE, null, ex); } return count; } public DBHealth() { try { if (con == null) { Class.forName("com.mysql.jdbc.Driver"); con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/health", "root", "mysql"); st1 = (Statement) con.createStatement(); } } catch (SQLException ex) { Logger.getLogger(DBHealth.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(DBHealth.class.getName()).log(Level.SEVERE, null, ex); } }
public static boolean login(String userName, String password) { try { String sql = "SELECT * FROM tbl_login WHERE login_uname='" + userName + "' AND login_pwd='" + password + "' AND login_status=0";
if (st1.executeQuery(sql).next()) { return true; } } catch (SQLException ex) { Logger.getLogger(DBHealth.class.getName()).log(Level.SEVERE, null, ex); } return false; } public boolean insertdrreg(String qry) { try { st1.executeUpdate(qry); return true; } catch (Exception e) { } return false; }
public int updateavail(String qry) { int i = 0; try { i = st1.executeUpdate(qry); } catch (Exception e) { } return i;
} public ResultSet retrievedoctor(String qry) { ResultSet rs = null; try { rs = st1.executeQuery(qry); } catch (Exception e) { e.printStackTrace(); } return rs; }
public ResultSet retrievedept(String qry) { ResultSet rs = null; try { rs = st1.executeQuery(qry); } catch (Exception e) { e.printStackTrace(); } return rs; } public void delavail(String sql) throws SQLException { st1.execute(sql); } public static String selDrID(String drname) throws SQLException { String sql = "SELECT * FROM tbl_doctors where doctor_name='" + drname + "' "; ResultSet rs = st1.executeQuery(sql); String id = null; while (rs.next()) { id = rs.getString(1);
} return id; } public static String selAvail(String drname) throws SQLException { String sql = "SELECT * FROM tbl_doctors where doctor_name='" + drname + "' "; ResultSet rs = st1.executeQuery(sql); String id = null; while (rs.next()) { id = rs.getString(1); } return id; } public static String selPatID(String pname) throws SQLException { String sql = "SELECT * FROM tbl_patient where patient_name='" + pname + "' "; ResultSet rs = st1.executeQuery(sql); String id = null; while (rs.next()) { id = rs.getString(1); } return id; } public static String seldeptID(String dname) throws SQLException { String sql = "SELECT * FROM tbl_dept where dept_name='" + dname + "' "; ResultSet rs = st1.executeQuery(sql); String id = null; while (rs.next()) { id = rs.getString(1); } return id;
} public static String selmedID(String dname) throws SQLException { String sql = "SELECT * FROM tbl_medicine where dept_name='" + dname + "' "; ResultSet rs = st1.executeQuery(sql); String id = null; while (rs.next()) { id = rs.getString(1); }
return id; } }
Service.java(Web Service)
package webService; import com.google.gson.Gson; import dao.Project; import dto.AvailObjects; import dto.ChatObjects; import dto.DateObjects; import dto.DatesObjects; import java.sql.SQLException; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST;
import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import dto.DeptObjects; import dto.DoctorObjects; import dto.FileObjects; import dto.IDObjects; import dto.LoginObjects; import dto.MedicineObjects; import dto.PatientObjects; import dto.ServiceObjects; import java.io.File; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilder; import javax.ws.rs.core.Response.Status; import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; @Path("/WebService") public class Service { Gson gson = new Gson(); Project project = new Project(); @GET @Path("/GetLoginPatient") @Produces("application/json") public String loginFeed(@QueryParam("userID") String userID, @QueryParam("passID") String passID) { String feeds = null;
System.out.println(userID); System.out.println(passID); try { ArrayList<LoginObjects> feedData = null; feedData = project.GetLoginPatient(userID, passID); feeds = gson.toJson(feedData); } catch (Exception e) { System.out.println("error"); e.printStackTrace(); } return feeds; } @GET @Path("/GetLoginDr") @Produces("application/json") public String loginFeed1(@QueryParam("userID") String userID, @QueryParam("passID") String passID) { String feeds = null; System.out.println(userID); System.out.println(passID); try { ArrayList<LoginObjects> feedData = null; feedData = project.GetLoginDr(userID, passID); feeds = gson.toJson(feedData); } catch (Exception e) { System.out.println("error"); e.printStackTrace(); } return feeds;
} @POST @Path("/PostRegister") @Consumes("application/json") @Produces("application/json") public String postJson(String content) throws JSONException { System.out.println(content); JSONArray jArray = new JSONArray(content); try {
for (int i = 0; i < jArray.length(); i++) { JSONObject c = jArray.getJSONObject(i); String name = c.getString("Name"); String email = c.getString("Email"); String password = c.getString("Password"); String phone = c.getString("Phone"); String addr = c.getString("Addr"); String dob = c.getString("Dob"); if (project.RegistrationInsert(name, email, password, phone, addr, dob)) { System.out.println("Success"); return "success"; } } } catch (SQLException ex) { Logger.getLogger(Service.class.getName()).log(Level.SEVERE, null, ex); } catch (JSONException e) { e.printStackTrace(); } return "No Data";
} @POST @Path("/PostFeedback") @Consumes("application/json") @Produces("application/json") public String postFeedback(String content) throws JSONException { System.out.println(content); JSONArray jArray = new JSONArray(content); try { for (int i = 0; i < jArray.length(); i++) { JSONObject c = jArray.getJSONObject(i); String email = c.getString("Email"); String feedback = c.getString("Feedback"); String date = c.getString("Date"); if (project.FeedbackInsert(email, feedback, date)) { System.out.println("Success"); return "success"; } } } catch (JSONException e) { e.printStackTrace(); } return "No Data"; } @GET @Path("/GetAllPatients") @Produces("application/json") public String allPatientsFeed() { String feeds = null;
try { ArrayList<PatientObjects> feedData = null; feedData = project.GetAllPatients(); feeds = gson.toJson(feedData); } catch (Exception e) { System.out.println("error"); e.printStackTrace(); } return feeds; } @GET @Path("/GetPatient") @Produces("application/json") public String allPatientsFeed(@QueryParam("id") String id) { String feeds = null; try { ArrayList<PatientObjects> feedData = null; feedData = project.GetPatient(id); feeds = gson.toJson(feedData); } catch (Exception e) { System.out.println("error"); e.printStackTrace(); } return feeds; } @GET @Path("/{fileName}/file") @Produces("file/file") public Response getFileInDICOMFormat(@PathParam("fileName") String fileName) {
//Put some validations here such as invalid file name or missing file name if (fileName == null || fileName.isEmpty()) { ResponseBuilder response = Response.status(Status.BAD_REQUEST); return response.build(); } //Prepare a file object with file to return File file = new File("E:/HealthCare Project Final 2013-10-10/Project Source Files Folder/HealthCareService/build/web/files/" + fileName);
ResponseBuilder response = Response.ok((Object) file); response.header("Content-Disposition", "attachment; filename=" + fileName); return response.build(); } @GET @Path("/GetMedicine") @Produces("application/json") public String medicineFeed(@QueryParam("userID") String user) { String feeds = null; try { System.out.println("Medicine Of:" + user); ArrayList<MedicineObjects> feedData = null; feedData = project.GetMedicine(user); feeds = gson.toJson(feedData); } catch (Exception e) { System.out.println("error"); e.printStackTrace(); } return feeds;
} @GET @Path("/GetPatID") @Produces("application/json") public String idFeed(@QueryParam("userID") String user) { String feeds = null; try { System.out.println("Pat ID Of:" + user); ArrayList<IDObjects> feedData = null; feedData = project.GetID(user); feeds = gson.toJson(feedData); } catch (Exception e) { System.out.println("error"); e.printStackTrace(); } return feeds; } }
PatientActivity.java (Android)
package com.healthcare; import com.healthcare.taskreminder.ReminderListActivity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View;
import android.widget.Button;
public class PatientActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dashboard_layout); /** * Creating all buttons instances * */ Button btn_doctors = (Button) findViewById(R.id.btn_doctors); Button btn_services = (Button) findViewById(R.id.btn_services); Button btn_files = (Button) findViewById(R.id.btn_medicine); Button btn_booking = (Button) findViewById(R.id.btn_booking); Button btn_feedback = (Button) findViewById(R.id.btn_feedback); Button btn_chat = (Button) findViewById(R.id.btn_chat); /** * Handling all button click events * */ btn_doctors.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) {
Intent DeptActivity.class);
new
Intent(getApplicationContext(),
Intent i = new Intent(getApplicationContext(), ServicesActivity.class); startActivity(i); } }); btn_files.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) {
Intent i = new Intent(getApplicationContext(), DatesViewActivity.class); startActivity(i); } }); btn_booking.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(getApplicationContext(), DeptActivityBooking.class); startActivity(i); } });
btn_feedback.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(getApplicationContext(), FeedbackActivity.class); startActivity(i);
} }); btn_chat.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(getApplicationContext(), ChatTestActivity.class); startActivity(i); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // TODO Auto-generated method stub getMenuInflater().inflate(R.menu.patient, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { // TODO Auto-generated method stub switch (item.getItemId()) { case R.id.otherSer: Intent i = new Intent(getApplicationContext(), OtherServicesActivity.class); startActivity(i); break; case R.id.viewReminders: Intent i2 = new Intent(getApplicationContext(), ReminderListActivity.class); startActivity(i2); break;
case R.id.viewID: Intent i3 = new Intent(getApplicationContext(), IDListActivity.class); startActivity(i3); break; case R.id.settings: Intent i1 = new Intent(getApplicationContext(), HomeActivity.class); startActivity(i1); break; case R.id.logout: System.exit(0); break; } return super.onOptionsItemSelected(item); } }
Exceptions In Java, errors are handled by an Exception object. Exceptions are said to be thrown, and it's your job to catch them. You can do this with a try catch block. The try catch block looks like this: try { } catch ( ExceptionType error_variable ) { } The try part of the try catch block means "try this code". If something goes wrong, Java will jump to the catch block. It checks what you have between the round brackets to see if you have handled the error. If you have the correct Exception type then whatever code you have between the curly brackets of catch will get executed. If you don't have the correct Exception type then Java will use its default exception handler to display an error message. Exception err The type of Exception you are using comes first. In this case we are using the Exception error object. This is a "catch all" type of Exception, and not very good programming practice. We'll change it to a specific type in a moment. After your Exception type you have a space then a variable name. We've called ours err, but you can it almost anything you like. In the curly brackets of catch we have a print statement. But look what we have between the round brackets of println: err.getMessage( ) getMessage is a method available to Exception objects. As its name suggests, it gets the error message associated with the Exception.
5.5
Parameters calling/passing
Call by value and call by reference are two mechanisms to pass parameters to methods or subroutines. If you have been a C or C++ programmer then you may be aware of both types of arguments passing techniques. Because C and C++ both languages supports both mechanisms of passing parameters to functions. The term call by value means that the caller provides the value to the method that is being called. This method copies the value of an argument into the formal parameter of the subroutine. Therefore, changes made to the formal parameter of the subroutine have no effect on the original value that was passed. Contrarily, in call by reference technique, caller provides the location (also called reference) of actual parameter to the method. By this technique, inside the subroutine, the reference passed to the subroutine is used to access actual argument mentioned in the call. This means changes made to the formal parameter will affect the actual argument used to call the subroutine. It looks very straight forward and simple when you experiment passing primitive types to a method but becomes obscure when it comes to passing objects to a subroutine. Interestingly, when an object reference is passed to a method, the reference itself is passed by use of call by value. However, since the value being passed refers to an object, the copy of that value will still refer to the same object that its corresponding argument does.
5.6
Validation checks
Validation checks are done at every piece of code using several validation functions.
Validations are done at the server side website and at the client side. For each input given by the user, it is checked whether the input given is valid or not. For eg., in case of email, the format of email is checked. If the input is not in that format, warning messages will display. It is applied to all such input values such as name, phone number, password etc. also to unfilled input fields. For a user to login, the given input is compared with the login details in the table. If no such user exists, error message will display. Another case is that uniqueness in the inputting values. Doctor registration, inserting departments and services is done by the administrator. In this case, it checks for whether the doctor is already registered and same for departments and services. Validation functions are used for checking these.
Formal code review, such as a Fagan inspection, involves a careful and detailed process with multiple participants and multiple phases. Formal code reviews are the traditional method of review, in which software developers attend a series of meetings and review code line by line, usually using printed copies of the material. Formal inspections are extremely thorough and have been proven effective at finding defects in the code under review. Lightweight code review typically requires less overhead than formal code inspections, though it can be equally effective when done properly. Lightweight reviews are often conducted as part of the normal development process:
Over-the-shoulder One developer looks over the author's shoulder as the latter walks through the code. Email pass-around Source code management system emails code to reviewers automatically after check-in is made. Pair Programming Two authors develop code together at the same workstation, such is common in Extreme Programming. Tool-assisted code review Authors and reviewers use specialized tools designed for peer code review.
7.5.1 Unit Test Cases The software is being divided into different components and unit testing is performed on each of these modules. This section is repeated for all components. Unit/Sub module Input Expected Output Sends the availability details and status of the selected doctor. Output Obtained Status Reason Remedies
Booking Select doctor Appointme and nt corresponding doctor id is passed to the server. A search request for availability of doctor.
Sends the Failed wrong details for valid input. Doesnt reply Failed for valid input.
Sends the option for selecting Reply with booking time. improper data Failed for valid Confirmation input. of booking. Sends the status of Success doctor for valid input. Sends the confirmation Success message for valid input.
Error in the code which sends reply. Error in the code which retrieves result from the database.
Correct code
Input
Expected Output Sends DICOM files for CT Scan, MRI Scan, Ultra Scan and X Ray. Sends PDF files for Report, Medicine, Remarks and Bill.
Status
Reason
Remedies
Failed
Error in the code which retrieves DICOM images. Error in the code which retrieves PDF files.
Correct code.
Failed
Correct code.
Error in the Correct code code which for retrieving analyses the files. input.
Download DICOM files Success and PDF files of the current user.
7.5.2 Integration Test Cases Integration testing is a part of testing which involves integrating components to create a system or sub-system. SubSystem Access hospital services. It includes several modules such as retrieving doctor informati on, services, departme nt etc. and booking. Input Select correspon ding options. Expected Output Display services provided by the hospital. Output Obtained Status Doesnt send reply or sends improper reply for proper search request. Failed Reason Error in the code which analyses the type of input. Remedies Perform proper type checking.
Display various departments Did not retrieve Failed and all details. corresponding doctor information. Couldnt retrieve doctor Failed availability and status. Make appointment and gets Sends proper Success confirmation reply for valid message. search request
Error in the code Perform proper analysis and correct the code.
Correct code.
Input Select option for setting remainder and initiate chat with doctor.
Expected Output Display medicine schedules and option for setting remainder. Alarm corresponding to the medicine schedules.
Output Obtained
Status
Reason
Remedies
Doesnt send Failed reply or sends improper reply for proper search request.
Error in Perform the code proper type which checking. analyses the type of input. Perform proper analysis and correct the code.
Failed
Chat box is displayed to type messages and can view incoming messages.
Failed
Error in code.
Correct code.
Correct code.
Preventing Debug Write readable code Develop and make consistent use of naming and coding standards. It not that important which standard we use, such as Hungarian notation or Pascal, Casing (First Name) or other naming conventions, as long as we use one. We should also strive for consistency in our comments and encourage liberal commenting code. Create effective test plan The only effective way to eliminate logic error is to test very path of your application with every possible data values that a user could enter. This is difficult to manage without effective planning. We should create our test plan at the same time we are designing the application, and we should update these plans as you modify the application design
Unauthorized or unintended activity or misuse by authorized database users, database administrators, or network/systems managers, or by unauthorized users or hackers (e.g. inappropriate access to sensitive data, metadata or functions within databases, or inappropriate changes to the database programs, structures or security configurations);
Malware infections causing incidents such as unauthorized access, leakage or disclosure of personal or proprietary data, deletion of or damage to the data or programs, interruption or denial of authorized access to the database, attacks on other systems and the unanticipated failure of database services;
Overloads, performance constraints and capacity issues resulting in the inability of authorized users to use databases as intended;
Physical damage to database servers caused by computer room fires or floods, overheating, lightning, accidental liquid spills, static discharge, electronic
Design flaws and programming bugs in databases and the associated programs and systems, creating various security vulnerabilities (e.g. unauthorized privilege escalation), data loss/corruption, performance degradation etc.;
Data corruption and/or loss caused by the entry of invalid data or commands, mistakes in database or system administration processes, sabotage/criminal damage etc.
Many layers and types of information security control are appropriate to databases, including:
Access control Auditing Authentication Encryption Integrity controls Backups Application security Application of Statistical Techniques Traditionally databases have been largely secured against hackers through network
security measures such as firewalls, and network-based intrusion detection systems. While network security controls remain valuable in this regard, securing the database systems themselves, and the programs/functions and data within them, has arguably become more critical as networks are increasingly opened to wider access, in particular access from the Internet. Furthermore, system, program, function and data access controls, along with the associated user identification, authentication and rights management functions, have always been important to limit and in some cases log the activities of authorized users and administrators. In other words, these are complementary approaches to database security, working from both the outside-in and the inside-out as it were. Many organizations develop their own "baseline" security standards and designs detailing basic security control measures for their database systems. These may reflect general information security requirements or obligations imposed by corporate information security policies and applicable laws and regulations (e.g. concerning privacy, financial management and reporting systems), along with generally-accepted good database security practices (such as appropriate hardening of the underlying systems) and perhaps security recommendations from the relevant database system and software vendors. The security designs for specific database systems typically specify further security administration and management functions (such as administration and reporting of user access rights, log management and analysis, database replication/synchronization and backups) along with various business-driven information security controls within the database programs and functions (e.g. data entry validation and audit trails).
Furthermore, various security-related activities (manual controls) are normally incorporated into the procedures, guidelines etc. relating to the design, development, configuration, use, management and maintenance of databases.
User
Holds the default rights for unauthenticated access to an instance. Per default this holds the medium access rights. .
Holds the default rights for unauthenticated access to an instance. Per default this holds the medium access rights
8. Implementation
8.1 New System Description
HealthCare Management App is a mobile application system developed for the android devices in which the patients details are stored in the server side database. The system contains a server application, which is the hospital website and is accessible only by the hospital administrator. The mobile application is the client side, developed in android and it is designed for doctors and patients. The prevalent functionality of the system is to provide medical experts and patients with a mobile user interface for managing healthcare information more securely. The retrieval of patient health records and patient-related medical data are easier through this system. The user can get the overview about the services provided by an hospital through this system. Users can also get navigation support to reach the hospital and can view the hospital on the map. Users can also make request for appointments. The system provides a practical, user friendly interface, so that its users can retrieve information about the hospital. The system provides several information about the hospital, navigation guide to the hospital, make appointment for consultation and other information on doctors and products. The system also includes patients DICOM format. DICOM files can be exchanged between two entities that are capable of receiving image and patient data in DICOM format. This system can remind its users to take the correct medicines on time. The system is equipped with user friendly interfaces to help its users to recognize the proper medicines and obtain the correct instructions of taking these drugs.
6.2
working system and is giving confidence on the new system for the users that it will work efficiently and effectively. It involves careful planning, investigation of the current system and its constraints on implementations, design of the methods to achieve the changeover methods .Apart from planning major tasks of preparing the implementation are education and training of users. The more complex system is being implemented, the more involved will be the system analysis and design effort required just for implementation. An implementation co-ordination committee based on politics of individual organization has been appointed. The implementation process begins with preparing a plan for the implementation of the system. According to this plan, the activities are to be carried out, discussions made regarding the equipment and resources and the additional equipment has to be acquired to implement the new system. Implementation is the final and important phase. The system can be implemented only after through testing is done and it is found to working according to the specification. This method also offers the greatest security since the old system can take over if the errors are found or inability to handle certain type of transactions while using the new system. The implementation plan includes a description of all activities that must occur to implement the system and to put it into operation .It indicates the personal responsible for the activities and prepares a time chart for implementing the system. The implementation plan consists of the following steps: List all files required for implementation. Identify all data required to build new files during the implementation. List all new documents and procedures that go into the new system. The implemented system has the following features: Reduce data redundancy. Ease of use Controlled flow Simplifies the management activities.
9. Conclusion
9.2 Suggestions
We can enhance this system by including more facilities like billing, electronic insurance card, emergency call directories, first aid and health libraries in the phone. So that users get all services in their pocket. To get the full support of the application we need a high-end smartphone with internet access and gps.
9.4 Conclusions
The project HealthCare Management App is a mobile application developed in android to ease the access to hospital services. The prevalent functionality of the application is to provide medical experts and patients with a mobile user interface for managing healthcare information more securely. The retrieval of patient health records and patientrelated medical data are easier through this app. The software takes care of all the requirements of an average hospital and is capable to provide easy and effective storage of information related to patients that come up to the hospital. It generates test reports, provide prescription details including various tests, diet advice, and medicines prescribed to patient and the user can utilize these facilities through the mobile. The project was successfully completed within the time span allotted. All the modules are tested separately and input together to form the main system. Finally the system is tested with the real data and everything worked successfully. Thus the system has fulfilled the entire objective identified. The system had been developed in an attractive dialog fashion. So the user with minimum knowledge about computers can also operate the system easily. To conclude this, we thank all the people who help as to complete this project successfully.
10. Bibliography
BOOKS [1]Pressman, Roger S. Software engineering: a practitioners approach / Roger S. Pressman.5th ed.p. cm (McGraw-Hill series in computer science). [2]E.Balagurasamy, Programming with java, Tata McGraw-Hill Publication.\ [3] Bock,Heiko,The Defintive Guide to NetBeans Platform 7(First ed.),Appress. [4] Holzner,Steve,Eclipse (First ed.),OReilly Media [5] John McCann ,Android 4.1 JellyBean Sourcecode,TechRadar
WEBSITES
http://en.wikipedia.org/wiki/Dependency_inversion_principle http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller http://www.tutorialspoint.com/struts_2/basic_mvc_architecture.html http://www.homeandlearn.co.uk/java/java_error_handling.html