//补充上传病人剩余未上传费用 private void btnSupplyLoad_Click(object sender, EventArgs e) { this.Cursor = PubStaticFun.WaitCursor(); try { string zyh = txtZyh.Text.Trim(); if (string.IsNullOrEmpty(zyh)) { MessageBox.Show("请输入住院号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } string strSql = string.Format("select INPATIENT_ID from ZY_INPATIENT where INPATIENT_NO ='{0}' and DEPT_ID='{1}' ", zyh, InstanceForm.BCurrentDept.DeptId); string inp = ""; try { inp = database.GetDataResult(strSql).ToString(); } catch (Exception ex) { MessageBox.Show("未在本科室找到该住院号:" + zyh + " 的病人信息\r" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } bool CanAudit = ClsAuditCheck.CheckIsAuditCheck(inp, database);//是否需要智审 if (!CanAudit) { MessageBox.Show("该病人不满足进行智审判断条件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (MessageBox.Show("确认补传 住院号:" + zyh + " 该病人未上传费用吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Cancel) { return; } string strMsg = ""; bool bSuc = DoVaildYbFee(new DataTable(), 9, 0, new Guid(inp), 0, true, out strMsg); if (!bSuc) { MessageBox.Show(strMsg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } MessageBox.Show("补传病人费用成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { } finally { this.Cursor = Cursors.Arrow; } }
//删除重审 private void btnReLoad_Click(object sender, EventArgs e) { this.Cursor = PubStaticFun.WaitCursor(); try { string zyh = txtZyh.Text.Trim(); if (string.IsNullOrEmpty(zyh)) { MessageBox.Show("请输入住院号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } string strSql = string.Format("select INPATIENT_ID from VI_ZY_VINPATIENT_ALL where INPATIENT_NO ='{0}' and {2}='{1}' ", zyh, _iYsHs == 0 ? InstanceForm.BCurrentDept.DeptId.ToString() : InstanceForm.BCurrentDept.WardId, _iYsHs == 0 ? "DEPT_ID" : "ward_id"); string inp = ""; try { inp = database.GetDataResult(strSql).ToString(); } catch (Exception ex) { MessageBox.Show("未在本科室找到该住院号:" + zyh + " 的病人信息\r" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } bool CanAudit = ClsAuditCheck.CheckIsAuditCheck(inp, database);//是否需要智审 if (!CanAudit) { MessageBox.Show("该病人不满足进行智审判断条件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //1、清除已有主单据 //2、上传该病人现有所有费用明细 //当天新开 医嘱预审保存不计费 需要提示 if (MessageBox.Show("建议执行完所有 今天新开医嘱 后再进行该操作!\r\r是否确认重传住院号:" + zyh + "所有费用?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Cancel) { return; } DoVaildYbFee(zyh, inp); } catch { } finally { this.Cursor = Cursors.Arrow; } }
/// <summary> /// 智审控费接口调用 /// </summary> /// <param name="myTb"></param> /// <param name="MNGType"></param> /// <param name="Kind"></param> /// <param name="BinID"></param> /// <param name="BabyID"></param> /// <returns></returns> private bool DoVaildYbFee(DataTable myTb, int MNGType, int Kind, Guid BinID, long BabyID, out string strMsg) { BmiAuditClass clsAdtChk = new BmiAuditClass(); ClsAuditCheck cls = new ClsAuditCheck(_DataBase); strMsg = ""; string strRet = ""; string zyh = ""; string yblx = ""; string ybzlx = ""; try { string inAGENCIES_ID = ""; string ssql = string.Format("select YBLX,XZLX,INPATIENT_NO from VI_ZY_VINPATIENT_ALL where INPATIENT_ID ='{0}' ", BinID.ToString()); try { DataTable dtInp = _DataBase.GetDataTable(ssql); if (dtInp == null || dtInp.Rows.Count <= 0) { throw new Exception("未找到该住院号的病人信息\r"); } yblx = dtInp.Rows[0]["YBLX"].ToString().Trim(); ybzlx = dtInp.Rows[0]["XZLX"].ToString().Trim(); zyh = dtInp.Rows[0]["INPATIENT_NO"].ToString().Trim(); if (yblx.Equals("1")) { inAGENCIES_ID = "1"; } else if (yblx.Equals("3") && ybzlx.Equals("55")) { inAGENCIES_ID = "2"; } } catch (Exception ex) { throw new Exception("未找到该住院号的病人信息\r" + ex.Message); } //wait to filter myTb DataTable dtVal = DoGetValidateFeeInfo(); DataTable dtFeeDetails = cls.GetPostFeeInfo(dtVal, MNGType, Kind, BinID, BabyID); decimal sum = 0M; DataTable dtDetail = cls.GetDetailFeeInfo(dtFeeDetails, yblx, ybzlx, out sum); //无上传明细,不审 if (dtDetail.Rows.Count <= 0) { return(true); } DataTable dtMain = ClsAuditCheck.RetAfSetMainInfo(BinID.ToString(), zyh, sum, _DataBase); strRet = clsAdtChk.ClaimAudit4Hospital_N(dtMain, dtDetail); if (strRet.Equals("0") || strRet.Equals("2")) { ///返回: 0:审核失败 //1:审核结果正常 //2:调用步骤出错 //3:审核结果有违规(取消) //4:审核结果有违规(保存);申明方法如下: string err = (strRet.Equals("0") ? "医保智审【审核失败!】" : "医保智审【调用步骤出错!】"); err = err + "\r\r返回原因:" + clsAdtChk.l_error_message; throw new Exception(err + "\r\r请手动上传该病人费用到中公网!"); } else if (strRet.Equals("3")) { //取消,不保存上传费用 //但是his费用已经产生 //强行保存这部分费用 strRet = clsAdtChk.ClaimAudit4Hospital_S(dtMain, dtDetail); string err = (strRet.Equals("0") ? "医保智审【审核失败!】" : "医保智审【调用步骤出错!】"); err = err + "\r\r返回原因:" + clsAdtChk.l_error_message; if (strRet.Equals("0") || strRet.Equals("2")) { throw new Exception("数据保存成功,上传中公网数据成功! \r\t医保智能审核检测到存在违规数据,请停止违规医嘱,并冲正费用,再手动上传该病人所有费用到中公网!"); } // bool bSc = cls.UpdateScbz(dtDetail); throw new Exception("数据保存成功,上传中公网数据成功," + (bSc ? "成功更新本地标识" : "失败更新本地标识") + "!\r\t医保智能审核检测到存在违规数据,请停止违规医嘱,并冲正费用! \r\t请在 问题数据处理界面 重新查看该医嘱"); } //强制提交是否需要日志记录或者相关信息 wait jchl strMsg = ""; bool bSc1 = cls.UpdateScbz(dtDetail); if (!bSc1) { throw new Exception("数据保存成功,上传中公网数据成功,失败更新本地标识!请手动上传该病人费用!"); } return(true); } catch (Exception ex) { strMsg = "医保智审数据上传错误" + ":" + ex.Message.ToString().Trim(); myFunc.SaveLog(FrmMdiMain.CurrentDept.DeptId, FrmMdiMain.CurrentUser.EmployeeId, "医保智审", BinID.ToString() + "医保智审数据上传错误" + ":" + ex.Message.ToString().Trim(), 1, 4); //wait log return(false); } }
//保存按钮 private void btsave_Click(object sender, EventArgs e) { try { DataTable tb = (DataTable)dgvyzxm.DataSource; if (tb.Rows.Count == 0) { MessageBox.Show("没有确认的费用", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ; //验证病人的状态,如果出区或结算,不能修改费用 Modify By Tany 2015-06-16 string ssql = "select * from zy_inpatient(nolock) where inpatient_id in (select INPATIENT_ID from ZY_ORDERRECORD(nolock) where ORDER_ID='" + order_id + "')"; DataTable tbpa = _DataBase.GetDataTable(ssql); if (tbpa.Rows.Count > 0) { //出院病人不能修改费用 if (tbpa.Rows[0]["flag"].ToString() == "5" || tbpa.Rows[0]["flag"].ToString() == "2" || tbpa.Rows[0]["flag"].ToString() == "6" || tbpa.Rows[0]["flag"].ToString() == "10") { MessageBox.Show("该病人已经定义出院,不能执行该操作!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } //Modify by jchl 2016-12-30 不允许医技科室2016-12-31 18:00:00 到 2017-01-01 00:10:00 操作费用 string _yblx = tbpa.Rows[0]["YBLX"].ToString().Trim(); if (_yblx.Trim().Equals("1")) { DateTime serDate = DateManager.ServerDateTimeByDBType(_DataBase); DateTime dtMin = DateTime.Parse("2016-12-31 18:00:00"); DateTime dtMax = DateTime.Parse("2017-01-01 00:10:00"); if (serDate >= dtMin && serDate <= dtMax) { MessageBox.Show("因为年底大调价,根据医院的统一部署安排,12月31日 18点 至 次日0:10分 医保病人不允许操作费用!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } ssql = "select * from zy_fee_speci(nolock) where order_id='" + order_id + "' and delete_bit=0 "; DataTable tbfee = _DataBase.GetDataTable(ssql); if (tbfee.Rows.Count > 0) { if (tbfee.Rows[0]["discharge_bit"].ToString() == "1") { MessageBox.Show("该费用已结算,不能执行该操作", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //Modify By Tany 2015-06-16 将这段代码移到外层 //ssql = "select * from zy_inpatient(nolock) where inpatient_id='" + tbfee.Rows[0]["inpatient_id"].ToString() + "' "; //tbpa = _DataBase.GetDataTable(ssql); //if (tbpa.Rows.Count > 0) //{ // //出院病人不能修改费用 // if (tbpa.Rows[0]["flag"].ToString() == "5" || tbpa.Rows[0]["flag"].ToString() == "2" || tbpa.Rows[0]["flag"].ToString() == "6" || tbpa.Rows[0]["flag"].ToString() == "10") // { // MessageBox.Show("该病人定义出院,不能执行该操作", "", MessageBoxButtons.OK, MessageBoxIcon.Error); // return; // } //} } if (new Guid(Convertor.IsNull(yjqrid, Guid.Empty.ToString())) != Guid.Empty) { ssql = "select * from yj_zysq(nolock) where zxid='" + orderexec_id + "' and bscbz=0 and btfbz<>0"; DataTable tbtf = _DataBase.GetDataTable(ssql); if (tbtf.Rows.Count > 0) { MessageBox.Show("该申请有退费信息,请先确认退费信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } DataTable tbmx = select.SelectTopFee(new Guid(order_id), _DataBase); if (tbmx.Rows.Count == 0) { MessageBox.Show("没有找到该申请的原记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ; string sDate = DateManager.ServerDateTimeByDBType(_DataBase).ToString();//登记时间 Guid inpatient_id = new Guid(tbmx.Rows[0]["inpatient_id"].ToString()); long baby_id = Convert.ToInt64(tbmx.Rows[0]["baby_id"]); //Guid orderexec_id = new Guid(tbmx.Rows[0]["orderexec_id"].ToString()); Guid prescription_id = new Guid(tbmx.Rows[0]["prescription_id"].ToString()); decimal presc_no = Convert.ToDecimal(tbmx.Rows[0]["presc_no"].ToString()); string presc_date = Convert.ToString(tbmx.Rows[0]["presc_date"].ToString()); int doc_id = Convert.ToInt32(tbmx.Rows[0]["doc_id"].ToString()); int dept_id = Convert.ToInt32(tbmx.Rows[0]["dept_id"].ToString()); int dept_br = Convert.ToInt32(tbmx.Rows[0]["dept_br"].ToString()); int execdept_id = Convert.ToInt32(tbmx.Rows[0]["execdept_id"].ToString()); int dept_ly = Convert.ToInt32(tbmx.Rows[0]["dept_ly"].ToString()); try { _DataBase.BeginTransaction(); //添加或取消费用 bool _bok = false; decimal qrje = 0; for (int i = 0; i <= tb.Rows.Count - 1; i++) { string id = Convertor.IsNull(tb.Rows[i]["id"], ""); string y_cz_id = Convertor.IsNull(tb.Rows[i]["y_cz_id"], ""); string delete_bit = Convertor.IsNull(tb.Rows[i]["delete_bit"], ""); if (id == "") { string cz_id = Convertor.IsNull(tb.Rows[i]["cz_id"], ""); string statitem_code = Convert.ToString(tb.Rows[i]["statitem_code"].ToString()); long xmid = Convert.ToInt64(tb.Rows[i]["xmid"].ToString()); string subcode = Convert.ToString(tb.Rows[i]["code"].ToString()); string item_name = Convert.ToString(tb.Rows[i]["name"].ToString()); string unit = Convert.ToString(tb.Rows[i]["item_unit"].ToString()); decimal price = Convert.ToDecimal(tb.Rows[i]["price"].ToString()); decimal num = Convert.ToDecimal(tb.Rows[i]["num"].ToString()); decimal je = Convert.ToDecimal(tb.Rows[i]["je"].ToString()); qrje = qrje + je; Guid NewID = Guid.Empty; int err_code = -1; string err_text = ""; yjqr.SaveFee(inpatient_id, baby_id, new Guid(order_id), new Guid(orderexec_id), prescription_id, presc_no, presc_date, sDate, TrasenFrame.Forms.FrmMdiMain.CurrentUser.EmployeeId, statitem_code, xmid, subcode, item_name, unit, price, num, je, new Guid(Convertor.IsNull(cz_id, Guid.Empty.ToString())), doc_id, dept_id, dept_br, execdept_id, dept_ly, jgbm, out NewID, out err_code, out err_text, _DataBase); if (err_code != 0 || NewID == Guid.Empty) { throw new Exception(err_text); } _bok = true; } if (delete_bit == "1") { decimal je = Convert.ToDecimal(tb.Rows[i]["je"].ToString()); qrje = qrje + (-1) * je; yjqr.DeleteFee(new Guid(id), new Guid(Convertor.IsNull(y_cz_id, Guid.Empty.ToString())), _DataBase, new Guid(orderexec_id)); } } //控制签收问题 ssql = "select * from yj_zysq where zxid='" + orderexec_id + "' and bqsbz=1"; DataTable tbbbqs = _DataBase.GetDataTable(ssql); if (tbbbqs.Rows.Count > 0 && new SystemCfg(10011, _DataBase).Config == "1") { throw new Exception("该申请标本已签收,不能修改费用"); } //产生医技确认记灵 Guid NewQrid = Guid.Empty; if (yjqrid != "" && (qrje != 0 || _bok == true)) { int err_code = -1; string err_text = ""; DataTable tbsq = select.SelectZYSQ(new Guid(yjsqid), _DataBase); if (tbsq.Rows.Count == 0) { throw new Exception("没有找到原申请记录"); } yjqr.yj_zysq_qrjl(new Guid(order_id), new Guid(orderexec_id), new Guid(yjsqid), qrje, TrasenFrame.Forms.FrmMdiMain.CurrentDept.DeptId, sDate, TrasenFrame.Forms.FrmMdiMain.CurrentUser.EmployeeId, 0, Convertor.IsNull(tbsq.Rows[0]["jcrq"], ""), Convert.ToInt32(Convertor.IsNull(tbsq.Rows[0]["jcys"], "0")), "", out NewQrid, out err_code, out err_text, 0, _DataBase); if (err_code != 0 || NewQrid == Guid.Empty) { throw new Exception(err_text); } btsave.Enabled = false; btadd.Enabled = false; btdel.Enabled = false; btcancel.Enabled = false; } _DataBase.CommitTransaction(); #region "医保智审调用" try { bool CanAudit = ClsAuditCheck.CheckIsAuditCheck(inpatient_id.ToString(), _DataBase);//是否需要智审 if (CanAudit) { if (baby_id == 0) { string strMsg = ""; bool bSuc = DoVaildYbFee(new DataTable(), 1, 1, inpatient_id, baby_id, out strMsg); if (!bSuc) { MessageBox.Show(strMsg, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } } catch { } #endregion if (NewQrid != Guid.Empty) { yjqrid = NewQrid.ToString(); } loaddata(); } catch (System.Exception err) { _DataBase.RollbackTransaction(); throw new Exception(err.Message); } } catch (System.Exception err) { MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// 智审控费接口调用 /// </summary> /// <param name="myTb"></param> /// <param name="MNGType">全部9</param> /// <param name="Kind">所有0</param> /// <param name="BinID"></param> /// <param name="BabyID">只处理0</param> /// <returns></returns> private bool DoVaildYbFee(DataTable myTb, int MNGType, int Kind, Guid BinID, string zyh, long BabyID, out string strMsg) { BabyID = 0;//不处理小孩医嘱和费用 BmiAuditClass clsAdtChk = new BmiAuditClass(); ClsAuditCheck cls = new ClsAuditCheck(database); strMsg = ""; string strRet = ""; //string serr = "0"; string yblx = ""; string ybzlx = ""; try { string inAGENCIES_ID = ""; //string ssql = string.Format("select YBLX,XZLX,INPATIENT_NO from VI_ZY_VINPATIENT_ALL where INPATIENT_ID ='{0}' ", BinID.ToString()); string ssql = string.Format("select YBLX,XZLX,INPATIENT_NO from ZY_INPATIENT where INPATIENT_ID ='{0}' ", BinID.ToString()); try { DataTable dtInp = database.GetDataTable(ssql); if (dtInp == null || dtInp.Rows.Count <= 0) { throw new Exception("未找到该住院号的病人信息\r"); } yblx = dtInp.Rows[0]["YBLX"].ToString().Trim(); ybzlx = dtInp.Rows[0]["XZLX"].ToString().Trim(); zyh = dtInp.Rows[0]["INPATIENT_NO"].ToString().Trim(); if (yblx.Equals("1")) { inAGENCIES_ID = "1"; } else if (yblx.Equals("3") && ybzlx.Equals("55")) { inAGENCIES_ID = "2"; } } catch (Exception ex) { throw new Exception("未找到该住院号的病人信息\r" + ex.Message); } DataTable dtFeeDetails = GetPostFeeInfo(myTb, MNGType, Kind, BinID, BabyID); if (dtFeeDetails.Rows.Count <= 0) { //throw new Exception("该病人没有需要上传的费用明细"); return(false); } //serr += "2"; decimal sum = 0M; DataTable dtDetail = cls.GetDetailFeeInfo(dtFeeDetails, yblx, ybzlx, true, out sum); DataTable dtMain = ClsAuditCheck.RetAfSetMainInfo(BinID.ToString(), zyh, sum, true, database); if (dtMain.Rows.Count != 1) { //throw new Exception("该病人主单信息不唯一"); return(false); } if (dtMain.Rows.Count != 1 || dtDetail.Rows.Count <= 0) { return(false); } //serr += "4"; strRet = clsAdtChk.ClaimAudit4Hospital_S(dtMain, dtDetail); if (strRet.Equals("0") || strRet.Equals("2")) { ///返回: 0:审核失败 //1:审核结果正常 //2:调用步骤出错 //3:审核结果有违规(取消) //4:审核结果有违规(保存);申明方法如下: string err = (strRet.Equals("0") ? "医保智审【审核失败!】" : "医保智审【调用步骤出错!】"); err = err + "\r\r返回原因:" + clsAdtChk.l_error_message; throw new Exception(err + " \r\r请手动上传该病人费用到中公网!"); } return(true); } catch (Exception ex) { strMsg = "医保智审数据上传错误" + ":" + ex.Message.ToString().Trim(); myFunc.SaveLog(FrmMdiMain.CurrentDept.DeptId, FrmMdiMain.CurrentUser.EmployeeId, "医保智审", BinID.ToString() + "医保智审数据上传错误" + ":" + ex.Message.ToString().Trim(), 1, 4); //wait log return(false); } }
/// <summary> /// 智审控费接口调用 /// </summary> /// <param name="myTb"></param> /// <param name="MNGType">全部9</param> /// <param name="Kind">所有0</param> /// <param name="BinID"></param> /// <param name="BabyID">只处理0</param> /// <returns></returns> private bool DoVaildYbFee(DataTable myTb, int MNGType, int Kind, Guid BinID, long BabyID, bool IsDelOrd, out string strMsg) { BabyID = 0;//不处理小孩医嘱和费用 BmiAuditClass clsAdtChk = new BmiAuditClass(); ClsAuditCheck cls = new ClsAuditCheck(database); strMsg = ""; string strRet = ""; string yblx = ""; string ybzlx = ""; string zyh = ""; try { string inAGENCIES_ID = ""; string ssql = string.Format("select YBLX,XZLX,INPATIENT_NO from VI_ZY_VINPATIENT_ALL where INPATIENT_ID ='{0}' ", BinID.ToString()); try { DataTable dtInp = database.GetDataTable(ssql); if (dtInp == null || dtInp.Rows.Count <= 0) { throw new Exception("未在病人信息\r"); } yblx = dtInp.Rows[0]["YBLX"].ToString().Trim(); ybzlx = dtInp.Rows[0]["XZLX"].ToString().Trim(); zyh = dtInp.Rows[0]["INPATIENT_NO"].ToString().Trim(); if (yblx.Equals("1")) { inAGENCIES_ID = "1"; } else if (yblx.Equals("3") && ybzlx.Equals("55")) { inAGENCIES_ID = "2"; } } catch (Exception ex) { throw new Exception("未找到该住院号的病人信息\r" + ex.Message); } if (IsDelOrd) { //wait to filter myTb DataTable dtVal = DoGetValidateFeeInfo(myTb, MNGType, Kind); //当天首次执行的医嘱 与开单时自动上传的未计费医嘱当天重复 需删除开单上传的费用 DataTable dtDel = cls.GetNoneFeeOrdInfo(dtVal, MNGType, Kind, BinID, BabyID); if (dtDel != null && dtDel.Rows.Count > 0) { for (int i = 0; i < dtDel.Rows.Count; i++) { string ordId = dtDel.Rows[i]["order_id"].ToString(); strRet = clsAdtChk.deleteDetail4Hospital(BinID.ToString(), ordId, inAGENCIES_ID); if (strRet.Trim().Equals("0")) { //日志记录wait log myFunc.SaveLog(FrmMdiMain.CurrentDept.DeptId, FrmMdiMain.CurrentUser.EmployeeId, "医保智审", "删除医嘱明细--病人:" + BinID.ToString() + " 医嘱:" + ordId + " 返回结果:" + strRet, 1, 4); } } } } DataTable dtFeeDetails = cls.GetPostFeeInfo(myTb, MNGType, Kind, BinID, BabyID); decimal sum = 0M; DataTable dtDetail = cls.GetDetailFeeInfo(dtFeeDetails, yblx, ybzlx, out sum); DataTable dtMain = ClsAuditCheck.RetAfSetMainInfo(BinID.ToString(), zyh, sum, database); strRet = clsAdtChk.ClaimAudit4Hospital_N(dtMain, dtDetail); if (strRet.Equals("0") || strRet.Equals("2")) { ///返回: 0:审核失败 //1:审核结果正常 //2:调用步骤出错 //3:审核结果有违规(取消) //4:审核结果有违规(保存);申明方法如下: string err = (strRet.Equals("0") ? "医保智审【审核失败!】" : "医保智审【调用步骤出错!】"); err = err + "\r\r返回原因:" + clsAdtChk.l_error_message; throw new Exception(err + " \r\r请手动上传该病人费用到中公网!"); } else if (strRet.Equals("3")) { //取消,不保存上传费用 //但是his费用已经产生 //强行保存这部分费用 strRet = clsAdtChk.ClaimAudit4Hospital_S(dtMain, dtDetail); string err = (strRet.Equals("0") ? "医保智审【审核失败!】" : "医保智审【调用步骤出错!】"); err = err + "\r\r返回原因:" + clsAdtChk.l_error_message; if (strRet.Equals("0") || strRet.Equals("2")) { throw new Exception("数据保存成功,上传中公网数据成功! \r\r 医保智能审核检测到存在违规数据,请停止违规医嘱,并冲正费用,再手动上传该病人所有费用到中公网!"); } // bool bSc = cls.UpdateScbz(dtDetail); throw new Exception("数据保存成功,上传中公网数据成功," + (bSc ? "成功更新本地标识" : "失败更新本地标识") + "!\r\r医保智能审核检测到存在违规数据,请停止违规医嘱,并冲正费用! \r\r请在 住院医保费用重审界面通过违规查询功能 重新查看违规明细!"); } //强制提交是否需要日志记录或者相关信息 wait jchl strMsg = ""; bool bSc1 = cls.UpdateScbz(dtDetail); if (!bSc1) { throw new Exception("数据保存成功,上传中公网数据成功,失败更新本地标识!请手动上传该病人费用!"); } return(true); } catch (Exception ex) { strMsg = "医保智审" + ":" + ex.Message.ToString().Trim(); myFunc.SaveLog(FrmMdiMain.CurrentDept.DeptId, FrmMdiMain.CurrentUser.EmployeeId, "医保智审", BinID.ToString() + "医保智审数据上传错误" + ":" + ex.Message.ToString().Trim(), 1, 4); //wait log return(false); } }
/// <summary> /// 删除上传费用,重置上传标志[] /// </summary> /// <param name="inpId"></param> /// <returns></returns> private bool DoDelInpFeeInfo(string inpId) { BmiAuditClass clsAdtChk = new BmiAuditClass(); try { string inAGENCIES_ID = ""; string ssql = string.Format("select YBLX,XZLX,INPATIENT_NO from VI_ZY_VINPATIENT_ALL where INPATIENT_ID ='{0}' ", inpId); string yblx = ""; string ybzlx = ""; string impNo = ""; string mainID = ""; try { DataTable dtInp = database.GetDataTable(ssql); if (dtInp == null || dtInp.Rows.Count <= 0) { throw new Exception("未找到该住院号的病人信息\r"); } yblx = dtInp.Rows[0]["YBLX"].ToString().Trim(); ybzlx = dtInp.Rows[0]["XZLX"].ToString().Trim(); impNo = dtInp.Rows[0]["INPATIENT_NO"].ToString().Trim(); if (yblx.Equals("1")) { inAGENCIES_ID = "1"; mainID = inpId; } else if (yblx.Equals("3") && ybzlx.Equals("55")) { inAGENCIES_ID = "2"; //获取医保主单 DataTable dtYbDjInfo = ClsAuditCheck.GetOldYbdjInfo(impNo, yblx, ybzlx, database); mainID = dtYbDjInfo.Rows[0]["akc190"] == null ? "" : dtYbDjInfo.Rows[0]["akc190"].ToString().Trim(); } } catch (Exception ex) { throw new Exception("未找到该住院号的病人信息\r" + ex.Message); } string sRet = clsAdtChk.deleteClaim4Hospital(mainID, inAGENCIES_ID); //string sRet = "1"; if (sRet.Trim().Equals("0")) { throw new Exception("重审删除主单数据返回出错!"); } else if (sRet.Trim().Equals("1") || sRet.Trim().Equals("2")) { //先清除主单,再更新标志,会多传一部分费用【就控费来说:比先更新标志,在清除主单 少传数据好】 string strSql = string.Format(@"update ZY_YBZNSH_Info set scbz=0 where inpatient_id='{0}' ", inpId); int iRet = database.DoCommand(strSql); if (iRet > 0) { //记录重审 重置上传标志位 的数据行【并行操作 可能实际上传数据行多于实际数据行 】 myFunc.SaveLog(FrmMdiMain.CurrentDept.DeptId, FrmMdiMain.CurrentUser.EmployeeId, "医保智审", inpId + " 重审重置上传标志返回数据行【" + iRet + "行】", 1, 4); } else { throw new Exception(" 重审重置上传标志返回数据行【" + iRet + "行】"); } } return(true);//1:成功 0:失败 } catch (Exception ex) { myFunc.SaveLog(FrmMdiMain.CurrentDept.DeptId, FrmMdiMain.CurrentUser.EmployeeId, "医保智审", inpId + " 删除重传操作错误:" + ex.Message, 1, 4); MessageBox.Show("医保智审-- 删除重传操作错误:" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } }
//重审已上传数据 private void btnReCheck_Click(object sender, EventArgs e) { this.Cursor = PubStaticFun.WaitCursor(); BmiAuditClass clsAdtChk = new BmiAuditClass(); try { string zyh = txtZyh.Text.Trim(); if (string.IsNullOrEmpty(zyh)) { MessageBox.Show("请输入住院号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } string strSql = string.Format("select INPATIENT_ID,YBLX,XZLX from VI_ZY_VINPATIENT_ALL where INPATIENT_NO ='{0}' and {2}='{1}' ", zyh, _iYsHs == 0 ? InstanceForm.BCurrentDept.DeptId.ToString() : InstanceForm.BCurrentDept.WardId, _iYsHs == 0 ? "DEPT_ID" : "ward_id"); string inp = ""; string yblx = ""; string ybzlx = ""; string mainID = ""; try { DataTable dtInp = database.GetDataTable(strSql); if (dtInp == null || dtInp.Rows.Count <= 0) { throw new Exception("未在本科室找到该住院号:" + zyh + " 的病人信息\r"); } inp = dtInp.Rows[0]["INPATIENT_ID"].ToString().Trim(); yblx = dtInp.Rows[0]["YBLX"].ToString().Trim(); ybzlx = dtInp.Rows[0]["XZLX"].ToString().Trim(); } catch (Exception ex) { throw new Exception("未在本科室找到该住院号:" + zyh + " 的病人信息\r" + ex.Message); } bool CanAudit = ClsAuditCheck.CheckIsAuditCheck(inp, database);//是否需要智审 if (!CanAudit) { MessageBox.Show("该病人不满足进行智审判断条件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } string inAGENCIES_ID = ""; if (yblx.Equals("1")) { inAGENCIES_ID = "1"; mainID = inp; } else if (yblx.Equals("3") && ybzlx.Equals("55")) { inAGENCIES_ID = "2"; //获取医保主单 DataTable dtYbDjInfo = ClsAuditCheck.GetOldYbdjInfo(zyh, yblx, ybzlx, database); mainID = dtYbDjInfo.Rows[0]["akc190"] == null ? "" : dtYbDjInfo.Rows[0]["akc190"].ToString().Trim(); } //inAGENCIES_ID :保险ID 1市直医保 2省直医保 string sRet = clsAdtChk.ReCheckLoadInfo(mainID, inAGENCIES_ID); if (sRet.Trim().Equals("0")) { MessageBox.Show("审核返回错误,请重新操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (sRet.Trim().Equals("1")) { MessageBox.Show("已上传费用审核通过", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show("审核出错" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { this.Cursor = Cursors.Arrow; } }