Java项目-医院挂号管理系统
题目:基于JavaWeb医院挂号的设计与实现-Servlet_医院挂号管理系统_jsp_hospital_yuyue
注意:这里不是全部功能,需要全部功能的可以联系我,看评论联系我
1.系统总体设计
1.1开发环境
操作系统:Windows10;
编程语言:Java;
运行环境:jdk1.8
开发工具:Eclipse或者Myeclipse;
框架:JavaWeb【Servlet】
所有工具下载链接:
JDK下载链接:jdk1.7、1.8版本.zip_校园失物招领管理系统-Java文档类资源-下载
Eclipse下载链接:eclipse2019、2016.zip_eclipse历史版本-Java文档类资源-下载
Maven下载链接:apache-maven-3.5.3版本.zip_java实现机票订购系统讲解-Java文档类资源-下载
tomcat下载链接:Tomcat.zip_网上蛋糕商城系统毕业论文源码-Web服务器文档类资源-下载
向日葵远程工具:向日葵远程工具.zip_向日葵-其它文档类资源-下载
2.医院挂号的设计与实现
2.1功能需求分析
在本系统架构中,主要包含三个角色:患者端则负责完成科室挂号和医生挂号的具体操作,并记录预约信息;同时能够评估健康状况;医生端则负责管理排班安排;而管理员端则专注于管理用户的基本资料,包括基本信息、科室信息以及各类排班申请.每个角色之间职责分明,确保系统的高效运行.
管理员:
基本信息:统计各个科室信息以及每周的预约信息,用柱状图显示。
医生信息管理:可以对医生进行模糊查询,添加医生。
患者信息管理: 查看患者信息。
排班申请管理:查看医生申请出诊信息
医生:
排班信息:可以查看自己的每周排班情况。
我的申请:查看自己申请出诊信息。
患者的核对流程:用于核对患者的预约信息;针对 appointment processing 两种情况: one 是完成诊疗程序; another 是患者的opt-out operation.
我的信息:查看我的详细信息。
患者:
按照科室挂号:通过科室完成挂号流程时,请确保您在自己的163邮箱中获取并输入正确的预约验证码。
按照医生进行挂账操作:按照医生指示执行挂账流程时,请确保您已经在自己的163邮箱账户内获取了当天的预约成功短信验证码,并正确填写并提交该短信验证码以完成挂账过程。
浏览个人安排:能够查阅详细的时间安排,并可进行时间更改及账户注销。其中,在其账户注销时也需要提供验证码。
浏览个人安排:能够查阅详细的时间安排,并可进行时间更改及账户注销。其中,在其账户注销时也需要提供验证码。
查看我的诚心度:查看自己的诚信都是多少分。
本系统各模块如下图2.1所示:

3.系统设计
3.1登录
输入用户名或密码。若输入的用户名或密码不符合要求,则系统将无法进行登录操作;否则系统将完成正常的登录流程。根据用户的角色进行判断:若为管理员,则会跳转至admin/index.jsp页面;若是医生,则会跳转至doctor/login.jsp;而患者的访问则直接进入主页面。
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String account = req.getParameter("account");
String password = req.getParameter("password");
String accounttype = req.getParameter("accounttype");
req.getSession().removeAttribute("message");
// System.out.println(url);
switch (accounttype){
case "管理员":
AdminDao adminDao=new IAdminimpl();
List<Admin> admins = adminDao.getAdmin(account);
if(admins.size()>0){
Admin admin = admins.get(0);
if(admin.getPassword().equals(password)){
req.getSession().setAttribute("admin",admin);
resp.sendRedirect("admin/index.jsp");
}
}
break;
case "医生":
DoctorDao doctorDao=new DoctorDao();
String where="where account =?";
List<Doctor> doctors = doctorDao.query(where, new Object[]{account});
if(doctors.size()>0){
Doctor doctor = doctors.get(0);
if(doctor.getPassword().equals(password)){
req.getSession().setAttribute("doctor",doctor);
resp.sendRedirect("doctor");
return;
}
}
req.getSession().setAttribute("message","用户名或密码错误!!");
req.getRequestDispatcher("doctor/login.jsp").forward(req,resp);
break;
case "患者":
PatientDao patientDao=new PatientDao();
List<Patient> patients = patientDao.query("account",account);
if(patients.size()>0){
Patient patient = patients.get(0);
if(patient.getPassword().equals(password)){
req.getSession().setAttribute("patient",patient);
String url= (String) req.getSession().getAttribute("url");
if(url==null)
url="index.jsp";
resp.sendRedirect(url);
return;
}
}
req.getSession().setAttribute("message","用户名或密码错误!!");
resp.sendRedirect("login.jsp");
break;
}
}

