Ejemplo n.º 1
0
        public void GetYZMX(string sqdh)
        {
            SqlParameter[] sqlPt = new SqlParameter[1];
            for (int j = 0; j < sqlPt.Length; j++)
            {
                sqlPt[j] = new SqlParameter();
            }
            //申请单号
            sqlPt[0].ParameterName = "In_FunctionRequestIDs";
            sqlPt[0].SqlDbType     = SqlDbType.NVarChar;
            sqlPt[0].Size          = 100;
            sqlPt[0].Direction     = ParameterDirection.Input;
            sqlPt[0].Value         = sqdh;

            DataTable dt_yzmx = new DataTable();
            SqlDB_ZGQ db      = new SqlDB_ZGQ();
            string    err_msg = "";

            dt_yzmx = db.Sql_DataAdapter(odbc, "pGetFunctionRequestListForPathNet", ref sqlPt, CommandType.StoredProcedure, ref err_msg);
            if (dt_yzmx == null)
            {
                return;
            }
            dataGridView2.DataSource            = dt_yzmx;
            dataGridView2.AutoSizeColumnsMode   = DataGridViewAutoSizeColumnsMode.AllCells;
            dataGridView2.Columns[0].HeaderText = "申请单号";
            dataGridView2.Columns[1].HeaderText = "项目ID";
            dataGridView2.Columns[2].HeaderText = "项目名称";
        }
Ejemplo n.º 2
0
        private static double get_je(string odbcsql, string brlb, string sqdh, string debug)
        {
            SqlDB_ZGQ db = new SqlDB_ZGQ();

            SqlParameter[] Parameters = new SqlParameter[2];

            for (int j = 0; j < Parameters.Length; j++)
            {
                Parameters[j] = new SqlParameter();
            }
            Parameters[0].ParameterName = "sqdh";
            Parameters[0].SqlDbType     = SqlDbType.VarChar;
            Parameters[0].Direction     = ParameterDirection.Input;
            Parameters[0].Value         = sqdh.Trim();

            Parameters[1].ParameterName = "return";
            Parameters[1].SqlDbType     = SqlDbType.Int;
            Parameters[1].Direction     = ParameterDirection.Output;


            string    except = "";
            DataTable dt     = new DataTable();

            if (brlb.Trim() == "住院")
            {
                dt = db.Sql_DataAdapter(odbcsql, "p_pa_zysfxx", ref Parameters, CommandType.StoredProcedure, ref except);
            }
            else
            {
                dt = db.Sql_DataAdapter(odbcsql, "p_pa_mzsfxx", ref Parameters, CommandType.StoredProcedure, ref except);
            }


            if (dt == null)
            {
                if (debug == "1")
                {
                    MessageBox.Show("费用获取失败:获取数据失败\r\n" + except);
                }
                return(0);
            }
            if (dt.Rows.Count <= 0)
            {
                if (debug == "1")
                {
                    MessageBox.Show("费用获取失败:返回行数为0\r\n" + except);
                }
                return(0);
            }

            try
            {
                if (int.Parse(Parameters[1].Value.ToString()) < 0)
                {
                    if (debug == "1")
                    {
                        MessageBox.Show("费用获取失败:" + Parameters[4].Value);
                    }
                    log.WriteMyLog("费用获取失败:" + Parameters[4].Value);
                    return(0);
                }
                double je = 0;
                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    je = double.Parse(dt.Rows[x]["je"].ToString().Trim()) + je;
                }

                return(je);
            }
            catch (Exception ee1)
            {
                if (debug == "1")
                {
                    MessageBox.Show("费用获取异常:" + ee1.Message);
                }
                log.WriteMyLog("费用获取异常:" + ee1.Message);
                return(0);
            }
        }
