public static string ptxml(string Sslbx, string Ssbz, string debug) { string exp = ""; string errMsg = ""; if (Sslbx != "") { int tkts = f.ReadInteger(Sslbx, "tkts", 1); debug = f.ReadString(Sslbx, "debug", "").Replace("\0", "").Trim(); string odbc = f.ReadString(Sslbx, "odbc", "Provider=MSDAORA;Data Source=ORCL68;User id=chisdb_dev;Password=chisdb_dev;").Replace("\0", "").Trim(); string tqbblb = f.ReadString(Sslbx, "tqbblb", "0"); string ptjk = f.ReadString(Sslbx, "ptjk", "1"); if (Sslbx == "取消登记标记") { dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); int x = aa.ExecuteSQL("update T_SQD set F_SQDZT='取消登记' where F_sqxh='" + Ssbz.Trim() + "'"); if (x > 0) { MessageBox.Show("取消登记成功"); } else { MessageBox.Show("取消登记失败"); } return("0"); } if (Sslbx == "退费") { // string odbc = f.ReadString(Sslbx, "odbc", "Provider=MSDAORA;Data Source=ORCL68;User id=chisdb_dev;Password=chisdb_dev;").Replace("\0", "").Trim(); #region 退费 string yhgh = f.ReadString("yh", "yhbh", "").Replace("\0", "").Trim();; dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); DataTable jcxx = new DataTable(); try { jcxx = aa.GetDataTable("select * from T_JCXX where F_BLH='" + Ssbz + "'", "jcxx"); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); return("0"); } if (jcxx == null) { MessageBox.Show("数据库连接异常"); return("0"); } if (jcxx.Rows.Count <= 0) { MessageBox.Show("取消无效,未查询到对应申请单记录"); return("0"); } string brlbbm = ""; if (jcxx.Rows[0]["F_brlb"].ToString().Trim() == "门诊") { brlbbm = "0"; } if (jcxx.Rows[0]["F_brlb"].ToString().Trim() == "住院") { brlbbm = "1"; } if (brlbbm == "") { MessageBox.Show("非门诊或住院病人,不能退费"); return("0"); } OleDbParameter[] ops = new OleDbParameter[5]; for (int j = 0; j < ops.Length; j++) { ops[j] = new OleDbParameter(); } ops[0].ParameterName = "v_flag_mz_zy"; ops[0].OleDbType = OleDbType.VarChar; ops[0].Direction = ParameterDirection.Input; ops[0].Size = 20; ops[0].Value = brlbbm; ops[1].ParameterName = "v_patient_id"; // ops[1].OleDbType = OleDbType.VarChar; ops[1].Direction = ParameterDirection.Input; ops[1].Size = 20; ops[1].Value = jcxx.Rows[0]["F_BRBH"].ToString(); ops[2].ParameterName = "v_page_no"; // ops[2].OleDbType = OleDbType.VarChar; ops[2].Direction = ParameterDirection.Input; ops[2].Size = 20; ops[2].Value = jcxx.Rows[0]["F_SQXH"].ToString(); ops[3].ParameterName = "v_opera"; // ops[3].OleDbType = OleDbType.VarChar; ops[3].Direction = ParameterDirection.Input; ops[3].Size = 10; ops[3].Value = yhgh; ops[4].ParameterName = "v_RetError"; // ops[4].OleDbType = OleDbType.VarChar; ops[4].Direction = ParameterDirection.Output; ops[4].Size = 200; //回写登记状态 OleDbDB_ZGQ oledb = new OleDbDB_ZGQ(); string message_ee = ""; oledb.OleDb_ExecuteNonQuery(odbc, "langjia_to_charge_bak", ref ops, CommandType.StoredProcedure, ref message_ee); if (message_ee.Trim() != "") { MessageBox.Show("退费标记失败:调HIS存储过程异常--" + message_ee); } else { if (ops[4].Value.ToString() == "2") { MessageBox.Show("退费标记成功"); aa.ExecuteSQL("update t_jcxx set F_hisbj='0' where f_blh='" + Ssbz + "'"); } else { MessageBox.Show("退费标记失败:" + ops[4].Value.ToString()); } } return("0"); #endregion } if (Sslbx == "申请号ID号") { #region string sqlstr = ""; sqlstr = "select * from view_langjia_apply_no WHERE 申请序号='" + Ssbz + "'"; errMsg = ""; OleDbDB_ZGQ db = new OleDbDB_ZGQ(); DataTable dt_his_sqd = db.OleDb_DataAdapter(odbc, sqlstr, ref errMsg); if (dt_his_sqd.Rows.Count <= 0) { sqlstr = "select * from view_langjia_apply_no WHERE HISID='" + Ssbz + "' and rownum<=20"; dt_his_sqd = db.OleDb_DataAdapter(odbc, sqlstr, ref errMsg); if (dt_his_sqd.Rows.Count <= 0) { return(GetBrxx(odbc, Sslbx, Ssbz)); } } int count = 0; if (dt_his_sqd.Rows.Count > tkts) { string xsys = f.ReadString(Sslbx, "xsys", "1"); //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_his_sqd.Columns.Add(dc0); string Columns = f.ReadString(Sslbx, "Columns", "病人类型,申请序号,住院号门诊号,病人姓名,病人性别,病人年龄,临床申请科室名称,临床申请医生姓名,检查部位,临床诊断"); string ColumnsName = f.ReadString(Sslbx, "ColumnsName", "病人类型,申请单号,住院号门诊号,姓名,性别,年龄,送检科室,送检医生,检查部位,临床诊断"); for (int x = 0; x < dt_his_sqd.Rows.Count; x++) { dt_his_sqd.Rows[x][dt_his_sqd.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_his_sqd, Columns, ColumnsName, xsys); yc.ShowDialog(); string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目!"); return(GetBrxx(odbc, Sslbx, Ssbz)); } try { count = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目!"); return(GetBrxx(odbc, Sslbx, Ssbz)); } } try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; string brlx = dt_his_sqd.Rows[count]["病人类型"].ToString().Trim(); if (brlx == "1") { brlx = "门诊"; } if (brlx == "2") { brlx = "住院"; } xml = xml + "病人编号=" + (char)34 + dt_his_sqd.Rows[count]["HISID"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + "" + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_his_sqd.Rows[count]["申请序号"].ToString().Trim() + (char)34 + " "; if (brlx == "2") { xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_his_sqd.Rows[count]["住院号门诊号"].ToString().Trim() + (char)34 + " "; } else { xml = xml + "门诊号=" + (char)34 + dt_his_sqd.Rows[count]["住院号门诊号"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + "" + (char)34 + " "; } xml = xml + "姓名=" + (char)34 + dt_his_sqd.Rows[count]["病人姓名"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_his_sqd.Rows[count]["病人性别"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_his_sqd.Rows[count]["病人年龄"].ToString().Trim() + dt_his_sqd.Rows[count]["病人单位"].ToString().Trim() + (char)34 + " "; xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + dt_his_sqd.Rows[count]["联系地址"].ToString().Trim() + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_his_sqd.Rows[count]["联系电话"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + "" + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_his_sqd.Rows[count]["床号"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_his_sqd.Rows[count]["身份证号"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_his_sqd.Rows[count]["就诊次数"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_his_sqd.Rows[count]["临床申请科室名称"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_his_sqd.Rows[count]["临床申请医生姓名"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_his_sqd.Rows[count]["检查部位"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + (char)34 + " "; xml = xml + "备用2=" + (char)34 + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + brlx + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + dt_his_sqd.Rows[count]["临床症状"].ToString().Trim() + "|回车|" + dt_his_sqd.Rows[count]["病史及体征"].ToString().Trim() + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_his_sqd.Rows[count]["临床诊断"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee1) { MessageBox.Show("提取HIS申请单信息出错,请重新操作\r\n" + ee1.Message); return(GetBrxx(odbc, Sslbx, Ssbz)); } #endregion } if (Sslbx == "住院号" || Sslbx == "门诊号" || Sslbx == "ID号" || Sslbx == "申请单号") { #region string sqlstr = ""; if (ptjk == "1") { dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); if (Sslbx == "住院号") { sqlstr = "select * from T_SQD where F_ZYH='" + Ssbz.Trim() + "' and F_sqdzt!='已登记'"; } if (Sslbx == "门诊号") { sqlstr = "select * from T_SQD where F_MZH='" + Ssbz.Trim() + "' and F_sqdzt!='已登记'"; } if (Sslbx == "ID号") { sqlstr = "select * from T_SQD where F_BRBH='" + Ssbz.Trim() + "' and F_sqdzt!='已登记'"; } if (Sslbx == "申请单号") { sqlstr = "select * from T_SQD where F_sqxh='JC" + Ssbz.Trim() + "' and F_sqdzt!='已登记'"; } if (sqlstr == "") { MessageBox.Show("错误的查询语句"); return("0"); } DataTable dt_sqd = aa.GetDataTable(sqlstr, "dt_sqd"); if (dt_sqd.Rows.Count > 0) { int count = 0; if (dt_sqd.Rows.Count > tkts) { string xsys = f.ReadString(Sslbx, "xsys", "1"); //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_sqd.Columns.Add(dc0); string Columns = f.ReadString(Sslbx, "Columns", "F_brbh,F_SQXH,F_BRLB,F_XM,F_XB,F_NL,F_SQKS,F_SQYS,F_YZXM,F_BBMC"); string ColumnsName = f.ReadString(Sslbx, "ColumnsName", "ID号,申请单号,病人类别,姓名,性别,年龄,送检科室,送检医生,医嘱项目,标本名称"); for (int x = 0; x < dt_sqd.Rows.Count; x++) { dt_sqd.Rows[x][dt_sqd.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_sqd, Columns, ColumnsName, xsys); yc.ShowDialog(); string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目!"); return("0"); } try { count = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目!"); return("0"); } } try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqd.Rows[count]["F_brbh"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqd.Rows[count]["F_JZLSH"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqd.Rows[count]["F_SQXH"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqd.Rows[count]["F_MZH"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqd.Rows[count]["F_ZYH"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqd.Rows[count]["F_XM"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_sqd.Rows[count]["F_XB"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqd.Rows[count]["F_NL"].ToString().Trim() + (char)34 + " "; xml = xml + "婚姻=" + (char)34 + dt_sqd.Rows[count]["F_HY"].ToString().Trim() + (char)34 + " "; xml = xml + "地址=" + (char)34 + dt_sqd.Rows[count]["F_DZ"].ToString().Trim() + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqd.Rows[count]["F_DH"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqd.Rows[count]["F_BQ"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqd.Rows[count]["F_CH"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqd.Rows[count]["F_SFZH"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqd.Rows[count]["F_JZCS"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + dt_sqd.Rows[count]["F_CSRQ"].ToString().Trim() + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqd.Rows[count]["F_SQKS"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqd.Rows[count]["F_SQYS"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqd.Rows[count]["F_BBMC"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqd.Rows[count]["F_YZXM"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + (char)34 + " "; xml = xml + "备用2=" + (char)34 + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqd.Rows[count]["F_BRLB"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + dt_sqd.Rows[count]["F_LCBS"].ToString().Trim() + "|回车|" + dt_sqd.Rows[count]["F_LCZL"].ToString().Trim() + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqd.Rows[count]["F_LCZD"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee1) { MessageBox.Show("提取申请表信息出错,请重新操作\r\n" + ee1.Message); } } } if (Sslbx == "住院号") { sqlstr = "select * from view_langjia_apply_no WHERE 住院号门诊号='" + Ssbz + "' and 病人类型='2' and rownum<20"; } if (Sslbx == "门诊号") { sqlstr = "select * from view_langjia_apply_no WHERE 住院号门诊号='" + Ssbz + "' and 病人类型='1' and rownum<20"; } if (Sslbx == "ID号") { sqlstr = "select * from view_langjia_apply_no WHERE HISID='" + Ssbz + "' and rownum<50"; } if (Sslbx == "申请单号") { sqlstr = "select * from view_langjia_apply_no WHERE 申请序号='" + Ssbz + "'"; } if (sqlstr == "") { MessageBox.Show("错误的查询语句2"); return("0"); } errMsg = ""; OleDbDB_ZGQ db = new OleDbDB_ZGQ(); DataTable dt_his_sqd = db.OleDb_DataAdapter(odbc, sqlstr, ref errMsg); if (dt_his_sqd.Rows.Count > 0) { int count = 0; if (dt_his_sqd.Rows.Count > tkts) { string xsys = f.ReadString(Sslbx, "xsys", "1"); //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_his_sqd.Columns.Add(dc0); string Columns = f.ReadString(Sslbx, "Columns", "病人类型,申请序号,住院号门诊号,病人姓名,病人性别,病人年龄,临床申请科室名称,临床申请医生姓名,检查部位,临床诊断"); string ColumnsName = f.ReadString(Sslbx, "ColumnsName", "病人类型,申请单号,住院号门诊号,姓名,性别,年龄,送检科室,送检医生,检查部位,临床诊断"); for (int x = 0; x < dt_his_sqd.Rows.Count; x++) { dt_his_sqd.Rows[x][dt_his_sqd.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_his_sqd, Columns, ColumnsName, xsys); yc.ShowDialog(); string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目!"); return(GetBrxx(odbc, Sslbx, Ssbz)); } try { count = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目!"); return(GetBrxx(odbc, Sslbx, Ssbz)); } } try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; string brlx = dt_his_sqd.Rows[count]["病人类型"].ToString().Trim(); if (brlx == "1") { brlx = "门诊"; } if (brlx == "2") { brlx = "住院"; } xml = xml + "病人编号=" + (char)34 + dt_his_sqd.Rows[count]["HISID"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + "" + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_his_sqd.Rows[count]["申请序号"].ToString().Trim() + (char)34 + " "; if (brlx == "2") { xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_his_sqd.Rows[count]["住院号门诊号"].ToString().Trim() + (char)34 + " "; } else { xml = xml + "门诊号=" + (char)34 + dt_his_sqd.Rows[count]["住院号门诊号"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + "" + (char)34 + " "; } xml = xml + "姓名=" + (char)34 + dt_his_sqd.Rows[count]["病人姓名"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_his_sqd.Rows[count]["病人性别"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_his_sqd.Rows[count]["病人年龄"].ToString().Trim() + dt_his_sqd.Rows[count]["病人单位"].ToString().Trim() + (char)34 + " "; xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + dt_his_sqd.Rows[count]["联系地址"].ToString().Trim() + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_his_sqd.Rows[count]["联系电话"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + "" + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_his_sqd.Rows[count]["床号"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_his_sqd.Rows[count]["身份证号"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_his_sqd.Rows[count]["就诊次数"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_his_sqd.Rows[count]["临床申请科室名称"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_his_sqd.Rows[count]["临床申请医生姓名"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_his_sqd.Rows[count]["检查部位"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + (char)34 + " "; xml = xml + "备用2=" + (char)34 + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + brlx + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + dt_his_sqd.Rows[count]["临床症状"].ToString().Trim() + "|回车|" + dt_his_sqd.Rows[count]["病史及体征"].ToString().Trim() + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_his_sqd.Rows[count]["临床诊断"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee1) { MessageBox.Show("提取HIS申请单信息出错,请重新操作\r\n" + ee1.Message); return(GetBrxx(odbc, Sslbx, Ssbz)); } } else { return(GetBrxx(odbc, Sslbx, Ssbz)); } #endregion } else { MessageBox.Show(Sslbx + "类型未设置!"); return("0"); } } else { MessageBox.Show(""); } return("0"); }
public static string ptxml(string Sslbx, string Ssbz, string Debug) { // string pathWEB = f.ReadString(Sslbx, "webservicesurl", ""); //获取sz.ini中设置的webservicesurl string djr = f.ReadString("yh", "yhmc", "").Replace("\0", "").Trim(); string tqbblb = f.ReadString(Sslbx, "tqbblb", "0"); if (Sslbx != "") { if (Sslbx == "条码号") { #region 条码号 string sqdh = ""; dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); DataTable dt_bbxx = new DataTable(); dt_bbxx = aa.GetDataTable("select * from T_sqd_bbxx where F_TMH='" + Ssbz.Trim() + "'", "bbtmh"); if (dt_bbxx.Rows.Count <= 0) { MessageBox.Show("无此标本条码信息"); return("0"); } sqdh = dt_bbxx.Rows[0]["F_SQXH"].ToString().Trim(); DataTable dt_sqdxx = new DataTable(); dt_sqdxx = aa.GetDataTable("select * from T_sqd where F_sqxh='" + sqdh + "' ", "sqdxx"); if (dt_sqdxx.Rows.Count <= 0) { MessageBox.Show("无此标本条码对应申请单信息"); return("0"); } DataTable dt_yzxx = new DataTable(); dt_yzxx = aa.GetDataTable("select * from T_sqd_yzxx where F_sqxh='" + sqdh + "'", "yzxx"); DataTable dt_bbxx2 = new DataTable(); dt_bbxx2 = aa.GetDataTable("select * from T_sqd_bbxx where F_sqxh='" + sqdh + "'", "bbxx"); if (dt_bbxx2.Rows.Count > 1) { if (tqbblb == "1") { bool yzbbxx = true; Frm_CDRMYY cd = new Frm_CDRMYY(sqdh, dt_yzxx, dt_bbxx2, dt_sqdxx, Ssbz.Trim(), yzbbxx); cd.ShowDialog(); if (cd.DialogResult == DialogResult.Yes) { } else { if (yzbbxx) { MessageBox.Show("标本袋数量不正确,不能提取信息!"); return("0"); } } } } DataTable dt = new DataTable(); //-返回xml---------------------------------------------------- try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqdxx.Rows[0]["F_BRBH"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqdxx.Rows[0]["F_jzcs"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqdxx.Rows[0]["F_SQXH"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqdxx.Rows[0]["F_MZH"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqdxx.Rows[0]["F_ZYH"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqdxx.Rows[0]["F_XM"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_sqdxx.Rows[0]["F_XB"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqdxx.Rows[0]["F_NL"].ToString().Trim() + (char)34 + " "; string MARRIED = dt_sqdxx.Rows[0]["F_HY"].ToString().Trim(); switch (MARRIED) { case "1": MARRIED = "未婚"; break; case "2": MARRIED = "已婚"; break; default: MARRIED = ""; break; } xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + "" + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqdxx.Rows[0]["F_DH"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqdxx.Rows[0]["F_BQ"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqdxx.Rows[0]["F_CH"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqdxx.Rows[0]["F_SFZH"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqdxx.Rows[0]["F_MZ"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqdxx.Rows[0]["F_SQKS"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqdxx.Rows[0]["F_SQYS"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqdxx.Rows[0]["F_BBMC"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqdxx.Rows[0]["F_YZXMBM"].ToString().Trim() + "^" + dt_sqdxx.Rows[0]["F_YZXMMC"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用2=" + (char)34 + "" + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqdxx.Rows[0]["F_BRLB"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqdxx.Rows[0]["F_LCZD"].ToString().Trim() + "]]></临床诊断>"; if (tqbblb == "1") { string BBLB_XML = "<BBLB>"; try { for (int x = 0; x < dt_bbxx2.Rows.Count; x++) { try { BBLB_XML = BBLB_XML + "<row "; BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + (x + 1).ToString() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + dt_bbxx2.Rows[x]["F_TMH"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_bbxx2.Rows[x]["F_BBMC"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_bbxx2.Rows[x]["F_CQBW"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_bbxx2.Rows[x]["F_LTSJ"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_bbxx2.Rows[x]["F_GDSJ"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_JSSJ=" + (char)34 + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + (char)34 + " "; BBLB_XML = BBLB_XML + "F_JSY=" + (char)34 + djr + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BBZT=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BBPJ=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "F_PJR=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "F_PJSJ=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "/>"; } catch (Exception eee) { MessageBox.Show("获取标本列表信息异常:" + eee.Message); tqbblb = "0"; break; } } } catch (Exception e3) { MessageBox.Show("获取标本名称异常:" + e3.Message); tqbblb = "0"; } BBLB_XML = BBLB_XML + "</BBLB>"; if (tqbblb == "1") { xml = xml + BBLB_XML; } } xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return("0"); } #endregion } if (Sslbx == "申请单号") { #region 申请单号 string sqdh = Ssbz.Trim(); dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); DataTable dt_sqdxx = new DataTable(); dt_sqdxx = aa.GetDataTable("select * from T_sqd where F_sqxh='" + sqdh + "' and (F_djzt='' or f_djzt is null) ", "sqdxx"); if (dt_sqdxx.Rows.Count <= 0) { MessageBox.Show("无此对应申请单记录(" + sqdh + ")"); return("0"); } DataTable dt_bbxx2 = new DataTable(); dt_bbxx2 = aa.GetDataTable("select * from T_sqd_bbxx where F_sqxh='" + sqdh + "'", "bbxx"); //if (dt_bbxx2.Rows.Count <= 0) //{ // MessageBox.Show("无此标本条码信息"); return "0"; //} //if (dt_bbxx2.Rows.Count > 1) //{ // if (tqbblb == "1") // { // DataTable dt_yzxx = new DataTable(); // dt_yzxx = aa.GetDataTable("select * from T_sqd_yzxx where F_sqxh='" + sqdh + "'", "yzxx"); // bool yzbbxx = false; // Frm_CDRMYY cd = new Frm_CDRMYY(sqdh, dt_yzxx, dt_bbxx2, dt_sqdxx, Ssbz.Trim(), yzbbxx); // cd.ShowDialog(); // if (cd.DialogResult == DialogResult.Yes) // { // } // else // { // if (yzbbxx) // { // MessageBox.Show("标本带数量不正确,不能提取信息!"); // return "0"; // } // } // } //} //-返回xml---------------------------------------------------- try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqdxx.Rows[0]["F_BRBH"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqdxx.Rows[0]["F_jzcs"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqdxx.Rows[0]["F_SQXH"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqdxx.Rows[0]["F_MZH"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqdxx.Rows[0]["F_ZYH"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqdxx.Rows[0]["F_XM"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_sqdxx.Rows[0]["F_XB"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqdxx.Rows[0]["F_NL"].ToString().Trim() + (char)34 + " "; string MARRIED = dt_sqdxx.Rows[0]["F_HY"].ToString().Trim(); switch (MARRIED) { case "1": MARRIED = "未婚"; break; case "2": MARRIED = "已婚"; break; default: MARRIED = ""; break; } xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + "" + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqdxx.Rows[0]["F_DH"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqdxx.Rows[0]["F_BQ"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqdxx.Rows[0]["F_CH"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqdxx.Rows[0]["F_SFZH"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqdxx.Rows[0]["F_MZ"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqdxx.Rows[0]["F_SQKS"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqdxx.Rows[0]["F_SQYS"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqdxx.Rows[0]["F_BBMC"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqdxx.Rows[0]["F_YZXMBM"].ToString().Trim() + "^" + dt_sqdxx.Rows[0]["F_YZXMMC"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用2=" + (char)34 + "" + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqdxx.Rows[0]["F_BRLB"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqdxx.Rows[0]["F_LCZD"].ToString().Trim() + "]]></临床诊断>"; if (tqbblb == "1") { string BBLB_XML = "<BBLB>"; try { for (int x = 0; x < dt_bbxx2.Rows.Count; x++) { try { BBLB_XML = BBLB_XML + "<row "; BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + (x + 1).ToString() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + dt_bbxx2.Rows[x]["F_TMH"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_bbxx2.Rows[x]["F_BBMC"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_bbxx2.Rows[x]["F_CQBW"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_bbxx2.Rows[x]["F_LTSJ"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_bbxx2.Rows[x]["F_GDSJ"].ToString().Trim() + (char)34 + " "; BBLB_XML = BBLB_XML + "F_JSSJ=" + (char)34 + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + (char)34 + " "; BBLB_XML = BBLB_XML + "F_JSY=" + (char)34 + djr + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BBZT=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "F_BBPJ=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "F_PJR=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "F_PJSJ=" + (char)34 + "" + (char)34 + " "; BBLB_XML = BBLB_XML + "/>"; } catch (Exception eee) { MessageBox.Show("获取标本列表信息异常:" + eee.Message); tqbblb = "0"; break; } } } catch (Exception e3) { MessageBox.Show("获取标本名称异常:" + e3.Message); tqbblb = "0"; } BBLB_XML = BBLB_XML + "</BBLB>"; if (tqbblb == "1") { xml = xml + BBLB_XML; } } xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return("0"); } #endregion } if (Sslbx == "就诊号") { #region 就诊号 int xh = 0; dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); DataTable dt_sqdxx = new DataTable(); dt_sqdxx = aa.GetDataTable("select * from T_sqd where f_jzh='" + Ssbz.Trim() + "' and (F_djzt='' or f_djzt is null) ", "sqdxx"); if (dt_sqdxx.Rows.Count <= 0) { MessageBox.Show("无此对应申请单记录(" + Ssbz.Trim() + ")"); return("0"); } if (dt_sqdxx.Rows.Count > 1) { string Columns = "F_SQXH,f_brlb,F_XM,F_XB,F_NL,F_zyh,F_BQ,F_CH,F_SQKS,F_SQYS,F_SQRQ,F_YZXMMC"; //显示的项目对应字段 string ColumnsName = "申请单号,病人类别,姓名,性别,年龄,住院号,病区,床号,送检科室,送检医生,申请日期,项目名称"; //显示的项目名称 string xsys = "1"; //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_sqdxx.Columns.Add(dc0); for (int x = 0; x < dt_sqdxx.Rows.Count; x++) { dt_sqdxx.Rows[x][dt_sqdxx.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_sqdxx, Columns, ColumnsName, xsys); yc.ShowDialog(); if (yc.DialogResult == DialogResult.Yes) { string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目!"); return("0"); } try { xh = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目!"); return("0"); } } else { MessageBox.Show("请重新选择申请项目!"); return("0"); } } //-返回xml---------------------------------------------------- try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqdxx.Rows[xh]["F_BRBH"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqdxx.Rows[xh]["F_jzcs"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQXH"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqdxx.Rows[xh]["F_MZH"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqdxx.Rows[xh]["F_ZYH"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqdxx.Rows[xh]["F_XM"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_sqdxx.Rows[xh]["F_XB"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqdxx.Rows[xh]["F_NL"].ToString().Trim() + (char)34 + " "; string MARRIED = dt_sqdxx.Rows[xh]["F_HY"].ToString().Trim(); switch (MARRIED) { case "1": MARRIED = "未婚"; break; case "2": MARRIED = "已婚"; break; default: MARRIED = ""; break; } xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + "" + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqdxx.Rows[xh]["F_DH"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqdxx.Rows[xh]["F_BQ"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqdxx.Rows[xh]["F_CH"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqdxx.Rows[xh]["F_SFZH"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqdxx.Rows[xh]["F_MZ"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQKS"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQYS"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqdxx.Rows[xh]["F_BBMC"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqdxx.Rows[xh]["F_YZXMBM"].ToString().Trim() + "^" + dt_sqdxx.Rows[xh]["F_YZXMMC"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用2=" + (char)34 + "" + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqdxx.Rows[xh]["F_BRLB"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqdxx.Rows[xh]["F_LCZD"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return("0"); } #endregion } if (Sslbx == "住院号(新)" || Sslbx == "住院号新" || Sslbx == "住院号" || Sslbx == "新住院号") { #region 住院号 int xh = 0; dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); DataTable dt_sqdxx = new DataTable(); dt_sqdxx = aa.GetDataTable("select * from T_sqd where F_zyh='" + Ssbz.Trim() + "' and (F_djzt='' or f_djzt is null) ", "sqdxx"); if (dt_sqdxx.Rows.Count <= 0) { MessageBox.Show("无此对应申请单记录(" + Ssbz.Trim() + ")"); return("0"); } if (dt_sqdxx.Rows.Count > 1) { string Columns = "F_SQXH,f_brlb,F_XM,F_XB,F_NL,F_zyh,F_BQ,F_CH,F_SQKS,F_SQYS,F_SQRQ,F_YZXMMC"; //显示的项目对应字段 string ColumnsName = "申请单号,病人类别,姓名,性别,年龄,住院号,病区,床号,送检科室,送检医生,申请日期,项目名称"; //显示的项目名称 string xsys = "1"; //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_sqdxx.Columns.Add(dc0); for (int x = 0; x < dt_sqdxx.Rows.Count; x++) { dt_sqdxx.Rows[x][dt_sqdxx.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_sqdxx, Columns, ColumnsName, xsys); yc.ShowDialog(); if (yc.DialogResult == DialogResult.Yes) { string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目!"); return("0"); } try { xh = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目!"); return("0"); } } else { MessageBox.Show("请重新选择申请项目!"); return("0"); } } //-返回xml---------------------------------------------------- try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqdxx.Rows[xh]["F_BRBH"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqdxx.Rows[xh]["F_jzcs"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQXH"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqdxx.Rows[xh]["F_MZH"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqdxx.Rows[xh]["F_ZYH"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqdxx.Rows[xh]["F_XM"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_sqdxx.Rows[xh]["F_XB"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqdxx.Rows[xh]["F_NL"].ToString().Trim() + (char)34 + " "; string MARRIED = dt_sqdxx.Rows[xh]["F_HY"].ToString().Trim(); switch (MARRIED) { case "1": MARRIED = "未婚"; break; case "2": MARRIED = "已婚"; break; default: MARRIED = ""; break; } xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + "" + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqdxx.Rows[xh]["F_DH"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqdxx.Rows[xh]["F_BQ"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqdxx.Rows[xh]["F_CH"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqdxx.Rows[xh]["F_SFZH"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqdxx.Rows[xh]["F_MZ"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQKS"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQYS"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqdxx.Rows[xh]["F_BBMC"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqdxx.Rows[xh]["F_YZXMBM"].ToString().Trim() + "^" + dt_sqdxx.Rows[xh]["F_YZXMMC"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用2=" + (char)34 + "" + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqdxx.Rows[xh]["F_BRLB"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqdxx.Rows[xh]["F_LCZD"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return("0"); } #endregion } if (Sslbx == "卡号" || Sslbx == "门诊号") { #region 卡号 int xh = 0; dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); DataTable dt_sqdxx = new DataTable(); dt_sqdxx = aa.GetDataTable("select * from T_sqd where F_mzh='" + Ssbz.Trim() + "' and (F_djzt='' or f_djzt is null) ", "sqdxx"); if (dt_sqdxx.Rows.Count <= 0) { MessageBox.Show("无此对应申请单记录(" + Ssbz.Trim() + ")"); return("0"); } if (dt_sqdxx.Rows.Count > 1) { string Columns = "F_SQXH,f_brlb,F_XM,F_XB,F_NL,F_MZH,F_SQKS,F_SQYS,F_SQRQ,F_YZXMMC"; //显示的项目对应字段 string ColumnsName = "申请单号,病人类别,姓名,性别,年龄,门诊号,送检科室,送检医生,申请日期,项目名称"; //显示的项目名称 string xsys = "1"; //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_sqdxx.Columns.Add(dc0); for (int x = 0; x < dt_sqdxx.Rows.Count; x++) { dt_sqdxx.Rows[x][dt_sqdxx.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_sqdxx, Columns, ColumnsName, xsys); yc.ShowDialog(); if (yc.DialogResult == DialogResult.Yes) { string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目!"); return("0"); } try { xh = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目!"); return("0"); } } else { MessageBox.Show("请重新选择申请项目!"); return("0"); } } //-返回xml---------------------------------------------------- try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqdxx.Rows[xh]["F_BRBH"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqdxx.Rows[xh]["F_jzcs"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQXH"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqdxx.Rows[xh]["F_MZH"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqdxx.Rows[xh]["F_ZYH"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqdxx.Rows[xh]["F_XM"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_sqdxx.Rows[xh]["F_XB"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqdxx.Rows[xh]["F_NL"].ToString().Trim() + (char)34 + " "; string MARRIED = dt_sqdxx.Rows[xh]["F_HY"].ToString().Trim(); switch (MARRIED) { case "1": MARRIED = "未婚"; break; case "2": MARRIED = "已婚"; break; default: MARRIED = ""; break; } xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + "" + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqdxx.Rows[xh]["F_DH"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqdxx.Rows[xh]["F_BQ"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqdxx.Rows[xh]["F_CH"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqdxx.Rows[xh]["F_SFZH"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqdxx.Rows[xh]["F_MZ"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQKS"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQYS"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqdxx.Rows[xh]["F_BBMC"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqdxx.Rows[xh]["F_YZXMBM"].ToString().Trim() + "^" + dt_sqdxx.Rows[xh]["F_YZXMMC"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用2=" + (char)34 + "" + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqdxx.Rows[xh]["F_BRLB"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqdxx.Rows[xh]["F_LCZD"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return("0"); } #endregion } if (Sslbx == "ID号" || Sslbx == "门诊ID号") { #region ID号 int xh = 0; dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); DataTable dt_sqdxx = new DataTable(); dt_sqdxx = aa.GetDataTable("select * from T_sqd where F_brbh='000" + Ssbz.Trim() + "00' and (F_djzt='' or f_djzt is null) ", "sqdxx"); if (dt_sqdxx.Rows.Count <= 0) { MessageBox.Show("无此对应申请单记录(" + Ssbz.Trim() + ")"); return("0"); } if (dt_sqdxx.Rows.Count > 1) { string Columns = "F_SQXH,f_brlb,F_XM,F_XB,F_NL,F_MZH,F_SQKS,F_SQYS,F_SQRQ,F_YZXMMC"; //显示的项目对应字段 string ColumnsName = "申请单号,病人类别,姓名,性别,年龄,门诊号,送检科室,送检医生,申请日期,项目名称"; //显示的项目名称 string xsys = "1"; //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_sqdxx.Columns.Add(dc0); for (int x = 0; x < dt_sqdxx.Rows.Count; x++) { dt_sqdxx.Rows[x][dt_sqdxx.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_sqdxx, Columns, ColumnsName, xsys); yc.ShowDialog(); if (yc.DialogResult == DialogResult.Yes) { string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目!"); return("0"); } try { xh = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目!"); return("0"); } } else { MessageBox.Show("请重新选择申请项目!"); return("0"); } } //-返回xml---------------------------------------------------- try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqdxx.Rows[xh]["F_BRBH"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqdxx.Rows[xh]["F_jzcs"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQXH"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqdxx.Rows[xh]["F_MZH"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqdxx.Rows[xh]["F_ZYH"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqdxx.Rows[xh]["F_XM"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + dt_sqdxx.Rows[xh]["F_XB"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqdxx.Rows[xh]["F_NL"].ToString().Trim() + (char)34 + " "; string MARRIED = dt_sqdxx.Rows[xh]["F_HY"].ToString().Trim(); switch (MARRIED) { case "1": MARRIED = "未婚"; break; case "2": MARRIED = "已婚"; break; default: MARRIED = ""; break; } xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + "" + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqdxx.Rows[xh]["F_DH"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqdxx.Rows[xh]["F_BQ"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqdxx.Rows[xh]["F_CH"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqdxx.Rows[xh]["F_SFZH"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqdxx.Rows[xh]["F_MZ"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQKS"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqdxx.Rows[xh]["F_SQYS"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqdxx.Rows[xh]["F_BBMC"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqdxx.Rows[xh]["F_YZXMBM"].ToString().Trim() + "^" + dt_sqdxx.Rows[xh]["F_YZXMMC"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用2=" + (char)34 + "" + (char)34 + " "; xml = xml + "费别=" + (char)34 + "" + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqdxx.Rows[xh]["F_BRLB"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqdxx.Rows[xh]["F_LCZD"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return("0"); } #endregion } else { MessageBox.Show("无此" + Sslbx); return("0"); } } else { MessageBox.Show("无此" + Sslbx); if (Debug == "1") { log.WriteMyLog(Sslbx + Ssbz + "不存在!"); } return("0"); } }
//HIS 申请单视图 private static string GetSQD(string Sslbx, string Ssbz, string debug) { string msg = f.ReadString(Sslbx, "msg", ""); DataTable dt_sqd = new DataTable(); if (Sslbx == "门诊号" || Sslbx == "住院号" || Sslbx == "门诊ID号" || Sslbx == "住院ID号" || Sslbx == "ID号" || Sslbx == "申请单号" || Sslbx == "单据号") { string sql = ""; if (Sslbx == "门诊号") { sql = " and MZH= 'f_sbh' order by sqsj desc"; } if (Sslbx == "住院号") { sql = " and zyh1= 'f_sbh' order by sqsj desc"; } if (Sslbx == "门诊ID号" || Sslbx == "住院ID号" || Sslbx == "ID号") { sql = " and brid= 'f_sbh' order by sqsj desc"; } if (Sslbx == "申请单号" || Sslbx == "单据号") { sql = " and djh= 'f_sbh' order by sqsj desc"; } string hissql = f.ReadString(Sslbx, "blsql", sql); if (hissql != "") { sql = hissql; } if (sql.Trim() == "") { return("0"); } sql = "select * from pathnet.v_pathology_information_all where 1=1 " + sql + " order by sqsj desc "; ZgqClassPub.DBData.OleDbDB db = new ZgqClassPub.DBData.OleDbDB(); string Columns = f.ReadString(Sslbx, "Columns", "SQSJ,DJH,ZYH,MZH,XM,XB,NL,YZXM,SQKS,SQYS,BQ,CH"); string ColumnsName = f.ReadString(Sslbx, "ColumnsName", "申请日期,单据号,住院号,门诊号,姓名,性别,年龄,医嘱项目,送检科室,送检医生,病区,床号"); string odbcsql = f.ReadString(Sslbx, "odbcsql", "Provider=MSDAORA;Data Source=ZLYY;User id=pathnet;Password=4s3c2a1p;"); string errmsg = ""; dt_sqd = db.DataAdapter(odbcsql, sql, ref errmsg); if (dt_sqd.Rows.Count == 0) { if (msg == "1") { MessageBox.Show("未查询到申请单信息" + errmsg); } return("0"); } int tkts = f.ReadInteger(Sslbx, "tkts", 1); int count = 0; if (dt_sqd.Rows.Count > tkts) { string xsys = f.ReadString(Sslbx, "xsys", "1"); //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_sqd.Columns.Add(dc0); for (int x = 0; x < dt_sqd.Rows.Count; x++) { dt_sqd.Rows[x][dt_sqd.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_sqd, Columns, ColumnsName, xsys); if (yc.ShowDialog() == DialogResult.Yes) { string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目"); return("0"); } try { count = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目"); return("0"); } } else { MessageBox.Show("未选择申请项目"); return("0"); } } try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqd.Rows[count]["BRID"].ToString() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqd.Rows[count]["ZYH"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqd.Rows[count]["DJH"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqd.Rows[count]["MZH"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqd.Rows[count]["ZYH1"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqd.Rows[count]["XM"].ToString().Trim() + (char)34 + " "; string xb = dt_sqd.Rows[count]["XB"].ToString().Trim(); if (xb == "F" || xb == "f") { xb = "女"; } if (xb == "M" || xb == "m") { xb = "男"; } xml = xml + "性别=" + (char)34 + xb + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqd.Rows[count]["NL"].ToString().Trim() + (char)34 + " "; xml = xml + "婚姻=" + (char)34 + dt_sqd.Rows[count]["YH"].ToString().Trim() + (char)34 + " "; xml = xml + "地址=" + (char)34 + dt_sqd.Rows[count]["DZ"].ToString().Trim() + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqd.Rows[count]["DH"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqd.Rows[count]["BQ"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqd.Rows[count]["CH"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqd.Rows[count]["SFZH"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqd.Rows[count]["MZ"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqd.Rows[count]["SQKS"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqd.Rows[count]["SQYS"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqd.Rows[count]["BBMC"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqd.Rows[count]["YZXM"].ToString().Trim() + "^" + dt_sqd.Rows[count]["XMDM"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用2=" + (char)34 + "" + (char)34 + " "; xml = xml + "费别=" + (char)34 + dt_sqd.Rows[count]["FZ"].ToString().Trim() + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqd.Rows[count]["BRLB"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + dt_sqd.Rows[count]["SZYJ"].ToString().Trim() + "<回车>" + dt_sqd.Rows[count]["BSZY"].ToString().Trim() + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqd.Rows[count]["LCZD"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; if (debug == "1") { log.WriteMyLog(xml); } return(xml); } catch (Exception e) { MessageBox.Show("获取申请单信息异常:" + e.Message); return("0"); } } else { return("0"); } }
//T_SQD private static string GetSQD111(string Sslbx, string Ssbz, string debug) { string msg = f.ReadString(Sslbx, "msg", ""); dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", ""); DataTable dt_sqd = new DataTable(); if (Sslbx == "门诊号" || Sslbx == "住院号" || Sslbx == "门诊ID号" || Sslbx == "住院ID号" || Sslbx == "门诊申请号" || Sslbx == "住院申请号" || Sslbx == "申请单号" || Sslbx == "ID号") { string sql = ""; if (Sslbx == "门诊号") { sql = "select F_brbh as 病人编号,F_brlb as 病人类别,F_FB as 费别,F_ZYH as 住院号,F_MZH as 门诊号,F_XM as 姓名,F_XB as 性别,F_NL as 年龄,F_HY as 婚姻,F_DZ as 地址,F_DH as 电话,F_BQ AS 病区,F_CH as 床号,F_SFZH as 身份证号,F_MZ as 民族,F_ZY as 职业,F_SJKS as 送检科室,F_SJYS AS 送检医生,F_LCZD as 临床诊断,F_LCBS as 临床病史,F_SF as 收费,F_YZID as 就诊ID,F_SQXH as 申请序号,F_BBMC as 标本名称,'本院' AS 送检医院,F_YZXM as 医嘱项目,F_BY1 as 备用1,F_BY2 as 备用2,F_JSRQ as 日期 from [pathnet].[dbo].[T_SQD] WHERE F_MZH= 'f_sbh' and F_sqdzt!='已登记' and F_JSRQ>dateadd(day,-30,GETDATE()) order by F_ID desc"; } if (Sslbx == "住院号") { sql = "select F_brbh as 病人编号,F_brlb as 病人类别,F_FB as 费别,F_ZYH as 住院号,F_MZH as 门诊号,F_XM as 姓名,F_XB as 性别,F_NL as 年龄,F_HY as 婚姻,F_DZ as 地址,F_DH as 电话,F_BQ AS 病区,F_CH as 床号,F_SFZH as 身份证号,F_MZ as 民族,F_ZY as 职业,F_SJKS as 送检科室,F_SJYS AS 送检医生,F_LCZD as 临床诊断,F_LCBS as 临床病史,F_SF as 收费,F_YZID as 就诊ID,F_SQXH as 申请序号,F_BBMC as 标本名称,'本院' AS 送检医院,F_YZXM as 医嘱项目,F_BY1 as 备用1,F_BY2 as 备用2,F_JSRQ as 日期 from [pathnet].[dbo].[T_SQD] WHERE F_ZYH= 'f_sbh' and F_sqdzt!='已登记' and F_JSRQ>dateadd(day,-30,GETDATE()) order by F_ID desc"; } if (Sslbx == "ID号") { sql = "select F_brbh as 病人编号,F_brlb as 病人类别,F_FB as 费别,F_ZYH as 住院号,F_MZH as 门诊号,F_XM as 姓名,F_XB as 性别,F_NL as 年龄,F_HY as 婚姻,F_DZ as 地址,F_DH as 电话,F_BQ AS 病区,F_CH as 床号,F_SFZH as 身份证号,F_MZ as 民族,F_ZY as 职业,F_SJKS as 送检科室,F_SJYS AS 送检医生,F_LCZD as 临床诊断,F_LCBS as 临床病史,F_SF as 收费,F_YZID as 就诊ID,F_SQXH as 申请序号,F_BBMC as 标本名称,'本院' AS 送检医院,F_YZXM as 医嘱项目,F_BY1 as 备用1,F_BY2 as 备用2,F_JSRQ as 日期 from [pathnet].[dbo].[T_SQD] WHERE F_BRBH= 'f_sbh' and F_sqdzt!='已登记' and F_JSRQ>dateadd(day,-30,GETDATE()) order by F_ID desc"; } if (Sslbx == "门诊ID号") { sql = "select F_brbh as 病人编号,F_brlb as 病人类别,F_FB as 费别,F_ZYH as 住院号,F_MZH as 门诊号,F_XM as 姓名,F_XB as 性别,F_NL as 年龄,F_HY as 婚姻,F_DZ as 地址,F_DH as 电话,F_BQ AS 病区,F_CH as 床号,F_SFZH as 身份证号,F_MZ as 民族,F_ZY as 职业,F_SJKS as 送检科室,F_SJYS AS 送检医生,F_LCZD as 临床诊断,F_LCBS as 临床病史,F_SF as 收费,F_YZID as 就诊ID,F_SQXH as 申请序号,F_BBMC as 标本名称,'本院' AS 送检医院,F_YZXM as 医嘱项目,F_BY1 as 备用1,F_BY2 as 备用2,F_JSRQ as 日期 from [pathnet].[dbo].[T_SQD] WHERE F_BRBH= 'f_sbh' and F_brlb='门诊' and F_sqdzt!='已登记' and F_JSRQ>dateadd(day,-30,GETDATE()) order by F_ID desc"; } if (Sslbx == "住院ID号") { sql = "select F_brbh as 病人编号,F_brlb as 病人类别,F_FB as 费别,F_ZYH as 住院号,F_MZH as 门诊号,F_XM as 姓名,F_XB as 性别,F_NL as 年龄,F_HY as 婚姻,F_DZ as 地址,F_DH as 电话,F_BQ AS 病区,F_CH as 床号,F_SFZH as 身份证号,F_MZ as 民族,F_ZY as 职业,F_SJKS as 送检科室,F_SJYS AS 送检医生,F_LCZD as 临床诊断,F_LCBS as 临床病史,F_SF as 收费,F_YZID as 就诊ID,F_SQXH as 申请序号,F_BBMC as 标本名称,'本院' AS 送检医院,F_YZXM as 医嘱项目,F_BY1 as 备用1,F_BY2 as 备用2,F_JSRQ as 日期 from [pathnet].[dbo].[T_SQD] WHERE F_BRBH= 'f_sbh' and F_brlb='住院' and F_sqdzt!='已登记' and F_JSRQ>dateadd(day,-30,GETDATE()) order by F_ID desc"; } if (Sslbx == "申请单号") { sql = "select F_brbh as 病人编号,F_brlb as 病人类别,F_FB as 费别,F_ZYH as 住院号,F_MZH as 门诊号,F_XM as 姓名,F_XB as 性别,F_NL as 年龄,F_HY as 婚姻,F_DZ as 地址,F_DH as 电话,F_BQ AS 病区,F_CH as 床号,F_SFZH as 身份证号,F_MZ as 民族,F_ZY as 职业,F_SJKS as 送检科室,F_SJYS AS 送检医生,F_LCZD as 临床诊断,F_LCBS as 临床病史,F_SF as 收费,F_YZID as 就诊ID,F_SQXH as 申请序号,F_BBMC as 标本名称,'本院' AS 送检医院,F_YZXM as 医嘱项目,F_BY1 as 备用1,F_BY2 as 备用2,F_JSRQ as 日期 from [pathnet].[dbo].[T_SQD] WHERE F_SQXH= 'f_sbh' and F_sqdzt!='已登记' "; } if (Sslbx == "门诊申请号") { sql = "select F_brbh as 病人编号,F_brlb as 病人类别,F_FB as 费别,F_ZYH as 住院号,F_MZH as 门诊号,F_XM as 姓名,F_XB as 性别,F_NL as 年龄,F_HY as 婚姻,F_DZ as 地址,F_DH as 电话,F_BQ AS 病区,F_CH as 床号,F_SFZH as 身份证号,F_MZ as 民族,F_ZY as 职业,F_SJKS as 送检科室,F_SJYS AS 送检医生,F_LCZD as 临床诊断,F_LCBS as 临床病史,F_SF as 收费,F_YZID as 就诊ID,F_SQXH as 申请序号,F_BBMC as 标本名称,'本院' AS 送检医院,F_YZXM as 医嘱项目,F_BY1 as 备用1,F_BY2 as 备用2,F_JSRQ as 日期 from [pathnet].[dbo].[T_SQD] WHERE F_SQXH= 'f_sbh' and F_brlb='门诊' and F_sqdzt!='已登记' "; } if (Sslbx == "住院申请号") { sql = "select F_brbh as 病人编号,F_brlb as 病人类别,F_FB as 费别,F_ZYH as 住院号,F_MZH as 门诊号,F_XM as 姓名,F_XB as 性别,F_NL as 年龄,F_HY as 婚姻,F_DZ as 地址,F_DH as 电话,F_BQ AS 病区,F_CH as 床号,F_SFZH as 身份证号,F_MZ as 民族,F_ZY as 职业,F_SJKS as 送检科室,F_SJYS AS 送检医生,F_LCZD as 临床诊断,F_LCBS as 临床病史,F_SF as 收费,F_YZID as 就诊ID,F_SQXH as 申请序号,F_BBMC as 标本名称,'本院' AS 送检医院,F_YZXM as 医嘱项目,F_BY1 as 备用1,F_BY2 as 备用2,F_JSRQ as 日期 from [pathnet].[dbo].[T_SQD] WHERE F_SQXH= 'f_sbh' and F_brlb='住院' and F_sqdzt!='已登记' "; } string hissql = f.ReadString(Sslbx, "blsql", sql); if (sql.Trim() == "") { return("0"); } hissql = hissql.Replace("f_sbh", Ssbz.Trim()); string Columns = f.ReadString(Sslbx, "Columns", "日期,申请序号,姓名,性别,年龄,医嘱项目,送检科室,送检医生,病区,床号"); string ColumnsName = f.ReadString(Sslbx, "ColumnsName", "日期,申请序号,姓名,性别,年龄,医嘱项目,送检科室,送检医生,病区,床号"); dt_sqd = aa.GetDataTable(hissql, "sqd"); ///////////////////////////////////////////////////////////////////// if (dt_sqd == null) { if (msg == "1") { MessageBox.Show("获取申请单信息失败"); } return("0"); } if (dt_sqd.Rows.Count == 0) { if (msg == "1") { MessageBox.Show("未查询到申请单信息"); } return("0"); } int tkts = f.ReadInteger(Sslbx, "tkts", 1); int count = 0; if (dt_sqd.Rows.Count > tkts) { string xsys = f.ReadString(Sslbx, "xsys", "1"); //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); dt_sqd.Columns.Add(dc0); for (int x = 0; x < dt_sqd.Rows.Count; x++) { dt_sqd.Rows[x][dt_sqd.Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt_sqd, Columns, ColumnsName, xsys); if (yc.ShowDialog() == DialogResult.Yes) { string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目"); return("0"); } try { count = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目"); return("0"); } } else { MessageBox.Show("未选择申请项目"); return("0"); } } try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt_sqd.Rows[count]["病人编号"].ToString() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt_sqd.Rows[count]["就诊ID"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + dt_sqd.Rows[count]["申请序号"].ToString().Trim() + (char)34 + " "; xml = xml + "门诊号=" + (char)34 + dt_sqd.Rows[count]["门诊号"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt_sqd.Rows[count]["住院号"].ToString().Trim() + (char)34 + " "; xml = xml + "姓名=" + (char)34 + dt_sqd.Rows[count]["姓名"].ToString().Trim() + (char)34 + " "; string xb = dt_sqd.Rows[count]["性别"].ToString().Trim(); if (xb == "F" || xb == "f") { xb = "女"; } if (xb == "M" || xb == "m") { xb = "男"; } xml = xml + "性别=" + (char)34 + xb + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt_sqd.Rows[count]["年龄"].ToString().Trim() + (char)34 + " "; xml = xml + "婚姻=" + (char)34 + dt_sqd.Rows[count]["婚姻"].ToString().Trim() + (char)34 + " "; xml = xml + "地址=" + (char)34 + dt_sqd.Rows[count]["地址"].ToString().Trim() + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt_sqd.Rows[count]["电话"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt_sqd.Rows[count]["病区"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt_sqd.Rows[count]["床号"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt_sqd.Rows[count]["身份证号"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt_sqd.Rows[count]["民族"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + dt_sqd.Rows[count]["职业"].ToString().Trim() + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt_sqd.Rows[count]["送检科室"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt_sqd.Rows[count]["送检医生"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + dt_sqd.Rows[count]["收费"].ToString().Trim() + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + dt_sqd.Rows[count]["标本名称"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + dt_sqd.Rows[count]["送检医院"].ToString().Trim() + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + dt_sqd.Rows[count]["医嘱项目"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + dt_sqd.Rows[count]["备用1"].ToString().Trim() + (char)34 + " "; xml = xml + "备用2=" + (char)34 + dt_sqd.Rows[count]["备用2"].ToString().Trim() + (char)34 + " "; xml = xml + "费别=" + (char)34 + dt_sqd.Rows[count]["费别"].ToString().Trim() + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt_sqd.Rows[count]["病人类别"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + dt_sqd.Rows[count]["临床病史"].ToString().Trim() + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt_sqd.Rows[count]["临床诊断"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; if (debug == "1") { log.WriteMyLog(xml); } return(xml); } catch (Exception e) { MessageBox.Show("获取申请单信息异常:" + e.Message); return("0"); } } else { return("0"); } }
//获取申请单信息 private static string getsqdxx(string fid, string putcmsg, string debug, int ljfs, string Ssbz) { if (debug == "1") { log.WriteMyLog("入参:" + putcmsg); } string getcmsg = ""; string err_msg = ""; bool rtn = false; if (ljfs == 0) { try { rtn = MQ(fid, putcmsg, debug, ref getcmsg); } catch (Exception e1) { MessageBox.Show(e1.Message); return("0"); } } else { EHSBMQWeb.Service ehsb = new LGHISJKZGQ.EHSBMQWeb.Service(); if (weburl.Trim() != "") { ehsb.Url = weburl; } try { rtn = ehsb.GETMQ(fid, putcmsg, ref getcmsg, ref err_msg); } catch (Exception e1) { MessageBox.Show(e1.Message); return("0"); } } if (!rtn) { MessageBox.Show(err_msg); return("0"); } if (debug == "1") { log.WriteMyLog("返回:" + getcmsg); } if (getcmsg.Trim() == "") { MessageBox.Show("提取失败,返回为空"); return("0"); } string RetCon = ""; string RetCode = ""; string bobys = ""; XmlNode xmlok = null; XmlNodeList xmlNL = null; XmlDocument xd = new XmlDocument(); try { xd.LoadXml(getcmsg); xmlok = xd.SelectSingleNode("/ESBEntry/RetInfo"); RetCon = xmlok["RetCon"].InnerText; RetCode = xmlok["RetCode"].InnerText; if (RetCode != "1") { MessageBox.Show(RetCon); return("0"); } xmlNL = xd.SelectNodes("/ESBEntry/MsgInfo/Msg"); foreach (XmlNode xn in xmlNL) { XmlNode xmlok_DATA = null; try { xd.LoadXml(xn.InnerText); xmlok_DATA = xd.SelectSingleNode("/body"); } catch { } bobys = bobys + xmlok_DATA.InnerXml; } } catch (Exception e1) { MessageBox.Show("提取信息异常,解析返回值异常:" + e1.Message); return("0"); } //转成dataset XmlNode xmlok_DATA2 = null; try { xd.LoadXml("<body>" + bobys + "</body>"); xmlok_DATA2 = xd.SelectSingleNode("/body"); } catch (Exception xmlok_e) { MessageBox.Show("解析DATA异常:" + xmlok_e.Message); return("0"); } if (xmlok_DATA2.InnerXml.Trim() == "") { MessageBox.Show("未找到对应的记录!"); return("0"); } DataSet ds1 = new DataSet(); try { StringReader sr = new StringReader(xmlok_DATA2.OuterXml); XmlReader xr = new XmlTextReader(sr); ds1.ReadXml(xr); } catch (Exception eee) { MessageBox.Show("XML转dataset异常:" + eee.Message); return("0"); } if (ds1.Tables[0].Rows.Count <= 0) { MessageBox.Show("未查询到此病人信息"); return("0"); } int xh = 0; if (ds1.Tables[0].Rows.Count > 1) { string Columns = "insur_no,apply_no,name,sex,age,residence_no,bed_no,apply_dept,apply_doctor,item_name,now_diagnosis"; //显示的项目对应字段 string ColumnsName = "医保卡号,单据号,姓名,性别,年龄,住院号,床号,送检科室,送检医生,项目名称,临床诊断"; //显示的项目名称 if (fid == "BS25017") { Columns = "insur_no,apply_no,name,sex,age,apply_dept,apply_doctor,item_name,now_diagnosis"; //显示的项目对应字段 ColumnsName = "医保卡号,单据号,姓名,性别,年龄,送检科室,送检医生,项目名称,临床诊断"; //显示的项目名称 } string xsys = "1"; //选择条件的项目 DataColumn dc0 = new DataColumn("序号"); ds1.Tables[0].Columns.Add(dc0); for (int x = 0; x < ds1.Tables[0].Rows.Count; x++) { ds1.Tables[0].Rows[x][ds1.Tables[0].Columns.Count - 1] = x; } if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } FRM_YZ_SELECT yc = new FRM_YZ_SELECT(ds1.Tables[0], Columns, ColumnsName, xsys); yc.ShowDialog(); string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择申请项目!"); return("0"); } try { xh = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择申请项目!"); return("0"); } } else { if (ds1.Tables[0].Rows.Count < 1) { MessageBox.Show("未查询到此病人信息"); return("0"); } } string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + ds1.Tables[0].Rows[xh]["sick_id"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + ds1.Tables[0].Rows[xh]["insur_no"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + ds1.Tables[0].Rows[xh]["apply_no"].ToString().Trim() + (char)34 + " "; if (fid == "BS25016") { xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " "; xml = xml + "住院号=" + (char)34 + ds1.Tables[0].Rows[xh]["residence_no"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + ds1.Tables[0].Rows[xh]["dept_name"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + ds1.Tables[0].Rows[xh]["bed_no"].ToString().Trim() + (char)34 + " "; } else { string mzh = ds1.Tables[0].Rows[xh]["insur_no"].ToString().Trim(); if (mzh == "") { mzh = Ssbz; } xml = xml + "门诊号=" + (char)34 + mzh + (char)34 + " "; xml = xml + "住院号=" + (char)34 + "" + (char)34 + " "; xml = xml + "病区=" + (char)34 + "" + (char)34 + " "; xml = xml + "床号=" + (char)34 + "" + (char)34 + " "; } xml = xml + "姓名=" + (char)34 + ds1.Tables[0].Rows[xh]["name"].ToString().Trim() + (char)34 + " "; xml = xml + "性别=" + (char)34 + ds1.Tables[0].Rows[xh]["sex"].ToString().Trim() + (char)34 + " "; xml = xml + "年龄=" + (char)34 + ds1.Tables[0].Rows[xh]["age"].ToString().Trim() + (char)34 + " "; xml = xml + "婚姻=" + (char)34 + ds1.Tables[0].Rows[xh]["marital_status"].ToString().Trim() + (char)34 + " "; xml = xml + "地址=" + (char)34 + ds1.Tables[0].Rows[xh]["communicate_address"].ToString().Trim() + (char)34 + " "; xml = xml + "电话=" + (char)34 + ds1.Tables[0].Rows[xh]["family_phone"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + ds1.Tables[0].Rows[xh]["id_card_no"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + ds1.Tables[0].Rows[xh]["nation"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + ds1.Tables[0].Rows[xh]["profession"].ToString().Trim() + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + ds1.Tables[0].Rows[xh]["apply_dept"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + ds1.Tables[0].Rows[xh]["apply_doctor"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + ds1.Tables[0].Rows[xh]["item_name"].ToString().Trim() + (char)34 + " "; xml = xml + "备用1=" + (char)34 + (char)34 + " "; xml = xml + "备用2=" + (char)34 + (char)34 + " "; xml = xml + "费别=" + (char)34 + ds1.Tables[0].Rows[xh]["rate_type"].ToString().Trim() + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + ds1.Tables[0].Rows[xh]["table_type"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + ds1.Tables[0].Rows[xh]["clinical_history"].ToString().Trim() + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + ds1.Tables[0].Rows[xh]["now_diagnosis"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); }
/// <summary> /// // @brlb ut_bz, --病人类别 0门诊 1住院 3体检 //@codetype ut_bz, --号码类型 1住院/门诊号指病历号,2卡号, 3PatientID // --对应于his中的 patid(门诊),patid(住院), 4CureNo对应于his,9发票号(门诊使用) // --中的ghsjh (门诊),和syxh(住院) // @code varchar(20) --号码,它的含义,由上面codetype指定 //exec usp_yjjk_getbrxx '1','4','285606' //测试: //his数据库 192.168.42.107\this4 //用户:sa/sql2k //库:this4_0720 //存储过程:usp_yjjk_getbrxx // @brlb ut_bz, --病人类别 0门诊 1住院 3体检 // @codetype ut_bz, --号码类型 1住院/门诊号指病历号,2卡号, // --对应于his中的 patid(门诊),patid(住院), 9发票号(门诊使用) // --中的ghsjh (门诊),和syxh(住院) // @code varchar(20) --号码,它的含义,由上面codetype指定 //patientID patientID //HospNo 病员号 病历号 //patName 病人姓名 //Sex 性别 1 男,2女 //age+ageUnit 年龄 //WardOrReg 病人类别 0门诊 1住院 3体检 //ChargeType 费别 //CureNo 住院号/门诊号 //CardNo 卡号 //applyDept 科室 代码 //select name from YY_KSBMK where id ='409' //ward 病区代码 ZY_BQDMK //bedNo 床号 //applyDoctor 医生代码 YY_ZGBMK //select name from YY_ZGBMK where id ='5358' //clincDesc 临床诊断。 //IDNum 身份号 //Phone 电话 //Address 地址 //Zip //Career 职业 //Nation 民族 //ToDoc //sendNo //Syxh 首页序号 //bqmc 病区 //yexh //DeptName 科室名称 //clinicDesc 临床诊断 /// </summary> /// <param name="Sslbx"></param> /// <param name="Ssbz"></param> /// <param name="Debug"></param> /// <returns></returns> public static string ptxml(string Sslbx, string Ssbz, string Debug) { if (Sslbx != "") { string odbcsql = f.ReadString(Sslbx, "odbcsql", "Data Source=192.168.42.107\\this4;Initial Catalog=THIS4_0720;User Id=sa;Password=sql2k;"); string brlb = ""; string codetype = ""; if (Sslbx == "门诊病历号") { brlb = "0"; codetype = "1"; } if (Sslbx == "门诊号") { brlb = "0"; codetype = "4"; } if (Sslbx == "卡号") { brlb = "0"; codetype = "2"; } if (Sslbx == "发票号") { brlb = "0"; codetype = "9"; } if (Sslbx == "住院病历号") { brlb = "1"; codetype = "1"; } if (Sslbx == "住院号") { brlb = "1"; codetype = "4"; } if (Sslbx == "体检号") { brlb = "3"; codetype = "1"; } if (Sslbx == "体检卡号") { brlb = "3"; codetype = "2"; } if (Sslbx == "体检发票号") { brlb = "3"; codetype = "9"; } if (brlb == "") { MessageBox.Show("未设置此识别类型" + Sslbx); return("0"); } DataTable dt = new DataTable(); string exec = ""; SqlDB_ZGQ sql = new SqlDB_ZGQ(); dt = sql.Sql_DataAdapter(odbcsql, "exec usp_yjjk_getbrxx '" + brlb + "','" + codetype + "','" + Ssbz.Trim() + "'", ref exec); if (exec != "") { MessageBox.Show(exec); return("0"); } if (dt.Rows.Count == 0) { MessageBox.Show("未能查询到对应的数据记录!请确认" + Sslbx + "是否正确"); return("0"); } //无数据集时对方返回 select "F","没有指定的条件!" try { MessageBox.Show(dt.Rows[0]["Column2"].ToString().Trim()); return("0"); } catch { } int count = 0; DataColumn dc0 = new DataColumn("序号"); dt.Columns.Add(dc0); DataColumn dc_brlb = new DataColumn("病人类别"); dt.Columns.Add(dc_brlb); for (int x = 0; x < dt.Rows.Count; x++) { dt.Rows[x][dt.Columns.Count - 2] = x; //通过医生代码查询医生姓名 try { DataTable dt_ys = new DataTable(); dt_ys = sql.Sql_DataAdapter(odbcsql, "select top 1 name from YY_ZGBMK where id ='" + dt.Rows[x]["ApplyDoctor"].ToString().Trim() + "'", ref exec); if (dt_ys.Rows.Count > 0) { dt.Rows[x]["ApplyDoctor"] = dt_ys.Rows[0]["name"].ToString().Trim(); } } catch { } //DeptName为空的情况下,通过科室代码代码查询科室名称 if (dt.Rows[x]["DeptName"].ToString().Trim() == null || dt.Rows[x]["DeptName"].ToString().Trim() == "") { try { DataTable dt_ks = new DataTable(); dt_ks = sql.Sql_DataAdapter(odbcsql, "select top 1 name from YY_KSBMK where id ='" + dt.Rows[x]["ApplyDept"].ToString().Trim() + "'", ref exec); if (dt_ks.Rows.Count > 0) { dt.Rows[x]["DeptName"] = dt_ks.Rows[0]["name"].ToString().Trim(); } } catch { } } // --病人类别 0门诊 1住院 3体检 dt.Rows[0]["病人类别"] = dt.Rows[0]["WardOrReg"].ToString().Trim(); if (dt.Rows[0]["WardOrReg"].ToString().Trim() == "1") { dt.Rows[0]["病人类别"] = "住院"; } if (dt.Rows[count]["WardOrReg"].ToString().Trim() == "3") { dt.Rows[0]["病人类别"] = "体检"; } if (dt.Rows[count]["WardOrReg"].ToString().Trim() == "0") { dt.Rows[0]["病人类别"] = "门诊"; } } // 多条数据显示选择窗体 if (dt.Rows.Count >= 1) { //dataGridView1显示样式 string xsys = f.ReadString(Sslbx, "xsys", "1"); //显示的列字段 string Columns = f.ReadString(Sslbx, "Columns", "HospNo,病人类别,PatName,Age,CureNo,CardNo,bqmc,BedNo,DeptName,ApplyDoctor,ClinicDesc"); //显示的列的别名 string ColumnsName = f.ReadString(Sslbx, "ColumnsName", "病历号,类别,姓名,年龄,住院号/门诊号,卡号,病区,床号,申请科室,申请医生,临床诊断"); //增加序号列 if (Columns.Trim() != "") { Columns = "序号," + Columns; } if (ColumnsName.Trim() != "") { ColumnsName = "序号," + ColumnsName; } //显示窗体 FRM_YZ_SELECT yc = new FRM_YZ_SELECT(dt, Columns, ColumnsName, xsys); yc.ShowDialog(); string rtn2 = yc.F_XH; if (rtn2.Trim() == "") { MessageBox.Show("未选择数据!"); return("0"); } try { count = int.Parse(rtn2); } catch { MessageBox.Show("请重新选择!"); return("0"); } } try { string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>"; xml = xml + "<LOGENE>"; xml = xml + "<row "; xml = xml + "病人编号=" + (char)34 + dt.Rows[count]["PatientID"].ToString().Trim() + (char)34 + " "; xml = xml + "就诊ID=" + (char)34 + dt.Rows[count]["HospNo"].ToString().Trim() + "^" + dt.Rows[count]["CardNo"].ToString().Trim() + (char)34 + " "; xml = xml + "申请序号=" + (char)34 + "" + (char)34 + " "; if (dt.Rows[count]["WardOrReg"].ToString().Trim() == "1") { xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " "; xml = xml + "住院号=" + (char)34 + dt.Rows[count]["CureNo"].ToString().Trim() + (char)34 + " "; } else { xml = xml + "门诊号=" + (char)34 + dt.Rows[count]["CureNo"].ToString().Trim() + (char)34 + " "; xml = xml + "住院号=" + (char)34 + "" + (char)34 + " "; } xml = xml + "姓名=" + (char)34 + dt.Rows[count]["PatName"].ToString().Trim() + (char)34 + " "; string xb = dt.Rows[count]["Sex"].ToString().Trim(); if (xb == "2") { xb = "女"; } if (xb == "1") { xb = "男"; } xml = xml + "性别=" + (char)34 + xb + (char)34 + " "; xml = xml + "年龄=" + (char)34 + dt.Rows[count]["Age"].ToString().Trim() + dt.Rows[count]["AgeUnit"].ToString().Trim() + (char)34 + " "; xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " "; xml = xml + "地址=" + (char)34 + dt.Rows[count]["Address"].ToString().Trim() + (char)34 + " "; xml = xml + "电话=" + (char)34 + dt.Rows[count]["Phone"].ToString().Trim() + (char)34 + " "; xml = xml + "病区=" + (char)34 + dt.Rows[count]["bqmc"].ToString().Trim() + (char)34 + " "; xml = xml + "床号=" + (char)34 + dt.Rows[count]["BedNo"].ToString().Trim() + (char)34 + " "; xml = xml + "身份证号=" + (char)34 + dt.Rows[count]["IDNum"].ToString().Trim() + (char)34 + " "; xml = xml + "民族=" + (char)34 + dt.Rows[count]["Nation"].ToString().Trim() + (char)34 + " "; xml = xml + "职业=" + (char)34 + dt.Rows[count]["Career"].ToString().Trim() + (char)34 + " "; xml = xml + "送检科室=" + (char)34 + dt.Rows[0]["DeptName"].ToString().Trim() + (char)34 + " "; xml = xml + "送检医生=" + (char)34 + dt.Rows[0]["ApplyDoctor"].ToString().Trim() + (char)34 + " "; xml = xml + "收费=" + (char)34 + "" + (char)34 + " "; xml = xml + "标本名称=" + (char)34 + "" + (char)34 + " "; xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " "; xml = xml + "医嘱项目=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用1=" + (char)34 + "" + (char)34 + " "; xml = xml + "备用2=" + (char)34 + "" + (char)34 + " "; xml = xml + "费别=" + (char)34 + dt.Rows[count]["ChargeType"].ToString().Trim() + (char)34 + " "; xml = xml + "病人类别=" + (char)34 + dt.Rows[0]["病人类别"].ToString().Trim() + (char)34 + " "; xml = xml + "/>"; xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>"; xml = xml + "<临床诊断><![CDATA[" + dt.Rows[count]["ClinicDesc"].ToString().Trim() + "]]></临床诊断>"; xml = xml + "</LOGENE>"; return(xml); } catch (Exception e) { MessageBox.Show("提取信息出现异常:" + e.Message); return("0"); } } return("0"); }