Example #1
0
        /// <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);
            }
        }
Example #2
0
        /// <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);
            }
        }