java课设 医院管理信息系统.docx
医院管理信息系统1需求分析1.1 现状当前,医院作为病人就诊的地方,有很多信息须要处理和管理。现今,有很多门诊信息都是初步起先运用,甚至尚未运用计兑机进行信息处理。依据调查得知,他们以前对信息管理的主要方式是基丁文本、表格等纸介后的手工处理,对手医历等很多信息都是用人工计算、手抄进行.数据信息处理工作员大,简洁出错:由于数据繁多,简洁丢失,且不易查找。总的来说,缺乏系统,规范的信息管理手段。数据处理手工操作,工作量大,出错率高,出错后不易更改。基这此问题,我认为有必要建立一个医院管理系统,使医院管理工作规范化,系统化,程序化,避开医院管理的随意性,提高信息处理的速度和精确性,能够刚好、精确、有效的查询和修改医院状况.医院信息系统简称HIS,是HoSPitaIInfOnnatiOnSyStem的简称,是指利用计算机和网络通信设备,为医院所属的各个部门供应病人诊疗和行政管理信息的手机、存储、处理提取和数据交换的实力。此次我课程设计的目标就是设计一个能使医院的管理工作系统化、规范化、自动化的系统,从而提高医院管理工作的效率。1.2 模块功能本系统功能主要包括:员工信息、病人信息、药剂管理、仪器管理、工资管理、病床管理。员工信息:储存了医院的医务人员的基本状况,包括员工编号,姓名,性别,所在部门,联系电话等信息。员工各种的查询、修改,包括员工基本信息、职称、岗位、工资等。员工的人事调动管理。病人信息:病人基本资料表中全部项目(姓名,性别,婚否,诞生日期,职业,职称,门诊诊断),病人基本资料表录入、修改、删除、复制。药剂管理:实现对医院药品信息的分类管理和数据分析,从而使信息整理快速、精神、1.3 用例图医院管理信息系统图2.用例图2系统设计2.1识别需求文档中的类1 .管理员管理协工编号,姓名,性别,所在部门,联系电话等信息,进行增删钱改。二般用户杳若员工信息。2 .管理员设附病人姓名,性别,婚否,诞生日期,职业,职称,门诊诊断,进行病人基本资料表录入、修改、删除、查询。3 .管理员实现对医院药园信息的分类管理,进行增删直改。4 .管理员保存医院所需医疗用品的网本状况,库存量和单品价格。5 .管理员录入医生员工号,工资级别和工资总额,进行增删查改。一般用户杳看自己的工资。)publicbleanexecuteUpdate(Stringsql)publicvoidcloseStn11()publicvoidcloseConn()publicstaticvoidnain(StringJargs)throwsExceptionII PCrSonframC.java为员工信息窗口的代码,可以进行查询,删除,刷新,修改,源代码如下:publicclassPersonFrameextendsJFrameimplements/Xction1.istener(privateJButtonbutton_add;privateJButtonbuiton_check:privateJButtonbutton_delete:privateJButtonbuiton_iefresh:privateJButtonbutton_update:privateJTabIetable:表格组件privateDefauItTabIeNkxleltableModel:Stringdatas11;StringHcohiinmiUeS="员工号,"员工姓名一性别”所在部门一身份证一生日"籍贯”国家"民族”婚姻状况健康状况”,"工作时间”家庭住址”联系电话“):publicPerSOnFrame(Slringdatas.inttype)(publicbooleanisCellEditable(introw.intcolumn)returnfalse:/表格不允许被编辑):)OverridepublicvoidactionPerfbrmed(/XctionEvente)(publicstaticvoidmain(Stringargs)测试方法(/newPersonFrame(null.O);)I InValidjava是病人管理模块的代码,可以进行入院,查询,刷新和更新的操作,源代码如下:publicclassInvalidextendsJFraineimplements/Xction1.istener(privateJButtonbuiton_add;privateJButtonbutton_check:privateJButtonbuiton_edit:privateJButtonbutton_refresh;privateJButtonbutton_delete;privateJTabIetable;/表格组件privateDefaultTabIeModeIUbIeModeI;Stringdatas(;StringHCoIUmnlitIeS="病人姓名”病人性别"入院时间”所属科室.病人状况”,"主治医生"病房号"病床号:publiclnvalid(Stringdatas,intIyPe)returnfalse:)表格不允许被编辑OverridepublicvoidactionPerfbrmed(/XctionEvente)publicstaticvoidmain(Stringargs)测试方法(/newlnvalid(null.O);)J APParatUS.java是对仪器进行管理,源代码如下:publicclassAPParatUSextendsJFrameimplementsAction1.istener(privateJButtonbutton_add;privateJButtonbutton_check:privateJButtonbutton_edit:privateJButtonbutton-refresh:privateJButtonbutton-delete;privateJTabIetable:表格组件privateDefauItTabIeModelIabIeModel;Stringdatas11);StringHCOlUmntitles=“仪器代号代,仪器名称仪器价格”,“仪器数量","备注");inttype:publicpparatus(Stringdatas).inttype)newStuff(null.();®PayJava是对员工工资进行管理录入的操作,源代码如下:publicclassPayextendsJFrameimplementsAction1.istenerprivateJButtonbutton_add;privateJButtonbutton_check:privateJButtonbutton_edit:privateJButtonbutton-refresh:privateJButtonbutton-delete;privateJTabletable;表格组件privateDefauItTabIeModelIabIeModel;Stringdatas11);StringHColUmmiUes=“员工号"工资等级","工资总额”publicPay(Stringdatas)IIOVerridepublicvoidactionPerfbrmed(ctionEvente)publicstaticvoidmain(Stringargs)测试方法(newPay(null);IIBedjava是对医院病床进行管理,显示病房及病床的运用信息,源代码如下:PublicclassBedextendsJFrameimplementsACtiOn1.iStener(privateJButtonbutton_add:i*三namepasswordfo1:d11w:admin12wayOOO03fa11rm11104Uaua1122205XInChOO3130设计思路:实现界面外观,添加交互功能,登录过程中须要进行用户【D与密码的验证。importjava.awt.*:importjavax.swing.*;importjava.awt.event.*;publicclass1.oginextendsJFramcimplementsAaion1.istcncrprivateJ1.abelUSer.password:privateJTexiFieldIeX1.USer;/用户名文本行privateJPasswordFicklICX1.PaSSWOrd;密码文本行privateJButtonbutton_ok.button_canccl:privateJComboBoxtypeBox;J1.abeljlabel;publicbooleanis1.ogin=falsc;推断登录是否胜利public1.ogin()SUPerC用户登录"):this.setSize(240,l50);this.sct1.<ation(550,200);this.sctBackground(Color.lightGray);this.setResizable(false):this.seiDefaultCloseOperation(DISPOSE_ON_C1.OSE);this.gclContcniPanc().sct1.ayout(newFIow1.ayoutO);jlabcl=ncwJ1.abcl("欢迎登陆医院管理信息系统".J1.abc1.CENTER);this.getContentPane().add(jlabel);USer=newJIabeK"用户名:”);UscrsctFonKncwFont("Dialog".0,12);this.gctContcntPanc().add(uscr);text-user=newJTextField(15):IeX1.USer.SetEdiiable(Irue);text_user.setText(""):IeX1.PaMword.setText(""):this.setVisiblc(falsc);publicvoidWindOWQoSing(WindOWEVCntc)publicvoidwindowpened(WindowEvente)publicvoitwindowClosed(WindowEvente)publicvoidWindOWICOnifiCd(WindowEvcnlc)publicvoidwindowDciconificd(WindowEvcntc)publicvoidWindoWACtiVated(WindOWEVente)(publicvoidwindowDeactivated(WindowEvente)(打开窗口关闭窗口后窗口最小化窗口复原激活窗口变为不活动窗口publicstaticvoidmain(StringargsJ)throwsException测试方法new1.ogin();Hosllain类HoSMain类是登录完成后进入的侯院管理信息系统的主界面,该界而显示了整个系统的功能模块.AXtta*AHMVif及2t*lfXKYifMtVifMXAiIeimportjava.awt.*;importjavax.swing.*;publicclass/XpparatusBeanStringsql;ResultSetrs=null:Stringano:Stringaname;Stringaprice;Stringamount;Stringexplain;publicvoidadd(Stringano.Stringaname.Stringaprice.Stringamount.Stringexplain)IDatabaseDB=newDatabaSe();sql="insertintoapparatusvalues('"+ano+,','"+aname+m,'"+aprice+"7"+anount+,","+explain+"')"tyDB.OpenConn();DB.executeUpdate(sql);JoPtiOnPane.showMessageDialog(null,"胜利添加仪薄信息!”);catch(Exceptione)SySten.oU1.PrinUn(e);JoPtionPane.showMessageDialog(null"保存失败"错误",JOPtiOnPane.ERROR_MESSAGE);finallyDB.closeStmt();DB.closeConn():this.ano=ano:this.aname=aname;this.aprice=aprice;this.amount=amount;this.explain=explain:sql="uxlateapparatussetaname=""+aname+'",aprice='"+aprice+'".amount="'+amoun+”',explain=""+explain+"“'tryDB.OenConn();DB.execute1.xlate(sqO;JoPlionPane.showMessageDialog(null,"胜利修改一一仪器信息!”);)catch(Exceptione)JOPIionPane.showMessageDialog(null,”更新失败二"错误",JOPtiOnPane.ERROR_MESSAGE):finallyDB.closeStmt();DB.closeConn();publicString11IsearchI1Apparatusor(Stringano.Stringaname.Stringaprice.Stringamount)this.ano=ano:this.aname=aname;this.aprice三aprice:this.amount=amount;DatabaseDB=newDatabase();amount)(this.ano=ano;this.aname=anane;this.apfice=aprice;this.amount=amount;DatabaseDB=newDatabase。:StringresultJ=null;sql="select*fromapparatuswhereano='"+ano+'"andaname='+anane+'"andaprice-"+aprice+"'andamount=""+amount+-"tryDB.O)enConn():rs=DB.executeQuery(sql);ResultSetMetaDatarsnd=rs.getMeiaData():intcolumns=rsmd.getColumnCount();introws=();while(rs.next()Irows+;if(rows=0)JOptionPane.showMessageDialog(null,"未查询到符合条件的仪器,请重新输入!","错误".JOptionPane.ERROR_MESSAGE);Strings=newStringrowscolumns;rs.beforeFirst();fo(inti=();rs.next();i+)for(intj=kj<=colunnsj+)siQ-l=rs.getString(j);result=s;importjava.awt.*;importjava.awt.event.ctionEvent;importjava.awt.event.ction1.istener;importjavax.swing.*;publicclass/XpparatusaddextendsJFrameimplementsAction1.istenerprivateJBultonbutton-add;privateJButtonbuiton_cancel;privateJButtonhutton-clear;privateJlabelIabe1.ano=newJIabel("仪器代号:");privateJlabeIlabe1.aname=newJ1.abel("仪器名称:");privateJIabeIlabe1.aPriCe=newJ1.abd("仪器价格:");privateJlabeIIabe1.amCUnl=newJ1.abel("储存量:");privateJI<abelIabe1.eXPIain=newJIabe1("备注:");privateJTextFieklext-ano;privateJTextFieIdtexl-anane;privateJTextFieIdtext-arice;privateJTeXlFieIdIeX1.alnOUnI;privateJTextFieIdIeX1.eXPIain;GridBag1.ayoutgridBag=newGridBag1.ayoutO;GridBagConstraintsgridBagCon;gridBagCon=newGridBagConstraintsO;gridBagCon.gridx=2;gridBagCon.gridy=0:gridBagCon.insets=newInsetsf10.15.10.1):gridBag.setConstraints(label-aname.gridBagCon);main.add(label_aname);gridBagCon=newGridBagConstraintsO;gridBagCon.gridx=3;gridBagCon.gridy=O:gridBagCon.inscts=ncwInscts(10J.10JO);tcxt-anamc=ncwJTcxtFicIdd5);gridBag.sctConstraints(tcxt_anamc.gridBagCon):main.add(text_aname);label_aprice.setFont(newFont("Dialog".().14):gridBagCon=newGndBagConstraintsO;gridBagCon.gridx=O:gridBagCon.gridy=1;gridBagCon.insets=newInsetsf10.15.10.1):gridBag.setConstraints(label_aprice.gridBagCon);main.add(label_aprice):gridBagCon=newGridBagConstraintsO;gridBagCon.gridx=1;gridBagCon.gridy=1;gridBagCon.insets=newlnsets(10.1.1().10);text_aprice=newJTextFieIdf15);gridBagCon.insets=newlnsets(10.1.10.10):text-explain=newJTextField(15);gridBag.setConstraints(text_exp!ain.gridBagCon):main.add(text_explain):/%加增加、清空、取消按钮JPaneIdown=newJPanel():buiton_add=newJBUttOnc'增加"):button-add.setFont(newFont("Dialog".0.14);button_add.addAction1.istener(this);buiton_clear=ncvJBution("清空"):button-clcar.sctFont(ncwFont("Dialog二0.14):buiton-clcar.addAction1.istcncr(this);button-canccl=ncwJButton("IRii1"):buiton-cancel.setFont(newFont("Dialog".0.14);button-cancel.addction1.istener(ihis);down.add(button_add):down.add(button-clear);down.add(button_cancel);this.getContentPane().add(down."South");this.setVisible(true);publicvoidactionf*erfbrmed(ctionEvente)if(e.getSource()=button_add)StuftBeanp=newStUffBean();p.add(text_ano.get'rext().text_aname.getText().text_aprice.getText().text_amount.getText0,IeX1.eXPIain.getText();if(e.getSource()=button_clear)text_ano.setText("");importjava.awt.*;importjava.awt.cvcnt.*importjava.sql.*;importjavax.swing.*;importjavax.swing.table.*;publicclassApparatuscheckextendsJFramcimplementsAction1.istcncrPriVatCJ1.abClIabcl=ncwJ1.abcl("设置查询条件:");privateJ1.abCIlabC1.anO=newJ1.abcl("仪SS代号:");privateJ1.abcIlabcl_aname=ncwJ1.abCiC'仪器名称:");privateJ1.abCIlabC1.叩ricc=ncwJ1.abCIe'仪器价格:");privateJ1.abcIlabcl_amount=ncwJ1.abCI("储存量:");privateJTcxtFicIdICX1.ano;privateJTcxtFicIdtcxt_anamc;privateJTextHeIdIeX1.aPrice:privateJTextFieIdtext_an)ount:privateJButtonbutton-searchI.button_search2.button_clear.button_cancel;privateJTabIetable:表格组件privateDefauItTableModelIabIeModel;StringUeolUmnS=”仪潜代号代仪器名称","仪器价格",”仪器数量Y备注"Stringdatas11;GridBag1.ayoutgridBag=newGridBag1.ayoutO;GridBagConstraintsgridBagCon;publicpparatuscheck(Stringdata11)(SUPere仪器信息查询"):this.setSize(8(X).6(X);this,set1.ocation(300,80);Ihis-SetBackground(ColorJightGray);this.setResizable(false);this.sctDcfaultCloscOpcration(DISPOSE_ON_C1.OSE);this.datas=data:JSpIitPancjs=ncwJSPIiIPanC(JSPlitPanC.VERTICA1.-SP1.n'):JPancIup=ncwJPancl();up.sct1.ayout(gridBag);js.add(up);this.gctContcntPanc().add(js);label.sctFont(ncwFont("Dialog-。18);gridBagCon=IicwGridBagConstraintsO;gridBagCon.gridx=0:第O列gridBagCon.gridy=O;第O行gridBagCon.insets=newInsets(10.10,10,1);gridBag.setConstraints(label.gridBagCon);up.add(label):label_ano.setFont(newFont("Dialog".O.I4);gridBagCon=newGiidBagConstraintsO;gridBagCon.gridx=O:gridBagCon.gridy=1;gridBagCon.insets=newInsets(10.10,10,1);gridBag.setConstraints(label_ano.gridBagCon);up.add(label_ano):gridBagCon=newGiidBagConstraintsO:gridBagCon.gridx=1:gridBagCon.gridy=1:gridBagCon.insets=newlnsets(1().1.10.15);tcxt-ano=ncwJTcxtFicld(15):gridBag.sctConstraints(tcxt_ano.gridBagCon);up.add(tcxt_ano);label_anamc.sctFont(newFont("Dialog".0.14);gridBagCon=ncwGiidBagConstraintsO:gridBagCon.gridx=2:gridBagCon.gridy=I;gridBagCon.inscts=newInscts(10.10.10.1);gridBag.sctConstraints(labclaname.gridBagCon);up.add(Iabc1.anamc);gridBagCon=ncwGridBagConstraintsO;gridBagCon.gridx=3:gridBagCon.gridy=1;gidBagCon.insets=newlnsets(10.1.10.15);text_aname=newJextField(15);gridBag.setConstraints(text_anai«e.gridBagCon);up.add(text-anane):label_aprice.setFon(newFoIW("Dialog”,0,14);gridBagCon=newGiidBagConstraintsO:gridBagCon.gridx=O:gridBagCon.gridy=2;gridBagCon.insets=newInsets(1().K).10.1);gridBag.setConstraints(label_aprice.gridBagCon);up.add(label-aprice);gridBagCon=newGridBagConstraintsO:gridBagCon.gridx=I;gridBagCon.gridy=2:gridBagCon.inscts=ncwInscts(10J.10J5);tcxt-apricc=ncwJTcxtFicIdd5);gridBag.sctConstraints(tcxt_apricc.gridBagCon);up.add(tcxt_apricc):labcl_ainount.setFont(newFont("Dialog".0.14);gridBagCon=ncwGridBagConstraintsO;gridBagCon.gridx=2:gridBagCon.gridy=2:gridBagCon.inscts=ncwInscts(10.10.10.1);gridBag.sctConstraints(labe1.amount.gridBagCon);up.add(label_amount);gridBagCon=newGridBagConstraintsO;gridBagCon.gridx=3;gridBagCon.gridy=2;gridBagCon.insets=newlnsets(1().1.1().15);text_amount=newJTextF'ield(15):gridBag.setConstraints(text-anou11.gridBagCon);up.add(text-amount);gridBagCon=newGridBagConstraintsO;gridBagCon.gridx=O:gridBagCon.gridy=4:gridBagCon.gridwidth=2;gridBagCon.insets=newInsetsf10.20.10.15);button-search1=newJBImOnet模糊查HiJ");button_scarch1.sctFont(ncwFont("Dialog",0.14);gridBag.SctConstraints(button_scarch1.gridBagCon);up.add(button-search1);button_search1.addAction1.istcncr(this);gridBagCon=ncwGiidBagConstraintsO:gridBagCon.gridx=2:gridBagCon.gridy=4;gridBagCon.gridwidth=2;gridBagCon.inscts=ncwInscts(10.20.10.15):button_scarch2=ncwJBUtlon("精确查询"):buiton_scarch2.sctFont(ncwFont("Dialog".0.14);gridBag.sctConstraints(button_scarch2.gridBagCon);up.add(button-search2):button-search2.add7ction1.istener(tlis);JSpIitPanesouth=newJSplitPane(JSplitPane.VERTlC/1._SP1.lT);south.setDivider1.ocation(280);列表框tableModel=newDefaul11'ableM<lel(datas.colunns);table=newJTable(IabIeModeI)publicbooleanisCellEditable(introw.intcolumn)Ireturnfalse:)表格不允许被编辑hJScrolIPanescrollPane=newJScrollPane(table);south.add(scrollPane);JPaneIdown=newJPanel();down.set1.ayout(gridBag):buiton_ClCar=newJButtonC清空"):button-clcar.sctFont(ncwFont("Dialog".0.14);down.add(button-clcar);buiton-clcar.addAction1.istcncr(this);buiton_CanCCl=newJButton("取消"):button-canccl.sctFont(newFont("Dialog".0.14);down.add(button-canccl);buiton_CaneC1.addACtiOn1.iStCnCr(Ihis);south.add(down);js.add(south):this.sctVisiblc(truc);)publicvoidactionf*erfbrmed(ctionEvente)/XpparatusBeansearchallp=newApparaiusBeanO;或关系查询if(e.get5iource()=button_search1)|datas=searchallp.searchAI1.Xpparatusand(text_ano.getText().text_anaine.getrext().text_aprice.getext().text-anount.getText();newInvalidchecMdatas);this.setVisible(false):“System.OU1.PrinUn("全部");与关系查询if(e.getSource()=button_search2)|datas=searchallp.searchAI1.Xpparatusand(text_ano.getText().text_anaine.getrext().text_aprice.getext().text-anount.getText();newInvalidchecMdatas);this.setVisible(false):“SystemQUt.println("全部"):if(c.gctSourcc()=button_clcar)清空列表框datas=null:newAPParalUSChCCk(datas):this.sctVisiblc(false):