فهرست منبع

feat: 门诊取消结算先取消共济

zhengjie 1 سال پیش
والد
کامیت
358765132d

+ 7 - 6
Business/HisMainBusiness.cs

@@ -1208,16 +1208,17 @@ namespace PTMedicalInsurance.Business
                 //展示登记面板
                 if (tools.ShowAppDiaglog(frmReg) == DialogResult.OK)
                 {
-                    string diseCodg = "", diseName = "";
-                    //哈尔滨要求必须传病种。普通疾病传主诊断
-                    if (string.IsNullOrEmpty(frmReg.diseCodg))
+                    string diseCodg = frmReg.diseCodg, diseName = frmReg.diseName;
+
+                    if (string.IsNullOrEmpty(diseCodg))
                     {
                         diseCodg = JsonHelper.getDestValue(joHisRtnInfo, "mdtrtinfo.dscg_maindiag_code");
-                    };
-                    if (string.IsNullOrEmpty(frmReg.diseName))
+                    }
+                    if (string.IsNullOrEmpty(diseName))
                     {
                         diseName = JsonHelper.getDestValue(joHisRtnInfo, "mdtrtinfo.dscg_maindiag_name");
-                    };
+                    }
+
                     #region 组织挂号入参
                     JObject joRegInpar = new JObject();
                     string occurTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

+ 14 - 17
Business/IrisServices.cs

@@ -508,22 +508,19 @@ namespace PTMedicalInsurance.Business
             joSumFee = new JObject();
 
             errMsg = "";