3.2患者挂号
患者进行挂号时可以按科室选择、通过医生选择、设置 preferred appointment time等选项完成基础配置。完成后需输入验证码信息并发送。系统会将此请求提交至 163 邮箱进行处理。请确保填写信息无误后提交操作以实现成功预约。若输入错误则返回失败提示并显示 error message提示用户重新输入正确验证码。
public static boolean sendMail(String to, String content){
Properties prop = new Properties();
prop.setProperty("mail.host", host);
prop.setProperty("mail.smtp.auth", "true");
prop.setProperty("mail.transport.protocol", "smtp");
/* prop.put("mail.smtp.ssl.enable", true);*/
// 开启SSL加密,否则会失败
try {
MailSSLSocketFactory sf = new MailSSLSocketFactory();
sf.setTrustAllHosts(true);
prop.put("mail.smtp.ssl.enable", "true");
prop.put("mail.smtp.ssl.socketFactory", sf);
Session session = Session.getInstance(prop);
/* prop.put("mail.smtp.ssl.enable", true);*/
Transport ts = session.getTransport();
// 连接邮件服务器:邮箱类型,帐号,授权码代替密码(更安全)
ts.connect(host,from, password);//后面的字符是授权码 // 创建邮件对象
MimeMessage message = new MimeMessage(session);
// 指明邮件的发件人
message.setFrom(new InternetAddress(from));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
// 邮件的标题
message.setSubject("在线预约挂号系统");
// 邮件的文本内容
/*int code=100000+(int)(899999*Math.random());
System.out.println(code);*/
message.setContent(content, "text/html;charset=UTF-8");
// 发送邮件
ts.sendMessage(message, message.getAllRecipients());
ts.close();
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}

3.3患者我的预约
点击我的预约,可以查看我的预约信息,可以修改预约以及取消预约。
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
Patient patient= (Patient) req.getSession().getAttribute("patient");
RecodeDao recodeDao = new RecodeDao();
/*String where="where pid=? order by ordertime desc";
List<Recode> list = recodeDao.query(where, new Object[]{patient.getId()});*/
List<HashMap<String, String>> list = recodeDao.orderList(patient.getId());
req.setAttribute("list",list);
req.getRequestDispatcher("orderList.jsp").forward(req,resp);
}

3.4患者诚信度
点击诚信度,可以查看当前患者诚信度。
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String where ="where pid=? order by time desc";
Patient patient = (Patient) req.getSession().getAttribute("patient");
IntegrityDao integrityDao=new IntegrityDao();
List<bean.Integrity> integrities = integrityDao.query(where, new Object[]{patient.getId()});
req.setAttribute("integrities",integrities);
req.getRequestDispatcher("integrity.jsp").forward(req,resp);
}

3.5医生排班信息
点击排班信息,可以查看医生排班信息。
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
WorkDayDao workDayDao=new WorkDayDao();
String action = Util.nullToString(req.getParameter("action"));
switch (action){
case "offWork":
String wid = req.getParameter("wid");
String set = "set state ='停诊' where id=?";
workDayDao.update(set,new Object[]{wid});
break;
}
Doctor doctor = (Doctor) req.getSession().getAttribute("doctor");
//List<WorkDay> workDays= workDayDao.queryWorkday1(doctor.getDid());
String where =" where did=? order by worktime asc";
List<WorkDay> workDays = workDayDao.query(where,new Object[]{doctor.getDid()});
req.setAttribute("workDays",workDays);
req.getRequestDispatcher("myWork.jsp").forward(req,resp);
}

3.6医生患者队列
进入患者队列页面后,可查询患者的预约记录;系统将提供处理当前患者的就医安排以及取消服务两种功能
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String action = Util.nullToString(req.getParameter("action"));
Doctor doctor = (Doctor) req.getSession().getAttribute("doctor");
String rid = Util.nullToString(req.getParameter("rid"));
String pid = Util.nullToString(req.getParameter("pid"));
RecodeDao recodeDao = new RecodeDao();
IntegrityDao integrityDao = new IntegrityDao();
Integrity integrity;
String set;
switch (action){
case "finish":
set = "set state ='完成' where rid=?";
recodeDao.update(set,new Object[]{rid});
integrity = new Integrity("", pid, doctor.getDname(), doctor.getOffice(), "", "完成预约", "10");
integrityDao.insert(integrity);
break;
case "sy":
set = "set state ='爽约' where rid=?";
recodeDao.update(set,new Object[]{rid});
integrity = new Integrity("", pid, doctor.getDname(), doctor.getOffice(), "", "爽约", "-10");
integrityDao.insert(integrity);
break;
}
PatientDao patientDao = new PatientDao();
ArrayList<HashMap<String, String>> list = patientDao.patientList(doctor.getDid());
req.setAttribute("list",list);
req.getRequestDispatcher("patientList.jsp").forward(req,resp);
}

4工程目录结构

5最终项目包含文件:

