/// <summary> ///判断是否从his中提取费用信息,以及其中的sql /// </summary> private void GetHisLoad() { DataHelper datahelper = new DataHelper(); string StrFeiyong = datahelper.GetConfigValueByKey("IEMIsLoadHisFeiYong"); { if (StrFeiyong == "1") { btnLoad.Visible = true; } else { btnLoad.Visible = false; } } }
/// <summary> ///判断是否从his中提取费用信息,以及其中的sql /// </summary> private void GetHisLoad() { try { DataHelper datahelper = new DataHelper(); string StrFeiyong = datahelper.GetConfigValueByKey("IEMIsLoadHisFeiYong"); { if (StrFeiyong == "1") { btnLoad.Visible = true; } else { btnLoad.Visible = false; } } } catch (Exception ex) { throw new Exception(ex.Message); } }
/// <summary> /// 提取 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnFee_Click(object sender, EventArgs e) { try { this.SuspendLayout(); if (m_App == null || m_App.CurrentPatientInfo == null) { return; } DataHelper datahelper = new DataHelper(); string GetFeeType = datahelper.GetConfigValueByKey("GetHisMoneyType"); IDataAccess sqlHelper = DataAccessFactory.GetSqlDataAccess("HISDB"); if (sqlHelper == null) { m_App.CustomMessageBox.MessageShow("无法连接到HIS!", CustomMessageBoxKind.ErrorOk); return; } //to do yxy 提取HIS数据库中病人费用信息 //仁和医院需求 首页调取费用的方式 0是取视图 1是取存储过程 DataRow dataRow = null; DataTable dataTable = new DataTable(); DataTable Dt_FeeInfo = dataTable.Copy(); if (GetFeeType == "0") { //add by ywk 2012年10月8日 12:33:30 string sqlView = string.Format(@"select * from ZC_IEMFEEINFO where 住院号='{0}'", m_App.CurrentPatientInfo.NoOfFirstPage); dataTable = sqlHelper.ExecuteDataTable(sqlView, CommandType.Text); if (dataTable == null || dataTable.Rows.Count <= 0) { return; } Dt_FeeInfo = dataTable.Copy();//将所有的费用信息COPY下来,再进行筛选 dataRow = Dt_FeeInfo.Rows[0]; } else if (GetFeeType == "1")//取HIS存储过程 { //仁和医院的HIS是SQLSERVER版本的 add by ywk 2012年12月17日14:15:45 using (SqlConnection conn = new SqlConnection(DataAccessFactory.GetSqlDataAccess("HISDB").GetDbConnection().ConnectionString)) { if (conn.State != ConnectionState.Open) { conn.Open(); } SqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "pr_IEMFEEINFO"; //SqlD odap = new OracleDataAdapter(cmd); cmd.Parameters.Add("zyh", OracleType.VarChar).Direction = ParameterDirection.Input;//患者住院流水号 cmd.Parameters["zyh"].Value = m_App.CurrentPatientInfo.NoOfHisFirstPage; //cmd.ex(cmd.CommandText, cmd.Parameters["zyh"], CommandType.StoredProcedure); SqlDataAdapter odap = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); odap.Fill(ds); dataTable = ds.Tables[0]; dataRow = ds.Tables[0].Rows[0]; } } //DataRow dataRow=dataTable.Rows[0]; //to do 赋值 //to do 赋值 if (dataTable.Columns.Contains("总费用")) { txtTotal.Text = dataRow["总费用"].ToString(); //总费用 } if (dataTable.Columns.Contains("自付金额")) { txtOwnFee.Text = dataRow["自付金额"].ToString(); //自付金额 } if (dataTable.Columns.Contains("一般医疗服务费")) { txtYBYLFY.Text = dataRow["一般医疗服务费"].ToString(); //一般医疗服务费 } if (dataTable.Columns.Contains("一般治疗操作费")) { txtYBZLFY.Text = dataRow["一般治疗操作费"].ToString(); //一般治疗操作费 } if (dataTable.Columns.Contains("护理费")) { txtCare.Text = dataRow["护理费"].ToString(); //护理费 } txtZHQTFY.Text = "-"; //其他费用 if (dataTable.Columns.Contains("病理诊断费")) { txtBLZDF.Text = dataRow["病理诊断费"].ToString();; //病理诊断费#### } if (dataTable.Columns.Contains("实验室诊断费")) { txtSYSZDF.Text = dataRow["实验室诊断费"].ToString(); //实验室诊断费 } if (dataTable.Columns.Contains("影像学诊断费")) { txtYXXZDF.Text = dataRow["影像学诊断费"].ToString(); //影像学诊断费 } if (dataTable.Columns.Contains("临床诊断")) { txtLCZDF.Text = dataRow["临床诊断"].ToString(); //临床诊断项目费 } txtFSSZLF.Text = "-"; //非手术治疗项目费 txtLCWLZLF.Text = "-"; //临床物理治疗费 float mzf = 0f; float ssf = 0f; if (dataTable.Columns.Contains("手术费")) { float.TryParse(dataRow["手术费"].ToString(), out ssf); } if (dataTable.Columns.Contains("麻醉费")) { float.TryParse(dataRow["麻醉费"].ToString(), out mzf); } txtSSZLF.Text = (mzf + ssf).ToString(); //手术治疗费 麻醉费+手术费 if (dataTable.Columns.Contains("麻醉费")) { txtMZF.Text = dataRow["麻醉费"].ToString(); //麻醉费 } if (dataTable.Columns.Contains("手术费")) { txtSSF.Text = dataRow["手术费"].ToString(); //手术费 } if (dataTable.Columns.Contains("康复费")) { txtKFF.Text = dataRow["康复费"].ToString(); //康复费#### } if (dataTable.Columns.Contains("中医治疗费")) { txtZYZLF.Text = dataRow["中医治疗费"].ToString(); //中医治疗费#### } if (dataTable.Columns.Contains("西药费")) { txtXYF.Text = dataRow["西药费"].ToString(); //西药费 } txtKJYWF.Text = "-"; //抗菌药物费用 if (dataTable.Columns.Contains("中成药费")) { txtCPMedical.Text = dataRow["中成药费"].ToString(); //中成药费 } if (dataTable.Columns.Contains("中草药费")) { txtCMedical.Text = dataRow["中草药费"].ToString(); //中草药费 } if (dataTable.Columns.Contains("输血费")) { txtBloodFee.Text = dataRow["输血费"].ToString(); //血费 } txtXDBLZPF.Text = "-"; //白蛋白类制品费 txtQDBLZPF.Text = "-"; //球蛋白类制品费 txtNXYZLZPF.Text = "-"; //凝血因子类制品费 txtXBYZLZPF.Text = "-"; //细胞因子类制品费 if (dataTable.Columns.Contains("医用材料费")) { txtJCYYCXCLF.Text = dataRow["医用材料费"].ToString(); //检查用一次性医用材料费 } txtZLYYCXCLF.Text = "-"; //治疗用一次性医用材料费 if (dataTable.Columns.Contains("手术材料费")) { txtSSYYCXCLF.Text = dataRow["手术材料费"].ToString(); //手术用一次性医用材料费 } if (dataTable.Columns.Contains("其它")) { txtOtherFee.Text = dataRow["其它"].ToString(); //其他费用 } } catch (Exception ex) { MyMessageBox.Show(2, ex); } }
/// <summary> /// 提取 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnFee_Click(object sender, EventArgs e) { this.SuspendLayout(); if (m_App == null || m_App.CurrentPatientInfo == null) { return; } IDataAccess sqlHelper = DataAccessFactory.GetSqlDataAccess("HISDB"); if (sqlHelper == null) { m_App.CustomMessageBox.MessageShow("无法连接到HIS!", CustomMessageBoxKind.ErrorOk); return; } //to do yxy 提取HIS数据库中病人费用信息 #region 注释 // string sql = string.Format(@"SELECT CONVERT(varchar(12), PatCode) AS PatID,FeeCode, // CONVERT(varchar(12), FeeName) AS FeeName, CONVERT(float, SUM(Amount)) AS amount // FROM root.InnerRecipeCount WITH (nolock) // where PatCode = '{0}' // GROUP BY PatCode, FeeName,FeeCode", m_App.CurrentPatientInfo.NoOfHisFirstPage); //m_App.CurrentPatientInfo.NoOfHisFirstPage); //SqlParameter[] paraColl = new SqlParameter[] { new SqlParameter("@syxh", m_App.CurrentPatientInfo.NoOfHisFirstPage ) }; //DataTable dataTable = sqlHelper.ExecuteDataTable("usp_bq_fymxcx", paraColl, CommandType.StoredProcedure); //将从HIS中提取费用的功能,用从视图中取到,视图名称为:“YD_IEMFEEINFO” //************add by ywk 2012年10月8日 12:27:17****************** // string hisSql = @"select // a.zyh as 住院号 , // sum(fy) as 总费用, // b.zfje as 自付金额, // sum(case fb when 'zl' then fy --治疗费 // when 'YQ' then fy --输氧费 // when 'ZZ' then fy --诊疗费 // when 'JC' then fy --检查费 // when 'LL' then fy --理疗费 // when 'JG' then fy --激光 // when 'WB' then fy --微波治疗 // when 'YC' then fy --高压氧舱 // when 'DJ' then fy --基因检测 // when 'PJ' then fy end ) as 一般治疗操作费,--眼科治疗 // sum(case fb when 'YH' then fy --婴护费 // when 'TH' then fy --特护费 // when '1H' then fy --护理收入 // when 'YF' then fy end ) as 护理费, --换药费 // sum (case fb when 'XY' then fy end) as 西药费, --西药费 // sum(case fb when 'ZC' then fy end) as 中成药费, --中成药费 // sum(case fb when 'ZA' then fy end) as 中草药费, --中草药费 // sum(case fb when 'SS' then fy --手术费 // when 'JS' then fy --接生费 // when 'MS' then fy --门诊手术 // when 'SP' then fy --射频手术 // when 'KS' then fy end ) as 手术费, --科手术 // sum (case fb when 'MZ' then fy end ) as 麻醉费, --麻醉费 // sum(case fb when 'HY' then fy --化验费 // when 'JF' then fy end ) as 实验室诊断费, --检验费 // sum(case fb when 'XG' then fy --X光 // when 'CT' then fy --CT费 // when 'BC' then fy --B超 // when 'CC' then fy --彩超费 // when 'LD' then fy --脑电图 // when 'TS' then fy --透视费 // when 'NT' then fy --乳透 // when '60' then fy --胸B超 // when 'HC' then fy --磁共振 // when 'CB' then fy --C臂介入 // when 'MB' then fy --乳腺钼靶 // when 'KB' then fy end ) as 影像学诊断费, --科B超 // sum (case fb when 'SX' then fy end ) as 输血费, --输血费 // sum (case fb when 'WJ' then fy --电子胃镜 // when 'XD' then fy --心电图 // when 'CX' then fy --长心电 // when 'DT' then fy --心动图 // when 'XJ' then fy --心电监护 // when 'KD' then fy --科心电图 // when 'PD' then fy end) as 临床诊断, --潘生心电 // sum(case fb when 'QT'then fy --其它 // when 'QL' then fy --取暖费 // when 'JW' then fy end ) as 其它, --降温费 // sum(case fb when 'WC' then fy end ) as 医用材料费,--医用材料费 // sum (case fb when 'SB' then fy end) as 手术材料费 --手术材料费 // from zybl a left join sfjl b on a.zyh=b.zyh where a.zyh='{0}' group by a.zyh;"; //string sql = string.Format(hisSql, m_App.CurrentPatientInfo.NoOfHisFirstPage); //DataTable dataTable = sqlHelper.ExecuteDataTable(sql, CommandType.Text); //if (dataTable == null || dataTable.Rows.Count <= 0) return; #endregion //仁和医院需求 首页调取费用的方式 0是取视图 1是取存储过程 DataHelper datahelper = new DataHelper(); string GetFeeType = datahelper.GetConfigValueByKey("GetHisMoneyType"); DataRow dataRow = null; DataTable dataTable = new DataTable(); DataTable Dt_FeeInfo = dataTable.Copy(); if (GetFeeType == "0") { //add by ywk 2012年10月8日 12:33:30 //二次更改 add by ywk 2013年4月24日13:30:36 //string sqlView = "select * from YD_IEMFEEINFO"; string sqlView = string.Format("select * from YD_IEMFEEINFO where 住院号='{0}'", m_App.CurrentPatientInfo.NoOfHisFirstPage); dataTable = sqlHelper.ExecuteDataTable(sqlView, CommandType.Text); //if (dataTable == null || dataTable.Rows.Count <= 0) return; dataTable = sqlHelper.ExecuteDataTable(sqlView, CommandType.Text); if (dataTable == null || dataTable.Rows == null || dataTable.Rows.Count <= 0) { DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("未提取到该病人的费用信息"); return; } //Dt_FeeInfo = dataTable.Copy();//将所有的费用信息COPY下来,再进行筛选 //DataRow[] Dr_FeeInfo = Dt_FeeInfo.Select(string.Format("住院号='{0}'", m_App.CurrentPatientInfo.NoOfHisFirstPage));//进行筛选出 //if (Dr_FeeInfo.Length == 0) //{ // return; //} //dataRow = dataTable.Rows[0]; //视图的也给予填写栏位add by ywk 2013年6月3日 08:47:12 if (dataTable.Rows.Count > 0) { dataRow = dataTable.Rows[0]; FillFeeInfo(dataTable, dataRow); } else { DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("视图中未提取到该病人的费用信息"); return; } ////""的暂时用0.00代替 //dataRow = Dr_FeeInfo[0]; } if (GetFeeType == "1")//取HIS存储过程 { try { //应该根据HIS是SQL还是Oracle的进行分别实现add by ywk 二〇一三年五月二十九日 11:02:44 if (sqlHelper.GetDbConnection().ConnectionString.IndexOf("Data Source") >= 0)//Oracle的 { DrectSoft.DSSqlHelper.DS_SqlHelper.CreateSqlHelperByDBName("HISDB"); //SqlHelper.DS_SqlHelper.ConnectionString = DataAccessFactory.GetSqlDataAccess("HISDB").GetDbConnection().ConnectionString; DrectSoft.DSSqlHelper.DS_SqlHelper.BeginTransaction(); //MessageBox.Show("执行到了ConnectionString" + SqlHelper.DS_SqlHelper.ConnectionString); //中心医院无法从表中直接查询,为计算得到费用取得改为输出参数ywk 二〇一三年五月三十日 13:12:44 SqlParameter[] sqlParamhis = new SqlParameter[] { new SqlParameter("zyh", SqlDbType.VarChar), new SqlParameter("par_total", SqlDbType.VarChar, 100), //总费用 new SqlParameter("par_paycost", SqlDbType.VarChar, 100), // 自付金额 new SqlParameter("par_ybylfwf", SqlDbType.VarChar, 100), //一般医疗服务费 new SqlParameter("par_ybzlczf", SqlDbType.VarChar, 100), //一般治疗操作费, new SqlParameter("par_hlf", SqlDbType.VarChar, 100), //护理费, new SqlParameter("par_zhfwlqtf", SqlDbType.VarChar, 100), // 其他费用 new SqlParameter("par_blzdf", SqlDbType.VarChar, 100), //病理诊断费 new SqlParameter("par_syszdf", SqlDbType.VarChar, 100), //实验室诊断费, new SqlParameter("par_yxxzdf", SqlDbType.VarChar, 100), //影像学诊断费 new SqlParameter("par_lczdxmf", SqlDbType.VarChar, 100), //临床诊断 new SqlParameter("par_fsszlxmf", SqlDbType.VarChar, 100), //非手术治疗费 new SqlParameter("par_lcwlzlf", SqlDbType.VarChar, 100), //临床物理治疗费, new SqlParameter("par_sszlf", SqlDbType.VarChar, 100), // 手术治疗费 new SqlParameter("par_mzf", SqlDbType.VarChar, 100), //麻醉费 new SqlParameter("par_ssf", SqlDbType.VarChar, 100), //手术费 new SqlParameter("par_kff", SqlDbType.VarChar, 100), //康复费, new SqlParameter("par_zyzlf", SqlDbType.VarChar, 100), // 中医治疗费 new SqlParameter("par_xyf", SqlDbType.VarChar, 100), // 西药费 new SqlParameter("par_kjywfy", SqlDbType.VarChar, 100), // 抗菌药物费用 new SqlParameter("par_cyf", SqlDbType.VarChar, 100), // 中成药费 new SqlParameter("par_zcyf", SqlDbType.VarChar, 100), // 中草药费 new SqlParameter("par_xf", SqlDbType.VarChar, 100), // 输血费 new SqlParameter("par_bdblzpf", SqlDbType.VarChar, 100), // 血蛋白类制品费 new SqlParameter("par_qdblzpf", SqlDbType.VarChar, 100), // 球蛋白类制品费 new SqlParameter("par_nxyzlzpf", SqlDbType.VarChar, 100), // 凝血因子类制品费 new SqlParameter("par_xbyzlzpf", SqlDbType.VarChar, 100), // 细胞因子类制品费 new SqlParameter("par_jcyycxcl", SqlDbType.VarChar, 100), // 医用材料费, new SqlParameter("par_zlyycxcl", SqlDbType.VarChar, 100), // 治疗用一次性医用材料费, new SqlParameter("par_ssyycxcl", SqlDbType.VarChar, 100), // 手术材料费 new SqlParameter("par_qt", SqlDbType.VarChar, 100) // 其他类 }; sqlParamhis[0].Direction = ParameterDirection.Input; //sqlParamhis[1].Size = 100; sqlParamhis[1].Direction = ParameterDirection.Output; sqlParamhis[2].Direction = ParameterDirection.Output; sqlParamhis[3].Direction = ParameterDirection.Output; sqlParamhis[4].Direction = ParameterDirection.Output; sqlParamhis[5].Direction = ParameterDirection.Output; sqlParamhis[6].Direction = ParameterDirection.Output; sqlParamhis[7].Direction = ParameterDirection.Output; sqlParamhis[8].Direction = ParameterDirection.Output; sqlParamhis[9].Direction = ParameterDirection.Output; sqlParamhis[10].Direction = ParameterDirection.Output; sqlParamhis[11].Direction = ParameterDirection.Output; sqlParamhis[12].Direction = ParameterDirection.Output; sqlParamhis[13].Direction = ParameterDirection.Output; sqlParamhis[14].Direction = ParameterDirection.Output; sqlParamhis[15].Direction = ParameterDirection.Output; sqlParamhis[16].Direction = ParameterDirection.Output; sqlParamhis[17].Direction = ParameterDirection.Output; sqlParamhis[18].Direction = ParameterDirection.Output; sqlParamhis[19].Direction = ParameterDirection.Output; sqlParamhis[20].Direction = ParameterDirection.Output; sqlParamhis[21].Direction = ParameterDirection.Output; sqlParamhis[22].Direction = ParameterDirection.Output; sqlParamhis[23].Direction = ParameterDirection.Output; sqlParamhis[24].Direction = ParameterDirection.Output; sqlParamhis[25].Direction = ParameterDirection.Output; sqlParamhis[26].Direction = ParameterDirection.Output; sqlParamhis[27].Direction = ParameterDirection.Output; sqlParamhis[28].Direction = ParameterDirection.Output; sqlParamhis[29].Direction = ParameterDirection.Output; sqlParamhis[30].Direction = ParameterDirection.Output; //for (int i = 1; i < 31; i++) //{ // sqlParamhis[i].Size = 100; //} sqlParamhis[0].Value = m_App.CurrentPatientInfo.NoOfHisFirstPage; //MessageBox.Show("第一个参数是" + sqlParam[0].Value); try { //SqlHelper.DS_SqlHelper.ExecuteDataTable("select 1 from dual", CommandType.Text); //MessageBox.Show("成功连接到HIS数据库"); DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteNonQueryInTran("pr_IEMFEEINFO", sqlParamhis, CommandType.StoredProcedure); //MessageBox.Show("已经执行ExecuteNonQueryInTran"); //没计算出来就给0 txtTotal.Text = sqlParamhis[1].Value.ToString() == "" ? "0" : sqlParamhis[1].Value.ToString(); //MessageBox.Show("总费用是" + sqlParamhis[1].Value.ToString()); txtOwnFee.Text = sqlParamhis[2].Value.ToString() == "" ? "0" : sqlParamhis[2].Value.ToString(); txtYBYLFY.Text = sqlParamhis[3].Value.ToString() == "" ? "0" : sqlParamhis[3].Value.ToString(); txtYBZLFY.Text = sqlParamhis[4].Value.ToString() == "" ? "0" : sqlParamhis[4].Value.ToString(); txtCare.Text = sqlParamhis[5].Value.ToString() == "" ? "0" : sqlParamhis[5].Value.ToString(); txtZHQTFY.Text = sqlParamhis[6].Value.ToString() == "" ? "0" : sqlParamhis[6].Value.ToString(); txtBLZDF.Text = sqlParamhis[7].Value.ToString() == "" ? "0" : sqlParamhis[7].Value.ToString(); txtSYSZDF.Text = sqlParamhis[8].Value.ToString() == "" ? "0" : sqlParamhis[8].Value.ToString(); txtYXXZDF.Text = sqlParamhis[9].Value.ToString() == "" ? "0" : sqlParamhis[9].Value.ToString(); txtLCZDF.Text = sqlParamhis[10].Value.ToString() == "" ? "0" : sqlParamhis[10].Value.ToString(); txtFSSZLF.Text = sqlParamhis[11].Value.ToString() == "" ? "0" : sqlParamhis[11].Value.ToString(); txtLCWLZLF.Text = sqlParamhis[12].Value.ToString() == "" ? "0" : sqlParamhis[12].Value.ToString(); txtSSZLF.Text = sqlParamhis[13].Value.ToString() == "" ? "0" : sqlParamhis[13].Value.ToString(); txtMZF.Text = sqlParamhis[14].Value.ToString() == "" ? "0" : sqlParamhis[14].Value.ToString(); txtSSF.Text = sqlParamhis[15].Value.ToString() == "" ? "0" : sqlParamhis[15].Value.ToString(); txtKFF.Text = sqlParamhis[16].Value.ToString() == "" ? "0" : sqlParamhis[16].Value.ToString(); txtZYZLF.Text = sqlParamhis[17].Value.ToString() == "" ? "0" : sqlParamhis[17].Value.ToString(); txtXYF.Text = sqlParamhis[18].Value.ToString() == "" ? "0" : sqlParamhis[18].Value.ToString(); txtKJYWF.Text = sqlParamhis[19].Value.ToString() == "" ? "0" : sqlParamhis[19].Value.ToString(); txtCPMedical.Text = sqlParamhis[20].Value.ToString() == "" ? "0" : sqlParamhis[20].Value.ToString(); txtCMedical.Text = sqlParamhis[21].Value.ToString() == "" ? "0" : sqlParamhis[21].Value.ToString(); txtBloodFee.Text = sqlParamhis[22].Value.ToString() == "" ? "0" : sqlParamhis[22].Value.ToString(); txtXDBLZPF.Text = sqlParamhis[23].Value.ToString() == "" ? "0" : sqlParamhis[23].Value.ToString(); txtQDBLZPF.Text = sqlParamhis[24].Value.ToString() == "" ? "0" : sqlParamhis[24].Value.ToString(); txtNXYZLZPF.Text = sqlParamhis[25].Value.ToString() == "" ? "0" : sqlParamhis[25].Value.ToString(); txtXBYZLZPF.Text = sqlParamhis[26].Value.ToString() == "" ? "0" : sqlParamhis[26].Value.ToString(); txtJCYYCXCLF.Text = sqlParamhis[27].Value.ToString() == "" ? "0" : sqlParamhis[27].Value.ToString(); txtZLYYCXCLF.Text = sqlParamhis[28].Value.ToString() == "" ? "0" : sqlParamhis[28].Value.ToString(); txtSSYYCXCLF.Text = sqlParamhis[29].Value.ToString() == "" ? "0" : sqlParamhis[29].Value.ToString(); txtOtherFee.Text = sqlParamhis[30].Value.ToString() == "" ? "0" : sqlParamhis[30].Value.ToString(); DrectSoft.DSSqlHelper.DS_SqlHelper.CommitTransaction(); } catch (Exception ex) { m_App.CustomMessageBox.MessageShow("调用HIS的存储过程报错信息为: " + ex.Message); } } else if (sqlHelper.GetDbConnection().ConnectionString.IndexOf("Database") >= 0)//SQL的 { //仁和医院的HIS是SQLSERVER版本的 add by ywk 2012年12月17日14:15:45 using (SqlConnection conn = new SqlConnection(DataAccessFactory.GetSqlDataAccess("HISDB").GetDbConnection().ConnectionString)) { if (conn.State != ConnectionState.Open) { conn.Open(); } SqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "pr_IEMFEEINFO"; //SqlD odap = new OracleDataAdapter(cmd); cmd.Parameters.Add("zyh", OracleType.VarChar).Direction = ParameterDirection.Input;//患者住院流水号 cmd.Parameters["zyh"].Value = m_App.CurrentPatientInfo.NoOfHisFirstPage; //cmd.ex(cmd.CommandText, cmd.Parameters["zyh"], CommandType.StoredProcedure); SqlDataAdapter odap = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); odap.Fill(ds); //edit by ywk 2013年4月27日10:30:14 dataTable = ds.Tables[0];//这个应该赋值!!!!!!!!!!!add by ywk 2013年5月6日16:07:17 if (dataTable.Rows.Count > 0) { dataRow = dataTable.Rows[0]; FillFeeInfo(dataTable, dataRow); } else { DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("存储过程中未提取到该病人的费用信息"); return; } } } } catch (Exception ex) { m_App.CustomMessageBox.MessageShow("调用HIS的存储过程报错信息为: " + ex.Message); //throw; } } //if (this.FindForm() == null) //{ // this.Refresh(); //} //else // this.FindForm().Refresh(); }
private void ReLocationEditButton() { DataHelper help = new DataHelper(); string cansee = help.GetConfigValueByKey("EmrInputConfig"); XmlDocument doc1 = new XmlDocument(); doc1.LoadXml(cansee); int m_AnOtherHeight = 0; string changeHeight = doc1.GetElementsByTagName("IemPageContorlVisable")[0].InnerText;//可见诊断符合的一些栏位 simpleButton1.Visible = false; simpleButton1.Height = Convert.ToInt32(percentHeight1 * GetPageHeight()); simpleButton1.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y); if (changeHeight == "1") { simpleButton2.Height = 480; simpleButton2.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y + simpleButton1.Height); } else { simpleButton2.Height = Convert.ToInt32(percentHeight2 * GetPageHeight()); simpleButton2.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y + simpleButton1.Height); } if (changeHeight == "1") { simpleButton3.Height = 580; simpleButton3.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y + simpleButton1.Height + simpleButton2.Height); } else { simpleButton3.Height = Convert.ToInt32(percentHeight3 * GetPageHeight()); simpleButton3.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y + simpleButton1.Height + simpleButton2.Height); } //if (changeHeight == "1") //{ // simpleButton4.Height = 630; // simpleButton4.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y - 200); //} //else //{ simpleButton4.Height = Convert.ToInt32(percentHeight4 * GetPageHeight()); simpleButton4.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y); //} //if (info.IemObstetricsBaby != null) //{ // //simpleButton5.Visible = true; // //simpleButton5.Height = Convert.ToInt32(percentHeight5 * GetPageHeight()); // //simpleButton5.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y + simpleButton4.Height); // simpleButton6.Height = Convert.ToInt32(percentHeight6 * GetPageHeight()); // simpleButton6.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y + simpleButton4.Height + simpleButton5.Height); //} //else //{ //simpleButton5.Visible = false; simpleButton6.Height = Convert.ToInt32(GetPageHeight() - simpleButton4.Height); simpleButton6.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y + simpleButton4.Height); //} }
private void LoadForm() { //manger = new IemMainPageManger(m_Host); //info = manger.GetIemInfo(); DeleteMetaFile(); util = new DrawMainPageUtil(info); pictureBox1.Width = GetPageWidth(); pictureBox1.Height = GetPageHeight(); pictureBox2.Width = GetPageWidth(); pictureBox2.Height = GetPageHeight(); pictureBox1.BackgroundImage = util.MF1; pictureBox2.BackgroundImage = util.MF2; pictureBox1.BackgroundImageLayout = ImageLayout.Stretch; pictureBox2.BackgroundImageLayout = ImageLayout.Stretch; ReLocationPicture(); BindParentFormCloseEvent(); if (this.Parent != null) { if (this.Parent.AccessibleName != null && this.Parent.AccessibleName.Trim() != "") //父窗体的AccessibleName不为空则表示没有编辑的权限 { simpleButton1.Visible = false; simpleButton2.Visible = false; simpleButton3.Visible = false; simpleButton4.Visible = false; simpleButton5.Visible = false;// addby ywk 2013年1月30日13:34:00 simpleButton6.Visible = false; } } Employee emp = new Employee(m_Host.User.Id); emp.ReInitializeProperties(); DataHelper help = new DataHelper(); string hoscode = help.GetConfigValueByKey("HosCode"); if (hoscode == "1") { string static_save = help.GetStatic_SaveValue(info.IemBasicInfo.NoOfInpat); if (static_save == "1") { simpleButton1.Enabled = false; simpleButton2.Enabled = false; simpleButton3.Enabled = false; simpleButton4.Enabled = false; simpleButton5.Enabled = false; simpleButton6.Enabled = false; } } if (emp.Grade.Trim() != "") { DoctorGrade grade = (DoctorGrade)Enum.Parse(typeof(DoctorGrade), emp.Grade); if (grade == DoctorGrade.Nurse) { simpleButton3.Enabled = false; simpleButton4.Enabled = false; simpleButton5.Enabled = false; simpleButton6.Enabled = false; } } else { simpleButton1.Enabled = false; simpleButton2.Enabled = false; simpleButton3.Enabled = false; simpleButton4.Enabled = false; simpleButton5.Enabled = false; simpleButton6.Enabled = false; } }
/// <summary> /// 提取 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnFee_Click(object sender, EventArgs e) { this.SuspendLayout(); if (m_App == null || m_App.CurrentPatientInfo == null) { return; } IDataAccess sqlHelper = DataAccessFactory.GetSqlDataAccess("HISDB"); if (sqlHelper == null) { m_App.CustomMessageBox.MessageShow("无法连接到HIS!", CustomMessageBoxKind.ErrorOk); return; } //to do yxy 提取HIS数据库中病人费用信息 #region 注释 // string sql = string.Format(@"SELECT CONVERT(varchar(12), PatCode) AS PatID,FeeCode, // CONVERT(varchar(12), FeeName) AS FeeName, CONVERT(float, SUM(Amount)) AS amount // FROM root.InnerRecipeCount WITH (nolock) // where PatCode = '{0}' // GROUP BY PatCode, FeeName,FeeCode", m_App.CurrentPatientInfo.NoOfHisFirstPage); //m_App.CurrentPatientInfo.NoOfHisFirstPage); //SqlParameter[] paraColl = new SqlParameter[] { new SqlParameter("@syxh", m_App.CurrentPatientInfo.NoOfHisFirstPage ) }; //DataTable dataTable = sqlHelper.ExecuteDataTable("usp_bq_fymxcx", paraColl, CommandType.StoredProcedure); //将从HIS中提取费用的功能,用从视图中取到,视图名称为:“YD_IEMFEEINFO” //************add by ywk 2012年10月8日 12:27:17****************** // string hisSql = @"select // a.zyh as 住院号 , // sum(fy) as 总费用, // b.zfje as 自付金额, // sum(case fb when 'zl' then fy --治疗费 // when 'YQ' then fy --输氧费 // when 'ZZ' then fy --诊疗费 // when 'JC' then fy --检查费 // when 'LL' then fy --理疗费 // when 'JG' then fy --激光 // when 'WB' then fy --微波治疗 // when 'YC' then fy --高压氧舱 // when 'DJ' then fy --基因检测 // when 'PJ' then fy end ) as 一般治疗操作费,--眼科治疗 // sum(case fb when 'YH' then fy --婴护费 // when 'TH' then fy --特护费 // when '1H' then fy --护理收入 // when 'YF' then fy end ) as 护理费, --换药费 // sum (case fb when 'XY' then fy end) as 西药费, --西药费 // sum(case fb when 'ZC' then fy end) as 中成药费, --中成药费 // sum(case fb when 'ZA' then fy end) as 中草药费, --中草药费 // sum(case fb when 'SS' then fy --手术费 // when 'JS' then fy --接生费 // when 'MS' then fy --门诊手术 // when 'SP' then fy --射频手术 // when 'KS' then fy end ) as 手术费, --科手术 // sum (case fb when 'MZ' then fy end ) as 麻醉费, --麻醉费 // sum(case fb when 'HY' then fy --化验费 // when 'JF' then fy end ) as 实验室诊断费, --检验费 // sum(case fb when 'XG' then fy --X光 // when 'CT' then fy --CT费 // when 'BC' then fy --B超 // when 'CC' then fy --彩超费 // when 'LD' then fy --脑电图 // when 'TS' then fy --透视费 // when 'NT' then fy --乳透 // when '60' then fy --胸B超 // when 'HC' then fy --磁共振 // when 'CB' then fy --C臂介入 // when 'MB' then fy --乳腺钼靶 // when 'KB' then fy end ) as 影像学诊断费, --科B超 // sum (case fb when 'SX' then fy end ) as 输血费, --输血费 // sum (case fb when 'WJ' then fy --电子胃镜 // when 'XD' then fy --心电图 // when 'CX' then fy --长心电 // when 'DT' then fy --心动图 // when 'XJ' then fy --心电监护 // when 'KD' then fy --科心电图 // when 'PD' then fy end) as 临床诊断, --潘生心电 // sum(case fb when 'QT'then fy --其它 // when 'QL' then fy --取暖费 // when 'JW' then fy end ) as 其它, --降温费 // sum(case fb when 'WC' then fy end ) as 医用材料费,--医用材料费 // sum (case fb when 'SB' then fy end) as 手术材料费 --手术材料费 // from zybl a left join sfjl b on a.zyh=b.zyh where a.zyh='{0}' group by a.zyh;"; //string sql = string.Format(hisSql, m_App.CurrentPatientInfo.NoOfHisFirstPage); //DataTable dataTable = sqlHelper.ExecuteDataTable(sql, CommandType.Text); //if (dataTable == null || dataTable.Rows.Count <= 0) return; #endregion //仁和医院需求 首页调取费用的方式 0是取视图 1是取存储过程 DataHelper datahelper = new DataHelper(); string GetFeeType = datahelper.GetConfigValueByKey("GetHisMoneyType"); DataRow dataRow = null; DataTable dataTable = new DataTable(); DataTable Dt_FeeInfo = dataTable.Copy(); if (GetFeeType == "0") { //add by ywk 2012年10月8日 12:33:30 //string sqlView = "select * from YD_IEMFEEINFO"; //xll 修改 费用提取 2013-04-19 string sqlView = string.Format("select * from YD_IEMFEEINFO where 住院号='{0}'", m_App.CurrentPatientInfo.NoOfHisFirstPage); dataTable = sqlHelper.ExecuteDataTable(sqlView, CommandType.Text); if (dataTable == null || dataTable.Rows == null || dataTable.Rows.Count <= 0) { DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("未提取到该病人的费用信息"); return; } //Dt_FeeInfo = dataTable.Copy();//将所有的费用信息COPY下来,再进行筛选 //DataRow[] Dr_FeeInfo = Dt_FeeInfo.Select(string.Format("住院号='{0}'", m_App.CurrentPatientInfo.NoOfHisFirstPage));//进行筛选出 //if (Dr_FeeInfo.Length == 0) //{ // return; //} //""的暂时用0.00代替 dataRow = dataTable.Rows[0]; } if (GetFeeType == "1")//取HIS存储过程 { try { //仁和医院的HIS是SQLSERVER版本的 add by ywk 2012年12月17日14:15:45 using (SqlConnection conn = new SqlConnection(DataAccessFactory.GetSqlDataAccess("HISDB").GetDbConnection().ConnectionString)) { if (conn.State != ConnectionState.Open) { conn.Open(); } SqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "pr_IEMFEEINFO"; //SqlD odap = new OracleDataAdapter(cmd); cmd.Parameters.Add("zyh", OracleType.VarChar).Direction = ParameterDirection.Input;//患者住院流水号 cmd.Parameters["zyh"].Value = m_App.CurrentPatientInfo.NoOfHisFirstPage; //cmd.ex(cmd.CommandText, cmd.Parameters["zyh"], CommandType.StoredProcedure); SqlDataAdapter odap = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); odap.Fill(ds); dataTable = ds.Tables[0]; dataRow = ds.Tables[0].Rows[0]; } //using (OracleConnection conn = new OracleConnection(DataAccessFactory.GetSqlDataAccess("HISDB").GetDbConnection().ConnectionString)) //{ // if (conn.State != ConnectionState.Open) // conn.Open(); // OracleCommand cmd = conn.CreateCommand(); // cmd.CommandType = CommandType.StoredProcedure; // cmd.CommandText = "pr_IEMFEEINFO"; // OracleDataAdapter odap = new OracleDataAdapter(cmd); // cmd.Parameters.Add("zyh", OracleType.VarChar).Direction = ParameterDirection.Input;//患者住院流水号 // cmd.Parameters["zyh"].Value = m_App.CurrentPatientInfo.NoOfHisFirstPage; // //sqlHelper.ExecuteDataTable(cmd.CommandText, cmd.Parameters["zyh"], CommandType.StoredProcedure); // DataSet ds = new DataSet(); // odap.Fill(ds); // dataTable = ds.Tables[0]; // dataRow = ds.Tables[0].Rows[0]; //} } catch (Exception ex) { m_App.CustomMessageBox.MessageShow("调用HIS的存储过程报错信息为: " + ex.Message); //throw; } } //DataRow dataRow=dataTable.Rows[0]; //to do 赋值 //to do 赋值 if (dataTable.Columns.Contains("总费用")) { txtTotal.Text = dataRow["总费用"].ToString(); //总费用 } if (dataTable.Columns.Contains("自付金额")) { txtOwnFee.Text = dataRow["自付金额"].ToString(); //自付金额 } if (dataTable.Columns.Contains("一般医疗服务费")) { txtYBYLFY.Text = dataRow["一般医疗服务费"].ToString(); //一般医疗服务费 } if (dataTable.Columns.Contains("一般治疗操作费")) { txtYBZLFY.Text = dataRow["一般治疗操作费"].ToString(); //一般治疗操作费 } if (dataTable.Columns.Contains("护理费")) { txtCare.Text = dataRow["护理费"].ToString(); //护理费 } txtZHQTFY.Text = "-"; //其他费用 if (dataTable.Columns.Contains("病理诊断费")) { txtBLZDF.Text = dataRow["病理诊断费"].ToString();; //病理诊断费#### } if (dataTable.Columns.Contains("实验室诊断费")) { txtSYSZDF.Text = dataRow["实验室诊断费"].ToString(); //实验室诊断费 } if (dataTable.Columns.Contains("影像学诊断费")) { txtYXXZDF.Text = dataRow["影像学诊断费"].ToString(); //影像学诊断费 } if (dataTable.Columns.Contains("临床诊断")) { txtLCZDF.Text = dataRow["临床诊断"].ToString(); //临床诊断项目费 } txtFSSZLF.Text = "-"; //非手术治疗项目费 txtLCWLZLF.Text = "-"; //临床物理治疗费 float mzf = 0f; float ssf = 0f; if (dataTable.Columns.Contains("手术费")) { float.TryParse(dataRow["手术费"].ToString(), out ssf); } if (dataTable.Columns.Contains("麻醉费")) { float.TryParse(dataRow["麻醉费"].ToString(), out mzf); } txtSSZLF.Text = (mzf + ssf).ToString(); //手术治疗费 麻醉费+手术费 if (dataTable.Columns.Contains("麻醉费")) { txtMZF.Text = dataRow["麻醉费"].ToString(); //麻醉费 } if (dataTable.Columns.Contains("手术费")) { txtSSF.Text = dataRow["手术费"].ToString(); //手术费 } if (dataTable.Columns.Contains("康复费")) { txtKFF.Text = dataRow["康复费"].ToString(); //康复费#### } if (dataTable.Columns.Contains("中医治疗费")) { txtZYZLF.Text = dataRow["中医治疗费"].ToString(); //中医治疗费#### } if (dataTable.Columns.Contains("西药费")) { txtXYF.Text = dataRow["西药费"].ToString(); //西药费 } txtKJYWF.Text = "-"; //抗菌药物费用 if (dataTable.Columns.Contains("中成药费")) { txtCPMedical.Text = dataRow["中成药费"].ToString(); //中成药费 } if (dataTable.Columns.Contains("中草药费")) { txtCMedical.Text = dataRow["中草药费"].ToString(); //中草药费 } if (dataTable.Columns.Contains("输血费")) { txtBloodFee.Text = dataRow["输血费"].ToString(); //血费 } txtXDBLZPF.Text = "-"; //白蛋白类制品费 txtQDBLZPF.Text = "-"; //球蛋白类制品费 txtNXYZLZPF.Text = "-"; //凝血因子类制品费 txtXBYZLZPF.Text = "-"; //细胞因子类制品费 if (dataTable.Columns.Contains("医用材料费")) { txtJCYYCXCLF.Text = dataRow["医用材料费"].ToString(); //检查用一次性医用材料费 } txtZLYYCXCLF.Text = "-"; //治疗用一次性医用材料费 if (dataTable.Columns.Contains("手术材料费")) { txtSSYYCXCLF.Text = dataRow["手术材料费"].ToString(); //手术用一次性医用材料费 } if (dataTable.Columns.Contains("其它")) { txtOtherFee.Text = dataRow["其它"].ToString(); //其他费用 } //if (this.FindForm() == null) //{ // this.Refresh(); //} //else // this.FindForm().Refresh(); }