-            decimal ybAmt, psnAcctAmt, hospAmt, psnPartAmt, psnCashAmt, medFee,otherAmt, mafPay, medisPay, fundAmt;
+            decimal ybAmt, psnAcctAmt, hospAmt, psnPartAmt, psnCashAmt, medFee, fundAmt;
             try
             {
-                //getFee(jo, "hifp_pay") //基本医保统筹基金支出
-                //+ getFee(jo, "hifes_pay") //企业补充医疗保险基金支出(民政补助)
-                //+ getFee(jo, "hifmi_pay") //居民大病保险
-                //+ getFee(jo, "cvlserv_pay") //公务员医疗补助                
-                //mafPay = getFee(jo, "maf_pay"); //医疗救助基金支出(医疗补助\优抚补助); //ylbzje
-                //medisPay = +getFee(jo, "medis_pay"); //医疗减免金额  //jmje
-
-                //otherAmt = getFee(jo, "oth_pay"); //其他支出
-                
-                ////基金支付总额
-                //fundAmt = getFee(jo, "hifob_pay") //职工大额医疗费用补助  //dezf
-                //      + mafPay + medisPay + otherAmt
-                //      + getFee(jo, "poor_pay"); //贫困人口再补助
+                //基金支付总额
+                fundAmt = getFee(jo, "hifp_pay") //基本医保统筹基金支出
+                + getFee(jo, "hifes_pay") //企业补充医疗保险基金支出(民政补助)
+                + getFee(jo, "hifmi_pay") //居民大病保险
+                + getFee(jo, "cvlserv_pay") //公务员医疗补助
+                + getFee(jo, "hifob_pay") //职工大额医疗费用补助  
+                + getFee(jo, "maf_pay") //医疗救助基金支出(医疗补助\优抚补助); 
+                + getFee(jo, "medis_pay") //医疗减免金额  
+                + getFee(jo, "hifdm_pay") //伤残人员医疗保障
+                + getFee(jo, "oth_pay"); //其他支出
 
                 psnAcctAmt = getFee(jo, "acct_pay");     //账户支付金额
                 psnCashAmt = getFee(jo, "psn_cash_pay"); //现金支付金额
@@ -531,15 +528,15 @@ namespace PTMedicalInsurance.Business
                 hospAmt = getFee(jo, "hosp_part_amt");   //医院承担金额
 
                 medFee = getFee(jo, "medfee_sumamt");    //总费用
-                ybAmt = medFee - psnAcctAmt - psnCashAmt - hospAmt;  //(医保支付金额)
+                //ybAmt = medFee - psnAcctAmt - psnCashAmt - hospAmt;  //(医保支付金额)
+                ybAmt = fundAmt + psnAcctAmt + psnCashAmt + hospAmt;
 
                 joSumFee.Add("ybAmt", ybAmt);
                 joSumFee.Add("psnAcctAmt", psnAcctAmt);
                 joSumFee.Add("hospAmt", hospAmt);
                 joSumFee.Add("psnCashAmt", psnCashAmt);
-                //zje(medfee_sumamt) = ybfdje(fund_pay_sumamt) + brfdje(psn_part_amt) + ylbzje(maf_pay) + yyfdje(hosp_part_amt) + yljmje(medis_pay) + pkryzjzje(poor_pay) + mzbzje(hifob_pay)
 
-                decimal total = (ybAmt + psnAcctAmt  + psnCashAmt + hospAmt);
+                decimal total = (ybAmt);
                 if (medFee != total)
                 {
                     Global.writeLog("ybAmt:"+ybAmt+ ",psnAcctAmt:" + psnAcctAmt + "psnCashAmt:"+ psnCashAmt + ",hospAmt:" + hospAmt);

+ 47 - 1
Business/Outpatient/OPQuerySettlementProcess.cs

@@ -1,11 +1,15 @@
-using Newtonsoft.Json.Linq;
+using MedicalInsurance.Forms;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 using PTMedicalInsurance.Helper;
 using PTMedicalInsurance.Variables;
 using System;
 using System.Collections.Generic;
+using System.Data;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Forms;
 
 namespace PTMedicalInsurance.Business
 {
@@ -27,8 +31,50 @@ namespace PTMedicalInsurance.Business
             //    return rtnResult;
             //}
             Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
+
+            //取消共济(成都)
+            joSettlInfo = CancelMutualAidPay(joSettlInfo);
+
             outParam = JsonHelper.toJsonString(joSettlInfo);
             return Success();
         }
+
+        private JObject CancelMutualAidPay(JObject joRtn)
+        {
+            DataTable dtSettlInfo = (DataTable)JsonConvert.DeserializeObject(joRtn["result"]["data"].ToString(), (typeof(DataTable)));
+            if (dtSettlInfo.Rows.Count != 1)
+            {
+                return JsonHelper.setExceptionJson(-1, "未查询到相关结算信息!","");
+            }
+
+            int mutualAidFlag = 0;
+            if (!string.IsNullOrEmpty(dtSettlInfo.Rows[0]["MutualAidFlag"].ToString()))
+            {
+                mutualAidFlag = Convert.ToInt32(dtSettlInfo.Rows[0]["MutualAidFlag"].ToString());
+            }
+            if (mutualAidFlag > 0)
+            {
+                //开启自付界面,因涉及到多次自付
+                MutualAid frmMA = new MutualAid(Global.pat.settlID);
+                if (frmMA.dtSettlInfo.Rows.Count != 0)
+                {
+                    frmMA.WindowState = FormWindowState.Maximized;
+                    if (frmMA.ShowDialog() == DialogResult.OK)
+                    {
+
+                    }
+                    else
+                    {
+                       return JsonHelper.setExceptionJson(-1, "收款员取消共济支付撤销!", null);
+                    }
+
+                }
+                else
+                {
+                    return JsonHelper.setExceptionJson(-1, "开启共济支付失败,原因为未检测到有效的被共济人的医保结算数据!", null);
+                }
+            }
+            return joRtn;
+        }
     }
 }

+ 5 - 0
Business/Outpatient/OPSettlementProcess.cs

@@ -54,6 +54,11 @@ namespace PTMedicalInsurance.Business
                 }
             }
         }
+        /// <summary>
+        /// 根据是否需要使用共济支付重新计算结算数据
+        /// </summary>
+        /// <param name="setlInfo"></param>
+        /// <returns></returns>
         private JObject MutualAidPay(string setlInfo)
         {
             JObject joRtn = JObject.Parse(setlInfo);