EMR电子病历管理系统

  • E2_507728
    了解作者
  • 2.2MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-18 08:50
    上传日期
Java web技术开发的电子病历管理系统
EMR源程序.rar
内容介绍
package EMR; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.dom4j.io.OutputFormat; import org.dom4j.io.SAXReader; import org.dom4j.io.XMLWriter; public class DoctorCheck extends HttpServlet { /** * Constructor of the object. */ public DoctorCheck() { super(); } /** * Destruction of the servlet. <br> */ public void destroy() { super.destroy(); // Just puts "destroy" string in log // Put your code here } /** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=gb2312"); PrintWriter out = response.getWriter(); response.setHeader("Cache-Control","no-cache"); response.setHeader("Pragma","no-cache"); request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String ZGH =new String(request.getParameter("ZGH").trim().getBytes("ISO-8859-1"), "GBK"); //String xx1[]; // xx1=xx.split(";"); try { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); } catch(Exception ce) { System.out.println(ce); } try { String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=EMR"; String user = "sa"; String password = "000000"; Connection con = DriverManager.getConnection(url,user,password); Statement sta = con.createStatement(); ResultSet rs=sta.executeQuery("select * from BLB where ZGH='"+ZGH+"'"); String ZSXM=""; String NL=""; String SG=""; String TZ=""; String BRMS=""; String ZDZT=""; String YSZD=""; String YSJY=""; String YZSY=""; String YHM=""; while(rs.next()){ ZSXM+=rs.getString("ZSXM")+";"; NL+=rs.getString("NL")+";"; SG+=rs.getString("SG")+";"; TZ+=rs.getString("TZ")+";"; BRMS+=rs.getString("BRMS")+";"; ZDZT+=rs.getString("ZDZT")+";"; YSZD+=rs.getString("YSZD")+";"; YSJY+=rs.getString("YSJY")+";"; YZSY+=rs.getString("YZSY")+";"; } Statement sta1 = con.createStatement(); String xm[]=ZSXM.split(";"); for(int i=0;i<xm.length;i++) { ResultSet rs1=sta1.executeQuery("select YHM from YHXX where ZSXM='"+xm[i]+"'"); if(rs1.next()){ YHM+=rs1.getString("YHM")+";"; } else{ YHM+=";"; } } String xx=ZSXM+"|"+NL+"|"+SG+"|"+TZ+"|"+BRMS+"|"+ZDZT+"|"+YSZD+"|"+YSJY+"|"+YZSY+"|"+YHM; out.print(xx); rs.close(); sta.close(); con.close(); } catch(Exception ce) { System.out.println(ce); } } /** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=gb2312"); response.setHeader("Cache-Control","no-cache"); response.setHeader("Pragma","no-cache"); PrintWriter out = response.getWriter(); String ZD=new String(request.getParameter("ZD").trim().getBytes("ISO-8859-1"), "GBK"); String ZDXX[]; ZDXX=ZD.split(";"); String da[]=ZDXX[5].split(","); String dat[]=da[0].split("-"); String hour[]=da[1].split(":"); String datee=dat[0]+dat[1]+dat[2]+hour[0]+hour[1]+hour[2]; String d=dat[0]+"年"+dat[1]+"月"+dat[2]+"日"+hour[0]+"时"+hour[1]+"分"+hour[2]+"秒"; try { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); } catch(Exception ce) { System.out.println(ce); } try { String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=EMR"; String user = "sa"; String password = "000000"; Connection con = DriverManager.getConnection(url,user,password); Statement sta4 = con.createStatement(); // 构建插入的sql语句 String sql4="update BLB set YSZD='"+ZDXX[0]+"',YSJY='"+ZDXX[1]+"',YZSY='"+ZDXX[2]+"',ZDSJ='"+ZDXX[5]+"',ZDZT='"+ZDXX[4]+"' where ZSXM='"+ZDXX[3]+"'"; out.print(sta4.executeUpdate(sql4)); Statement sta2 = con.createStatement(); // 构建插入的sql语句 String sql1="select * from BLB WHERE ZSXM='"+ZDXX[3]+"'"; ResultSet rs=sta2.executeQuery(sql1); String BL=""; while(rs.next()) { BL=rs.getString("ZSXM")+";"+rs.getString("NL")+";"+rs.getString("SG")+";"+rs.getString("TZ") +";"+rs.getString("BRMS")+";"+rs.getString("YSSSYY")+";"+rs.getString("YSKS")+";"+ rs.getString("YSXM")+";"+rs.getString("YSZD")+";"+rs.getString("YSJY")+";"+rs.getString("ZDSJ"); } Statement sta=con.createStatement(); String sql="select YHM from YHXX where ZSXM='"+ZDXX[3]+"'"; ResultSet rs1=sta.executeQuery(sql); String YHM=""; while(rs1.next()) { YHM=rs1.getString("YHM"); } Statement stat=con.createStatement(); String YH=d+YHM; String sqlt="insert into BLBXX(TIME,NAME,BLB) values('"+datee+"','"+YHM+"','"+YH+"')"; stat.executeUpdate(sqlt); String bl[]; bl=BL.split(";"); SAXReader reader = new SAXReader(); OutputFormat format = OutputFormat.createPrettyPrint(); format.setEncoding("gbk"); // 指定XML编码 //String xmlpath =new getconfiginfo().getXmlpath(); //System.out.print(xmlpath); XMLWriter writer = new XMLWriter(new FileWriter("F:/Java/EMR/Xml/"+YH+".xml"),format); //创建写入文档 Document document = DocumentHelper.createDocument(); Element root = document.addElement("BLB");// 创建根节点 Element userEle = root.addElement("userinfo"); //用户子节点信息 Element nameEle = userEle.addElement("name"); //名称 nameEle.addAttribute("name", bl[0]); Element ageEle = userEle.addElement("age"); ageEle.addAttribute("age", bl[1]); Element heightEle = userEle.addElement("height"); heightEle.addAttribute("height", bl[2]); Element sizeEle = userEle.addElement("size"); sizeEle.addAttribute("size", bl[3]); Element brmsEle = userEle.addElement("brms"); brmsEle.addAttribute("brms", bl[4]); Element hospitalEle = root.addElement("hospitalinfo");//医院子节点信息 Element yymcEle = hospitalEle.addElement("yymc"); yymcEle.addAttribute("yymc", bl[5]); Element ksmcEle = hospitalEle.addElement("ksmc"); ksmcEle.addAttrib
评论
    相关推荐
    • Java
      Java 对于Java练习
    • java
      Java Java基础
    • Java
      Java 我创建的Java项目
    • JAVA教程
      一本非常不错的清华大学java教程,讲解非常详细,看了就知道。
    • Java Cipher
      Java Cipher 加密和解密工具 附带源码 Java Cipher 加密和解密工具 附带源码 Java Cipher 加密和解密工具 附带源码 Java Cipher 加密和解密工具 附带源码
    • javabank
      Java银行 Java com的模拟操作将在bancárias上发布! 要求:Java 8。
    • java 李兴华
      java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java ...
    • JAVA教程
      详细介绍了JAVA语言程序设计,对JAVA的基础知识运用实例的方式来讲解,使初学者能够非常轻松的掌握。
    • java程序
      java程序-吃点点java程序-吃点点java程序-吃点点java程序-吃点点java程序-吃点点java程序-吃点点
    • Java
      Java 2021/02/19 .java Main.java 学生.java Bmi.java 。班级 Bmi类 主类 MyBmi.class 学生班 学生样本类 2021/02/20 .java DeleteFile.java WriteFile.java MyDataPrint.java 。班级 DeleteFile.class ...