医院导诊系统详细设计.docx
《医院导诊系统详细设计.docx》由会员分享,可在线阅读,更多相关《医院导诊系统详细设计.docx(41页珍藏版)》请在冰豆网上搜索。
医院导诊系统详细设计
医院导诊系统详细设计
4.登录模块的详细设计
登录模块主要实现对该系统用户登录的验证等功能,用户登录管理的视图层,控制层和模型层三个层次的模块如表所示。
视图控制器模型
JSP组件ActionForm客户标签
login.jspLoginFormLoginActionDBUtil.javaStrutsHtml
receptionist_main.Adminer.java标签
jspDoctor.javadoctor_main.jspReceptionist.javaadminer_main.jsp
4.1视图层
视图层主要实现表示层的功能,视图层包括JSP组件,Form组件以及标签库等。
4.1.1JSP组件
登录模块视图层主要有4个JSP文件。
4.1.2Form组件
登录模块视图层共有1个Form文件,下面是LoginForm的伪代码描述。
packagecom.hgs.forms;
importorg.apache.struts.action.ActionForm;
@SuppressWarnings("serial")
publicclassLoginActionFormextendsActionForm{
privateStringuserId;
//用户姓名
privateStringuserName;
//密码
privateStringpassword;
//用户角色
privateStringjuese;
publicStringgetJuese(){
......
}
publicvoidsetJuese(Stringjuese){
......}
publicStringgetUserId(){
......
}
publicvoidsetUserId(StringuserId){
......}
publicStringgetUserName(){
......}
publicvoidsetUserName(StringuserName){
......}
publicStringgetPassword(){
......}
publicvoidsetPassword(Stringpassword){
......}
}
4.2控制层
登录模块控制层有1个Action文件,下面是LoginAction的伪代码描
述。
packagecom.hgs.actions;
importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;
importorg.apache.struts.action.Action;importorg.apache.struts.action.ActionForm;importorg.apache.struts.action.ActionForward;importorg.apache.struts.action.ActionMapping;importcom.hgs.forms.LoginActionForm;importcom.hgs.model.*;
importcom.hgs.service.*;
publicclassLoginActionextendsAction{
@Override
publicActionForwardexecute(
ActionMappingmapping,
ActionFormform,
HttpServletRequestrequest,
HttpServletResponseresponse)
throwsException{
LoginActionFormlaf=(LoginActionForm)form;
StringuserId=laf.getUserId();
Stringpassword=laf.getPassword();
Stringjuese=laf.getJuese();
if("admin".equals(juese)){
Admineradminer=
AdminerDaoProxy.getInstance().login(null,userId,password);
request.getSession().setAttribute("adminer",adminer);
if(adminer==null){
......}
if
(!
adminer.getAdminer_password().equals(password)){
......
}
else{
......
}
}
if("doctor".equals(juese)){
Doctordoctor=
DoctorDaoProxy.getInstance().login(null,userId,password);
request.getSession().setAttribute("doctor",doctor);
if(doctor==null){
......
}
if
(!
doctor.getDoctor_password().equals(password)){
......}
else{
......}
}
else{
Receptionistreceptionist=ReceptionistDaoProxy.getInstance().login(null,userId,password);
request.getSession().setAttribute("receptionist
",receptionist);
if(receptionist==null){
......}
if
(!
receptionist.getReceptionist_password().equals(pa
ssword)){
......
}
return......}
}
}
4.3模型层
登录模块模型层共有4个组件,下面是DBUtil.java的伪代码描
述。
packagecom.hgs.DBUtil;
importjava.sql.*;
publicclassDBUtil{
publicstaticConnectiongetConnection(){
Connectionconn=null;
try{
//加载驱动,连接数据库
......
......
}
returnconn;
}
publicstaticvoidclose(Connectionconn){
if(conn!
=null){
try{
......
}
}
}
publicstaticvoidclose(PreparedStatement
pstmt){
if(pstmt!
=null){
try{
......
}
}
}
publicstaticvoidclose(ResultSetrs){
if(rs!
=null){
try{
......
}
}
}
}
5.导医员模块的详细设计
导医员模块主要实现对前来挂号的病人进行登记,选择科室和医生进行挂号等功能,导医员模块的视图层,控制层和模型层三个层次的模块如表所示。
视图控制器模型
JSP组件ActionFor客户标签
m
receptionist_main.jspRecMgrActionDBUtil.javaRecMgrFormStrutsHtml
first_register.jspRegistration.java标签
patient_register.jspPatient.java
register_queue.jsp
5.1视图层
视图层主要实现表示层的功能,视图层包括JSP组件,Form组件以及标签库等。
5.1.1JSP组件
导医员模块视图层主要有4个JSP文件。
5.1.2Form组件
导医员模块视图层共有1个Form文件,下面是RecMgrForm的伪代码描述。
packagecom.hgs.forms;
importjava.util.Date;
importorg.apache.struts.action.ActionForm;
@SuppressWarnings("serial")
publicclassRecMgrFormextendsActionForm{
privateStringpatient_id;//病人id
privateStringpatient_name;//病人姓名
privateintpatient_age;//病人年龄
privateStringpatient_sex;//病人性别
privateStringpatient_id_no;//病人身份证号
privateStringpatient_tel;//病人联系电话
privateStringcard_no;//卡号
privateStringpatient_address;//病人地址
privateStringcreate_date;//病人登记日期
privateintregistration_id;//挂号id
privateDateregistration_time;//挂号时间
privateStringstate;//挂号状态
privateStringreceptionist;
privateStringpatient;
privateStringdoctor;
publicStringgetPatient_id(){
......
}
publicvoidsetPatient_id(Stringpatient_id){
......
}
publicStringgetPatient_name(){
......
}
publicvoidsetPatient_name(String
patient_name){
......
}
publicintgetPatient_age(){
......}
publicvoidsetPatient_age(intpatient_age){
......}
publicStringgetPatient_sex(){
......}
publicvoidsetPatient_sex(Stringpatient_sex)
{
......
}
publicStringgetPatient_id_no(){
......}
publicvoidsetPatient_id_no(Stringpatient_id_no){
......}
publicStringgetPatient_tel(){
......}
publicvoidsetPatient_tel(Stringpatient_tel)
{
......
}
publicStringgetCard_no(){
......}
publicvoidsetCard_no(Stringcard_no){
......}
publicStringgetPatient_address(){
......
}
publicvoidsetPatient_address(Stringpatient_address){
......}
publicStringgetCreate_date(){
......}
publicvoidsetCreate_date(Stringcreate_date)
{
......
}
publicintgetRegistration_id(){
......}
publicvoidsetRegistration_id(int
registration_id){
......
}
publicDategetRegistration_time(){
......}
publicvoidsetRegistration_time(Dateregistration_time){
......}
publicStringgetState(){
......}
publicvoidsetState(Stringstate){
......}
publicStringgetReceptionist(){
......}
publicvoidsetReceptionist(Stringreceptionist)
{
......
}
publicStringgetPatient(){
......}
publicvoidsetPatient(Stringpatient){
......}
publicStringgetDoctor(){
......}
publicvoidsetDoctor(Stringdoctor){
......}
}
5.2控制层
导医员模块控制层有1个Action文件,下面是RecMgrAction的伪代码
描述。
packagecom.hgs.actions;
importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importorg.apache.struts.action.ActionForm;importorg.apache.struts.action.ActionForward;importorg.apache.struts.action.ActionMapping;importorg.apache.struts.actions.DispatchAction;publicclassRecMgrActionextendsDispatchAction{/**
*查询病人
*/
@Override
protectedActionForward
unspecified(ActionMappingmapping,ActionFormform,
HttpServletRequestrequest,
HttpServletResponseresponse)
throwsException{
......
returnmapping.findForward("patient_list");
}
/**
*首次看病登记
*/
publicActionForwardaddPatient(ActionMapping
mapping,ActionFormform,
HttpServletRequestrequest,HttpServletResponseresponse)
throwsException{
......
returnmapping.findForward("");}
/**
*查找病人
*/
publicActionForwardfindPatient(ActionMapping
mapping,ActionFormform,
HttpServletRequestrequest,HttpServletResponseresponse)
throwsException{
......
returnmapping.findForward("");
}
/**
*为此病人挂号
*/
publicActionForward
choosePatient(ActionMappingmapping,ActionForm
form,
HttpServletRequestrequest,HttpServletResponseresponse)
throwsException{
......
returnmapping.findForward("");
}
/**
*查找医生
*/
publicActionForwardfindDoctor(ActionMapping
mapping,ActionFormform,
HttpServletRequestrequest,HttpServletResponseresponse)
throwsException{
......
returnmapping.findForward("");
}
/**
*选择此医生挂号
*/
publicActionForwardchooseDoctor(ActionMapping
mapping,ActionFormform,
HttpServletRequestrequest,HttpServletResponseresponse)
throwsException{
......
returnmapping.findForward("");
}
/**
*就诊队列
*/
publicActionForwardregistration(ActionMapping
mapping,ActionFormform,
HttpServletRequestrequest,HttpServletResponseresponse)
throwsException{
......
returnmapping.findForward("");
}
}
5.3模型层
导医员模块模型层共有3个组件,下面是Registration.java的伪
代码描述。
packagecom.hgs.model;
importjava.util.Date;
publicclassRegistration{
privateintregistration_id;
privateDateregistration_time;
privateStringstate;
privateReceptionistreceptionist;
privatePatientpatient;
privateDoctordoctor;
publicintgetRegistration_id(){
......
}
publicvoidsetRegistration_id(int
registration_id){
......}
publicDategetRegistration_time(){
......}
publicvoidsetRegistration_time(Dateregistration_time){
......}
publicStringgetState(){
......}
publicvoidsetState(Stringstate){
......}
publicReceptionistgetReceptionist(){
......}
publicvoidsetReceptionist(Receptionistreceptionist){
......}
publicPatientgetPatient(){
returnpatient;
}
publicvoidsetPatient(Patientpatient){
......}
publicDoctorgetDoctor(){
......
}
publicvoidsetDoctor(Doctordoctor){
......
}
}
6.医生模块的详细设计
医生模块主要实现查看就诊队列,选择挂号的病人进行诊断,查看病历等功能,医生模块的视图层,控制层和模型层三个层次的模块如表所示。
视图控制器模型
JSP组件ActionFor客户标签
m
register_queue.jspDocMgrForDocMgrActionDBUtil.javaStrutsHtml
mDiagnose.jspRegistration.java标签
historylist.jspPatient.java
Diagnose.java
6.1视图层
视图层主要实现表示层的功能,视图层包括JSP组件,Form组件以及标签库等。
6.1.1JSP组件
医生模块视图层主要有3个JSP文件。
6.1.2Form组件
医生模块视图层共有1个Form文件,下面是DocMgrForm的伪代码描述。
packagecom.hgs.forms;
importjava.util.Date;
importorg.apache.struts.action.ActionForm;
@SuppressWarnings("serial")
publicclassDocMgrFormextendsActionForm{
privateStringpatient_id;//病人id
privateStringpatient_name;//病人姓名
privateintpatient_age;//病人年龄
privateStringpatient_sex;//病人性别
privateStringpatient_id_no;//病人身份证号
privateStringpatient_tel;//病人联系电话
privateStringcard_no;//卡号