您的位置:首页 > 健康 > 养生 > 基于java 的医院排号管理系统设计与实现

基于java 的医院排号管理系统设计与实现

2025/2/23 12:58:59 来源:https://blog.csdn.net/qq_41221322/article/details/142298626  浏览:    关键词:基于java 的医院排号管理系统设计与实现

博主介绍:专注于Java .net  php phython  小程序 等诸多技术领域和毕业项目实战、企业信息化系统建设,从业十五余年开发设计教学工作

☆☆☆ 精彩专栏推荐订阅☆☆☆☆☆不然下次找不到哟
我的博客空间发布了1000+毕设题目 方便大家学习使用
感兴趣的可以先收藏起来,还有大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助更多的人

  1.  总体设计
    1.  基本设计概念和处理流程

系统使用面向对象方法进行分析和设计,在MYSQL数据库上实现数据操作。使用面向对象的JAVA作为开发语言,Windows XP Professional为开发平台,系统基本流程是:用户登录—〉主界面—〉选择进行各项管理的Web页。

    1.  软件结构设计

经过需求分析阶段的工作,针对医院排号管理系统所要实现的目标,将系统分为了六部分:

1. 病人管理:病人可以自己注册,管理员可以注册的病人,进行数据维护。

2. 大夫管理:添加大夫信息,对大夫可以进行数据管理。

 3. 大夫日程管理:添加单位,修改及删除单位信息。

4. 病人预约:病人登录系统可以对医院的大夫进行诊治时间预约。

5. 诊治病人:对于申请预约的病人,可以填写诊治病例。

6. 查看病例:查看已经诊治的病例。

    1.  系统模块设计

根据医院排号管理系统的软件结构设计,对系统总体结构进行了设计,如图4-1所示:

 图3-1 系统总体结构图

    1.  数据库设计

首先通过MYSQL创建一个名为“hospital”的数据库,然后在其中创建“管理员表”、“日程表”、“预约信息表”、“大夫信息表”、“病人信息表”、“病志信息表”六个表。

1. 名称:管理员表(见表3-1)

表3-1管理员表

字段名称

类型

主键

说明

id

int

Yes

用户id

username

vachar

No

用户名

password

vachar

No

密码

Email

vachar

No

所属系院

name

vachar

No

电子邮箱

phone

vachar

No

手机号

2. 名称:日程表(见表3-2)

表3-2 日程表

字段名称

类型

主键

说明

Did

int

Yes

信息号

suna

tinyint

No

周日上午

Sunb

tinyint

No

周日下午

Mona

Tinyint

No

周一上午

Monb

Tinyint

No

周一下午

Tuea

Tinyint

No

周二上午

Tueb

Tinyint

No

周二下午

Wena

Tinyint

No

周三上午

Wenb

Tinyint

No

周三下午

Thua

Tinyint

No

周四上午

Thub

Tinyint

No

周四下午

Fria

Tinyint

No

周五上午

Frib

Tinyint

No

周五下午

Sata

Tinyint

No

周六上午

Satb

Tinyint

No

周六下午

3. 名称:预约表(见表3-3)

                             表3-3 预约表

字段名称

类型

主键

说明

Did

int

Yes

信息号

suna

tinyint

No

周日上午

Sunb

tinyint

No

周日下午

Mona

Tinyint

No

周一上午

Monb

Tinyint

No

周一下午

Tuea

Tinyint

No

周二上午

Tueb

Tinyint

No

周二下午

Wena

Tinyint

No

周三上午

Wenb

Tinyint

No

周三下午

Thua

Tinyint

No

周四上午

Thub

Tinyint

No

周四下午

Fria

Tinyint

No

周五上午

Frib

Tinyint

No

周五下午

Sata

Tinyint

No

周六上午

Satb

Tinyint

No

周六下午

字段名称

类型

主键

说明

4. 名称:大夫信息表(见表3-4)

表3-4 大夫信息表

字段名称

类型

说明

主键

Did

int

部门id

Yes

Name

vachar

姓名

no

Password

Varchar

密码

No

Age

Tinyint

年龄

No

Sex

Tinyint

性别

No

Level

Varchar

级别

No

Section

Varchar

科室

No

Phone

Varchar

电话

No

5. 名称:病人信息表(见表3-5)

表3-5病人信息表

字段名称

类型

说明

主键

Did

int

部门id

Yes

Name

vachar

姓名

no

Password

Varchar

密码

No

Age

Tinyint

年龄

No

Sex

Tinyint

性别

No

Level

Varchar

级别

No

Section

Varchar

科室

No

Phone

Varchar

电话

No

6. 名称:病例信息表(见表3-6)

表3-6病例信息表

字段名称

类型

主键

说明

hid

int

Yes

Id

Doctor

vachar

No

医生

description

vachar

No

描述

diagnose

vachar

No

处方

patient

vachar

No

病人

rx

vachar

No

历史

finished

vachar

No

完成状态

FDATE

vachar

No

时间

  1. 系统的详细设计与实现

根据JSP应用的开发过程,按照以下步骤进行了医院排号管理系统的设计。

    1.  管理员登录模块的实现

操作员登录界面:模块所要完成的是管理员的登录,一般用户是不能进入系进行统管理的。

对于界面而言,管理员只要输入自己的姓名和密码,很方便的登录就可以了。界面如图4-1所示。

图4-1 操作员登录界面

登录界面的主要代码如下:

<%

String _login="";

Patient p=(Patient)session.getAttribute("patient");

if(p!=null)

_login="已登录";

if(request.getParameter("login")!=null){

String username=request.getParameter("username");

String password=request.getParameter("password");

try{

p=new Patient(username);

int l=p.login(password);

System.out.println(p.getPID());

switch(l){

case 1:

_login="登录成功";

session.setAttribute("patient",p);

response.sendRedirect("../default.jsp");

break;

case 2:

_login="密码错";

break;

case -1:

_login="数据库异常";

break;

default:

_login="一般异常";

}

}

catch(InvalidUserException iue){

_login="非法用户名";

}

}

%> }

    1. 跳转页面的实现

在医院排号管理系统中,实现跳转功能的界面,分别是主页、添加车辆页、添加用户页、添加院系页等。由于它们的实现功能的方法相同,左侧页面菜单树实现页面菜单加载,主要的文件,patient.inc。

主页界面:主页面是工作人员选择管理内容,使工作人员转向其他页面进行数据管理操作界面设计如图4-2所示。

图4-2 主页界面

根据界面跳转设计用include方法把其他页面菜单引到页面上,实现功能的主要代码查询界面代码如下:

<%@ page contentType="text/html; charset=gbk"%>

<td width="167" height="290" valign="top" bgcolor="8FBEE8">

<div align="center">

<br>

<p><a href="/hospital/default.jsp">返回首页</a></p>

<br>

<p><a href="/hospital/patient/login.jsp">登录(患者用户)</a></p>

<p><a href="/hospital/patient/register.jsp">注册</a></p>

<%if(session.getAttribute("patient")!=null){%>

<p><a href="/hospital/patient/getDoctorInfo.jsp">查询医生信息</a></p>

<p><a href="/hospital/patient/getDoctorInfo.jsp">预约</a></p>

<p><a href="/hospital/patient/getAppointmentInfo.jsp">查询预约信息</a></p>

<p><a href="/hospital/patient/getAppointmentInfo.jsp">取消预约</a></p>

<p><a href="/hospital/patient/getCurrentDoctorInfo.jsp">查询主治医生信息</a></p>

<p><a href="/hospital/patient/getHistory.jsp">查询病历</a></p>

<p><a href="/hospital/patient/logout.jsp">注销</a></p>

<%}%>

<br>

<p><a href="/hospital/doctor/main.jsp">医生用户</a></p>

<p><a href="/hospital/admin/main.jsp">管理员用户</a></p>

<br>

</div>

</td>

预约代码:

<%@ page contentType="text/html; charset=gbk"%><%@ include file = "../include/ccs.inc" %>

<%@ page import="hospital.db.dboperation.*" %>

<%@ page import="hospital.db.*" %>

<%@ page import="java.sql.*" %>

<html>

<head>

<title>医院门诊预约系统-医生预约信息</title>

<meta http-equiv="Content-Type" content="text/html; charset=gbk"></head>

<%

String did=request.getParameter("did");

String _doctorInfo="";

ResultSet rs=null;

Patient patient=(Patient)session.getAttribute("patient");

try{

if(patient==null)

patient=new Patient(Patient.ANONYMOUS);

int a=patient.getDoctorAppointmentInfo(did);

if(a==1){

_doctorInfo="查询成功";

rs=patient.getResultSet();

}

else if(a==-1)

_doctorInfo="数据库异常";

else if(a==0)

_doctorInfo="一般异常";

else

_doctorInfo="DID不存在";

}

catch(InvalidUserException iue){

_doctorInfo="非法用户名";

}

%>

<body bgcolor="#FFFFFF">

<table width="770" height="423" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">

<tr>

<td height="421" bgcolor="#FFFFFF"><%@ include file = "../include/head.inc" %>

<table width="770" height="290" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<%@ include file = "../include/patient.inc" %>

<td width="603" align="center" valign="top">

<table width="100%" height="85%" border="0" cellpadding="3" cellspacing="1" bgcolor="#666666">

<tr>

<td width="100%" height="257" align="center" valign="top" bgcolor="E3EDFF">

<br>

<p align="left"><%=_doctorInfo%> 单击“当前可预约数量”进行预约</p>

<%if(rs!=null && rs.next()){%>

<table width="100%"  border="0" cellspacing="0" cellpadding="0">

<tr>

<th></th>

<th>周日上午</th>

<th>周日下午</th>

<th>周一上午</th>

<th>周一下午</th>

<th>周二上午</th>

<th>周二下午</th>

<th>周三上午</th>

<th>周三下午</th>

<th>周四上午</th>

<th>周四下午</th>

<th>周五上午</th>

<th>周五下午</th>

<th>周六上午</th>

<th>周六下午</th>

</tr>

<tr align="center">

<td>当前可预约数</td>

<%for(int i=2;i<16;i++){

int day=i/2-1;

int ap=i%2;

out.print("<td><a href=\"makeAppointment.jsp?did="+did+"&day="+day+"&ap="+ap+"\">"+rs.getInt(i)+"</a></td>");

}%>

</tr>

<tr align="center">

<td>最大可预约数</td>

<%for(int i=17;i<31;i++)

out.print("<td>"+rs.getInt(i)+"</td>");%>

</tr>

</table>

<%}%>

</td>

</tr>

</table>

</td>

</tr>

</table></td>

</tr>

</table>

</body>

</html>

<%

if(patient!=null)

patient.closeConnection();

%>

    1. 人员注册功能的实现

医院排号管理系统对于病人信息需要做大量的病人自己录入工作,用户自行录入基本信息,用户名,密码,姓名,性别,年龄,联系地址,联系电话,因此在这里我详细叙述一下车辆管理操作界面的详细设计。

注册用户信息操作界面:登录系统没有账号的病人,可以申请账号,将存入的病人信息添加进数据库。根据我的界面设计,注册操作的界面如下页图4-3所示。

图4-3添加自行车操作界面

根据我对添加自行车操作界面的功能设计和界面设计,实现功能的主要代码如下:

String _register="";

Patient p=(Patient)session.getAttribute("patient");

