java课设 医院管理信息系统.doc_第1页
java课设 医院管理信息系统.doc_第2页
java课设 医院管理信息系统.doc_第3页
java课设 医院管理信息系统.doc_第4页
java课设 医院管理信息系统.doc_第5页
已阅读5页,还剩43页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

精品医院管理信息系统1需求分析1.1现状当前,医院作为病人就诊的地方,有许多信息需要处理和管理。现今,有很多门诊信息都是初步开始使用,甚至尚未使用计算机进行信息处理。根据调查得知,他们以前对信息管理的主要方式是基于文本、表格等纸介质的手工处理,对于医历等很多信息都是用人工计算、手抄进行。数据信息处理工作量大,容易出错;由于数据繁多,容易丢失,且不易查找。总的来说,缺乏系统,规范的信息管理手段。数据处理手工操作,工作量大,出错率高,出错后不易更改。基于这此问题,我认为有必要建立一个医院管理系统,使医院管理工作规范化,系统化,程序化,避免医院管理的随意性,提高信息处理的速度和准确性,能够及时、准确、有效的查询和修改医院情况。医院信息系统简称HIS,是Hospital Information System的简称,是指利用计算机和网络通信设备,为医院所属的各个部门提供病人诊疗和行政管理信息的手机、存储、处理提取和数据交换的能力。此次我课程设计的目标就是设计一个能使医院的管理工作系统化、规范化、自动化的系统,从而提高医院管理工作的效率。1.2模块功能 本系统功能主要包括:员工信息、病人信息、药剂管理、仪器管理、工资管理、病床管理。员工信息:储存了医院的医务人员的基本情况,包括员工编号,姓名,性别,所在部门,联系电话等信息。员工各种的查询、修改,包括员工基本信息、职称、岗位、工资等。 员工的人事调动管理。病人信息:病人基本资料表中所有项目(姓名,性别,婚否,出生日期,职业,职称,门诊诊断),病人基本资料表录入、修改、删除、复制。药剂管理:实现对医院药品信息的分类管理和数据分析,从而使信息整理快速、准确、简单,以便于相关部门给予统筹安排,从而提高改进传统的管理方法,提高企业管理水平。仪器管理:保存了医院所需医疗用品的基本情况,库存量和单品价格。以便管理人员查看,随时进行补货。工资管理:存储医生员工号,工资级别和工资总额,管理人员可以进行增删查改。病床管理:实现床位分配、空床查询、包床/退床、转床出院处理。图1.功能结构图1.3用例图图2.用例图2系统设计2.1识别需求文档中的类1.管理员管理员工编号,姓名,性别,所在部门,联系电话等信息,进行增删查改。普通用户查看员工信息。2.管理员设置病人姓名,性别,婚否,出生日期,职业,职称,门诊诊断,进行病人基本资料表录入、修改、删除、查询。3.管理员实现对医院药品信息的分类管理,进行增删查改。4.管理员保存医院所需医疗用品的基本情况,库存量和单品价格。5.管理员录入医生员工号,工资级别和工资总额,进行增删查改。普通用户查看自己的工资。6.管理员实现床位分配、空床查询、包床/退床、转床出院处理。需求文档中的名词/名词短语,按照出现顺序,从左到右排列(不重复):管理员(admin)、普通用户(person)、病人(invalid)、药品(stuff)、医疗用品)(apparatus、工资(pay)、床位(bed)。2.2初步建模类及类间关系员工信息包括:医生编号、姓名、性别、学历、职务、所在科室。病人基本情况描述包括病人的病人编号、姓名、性别、联系电话、籍贯、国家、民族、身份证号、健康状况、科室名称、病房号、床号。病号唯一确定一个病人。药品信息描述包括:药品编号、药品名称、库存量、单价。仪器信息描述包括:仪器代号、名称、单价、数量。床位信息描述包括床号、病房号、是否已住人。一个床号和病房号唯一确定一个床位情况。2.3初步的UML图Database+sql:String+url:String+user:String+password:String+Database()+OpenConn():void+executeQuery(in sql:String):ResultSet+executeUpdate(in sql:Sring):boolean+closestmt():void+closeConn():void图3.Database UML设计Apparatus+Datas:String+Columntitles:String+type:int+Apparatus(in datas:String,in type:int)+actionPerformed(in e:ActionEvent):void图4.Apparatus UML设计Invalid+datas:String+columntitles:String+type:int+Invalid(in datas:String,in type:int)+actionPerformed(in e:ActionEvent):void图5.Invalid UML设计Personcheck-pclass:String+columns:String+datas:String+Personcheck(in data:String)+actionPerformed(in e:ActionEvent):void图6.Personcheck UML设计Invalidupdate+Invalidupdate()+actionPerformed(in e:ActionEvent):void图7.Invalidupate UML设计Invalidcheck-pclass:String+columns:String+datas:String+Invalidcheck(in data:String)+actionPerformed(in e:ActionEvent):void图8.Invalidcheck UML设计Invalidadd-pclass:String+Invalidadd()+actionPerformed(in e:ActionEvent):void图9.Invalidadd UML设计InvalidBeansql:Stringiname:Stringsex:stringpclass: Stringstate:Stringdoctor: Stringitime: Stringrno: Stringbno: StringAdd(in name:String,in sex:String,in time:String,in plass:String,in state:String,in doctor:String,in rno:String,in bno:String):voidsearchInvalidiname(in iname:String):StringeditInvalid(in iname:String,in sex:String,in itime:String,in plass:String,in state:String,in doctor:String,in rno:String,in bno:String):voiddeleteInvalid(in iname:String):voidsearchAllInvalidor(in iname:String,in itime:String,in pclass:String,in state:String,in rno:String,in bno:String):StringsearchAllInvalidand(in iname:String,in itime:String,in pclass:String,in state:String,in rno:String,in bno:String):StringgetAlliname():Stringrefresh():String图10.InvalidBean UML设计3系统实现3.1UML类图转换成Java代码框架 Database.Java是数据库连接,源代码如下:public class Database public Database()public void OpenConn()throws Exceptiontrycatch(Exception e) public ResultSet executeQuery(String sql)catch(SQLException e) public boolean executeUpdate(String sql)public void closeStmt() public void closeConn() public static void main(Stringargs) throws Exception Personframe.java为员工信息窗口的代码,可以进行查询,删除,刷新,修改,源代码如下:public class PersonFrame extends JFrame implements ActionListenerprivate JButton button_add;private JButton button_check;private JButton button_delete;private JButton button_refresh;private JButton button_update; private JTable table; /表格组件 private DefaultTableModel tableModel; String datas;String columntitles=员工号,员工姓名,性别,所在部门,身份证,生日,籍贯,国家,民族,婚姻状况,健康状况,工作时间,家庭住址,联系电话 ;public PersonFrame(String datas,int type) public boolean isCellEditable(int row, int column) return false;/表格不允许被编辑 ; Overridepublic void actionPerformed(ActionEvent e) public static void main(String args) /测试方法/new PersonFrame(null,0); Invalid.java是病人管理模块的代码,可以进行入院,查询,刷新和更新的操作,源代码如下:public class Invalid extends JFrame implements ActionListenerprivate JButton button_add;private JButton button_check;private JButton button_edit;private JButton button_refresh;private JButton button_delete; private JTable table; /表格组件 private DefaultTableModel tableModel; String datas;String columntitles=病人姓名,病人性别,入院时间,所属科室,病人状况,主治医生,病房号,病床号;public Invalid(String datas, int type) public boolean isCellEditable(int row, int column) return false;/表格不允许被编辑 ; Overridepublic void actionPerformed(ActionEvent e) public static void main(String args) /测试方法/new Invalid(null,0); Apparatus.java是对仪器进行管理,源代码如下:public class Apparatus extends JFrame implements ActionListenerprivate JButton button_add;private JButton button_check;private JButton button_edit;private JButton button_refresh;private JButton button_delete; private JTable table; /表格组件 private DefaultTableModel tableModel; String datas;String columntitles=仪器代号,仪器名称,仪器价格,仪器数量,备注;int type;public Apparatus(String datas,int type) public boolean isCellEditable(int row, int column) return false;/表格不允许被编辑 ; Overridepublic void actionPerformed(ActionEvent e) public static void main(String args) /测试方法new Apparatus(null,0); Stuff.java是药剂管理,可以查询库存药品的信息,源代码如下:public class Stuff extends JFrame implements ActionListenerprivate JButton button_add;private JButton button_check;private JButton button_edit;private JButton button_refresh;private JButton button_delete;private JTable table; /表格组件 private DefaultTableModel tableModel; String datas;String columntitles=药剂代号,药剂名称,药剂价格,储存量,备注;int type;public Stuff(String datas,int type) Overridepublic void actionPerformed(ActionEvent e) public static void main(String args) /测试方法new Stuff(null,0); Pay.Java是对员工工资进行管理录入的操作,源代码如下:public class Pay extends JFrame implements ActionListenerprivate JButton button_add;private JButton button_check;private JButton button_edit;private JButton button_refresh;private JButton button_delete; private JTable table; /表格组件 private DefaultTableModel tableModel; String datas;String columntitles=员工号,工资等级,工资总额public Pay(String datas) Overridepublic void actionPerformed(ActionEvent e) public static void main(String args) /测试方法new Pay(null); Bed.java是对医院病床进行管理,显示病房及病床的使用信息,源代码如下:Public class Bed extends JFrame implements ActionListenerprivate JButton button_add;private JButton button_check;private JButton button_refresh;private JButton button_delete; private JTable table; /表格组件 private DefaultTableModel tableModel; String datas;String columntitles=病床号,病房号,状态;public Bed(String datas) public boolean isCellEditable(int row, int column) return false;/表格不允许被编辑 ; Overridepublic void actionPerformed(ActionEvent e) public static void main(String args) /测试方法new Bed(null);3.2添加表示层,实现交互功能3.2.1Login类系统的用户有管理员、医生,因此,在进入主界面之前,应该先弹出登录界面,要求用户输入用户编号(姓名可能重名)和登录口令,以验证用户身份。因此,我们首先需要设计一个登录界面Login类。设计思路:实现界面外观,添加交互功能。登录过程中需要进行用户ID与密码的验证。 import java.awt.*;import javax.swing.*;import java.awt.event.*;public class Login extends JFrame implements ActionListener private JLabel user,password; private JTextField text_user; /用户名文本行 private JPasswordField text_password; /密码文本行 private JButton button_ok,button_cancel; private JComboBox typeBox; JLabel jlabel; public boolean isLogin=false; /判断登录是否成功 public Login() super(用户登录); this.setSize(240,150); this.setLocation(550,200); this.setBackground(Color.lightGray); this.setResizable(false); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); this.getContentPane().setLayout(new FlowLayout(); jlabel=new JLabel(欢迎登陆医院管理信息系统 ,JLabel.CENTER); this.getContentPane().add(jlabel); user=new JLabel(用户名:); user.setFont(new Font(Dialog,0,12); this.getContentPane().add(user); text_user = new JTextField(15); text_user.setEditable(true); this.getContentPane().add(text_user); password=new JLabel(密 码:); password.setFont(new Font(Dialog,0,12); this.getContentPane().add(password); text_password = new JPasswordField(15); this.getContentPane().add(text_password); String types = 普通用户,管理员; typeBox = new JComboBox(types); button_ok = new JButton(登录); button_ok.setFont(new Font(Dialog,0,12); this.getContentPane().add(new Label(); this.getContentPane().add(typeBox); this.getContentPane().add(button_ok); button_ok.addActionListener(this); button_cancel = new JButton(取消); button_cancel.setFont(new Font(Dialog,0,12); this.getContentPane().add(button_cancel); button_cancel.addActionListener(this); this.setVisible(true); public void actionPerformed(ActionEvent e) /单击事件处理方法 String username = text_user.getText(); String password = new String(text_password.getPassword(); if (e.getSource()=button_cancel) /单击退出按钮 this.setVisible(false); else if (username.equals() JOptionPane.showMessageDialog(this, 请输入用户名); else if (password.equals() JOptionPane.showMessageDialog(this, 密码不能为空,请输入密码); else if (e.getSource()=button_ok) /单击登录按钮 LoginBean login=new LoginBean(); isLogin=login.enter(username,password); int type = typeBox.getSelectedIndex(); if(isLogin) if(login.Flag=type) new HOSMain(type); else JOptionPane.showMessageDialog(this, 登陆身份不正确!); return; text_user.setText(); text_password.setText(); this.setVisible(false); public void windowClosing(WindowEvent e) public void windowOpened(WindowEvent e) /打开窗口 public void windowClosed(WindowEvent e) /关闭窗口后 public void windowIconified(WindowEvent e) /窗口最小化 public void windowDeiconified(WindowEvent e) /窗口恢复 public void windowActivated(WindowEvent e) /激活窗口 public void windowDeactivated(WindowEvent e) /变为不活动窗口 public static void main(String args) throws Exception /测试方法 new Login(); 3.2.2HosMain类HosMain类是登录完成后进入的医院管理信息系统的主界面,该界面显示了整个系统的功能模块。代码如下:import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.sql.*;/* * 系统主界面 */public class HOSMain extends JFrame implements ActionListenerDimension faceSize = new Dimension(450, 550);JPanel contentPane;JButton buttonPersonFrame;JButton buttonInvalid;JButton buttonStuff;JButton buttonApparatus;JButton buttonPay;JButton buttonBed;JButton buttonExit;int type; public HOSMain(int type) this.type=type;this.setDefaultCloseOperation(EXIT_ON_CLOSE);this.setSize(800,500);this.setTitle(医院管理系统);this.setLocation(400,100);buttonPersonFrame=new JButton(员工信息);buttonInvalid=new JButton(病人信息);buttonStuff=new JButton(药剂管理);buttonApparatus=new JButton(仪器管理);buttonPay=new JButton(工资管理);buttonBed=new JButton(病床管理);buttonExit=new JButton(退出系统);JPanel panel1=new JPanel();panel1.add(buttonPersonFrame);JPanel panel2=new JPanel();panel2.add(buttonInvalid);JPanel panel3=new JPanel();panel3.add(buttonStuff);JPanel panel4=new JPanel();panel4.add(buttonApparatus);JPanel panel5=new JPanel();panel5.add(buttonPay);JPanel panel6=new JPanel();panel6.add(buttonBed);JPanel panel7=new JPanel();panel7.add(buttonExit); ImageIcon firstpage=new ImageIcon(abc.PNG); this.getContentPane().setLayout(new BorderLayout();JPanel panel = new JPanel();panel.add(panel1);panel.add(panel2);panel.add(panel3);panel.add(panel4);panel.add(panel5);panel.add(panel6);panel.add(panel7);this.getContentPane().add(panel,BorderLayout.NORTH);this.getContentPane().add(new JLabel(firstpage),BorderLayout.CENTER);buttonPersonFrame.addActionListener(this);buttonInvalid.addActionListener(this);buttonStuff.addActionListener(this);buttonApparatus.addActionListener(this);buttonPay.addActionListener(this);buttonBed.addActionListener(this);buttonExit.addActionListener(this);/关闭程序时的操作this.addWindowListener(new WindowAdapter()public void windowClosing(WindowEvent e)System.exit(0););this.setVisible(true);public void actionPerformed(ActionEvent e)if(e.getSource()=buttonPersonFrame) new PersonFrame(null,type); if(e.getSource()=buttonInvalid)new Invalid(null,type);if(e.getSource()=buttonStuff) new Stuff(null,type); if(e.getSource()=buttonApparatus)new Apparatus(null,type);if(e.getSource()=buttonPay)new Pay(null);if(e.getSource()=buttonBed)new Bed(null);if(e.getSource()=buttonExit)JOptionPane.showConfirmDialog(null, 您确定退出系统吗?,消息,JOptionPane.YES_NO_OPTION);System.exit(0);public static void main(String args)new HOSMain(1);3.2.3ApparatusBean类点击进入仪器管理的界面,实现添加、修改、查询、删除的操作。import java.util.*;import java.util.Date;import java.sql.*;import java.awt.*;import javax.swing.*;public class ApparatusBean String sql;ResultSet rs = null;String ano;String aname;String aprice;String amount;String explain;public void add(String ano,String aname,String aprice,String amount,String explain) Database DB = new Database();sql=insert into apparatus values ( +ano+,+aname+,+aprice+,+amount+,+explain+);tryDB.OpenConn();DB.executeUpdate(sql);JOptionPane.showMessageDialog(null,成功添加仪器信息!);catch(Exception e)System.out.println(e);JOptionPane.showMessageDialog(null, 保存失败, 错误, JOptionPane.ERROR_MESSAGE); finally DB.closeStmt();DB.closeConn();public String searchApparatusano(String ano)Database DB = new Database();this.ano =ano;String s = new String5;sql = select distinct * from apparatus where ano = +ano+;tryDB.OpenConn();rs = DB.executeQuery(sql);if(rs.next()s0 = rs.getString(1);s1 = rs.getString(2);s2 = rs.getString(3);s3 = rs.getString(4);s4 = rs.getString(5);elses = null;catch(Exception e)finally DB.closeStmt();DB.closeConn();return s;public void editApparatus(String ano,String aname,String aprice,String amount,String explain)Database DB = new Database();this.ano=ano;this.aname = aname;this.aprice=aprice;this.amount = amount;this.explain = explain; sql = update apparatus set aname = +aname+, aprice=+aprice+,amount = +amount+, explain = +explain+;tryDB.OpenConn();DB.executeUpdate(sql);JOptionPane.showMessageDialog(null,成功修改一条仪器信息!); catch(Exception e)JOptionPane.showMessageDialog(null, 更新失败, 错误, JOptionPane.ERROR_MESSAGE); finally DB.closeStmt();DB.closeConn();public String searchAllApparatusor(String ano,String aname,String aprice,String amount) this.ano = ano;this.aname = aname;this.aprice = aprice;this.amount = amount;Database DB = new Database();String result=null;sql = select * from apparatus where ano=+ano+ or aname= +aname+ or aprice=+aprice+ or amount=+amount+;tryDB.OpenConn();rs = DB

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论