Ejemplo n.º 3
0
        public static string ptxml(string Sslbx, string Ssbz, string Debug)
        {
            SqlDB_ZGQ db = new SqlDB_ZGQ();

            if (Sslbx != "")
            {
                string exp = "";

                if (Sslbx == "门诊退费")
                {
                    string        odbcsql = f.ReadString(Sslbx, "odbcsql", "Data Source=172.16.10.1;Initial Catalog=xsylzx;User Id=xrh;Password=xsrmyy18;");
                    string        yhmc    = f.ReadString("yh", "yhmc", "").Replace("\0", "").Trim();
                    string        yhbh    = f.ReadString("yh", "yhbh", "").Replace("\0", "").Trim();
                    dbbase.odbcdb aa      = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", "");
                    DataTable     bljc    = new DataTable();
                    bljc = aa.GetDataTable("select * from T_jcxx where F_blh='" + Ssbz + "'", "bljc");


                    if (bljc == null)
                    {
                        MessageBox.Show("病理号:" + Ssbz + ",病理数据库设置有问题!");
                        return("0");
                    }
                    if (bljc.Rows.Count < 1)
                    {
                        MessageBox.Show("病理号:" + Ssbz + ",病理号有错误!");
                        return("0");
                    }
                    if (bljc.Rows[0]["F_SQXH"].ToString().Trim() == "")
                    {
                        MessageBox.Show("申请序号为空,不能取消退费");
                        return("0");
                    }
                    if (bljc.Rows[0]["F_brlb"].ToString().Trim() == "门诊")
                    {
                        MessageBox.Show("非门诊病人,不能取消退费");
                        return("0");
                    }
                    if (bljc.Rows[0]["F_mzqf"].ToString().Trim() != "1")
                    {
                        MessageBox.Show("未确费或非本系统确费,不能取消退费");
                        return("0");
                    }
                    if (bljc.Rows[0]["F_brlb"].ToString().Trim() == "门诊" && bljc.Rows[0]["F_mzqf"].ToString().Trim() != "1")
                    {
                        SqlParameter[] Parameters = new SqlParameter[5];

                        for (int j = 0; j < Parameters.Length; j++)
                        {
                            Parameters[j] = new SqlParameter();
                        }
                        Parameters[0].ParameterName = "sqdh";
                        Parameters[0].SqlDbType     = SqlDbType.VarChar;
                        Parameters[0].Direction     = ParameterDirection.Input;
                        Parameters[0].Value         = bljc.Rows[0]["F_SQXH"].ToString().Trim();

                        Parameters[1].ParameterName = "czgh";
                        Parameters[1].SqlDbType     = SqlDbType.VarChar;
                        Parameters[1].Direction     = ParameterDirection.Input;
                        Parameters[1].Value         = yhbh;

                        Parameters[2].ParameterName = "bz";
                        Parameters[2].SqlDbType     = SqlDbType.Int;
                        Parameters[2].Direction     = ParameterDirection.Input;
                        Parameters[2].Value         = 9;

                        Parameters[3].ParameterName = "zxysh";
                        Parameters[3].SqlDbType     = SqlDbType.VarChar;
                        Parameters[3].Direction     = ParameterDirection.Input;
                        Parameters[3].Value         = yhmc;

                        Parameters[4].ParameterName = "return";
                        Parameters[4].SqlDbType     = SqlDbType.Int;
                        Parameters[4].Direction     = ParameterDirection.ReturnValue;

                        string except = "";
                        db.Sql_ExecuteNonQuery(odbcsql, "p_yjqr", ref Parameters, CommandType.StoredProcedure, ref except);
                        if (except != "")
                        {
                            MessageBox.Show("连接数据库失败,门诊病人退费失败");
                        }
                        else
                        {
                            try
                            {
                                if (int.Parse(Parameters[4].Value.ToString()) < 0)
                                {
                                    MessageBox.Show("门诊病人退费失败:" + Parameters[4].Value);
                                }
                                else
                                {
                                    aa.ExecuteSQL("update T_JCXX set F_MZQF='0' where F_BLH='" + Ssbz + "'");
                                    MessageBox.Show("门诊病人退费成功");
                                }
                            }
                            catch (Exception ee1)
                            {
                                MessageBox.Show("门诊退费异常:" + ee1.Message);
                            }
                        }
                        return("0");
                    }
                    return("0");
                }
                if (Sslbx == "申请单号" || Sslbx == "标本条码号")
                {
                    string sqxh = Ssbz.Trim();
                    if (Sslbx == "标本条码号")
                    {
                        sqxh = Ssbz.Trim().Split('_')[0].Trim();
                    }

                    string odbcsql = f.ReadString(Sslbx, "odbcsql", "Data Source=172.16.10.1;Initial Catalog=xsylzx;User Id=xrh;Password=xsrmyy18;");
                    string tqbblb  = f.ReadString(Sslbx, "tqbblb", "0");
                    string debug   = f.ReadString(Sslbx, "debug", "0");

                    string    djr    = f.ReadString("yh", "yhmc", "").Replace("\0", "").Trim();
                    string    sqlstr = "select *  from dbo.V_pa_apply   WHERE  apply_id= '" + sqxh.Trim() + "'";
                    DataTable dt_SQD = new DataTable();
                    string    exp_db = "";
                    dt_SQD = db.Sql_DataAdapter(odbcsql, sqlstr, ref exp_db);
                    if (exp_db.Trim() != "")
                    {
                        MessageBox.Show("连接HIS数据库异常:" + exp_db);
                    }

                    if (dt_SQD == null)
                    {
                        MessageBox.Show("未查询到此条码号记录!");
                        return("0");
                    }

                    if (dt_SQD.Rows.Count <= 0)
                    {
                        MessageBox.Show("未查询到此申请序号记录!");
                        return("0");
                    }

                    //取收费je



                    //-返回xml----------------------------------------------------
                    try
                    {
                        string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>";
                        xml = xml + "<LOGENE>";
                        xml = xml + "<row ";
                        try
                        {
                            xml = xml + "病人编号=" + (char)34 + dt_SQD.Rows[0]["PATIENT_ID"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "病人编号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        xml = xml + "就诊ID=" + (char)34 + "" + (char)34 + " ";

                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "申请序号=" + (char)34 + dt_SQD.Rows[0]["APPLY_ID"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "申请序号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "门诊号=" + (char)34 + dt_SQD.Rows[0]["INPATIENT_NO"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "住院号=" + (char)34 + dt_SQD.Rows[0]["PATIENT_NO"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "住院号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "姓名=" + (char)34 + dt_SQD.Rows[0]["PATIENT_NAME"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "姓名=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "性别=" + (char)34 + dt_SQD.Rows[0]["SEX"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "性别=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "年龄=" + (char)34 + dt_SQD.Rows[0]["AGE"].ToString().Trim() + "岁" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "年龄=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "婚姻=" + (char)34 + dt_SQD.Rows[0]["HY"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "地址=" + (char)34 + dt_SQD.Rows[0]["ADDRESS"].ToString().Trim() + (char)34 + "   ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "地址=" + (char)34 + "" + (char)34 + "   ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "电话=" + (char)34 + dt_SQD.Rows[0]["TELPHONE"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "电话=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "病区=" + (char)34 + dt_SQD.Rows[0]["PATIENT_DEPT"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "病区=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "床号=" + (char)34 + dt_SQD.Rows[0]["PATIENT_BED"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "床号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "身份证号=" + (char)34 + dt_SQD.Rows[0]["SFZH"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "身份证号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "民族=" + (char)34 + dt_SQD.Rows[0]["MZ"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "民族=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "职业=" + (char)34 + dt_SQD.Rows[0]["ZY"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "职业=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "送检科室=" + (char)34 + dt_SQD.Rows[0]["APPLY_DEPT_NAME"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "送检科室=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "送检医生=" + (char)34 + dt_SQD.Rows[0]["APPLY_DOCTOR_NAME"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "送检医生=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        double je = 0;

                        string brlb = dt_SQD.Rows[0]["PATIENT_TYPE"].ToString().Trim();
                        if (brlb == "门诊" || brlb == "住院")
                        {
                            je = get_je(odbcsql, brlb, dt_SQD.Rows[0]["APPLY_ID"].ToString().Trim(), debug);
                        }
                        xml = xml + "收费=" + (char)34 + je.ToString() + (char)34 + " ";
                        //----------------------------------------------------------
                        ///////////////////////////
                        string BBLB_XML = "";
                        if (tqbblb == "1")
                        {
                            string    sqlstr_mx = "select *  from dbo.V_pa_apply_mx   WHERE  APPLY_ID= '" + sqxh.Trim() + "'";
                            DataTable dt_SQD_MX = new DataTable();
                            string    exp_db_mx = "";
                            dt_SQD_MX = db.Sql_DataAdapter(odbcsql, sqlstr_mx, ref exp_db_mx);
                            if (exp_db_mx.Trim() != "")
                            {
                                MessageBox.Show("连接HIS数据库异常:" + exp_db_mx);
                            }
                            else
                            {
                                if (dt_SQD_MX == null)
                                {
                                    MessageBox.Show("未查询到此条码号记录!");
                                }
                                else
                                {
                                    if (dt_SQD_MX.Rows.Count <= 0)
                                    {
                                        MessageBox.Show("未查询到此申请序号记录!");
                                    }
                                    else
                                    {
                                        BBLB_XML = "<BBLB>";
                                        try
                                        {
                                            for (int x = 0; x < dt_SQD_MX.Rows.Count; x++)
                                            {
                                                try
                                                {
                                                    BBLB_XML = BBLB_XML + "<row ";
                                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + dt_SQD_MX.Rows[x]["BBXH"].ToString().Trim() + (char)34 + " ";
                                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + dt_SQD_MX.Rows[x]["APPLY_BARCODE"].ToString().Trim() + (char)34 + " ";
                                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD_MX.Rows[x]["BBMC"].ToString().Trim() + (char)34 + " ";
                                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD_MX.Rows[x]["BWMC"].ToString().Trim() + (char)34 + " ";
                                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD_MX.Rows[x]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD_MX.Rows[x]["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>";
                                    }
                                }
                            }
                        }
                        xml = xml + "标本名称=" + (char)34 + dt_SQD.Rows[0]["BBMC"].ToString().Trim() + (char)34 + " ";
                        //----------------------------------------------------------

                        xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " ";
                        //----------------------------------------------------------
                        xml = xml + "医嘱项目=" + (char)34 + dt_SQD.Rows[0]["ORDER_NAME"].ToString().Trim() + (char)34 + " ";
                        //----------------------------------------------------------
                        xml = xml + "备用1=" + (char)34 + (char)34 + " ";
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "备用2=" + (char)34 + DateTime.Parse(dt_SQD.Rows[0]["csrq"].ToString().Trim()).ToString("yyyy-MM-dd") + (char)34 + " ";
                        }
                        catch (Exception ee4)
                        {
                            log.WriteMyLog(ee4.Message);
                            xml = xml + "备用2=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "费别=" + (char)34 + dt_SQD.Rows[0]["FEE_CLASS"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "费别=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "病人类别=" + (char)34 + brlb + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "病人类别=" + (char)34 + "" + (char)34 + " ";
                        }
                        xml = xml + "/>";
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>";//.Replace("\"", "&quot;")
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "<临床诊断><![CDATA[" + dt_SQD.Rows[0]["DIAGNOSIS"].ToString().Trim() + "]]></临床诊断>";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.Message.ToString();
                            xml = xml + "<临床诊断><![CDATA[" + "" + "]]></临床诊断>";
                        }

                        if (tqbblb == "1")
                        {
                            xml = xml + BBLB_XML;
                        }
                        xml = xml + "</LOGENE>";

                        if (Debug == "1" && exp.Trim() != "")
                        {
                            log.WriteMyLog(exp.Trim());
                        }
                        return(xml);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("提取信息出错,请重新操作");
                        log.WriteMyLog("xml解析错误---" + e.Message);
                        return("0");
                    }
                }
                else
                {
                    MessageBox.Show("无此" + Sslbx);
                    return("0");
                }
            }
            return("0");
        }
Ejemplo n.º 4
0
        public string ca(string yhxx)
        {
            bool yzpassword = false;


            dbbase.odbcdb aa = new odbcdb("DSN=pathnet;UID=pathnet;PWD=4s3c2a1p", "", "");

            //-------获取sz中设置的参数---------------------
            string debug       = f.ReadString("CA", "debug", "");
            string msg         = f.ReadString("CA", "message", "1");
            string ftpServerIP = f.ReadString("ftp", "ftpip", "");
            string ftpUserID   = f.ReadString("ftp", "user", "");
            string ftpPassword = f.ReadString("ftp", "pwd", "");
            string ftpszqmbmp  = f.ReadString("ftp", "szqmbmp", "pathsetup/pathqc/rpt-szqm/ysbmp");
            string IP          = f.ReadString("CA", "IP", "192.1.33.143:7000").Trim();
            string yzzsyxx     = f.ReadString("CA", "yzzsyxx", "0").Trim();


            string ServerIP = f.ReadString("sqlserver", "Server", "192.10.33.84");
            string sqlcon   = "Server=192.10.33.84;Database=pathnet_ca;User ID=pathnet;Password=4s3c2a1p;Trusted_Connection=False;";

            string getblh = "";
            string type   = "";
            string type2  = "";
            string yhm    = "";

            string yhmc    = "";
            string yhbh    = "";
            string yhmm    = "";
            string bglx    = "";
            string bgxh    = "";
            string keyname = "";

            string[] getyhxx = yhxx.Split('^');
            if (getyhxx.Length == 5)
            {
                type = getyhxx[0];
                yhm  = getyhxx[1];
                yhmc = getyhxx[3];
                yhbh = getyhxx[2];
                yhmm = getyhxx[4];
            }
            else
            {
                type2  = getyhxx[0];
                getblh = getyhxx[1];
                bgxh   = getyhxx[2];
                bglx   = getyhxx[3].ToLower();
                type   = getyhxx[4];
                yhm    = getyhxx[5];
                yhmc   = getyhxx[6];
                yhbh   = getyhxx[7];
                yhmm   = getyhxx[8];
            }



            string password = string.Empty;

            //string KEY_sbDeviceInfo = f.ReadString("CA_KEY", "sbDeviceInfo", "").Trim();
            //string KEY_userName = f.ReadString("CA_KEY", "userName", "").Trim();
            //password = f.ReadString("CA_KEY", "pwd", "").Trim();
            //if (key == "0")
            //{
            //    return "1";
            //}

            //------------------------------------------------------------------
            //------------------------------------------------------------------
            //审核前执行 ,验证KEY
            //------------------------------------------------------------------
            //------------------------------------------------------------------

            if (type == "SH")
            {
                //if (!axSBFjCAEnAndSign1.OpenFJCAUSBKey())
                //{
                //    axSBFjCAEnAndSign1.CloseUSBKey();
                //    return;
                //}
                //axSBFjCAEnAndSign1.CloseUSBKey();


                //读取Key的硬件介质号
                //if (debug == "1")
                //    MessageBox.Show("读取Key的硬件介质号");

                //StringBuilder sbDeviceInfo = new StringBuilder(256);
                //if (GetDeviceInfoOnUsbKey(sbDeviceInfo) == 0)
                //{
                //    if (msg=="1")
                //    MessageBox.Show("读取Key的硬件介质号失败,请确认Key已经插入电脑。");
                //return "0";
                //}
                //if (debug == "1")
                //    MessageBox.Show("读取Key的硬件介质号:" + sbDeviceInfo.ToString());

                // yzpassword = false;

                //            if (sbDeviceInfo.ToString() == KEY_sbDeviceInfo)
                //             {

                //                     if (password != "")
                //                         yzpassword = true;


                //             }

                //            bool  savepwd=true;

                //yzmm:
                //             if (!yzpassword)
                //            {

                //                Frm_XMZSYY_Login login = new Frm_XMZSYY_Login();
                //                if (login.ShowDialog() != DialogResult.Yes)
                //                {
                //                    if (msg == "1")
                //                        MessageBox.Show("用户登录取消,验证失败");
                //                    return "0";
                //                }
                //                password = login.password;
                //                 savepwd=login.savepwd;
                //                if (password == string.Empty)
                //                {
                //                    if (msg == "1")
                //                        MessageBox.Show("密码输入错误,不能为空");
                //                    return "0";
                //                }

                //            }

                if (debug == "1")
                {
                    MessageBox.Show("打开Key");
                }
                //打开Key
                if (OpenUsbKey("") == 0)
                {
                    //if (MessageBox.Show("打开Key失败,可能密码输入错误\r\n是否重试", "密码验证", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                    //{
                    //    yzpassword = false;
                    //    goto yzmm;
                    //}
                    //else
                    if (msg == "1")
                    {
                        MessageBox.Show("打开Key失败,Key未插入或密码输入错误");
                    }
                    return("0");
                }
                if (debug == "1")
                {
                    MessageBox.Show("打开Key成功");
                }
                //if (savepwd)
                //{
                //    f.WriteString("CA_KEY", "sbDeviceInfo", sbDeviceInfo.ToString());
                //    // f.WriteString("CA_KEY", "userName", KEY_YH);
                //    f.WriteString("CA_KEY", "pwd", password);
                //}
                //else
                //{
                //    f.WriteString("CA_KEY", "sbDeviceInfo", "");
                //    // f.WriteString("CA_KEY", "userName", KEY_YH);
                //    f.WriteString("CA_KEY", "pwd", "");
                //}
                if (debug == "1")
                {
                    MessageBox.Show("获取签名证书");
                }
                //获取签名证书
                StringBuilder sbSignCert = new StringBuilder(4096);
                if (GetSignCertOnUsbKey(sbSignCert) == 0)
                {
                    CloseUsbKey();
                    if (msg == "1")
                    {
                        MessageBox.Show("获取签名证书失败");
                    }
                    return("0");
                }
                if (debug == "1")
                {
                    MessageBox.Show("证书:" + sbSignCert.ToString());
                }

                //sfzh
                StringBuilder sbInfo = new StringBuilder(1024);
                GetCertExtensionInfoById(sbSignCert.ToString(), "1.2.86.21.1.1", sbInfo);

                string KEY_SFZH = sbInfo.ToString().Substring(9, sbInfo.Length - 9);
                if (debug == "1")
                {
                    MessageBox.Show("身份证号:" + KEY_SFZH);
                }

                // 证书有效性验证通过,展示证书信息。

                StringBuilder sbCertName = new StringBuilder(1024);
                if (GetCertName(sbSignCert.ToString(), sbCertName) == 0)
                {
                    CloseUsbKey();
                    if (msg == "1")
                    {
                        MessageBox.Show("获取签名证书失败");
                    }
                    return("0");
                }
                string KEY_YH = sbCertName.ToString();
                if (debug == "1")
                {
                    MessageBox.Show("KEY用户:" + KEY_YH);
                }



                //关闭Key
                CloseUsbKey();

                //验证用户名

                if (yhmc.Trim() != KEY_YH)
                {
                    if (msg == "1")
                    {
                        MessageBox.Show("软件使用者与KEY用户不一致,验证失败!");
                    }
                    return("0");
                }

                if (yhbh.Trim() != KEY_SFZH)
                {
                    if (msg == "1")
                    {
                        MessageBox.Show("用户身份证号与KEY中身份证号不一致,验证失败!");
                    }
                    return("0");
                }

                if (yzzsyxx == "1")
                {
                    if (debug == "1")
                    {
                        MessageBox.Show("获取随机数");
                    }

                    //// 获取随机数
                    StringBuilder sbRandom = new StringBuilder(64);
                    if (GetRandomByLengthOnMultiServer(IP, 32, sbRandom) == 0 || sbRandom.ToString().Length <= 0 || sbRandom.ToString() == string.Empty)
                    {
                        CloseUsbKey();
                        if (msg == "1")
                        {
                            MessageBox.Show("从服务器获取随机数失败");
                        }
                        return("0");
                    }
                    if (debug == "1")
                    {
                        MessageBox.Show("获取随机数完成");
                    }
                    //签名SignDataOnUsbKey

                    StringBuilder sbSignData = new StringBuilder(4096);
                    if (SignDataOnUsbKey(sbRandom.ToString(), sbSignData) == 0)
                    {
                        CloseUsbKey();
                        if (msg == "1")
                        {
                            MessageBox.Show("签名失败");
                        }
                        return("0");
                    }
                    if (debug == "1")
                    {
                        MessageBox.Show("签名完成");
                    }

                    // 验证证书有效性
                    if (LoginAuthenticationOnMultiServer(IP, sbSignData.ToString(), sbSignCert.ToString(), sbRandom.ToString()) == 0)
                    {
                        CloseUsbKey();
                        if (msg == "1")
                        {
                            MessageBox.Show("连接服务器验证证书有效性失败");
                        }
                        return("0");
                    }
                    if (debug == "1")
                    {
                        MessageBox.Show("验证证书有效性完成");
                    }
                }

                if (debug == "1")
                {
                    MessageBox.Show("验证通过");
                }

                return("1");
            }
            //***************************************************************
            ////审核后执行,数字签名,生成pdf和edu文件,并上传,写数据库等

            if (type == "QZ")
            {
                //***************************************************************
                if (debug == "1")
                {
                    MessageBox.Show("审核签字");
                }


                string origindata = "";

                DataTable dt_jcxx = new DataTable();
                dt_jcxx = aa.GetDataTable("select * from T_JCXX where  F_BLH='" + getblh + "'", "cgbg");

                if (dt_jcxx == null)
                {
                    if (msg == "1")
                    {
                        MessageBox.Show("连接数据库异常");
                    }
                    return("0");
                }
                if (dt_jcxx.Rows.Count <= 0)
                {
                    if (msg == "1")
                    {
                        MessageBox.Show("T_JCXX查询数据异常");
                    }
                    return("0");
                }
                string shys   = dt_jcxx.Rows[0]["F_shys"].ToString();
                string spare5 = dt_jcxx.Rows[0]["F_spare5"].ToString();
                if (bglx == "cg")
                {
                    if (dt_jcxx.Rows[0]["F_BGZT"].ToString() != "已审核")
                    {
                        if (msg == "1")
                        {
                            MessageBox.Show("报告未审核");
                        }
                        return("0");
                    }
                    origindata = "病理号:" + dt_jcxx.Rows[0]["f_blh"].ToString() + "&报告类型:常规报告&报告序号:" + bgxh + "&&性别:" + dt_jcxx.Rows[0]["F_XB"].ToString() + "&年龄:" + dt_jcxx.Rows[0]["F_nl"].ToString()
                                 + "&住院号:" + dt_jcxx.Rows[0]["F_zyh"].ToString() + "&门诊号:" + dt_jcxx.Rows[0]["F_mzh"].ToString() + "&科室:" + dt_jcxx.Rows[0]["F_sjks"].ToString()
                                 + "&病理诊断:" + dt_jcxx.Rows[0]["F_blzd"].ToString() + "&报告医生:" + dt_jcxx.Rows[0]["F_bgys"].ToString() + "&复诊医生:" + dt_jcxx.Rows[0]["F_FZYS"].ToString()
                                 + "&审核医生:" + dt_jcxx.Rows[0]["F_SHYS"].ToString() + "&报告日期:" + dt_jcxx.Rows[0]["F_bgrq"].ToString() + "&审核日期:" + dt_jcxx.Rows[0]["F_spare5"].ToString();
                }
                //补充审核
                if (bglx == "bc")
                {
                    DataTable dt_bc = new DataTable();
                    dt_bc = aa.GetDataTable("select * from T_BCBG where  F_BLH='" + getblh + "' and F_BC_BGZT='已审核'and F_BC_BGXH='" + bgxh + "'", "bcbg");
                    if (dt_bc == null)
                    {
                        if (msg == "1")
                        {
                            MessageBox.Show("连接数据库异常");
                        }
                        return("0");
                    }
                    if (dt_bc.Rows.Count <= 0)
                    {
                        if (msg == "1")
                        {
                            MessageBox.Show("T_BCBG查询数据异常");
                        }
                        return("0");
                    }
                    origindata = "病理号:" + dt_jcxx.Rows[0]["f_blh"].ToString() + "&报告类型:补充报告&报告序号:" + bgxh + "&性别:" + dt_jcxx.Rows[0]["F_XB"].ToString() + "&年龄:" + dt_jcxx.Rows[0]["F_nl"].ToString()
                                 + "&住院号:" + dt_jcxx.Rows[0]["F_zyh"].ToString() + "&门诊号:" + dt_jcxx.Rows[0]["F_mzh"].ToString() + "&科室:" + dt_jcxx.Rows[0]["F_sjks"].ToString()
                                 + "&病理诊断:" + dt_bc.Rows[0]["F_BCZD"].ToString() + "&报告医生:" + dt_bc.Rows[0]["F_bc_bgys"].ToString() + "&复诊医生:" + dt_bc.Rows[0]["F_bc_FZYS"].ToString()
                                 + "&审核医生:" + dt_bc.Rows[0]["F_bc_SHYS"].ToString() + "&报告日期:" + dt_bc.Rows[0]["F_bc_bgrq"].ToString() + "&审核日期:" + dt_bc.Rows[0]["F_bc_spare5"].ToString();

                    shys   = dt_bc.Rows[0]["F_bc_shys"].ToString();
                    spare5 = dt_bc.Rows[0]["F_bc_spare5"].ToString();
                }
                //小冰冻审核
                if (bglx == "bd")
                {
                    DataTable dt_bd = new DataTable();
                    dt_bd = aa.GetDataTable("select * from T_BDBG  where  F_BLH='" + getblh + "' and  F_BD_BGZT='已审核' and F_BD_BGXH='" + bgxh + "'", "bcbg");
                    if (dt_bd == null)
                    {
                        if (msg == "1")
                        {
                            MessageBox.Show("连接数据库异常");
                        }
                        return("0");
                    }
                    if (dt_bd.Rows.Count <= 0)
                    {
                        if (msg == "1")
                        {
                            MessageBox.Show("T_BDBG查询数据异常");
                        }
                        return("0");
                    }
                    origindata = "病理号:" + dt_jcxx.Rows[0]["f_blh"].ToString() + "&报告类型:冰冻报告&报告序号:" + bgxh + "&性别:" + dt_jcxx.Rows[0]["F_XB"].ToString() + "&年龄:" + dt_jcxx.Rows[0]["F_nl"].ToString()
                                 + "&住院号:" + dt_jcxx.Rows[0]["F_zyh"].ToString() + "&门诊号:" + dt_jcxx.Rows[0]["F_mzh"].ToString() + "&科室:" + dt_jcxx.Rows[0]["F_sjks"].ToString()
                                 + "&病理诊断:" + dt_bd.Rows[0]["F_BdZD"].ToString() + "&报告医生:" + dt_bd.Rows[0]["F_bd_bgys"].ToString() + "&复诊医生:" + dt_bd.Rows[0]["F_fz_FZYS"].ToString()
                                 + "&审核医生:" + dt_bd.Rows[0]["F_bd_SHYS"].ToString() + "&报告日期:" + dt_bd.Rows[0]["F_bd_bgrq"].ToString();

                    shys   = dt_bd.Rows[0]["F_bd_shys"].ToString();
                    spare5 = dt_bd.Rows[0]["F_bd_bgrq"].ToString();
                }

                if (origindata.Trim() == "")
                {
                    if (msg == "1")
                    {
                        MessageBox.Show("数字签名内容为空");
                    }
                    return("0");
                }


                if (debug == "1")
                {
                    MessageBox.Show("打开key");
                }


                if (OpenUsbKey("") == 0)
                {
                    if (msg == "1")
                    {
                        MessageBox.Show("打开Key失败,签名失败");
                    }
                    return("0");
                }
                if (debug == "1")
                {
                    MessageBox.Show("打开key完成");
                }


                //获取签名证书
                StringBuilder sbSignCert = new StringBuilder(4096);
                if (GetSignCertOnUsbKey(sbSignCert) == 0)
                {
                    CloseUsbKey();
                    if (msg == "1")
                    {
                        MessageBox.Show("获取签名证书失败");
                    }
                    return("0");
                }
                if (debug == "1")
                {
                    MessageBox.Show("获取签名证书完成");
                }

                StringBuilder sbSignData = new StringBuilder(4096);

                if (SignDataOnUsbKey(origindata, sbSignData) == 0)
                {
                    CloseUsbKey();
                    if (msg == "1")
                    {
                        MessageBox.Show("签名失败");
                    }
                    return("0");
                }
                if (debug == "1")
                {
                    MessageBox.Show("签名完成");
                }

                SqlDB_ZGQ sqldb  = new SqlDB_ZGQ();
                string    errmsg = "";
                int       x      = sqldb.Sql_ExecuteNonQuery(sqlcon, "insert into T_CAXX(F_BLH,F_BGLX,F_BGXH,F_SHYS,F_SPARE5,F_CZY,F_QZNR,F_SignCert,F_SignData) values('" + getblh + "','" + bglx + "','" + bgxh
                                                             + "','" + shys + "','" + spare5 + "','" + yhmc + "','" + origindata + "','" + sbSignCert.ToString() + "','" + sbSignData.ToString() + "')", ref errmsg);
                if (debug == "1")
                {
                    if (x >= 1)
                    {
                        MessageBox.Show("写入T_CAXX完成");
                    }
                    else
                    {
                        MessageBox.Show("写入T_CAXX失败:" + errmsg);
                    }
                }

                string szqmlj = getSZ_String("view", "szqmlj", @"\\192.10.33.84\pathqc\rpt-szqm\YSBMP\");
                if (!File.Exists(szqmlj + yhmc + ".bmp"))
                {
                    DataTable dt_ca = new DataTable();
                    dt_ca = sqldb.Sql_DataAdapter(sqlcon, "select TOP 1 * from t_userInfo  where IdCardNumber='" + yhbh.Trim() + "'", ref errmsg);

                    if (dt_ca == null)
                    {
                        if (msg == "1")
                        {
                            MessageBox.Show("连接数据库pathnet_CA异常");
                        }
                        return("0");
                    }
                    if (dt_ca.Rows.Count <= 0)
                    {
                        MessageBox.Show("未能查询到用户(" + yhmc + ")的签名图片");
                        return("0");
                    }
                    if (debug == "1")
                    {
                        MessageBox.Show("查询t_userInfo完成");
                    }

                    try
                    {
                        byte[] MyData = new byte[0];
                        MyData = (byte[])dt_ca.Rows[0]["Image"];   //读取图片的位流
                        int ArraySize = MyData.GetUpperBound(0);   //获得数据库中存储的位流数组的维度上限,用作读取流的上限

                        FileStream fs = new FileStream(@"c:\temp\" + yhmc + ".jpg", FileMode.OpenOrCreate, FileAccess.Write);
                        fs.Write(MyData, 0, ArraySize);
                        fs.Close();


                        Bitmap source = new Bitmap(@"c:\temp\" + yhmc + ".jpg");
                        Bitmap bmp    = new Bitmap(source.Width, source.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);

                        Graphics.FromImage(bmp).DrawImage(source, new Rectangle(0, 0, bmp.Width, bmp.Height));


                        bmp.Save(szqmlj + yhmc + ".bmp", System.Drawing.Imaging.ImageFormat.Bmp);
                        if (szqmlj.Substring(0, 2) != "//")
                        {
                            ZgqFtpWeb.FtpUpload(ftpUserID, ftpPassword, ftpServerIP, szqmlj + yhmc + ".bmp", ftpszqmbmp, ref errmsg);
                        }
                        bmp.Save(szqmlj + yhmc + ".bmp", System.Drawing.Imaging.ImageFormat.Bmp);



                        //File.Copy(@"c:\temp\" + yhmc + ".jpg", szqmlj + yhmc + ".jpg");
                    }
                    catch (Exception e3)
                    {
                        MessageBox.Show(e3.Message);
                        return("0");
                    }
                    if (debug == "1")
                    {
                        MessageBox.Show("上传签字图片完成");
                    }
                }
                if (debug == "1")
                {
                    MessageBox.Show("签字完成");
                }
                return("1");
            }



            //***************************************************************
            //////取消审核前
            if (type == "QXSH")
            {
                return("1");
            }



            //***************************************************************
            //------------------------------------------------------------------
            //------------------------------------------------------------------
            //////取消审核后 ,同时删除数据库ca记录
            //------------------------------------------------------------------
            //------------------------------------------------------------------
            if (type == "QXQZ")   //&& (bglx == "BC" || bglx == "BD")
            {
                SqlDB_ZGQ sqldb  = new SqlDB_ZGQ();
                string    errmsg = "";
                sqldb.Sql_ExecuteNonQuery(sqlcon, "delete from  T_CAXX  where  F_BLH='" + getblh + "'  and F_BGLX='" + bglx + "' and F_BGXH='" + bgxh + "'", ref errmsg);
                return("1");
            }
            return("1");
        }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            string    conStr = f.ReadString("病理医嘱列表", "BLODBC", "Data Source=172.16.95.230;Initial Catalog=pathnet;User Id=pathnet;Password=4s3c2a1p");
            string    sqlstr = f.ReadString("病理医嘱列表", "sqlstr", "select top 10000 F_ZYH as 住院号,F_BRLB as 病人类别, F_XM as 姓名, F_XB as 性别, F_NL as 年龄,F_BLH as 病理号,F_LKH as 蜡块号,F_BJW as 医嘱项目,F_BZ as 备注,F_YZZT as 医嘱状态,F_SQYS as 申请医生,F_SQSJ as 申请日期,F_ZXR  as 执行人,F_ZXSJ as 执行时间,F_TJYZH as 医嘱号,F_BRBH as  病人编号,F_LCZD as 临床诊断,F_LXXX as 联系信息,F_SFZH as 身份证号,F_BQ as 病区,F_CH as 床号,F_HY as 婚姻,F_SJDW as 送检单位 FROM  V_TJYZ_TO_FZ ");
            SqlDB_ZGQ sql    = new SqlDB_ZGQ();

            sqlstr = sqlstr + " where F_SQSJ>='" + dateTimePicker1.Value.ToString("yyyy-MM-dd") + "'  and F_SQSJ<'" + dateTimePicker2.Value.AddDays(1).ToString("yyyy-MM-dd") + "' ";

            if (txtxm.Text.Trim() != "")
            {
                sqlstr = sqlstr + " and F_XM='" + txtxm.Text.Trim() + "'";
            }
            if (txtblh.Text.Trim() != "")
            {
                sqlstr = sqlstr + " and F_BLH='" + txtblh.Text.Trim() + "'";
            }

            if (txtzyh.Text.Trim() != "")
            {
                sqlstr = sqlstr + " and F_ZYH='" + txtzyh.Text.Trim() + "'";
            }
            if (txtmzh.Text.Trim() != "")
            {
                sqlstr = sqlstr + " and F_MZH='" + txtmzh.Text.Trim() + "'";
            }
            if (txtsqys.Text.Trim() != "")
            {
                sqlstr = sqlstr + " and F_SQYS='" + txtsqys.Text.Trim() + "'";
            }
            if (txtzxr.Text.Trim() != "")
            {
                sqlstr = sqlstr + " and F_ZXR='" + txtzxr.Text.Trim() + "'";
            }

            if (comboBox1.Text.Trim() != "全部")
            {
                if (comboBox1.Text.Trim() == "未执行")
                {
                    sqlstr = sqlstr + " and F_YZZT=' '";
                }
                else
                {
                    sqlstr = sqlstr + " and F_YZZT='" + comboBox1.Text.Trim() + "'";
                }
            }

            string errMsg = "";

            sqlstr = sqlstr + "  order by F_SQSJ desc";


            dt = sql.Sql_DataAdapter(conStr, sqlstr, ref errMsg);
            if (errMsg != "")
            {
                MessageBox.Show(errMsg); return;
            }

            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
            groupBox1.Text = "查询结果:" + dt.Rows.Count.ToString();

            if (dt.Rows.Count <= 0)
            {
                MessageBox.Show("未查询到相关记录");
            }
            else
            {
                dataGridView1.DataSource        = dt;
                dataGridView1.Columns[0].Width  = 100;
                dataGridView1.Columns[1].Width  = 50;
                dataGridView1.Columns[2].Width  = 70;
                dataGridView1.Columns[3].Width  = 30;
                dataGridView1.Columns[4].Width  = 45;
                dataGridView1.Columns[5].Width  = 80;
                dataGridView1.Columns[6].Width  = 85;
                dataGridView1.Columns[7].Width  = 160;
                dataGridView1.Columns[8].Width  = 90;
                dataGridView1.Columns[9].Width  = 60;
                dataGridView1.Columns[10].Width = 65;
                dataGridView1.Columns[11].Width = 120;
                dataGridView1.Columns[12].Width = 65;
                dataGridView1.Columns[13].Width = 120;
                dataGridView1.Columns[14].Width = 120;
                dataGridView1.Columns[15].Width = 80;
                dataGridView1.Columns[16].Width = 150;
                dataGridView1.Columns[17].Width = 100;
                dataGridView1.Columns[18].Width = 160;
                dataGridView1.Columns[19].Width = 90;
                dataGridView1.Columns[20].Width = 80;
                dataGridView1.Columns[21].Width = 50;
                dataGridView1.Columns[22].Width = 140;
            }
        }
Ejemplo n.º 6
0
        public static string ptxml(string Sslbx, string Ssbz, string Debug)
        {
            SqlDB_ZGQ db = new SqlDB_ZGQ();

            if (Sslbx != "")
            {
                string exp = "";
                string djr = f.ReadString("yh", "yhmc", "").Replace("\0", "").Trim();
                if (Sslbx == "手术申请单" || Sslbx == "冰冻申请单号")
                {
                    string odbcsql = f.ReadString(Sslbx, "odbcsql", "Data Source=172.16.10.1;Initial Catalog=xsylzx;User Id=xrh;Password=xsrmyy18;");
                    string tqbblb  = f.ReadString(Sslbx, "tqbblb", "0");
                    string debug   = f.ReadString(Sslbx, "debug", "0");

                    string sqlstr = "select *  from dbo.view_bdqpjcsqd   WHERE  registerid_int= '" + Ssbz.Trim() + "'";

                    DataTable dt_SQD = new DataTable();
                    string    exp_db = "";
                    dt_SQD = db.Sql_DataAdapter(odbcsql, sqlstr, ref exp_db);


                    if (dt_SQD == null)
                    {
                        MessageBox.Show("数据库连接异常!" + exp_db);
                        return("0");
                    }

                    if (dt_SQD.Rows.Count <= 0)
                    {
                        MessageBox.Show("未查询到此申请序号记录!");
                        return("0");
                    }

                    //取收费je
                    if (debug == "1")
                    {
                        MessageBox.Show(exp_db);
                    }

                    //-返回xml----------------------------------------------------
                    try
                    {
                        string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>";
                        xml = xml + "<LOGENE>";
                        xml = xml + "<row ";
                        try
                        {
                            xml = xml + "病人编号=" + (char)34 + dt_SQD.Rows[0]["patientid_vchr"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "病人编号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "就诊ID=" + (char)34 + dt_SQD.Rows[0]["iptimes_int"].ToString().Trim() + (char)34 + " ";
                        }
                        catch
                        {
                            xml = xml + "就诊ID=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "申请序号=" + (char)34 + dt_SQD.Rows[0]["registerid_int"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "申请序号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "住院号=" + (char)34 + dt_SQD.Rows[0]["PatientIpNo"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "住院号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "姓名=" + (char)34 + dt_SQD.Rows[0]["PatientName"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "姓名=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "性别=" + (char)34 + dt_SQD.Rows[0]["PatientSex"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "性别=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "年龄=" + (char)34 + dt_SQD.Rows[0]["PatientAge"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "年龄=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "地址=" + (char)34 + "" + (char)34 + "   ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "地址=" + (char)34 + "" + (char)34 + "   ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "电话=" + (char)34 + dt_SQD.Rows[0]["TEL"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "电话=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "病区=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "病区=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "床号=" + (char)34 + dt_SQD.Rows[0]["PatientBedNo"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "床号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "身份证号=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "身份证号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "民族=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "民族=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "职业=" + (char)34 + dt_SQD.Rows[0]["PatientJob"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "职业=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "送检科室=" + (char)34 + dt_SQD.Rows[0]["PatientDept"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "送检科室=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "送检医生=" + (char)34 + dt_SQD.Rows[0]["SJYS"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "送检医生=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------


                        xml = xml + "收费=" + (char)34 + "501" + (char)34 + " ";
                        //----------------------------------------------------------

                        xml = xml + "标本名称=" + (char)34 + dt_SQD.Rows[0]["BBMC"].ToString().Trim() + (char)34 + " ";
                        //----------------------------------------------------------

                        xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " ";
                        //----------------------------------------------------------
                        xml = xml + "医嘱项目=" + (char)34 + "" + (char)34 + " ";
                        //----------------------------------------------------------
                        xml = xml + "备用1=" + (char)34 + (char)34 + " ";
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "备用2=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee4)
                        {
                            log.WriteMyLog(ee4.Message);
                            xml = xml + "备用2=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "费别=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "费别=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "病人类别=" + (char)34 + "住院" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "病人类别=" + (char)34 + "" + (char)34 + " ";
                        }
                        xml = xml + "/>";
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "<临床病史><![CDATA[" + dt_SQD.Rows[0]["BLZY"].ToString().Trim() + "]]></临床病史>";//.Replace("\"", "&quot;")
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "<临床诊断><![CDATA[" + dt_SQD.Rows[0]["LCZD"].ToString().Trim() + "]]></临床诊断>";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "<临床诊断><![CDATA[" + "" + "]]></临床诊断>";
                        }


                        xml = xml + "</LOGENE>";

                        if (Debug == "1" && exp.Trim() != "")
                        {
                            log.WriteMyLog(exp.Trim());
                        }
                        return(xml);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("提取信息出错,请重新操作");
                        log.WriteMyLog("xml解析错误---" + e.Message);
                        return("0");
                    }
                }
                if (Sslbx == "申请单号" || Sslbx == "常规病理申请单号")
                {
                    string odbcsql = f.ReadString(Sslbx, "odbcsql", "Data Source=172.16.10.1;Initial Catalog=xsylzx;User Id=xrh;Password=xsrmyy18;");
                    string tqbblb  = f.ReadString(Sslbx, "tqbblb", "0");
                    string debug   = f.ReadString(Sslbx, "debug", "0");

                    string sqlstr = "select *  from dbo.view_bljcsqd   WHERE  registerid_int= '" + Ssbz.Trim() + "'";

                    DataTable dt_SQD = new DataTable();
                    string    exp_db = "";
                    dt_SQD = db.Sql_DataAdapter(odbcsql, sqlstr, ref exp_db);


                    if (dt_SQD == null)
                    {
                        MessageBox.Show("数据库连接异常!" + exp_db);
                        return("0");
                    }

                    if (dt_SQD.Rows.Count <= 0)
                    {
                        MessageBox.Show("未查询到此申请序号记录!");
                        return("0");
                    }

                    //取收费je
                    if (debug == "1")
                    {
                        MessageBox.Show(exp_db);
                    }

                    //-返回xml----------------------------------------------------
                    try
                    {
                        string xml = "<?xml version=" + (char)34 + "1.0" + (char)34 + " encoding=" + (char)34 + "gbk" + (char)34 + "?>";
                        xml = xml + "<LOGENE>";
                        xml = xml + "<row ";
                        try
                        {
                            xml = xml + "病人编号=" + (char)34 + dt_SQD.Rows[0]["patientid_vchr"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "病人编号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "就诊ID=" + (char)34 + dt_SQD.Rows[0]["iptimes_int"].ToString().Trim() + (char)34 + " ";
                        }
                        catch
                        {
                            xml = xml + "就诊ID=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "申请序号=" + (char)34 + dt_SQD.Rows[0]["registerid_int"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "申请序号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "门诊号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "住院号=" + (char)34 + dt_SQD.Rows[0]["PatientIpNo"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "住院号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "姓名=" + (char)34 + dt_SQD.Rows[0]["PatientName"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "姓名=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "性别=" + (char)34 + dt_SQD.Rows[0]["PatientSex"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "性别=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "年龄=" + (char)34 + dt_SQD.Rows[0]["PatientAge"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "年龄=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "婚姻=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "地址=" + (char)34 + "" + (char)34 + "   ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "地址=" + (char)34 + "" + (char)34 + "   ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "电话=" + (char)34 + dt_SQD.Rows[0]["TEL"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "电话=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "病区=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "病区=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "床号=" + (char)34 + dt_SQD.Rows[0]["PatientBedNo"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "床号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "身份证号=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "身份证号=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "民族=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "民族=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "职业=" + (char)34 + dt_SQD.Rows[0]["PatientJob"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "职业=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "送检科室=" + (char)34 + dt_SQD.Rows[0]["PatientDept"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "送检科室=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------

                        try
                        {
                            xml = xml + "送检医生=" + (char)34 + dt_SQD.Rows[0]["SJYS"].ToString().Trim() + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "送检医生=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------


                        xml = xml + "收费=" + (char)34 + "201" + (char)34 + " ";
                        //----------------------------------------------------------
                        ///////////////////////////
                        string BBLB_XML = "";
                        if (tqbblb == "1")
                        {
                            BBLB_XML = "<BBLB>";
                            try
                            {
                                if (dt_SQD.Rows[0]["BBMC1"].ToString().Trim() != "" || dt_SQD.Rows[0]["CQBW1"].ToString().Trim() != "")
                                {
                                    BBLB_XML = BBLB_XML + "<row ";
                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + "1" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD.Rows[0]["BBMC1"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD.Rows[0]["CQBW1"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD.Rows[0]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD.Rows[0]["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 + "/>";
                                }

                                if (dt_SQD.Rows[0]["BBMC2"].ToString().Trim() != "" || dt_SQD.Rows[0]["CQBW2"].ToString().Trim() != "")
                                {
                                    BBLB_XML = BBLB_XML + "<row ";
                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + "2" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD.Rows[0]["BBMC2"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD.Rows[0]["CQBW2"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD.Rows[0]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD.Rows[0]["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 + "/>";
                                }

                                if (dt_SQD.Rows[0]["BBMC3"].ToString().Trim() != "" || dt_SQD.Rows[0]["CQBW3"].ToString().Trim() != "")
                                {
                                    BBLB_XML = BBLB_XML + "<row ";
                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + "3" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD.Rows[0]["BBMC3"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD.Rows[0]["CQBW3"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD.Rows[0]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD.Rows[0]["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 + "/>";
                                }
                                if (dt_SQD.Rows[0]["BBMC4"].ToString().Trim() != "" || dt_SQD.Rows[0]["CQBW4"].ToString().Trim() != "")
                                {
                                    BBLB_XML = BBLB_XML + "<row ";
                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + "4" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD.Rows[0]["BBMC4"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD.Rows[0]["CQBW4"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD.Rows[0]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD.Rows[0]["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 + "/>";
                                }
                                if (dt_SQD.Rows[0]["BBMC5"].ToString().Trim() != "" || dt_SQD.Rows[0]["CQBW5"].ToString().Trim() != "")
                                {
                                    BBLB_XML = BBLB_XML + "<row ";
                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + "5" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD.Rows[0]["BBMC5"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD.Rows[0]["CQBW5"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD.Rows[0]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD.Rows[0]["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 + "/>";
                                }
                                if (dt_SQD.Rows[0]["BBMC6"].ToString().Trim() != "" || dt_SQD.Rows[0]["CQBW6"].ToString().Trim() != "")
                                {
                                    BBLB_XML = BBLB_XML + "<row ";
                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + "6" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD.Rows[0]["BBMC6"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD.Rows[0]["CQBW6"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD.Rows[0]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD.Rows[0]["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 + "/>";
                                }
                                if (dt_SQD.Rows[0]["BBMC7"].ToString().Trim() != "" || dt_SQD.Rows[0]["CQBW7"].ToString().Trim() != "")
                                {
                                    BBLB_XML = BBLB_XML + "<row ";
                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + "7" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD.Rows[0]["BBMC7"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD.Rows[0]["CQBW7"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD.Rows[0]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD.Rows[0]["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 + "/>";
                                }
                                if (dt_SQD.Rows[0]["BBMC8"].ToString().Trim() != "" || dt_SQD.Rows[0]["CQBW8"].ToString().Trim() != "")
                                {
                                    BBLB_XML = BBLB_XML + "<row ";
                                    BBLB_XML = BBLB_XML + "F_BBXH=" + (char)34 + "8" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBTMH=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BBMC=" + (char)34 + dt_SQD.Rows[0]["BBMC8"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_CQBW=" + (char)34 + dt_SQD.Rows[0]["CQBW8"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_BZ=" + (char)34 + "" + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_LTSJ=" + (char)34 + dt_SQD.Rows[0]["LTSJ"].ToString().Trim() + (char)34 + " ";
                                    BBLB_XML = BBLB_XML + "F_GDSJ=" + (char)34 + dt_SQD.Rows[0]["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";
                            }



                            BBLB_XML = BBLB_XML + "</BBLB>";
                        }
                        xml = xml + "标本名称=" + (char)34 + dt_SQD.Rows[0]["BBMC"].ToString().Trim() + (char)34 + " ";
                        //----------------------------------------------------------

                        xml = xml + "送检医院=" + (char)34 + "本院" + (char)34 + " ";
                        //----------------------------------------------------------
                        xml = xml + "医嘱项目=" + (char)34 + "" + (char)34 + " ";
                        //----------------------------------------------------------
                        xml = xml + "备用1=" + (char)34 + (char)34 + " ";
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "备用2=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee4)
                        {
                            log.WriteMyLog(ee4.Message);
                            xml = xml + "备用2=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "费别=" + (char)34 + "" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "费别=" + (char)34 + "" + (char)34 + " ";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "病人类别=" + (char)34 + "住院" + (char)34 + " ";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "病人类别=" + (char)34 + "" + (char)34 + " ";
                        }
                        xml = xml + "/>";
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "<临床病史><![CDATA[" + dt_SQD.Rows[0]["SSSJ"].ToString().Trim() + "]]></临床病史>";//.Replace("\"", "&quot;")
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "<临床病史><![CDATA[" + "" + "]]></临床病史>";
                        }
                        //----------------------------------------------------------
                        try
                        {
                            xml = xml + "<临床诊断><![CDATA[" + dt_SQD.Rows[0]["LCZD"].ToString().Trim() + "]]></临床诊断>";
                        }
                        catch (Exception ee)
                        {
                            exp = exp + ee.ToString();
                            xml = xml + "<临床诊断><![CDATA[" + "" + "]]></临床诊断>";
                        }

                        if (tqbblb == "1")
                        {
                            xml = xml + BBLB_XML;
                        }
                        xml = xml + "</LOGENE>";

                        if (Debug == "1" && exp.Trim() != "")
                        {
                            log.WriteMyLog(exp.Trim());
                        }
                        return(xml);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("提取信息出错,请重新操作");
                        log.WriteMyLog("xml解析错误---" + e.Message);
                        return("0");
                    }
                }
                else
                {
                    MessageBox.Show("无此" + Sslbx);
                    return("0");
                }
            }
            return("0");
        }
Ejemplo n.º 7
0
        /// <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");
        }