if(request.getParameter("reg")!=null){

String username=request.getParameter("username");

String password=request.getParameter("password");

int age=Integer.parseInt(request.getParameter("age"));

int sex=Integer.parseInt(request.getParameter("sex"));

String address=request.getParameter("address");

String phone=request.getParameter("phone");

String name=request.getParameter("name");

try{

p=new Patient(Patient.ANONYMOUS);

int r=p.addPatient(username,name,password,age,sex,address,phone);

if(r==1)

_register="注册成功";

else if(r==-2)

_register="用户名已存在";

else if(r==-1)

_register="数据库异常";

else

_register="一般异常";

}

catch(InvalidUserException iue){

_register="非法用户名";

}

finally{

if(p!=null)

p.closeConnection();

}

}}

    1.  查询医生功能的实现

医院排号管理系统的信息管理中,查询、预约大夫功能是非常重要的,使用这个功能可以根据客户的需求尽快查找到合适的大夫,查看大夫的信息,并可以直接提交预约信息。

查询时需要连接数据库,根据查询条件进行查询。下面将对信息查询页的详细设计进行具体的叙述。

医生查询的界面:它的使用具有较大的伸缩性,可以简单、快速的使用,使病人对医院的主要医生有一个了解,也可以直接预约医生给自己诊治。

医生查询的界面如图4-4所示。

图4-4医生、预约查询

根据设计的页面功能,使用以上对象,实现代码如下:

<%@ page contentType="text/html; charset=gbk"%><%@ include file = "../include/ccs.inc" %>

<%@ page import="hospital.db.dboperation.*" %>

<%@ page import="hospital.db.*" %>

<%@ page import="java.sql.*" %>

<html>

<head>

<title>医院门诊预约系统-医生信息</title>

<%

String _getDoctorInfo="";

String orderBy="";

ResultSet rs=null;

Patient p=null;

try{

orderBy=request.getParameter("orderby");

p=new Patient(Patient.ANONYMOUS);

int g=p.getDoctorInfo(orderBy);

if(g==1){

_getDoctorInfo="查询成功";

rs=p.getResultSet();

}

else if(g==-1)

_getDoctorInfo="数据库异常";

else

_getDoctorInfo="一般异常";

}

catch(InvalidUserException iue){

_getDoctorInfo="非法用户名";

}

%>

<meta http-equiv="Content-Type" content="text/html; charset=gbk"></head>

<body bgcolor="#FFFFFF">

<table width="770" height="423" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">

<tr>

<td height="421" bgcolor="#FFFFFF"><%@ include file = "../include/head.inc" %>

<table width="770" height="290" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<%@ include file = "../include/patient.inc" %>

<td width="603" align="center" valign="top">

<table width="100%" height="85%" border="0" cellpadding="3" cellspacing="1" bgcolor="#666666">

<tr>

<td width="100%" height="257" align="center" valign="top" bgcolor="E3EDFF">

<br>

<p align="left"><strong>单击医生姓名查询医生预约信息</strong></p>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<th>姓名</th>

<th>年龄</th>

<th>性别</th>

<th>职称</th>

<th>科室</th>

<th>特长</th>

<th>联系电话</th>

</tr>

<%while(rs.next()){%>

<tr align="center">

<td><a href="getDoctorAppointmentInfo.jsp?did=<%=rs.getString("DID")%>" >

<%=Util.decode(rs.getString("Name"))%></a></td>

<td><%=rs.getInt("Age")%></td>

<td><%if(rs.getInt("Sex")==1){out.println("女");}else{

out.println("女");

}%></td>

<td><%=Util.decode(rs.getString("Level"))%></td>

<td><%=Util.decode(rs.getString("Section"))%></td>

<td><%=Util.decode(rs.getString("Specialism"))%></td>

<td><%=rs.getString("Phone")%></td>

</tr>

<%}%>

</table>

</td>

</tr>

</table>

</td>

</tr>

</table></td>

</tr>

</table>

</body>

</html>

<%

if(p!=null)

p.closeConnection();

%>}


大家点赞、收藏、关注、评论啦  其他的定制服务  下方联系卡片↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 或者私信作者

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com