Browse Source

fix: 全国异地参保地问题&门诊共济

zhengjie 1 year ago
parent
commit
0e6bf4f88f

+ 2 - 1
Business/Inpatient/IPRegistionProcess.cs

@@ -18,13 +18,14 @@ namespace PTMedicalInsurance.Business
             JObject joReg = new JObject();
             string errMsg = "";
 
+            Global.businessType = "01103";
+
             YinHaiSafeCtrl safeCtrl = new YinHaiSafeCtrl();
             if (safeCtrl.Prepare(TradeEnum.InpatientReg.GetCode(), out errMsg) != 0)
             {
                 return Exception("调用安全控件", errMsg);
             }
 
-
             string patInfo = JsonHelper.getDestValue(input, "patientInfo");
             //显示登记面板
             if (hBus.showInPatRegisterForm(patInfo,out joReg) == 0)

+ 12 - 0
Business/IrisServices.cs

@@ -1366,6 +1366,18 @@ namespace PTMedicalInsurance.Business
                 joSetlinfo.Add("insuplc_admdvs", Global.pat.insuplc_admdvs);
                 joSetlinfo.Add("ExpContent", Global.pat.ExpContent);
 
+                //共济
+                if (Global.pat.mutualAidFlag)
+                {
+                    joSetlinfo.Add("MainSettlementIDOfMutualAid", JsonHelper.getDestValue(joSetlinfo, "setl_id"));
+                    joSetlinfo.Add("MutualAidFlag", 1);
+                }
+                else
+                {
+                    joSetlinfo.Add("MainSettlementIDOfMutualAid", "");
+                    joSetlinfo.Add("MutualAidFlag", "0");
+                }
+
 
                 joSetlinfo.Add("HospitalizationsDays", Global.Set.hospitalizationsDays);
                 joSetlinfo.Add("HospitalizationsTimes", Global.Set.hospitalizationsTimes);

+ 5 - 2
Business/Local/TestProcess.cs

@@ -17,8 +17,11 @@ namespace PTMedicalInsurance.Business
             //OPSettlementProcess process = new OPSettlementProcess();
             //process.Process(joInput);
 
-            OPSettlementProcess process = new OPSettlementProcess();
-            process.Process(joInput);
+            //OPSettlementProcess process = new OPSettlementProcess();
+            //process.Process(joInput);
+            InvokeHelper invoker = new InvokeHelper();
+
+            JObject joRtn = invoker.invokeInsuService(joInput.ToString(),"");
 
             //JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(joInput, "output.setlinfo"));
 

+ 6 - 1
Business/Outpatient/OPQuerySettlementProcess.cs

@@ -30,7 +30,12 @@ namespace PTMedicalInsurance.Business
             //    rtnResult = JsonHelper.setExceptionJson(-1, "查询结算信息失败!", errMsg).ToString();
             //    return rtnResult;
             //}
-            Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
+            
+            string insuplc_admvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
+            if (!string.IsNullOrEmpty(Global.pat.insuplc_admdvs))
+            {
+                Global.pat.insuplc_admdvs = insuplc_admvs;
+            }
 
             //取消共济(成都)
             joSettlInfo = CancelMutualAidPay(joSettlInfo);

+ 25 - 19
Business/Outpatient/OPSettlementProcess.cs

@@ -65,34 +65,40 @@ namespace PTMedicalInsurance.Business
             JObject joRtn = JObject.Parse(setlInfo);
             if (Global.pat.mutualAidFlag)
             {
-                decimal psnCashPay = decimal.Parse(JsonHelper.getDestValue(joRtn, "psn_cash_pay"));
-                if (psnCashPay == 0)
+                try
                 {
-                    MessageBox.Show("该患者自付金额为0,不需要进行共济支付!");
-                }
-                else
-                {
-                    //开启自付界面,因涉及到多次自付
-                    MutualAid frmMA = new MutualAid(joRtn);
-                    if (frmMA.dtSettlInfo.Rows.Count != 0)
+                    decimal psnCashPay = decimal.Parse(JsonHelper.getDestValue(joRtn, "psn_cash_pay"));
+                    if (psnCashPay == 0)
                     {
-                        frmMA.WindowState = FormWindowState.Maximized;
-                        if (frmMA.ShowDialog() == DialogResult.OK)
+                        MessageBox.Show("该患者自付金额为0,不需要进行共济支付!");
+                    }
+                    else
+                    {
+                        //开启自付界面,因涉及到多次自付
+                        MutualAid frmMA = new MutualAid(joRtn);
+                        if (frmMA.dtSettlInfo.Rows.Count != 0)
                         {
-                            joRtn = JObject.Parse(frmMA.finalSettlementInfo);
+                            frmMA.WindowState = FormWindowState.Maximized;
+                            if (frmMA.ShowDialog() == DialogResult.OK)
+                            {
+                                joRtn = JObject.Parse(frmMA.finalSettlementInfo);
+
+                            }
+                            else
+                            {
+                                MessageBox.Show("开启共济支付失败,原因为收款员取消共济支付!");
+                            }
 
                         }
                         else
                         {
-                            MessageBox.Show("开启共济支付失败,原因为收款员取消共济支付!");
+                            MessageBox.Show("开启共济支付失败,原因为未检测到有效的被共济人的医保结算数据!");
                         }
-
-                    }
-                    else
-                    {
-                        MessageBox.Show("开启共济支付失败,原因为未检测到有效的被共济人的医保结算数据!");
                     }
-
+                }
+                catch (Exception ex)
+                {
+                    MessageBox.Show("共济支付失败:"+ex.Message);
                 }
             }
             return joRtn;

+ 7 - 2
Common/YinHaiSafeCtrl.cs

@@ -46,8 +46,13 @@ namespace PTMedicalInsurance.Common
             else
             {
                 JObject jodata = JObject.FromObject(joRtn["data"]);
-
-                Global.pat.insuplc_admdvs = jodata["insuplc_admdvs"].ToString();
+                Global.writeLog("参保地:"+ Global.pat.insuplc_admdvs);
+                Global.writeLog("读卡返回:" + jodata.ToString());
+                // 如果存在则不使用读卡返回的信息
+                if (string.IsNullOrEmpty(Global.pat.insuplc_admdvs))
+                {
+                    Global.pat.insuplc_admdvs = jodata["insuplc_admdvs"].ToString();
+                }
                 Global.pat.mdtrtcertType = jodata["mdtrt_cert_type"].ToString();
                 Global.pat.mdtrtcertNO = jodata["mdtrt_cert_no"].ToString();
                 Global.pat.psn_type = jodata["psn_cert_type"].ToString();

+ 2 - 2
Forms/MutualAid.cs

@@ -76,7 +76,7 @@ namespace MedicalInsurance.Forms
             errMsg = "";
             try
             {
-                string sqlStr = "SELECT * FROM  MedInsu_Tables.Settlement WHERE Hosp_Dr=" + Global.inf.hospitalDr + " AND SettlementID='" + settlementID + "'";
+                string sqlStr = "SELECT * FROM  BS_MedInsuSettlement WHERE Hospital_Dr=" + Global.inf.hospitalDr + " AND SettlementID='" + settlementID + "'";  
                 JObject joSqlStr = new JObject();
                 joSqlStr.Add("sqlStr", sqlStr);
 
@@ -118,7 +118,7 @@ namespace MedicalInsurance.Forms
             errMsg = "";
             try
             {
-                string sqlStr = "SELECT * FROM  MedInsu_Tables.Settlement WHERE Hosp_Dr=" + Global.inf.hospitalDr + " AND MainSettlementIDOfMutualAid='" + settlementID + "'";
+                string sqlStr = "SELECT * FROM  BS_MedInsuSettlement WHERE Hospital_Dr=" + Global.inf.hospitalDr + " AND MainSettlementIDOfMutualAid='" + settlementID + "'";
                 JObject joSqlStr = new JObject();
                 joSqlStr.Add("sqlStr", sqlStr);
 

+ 2 - 0
Forms/OutpatientRegistration.cs

@@ -190,6 +190,8 @@ namespace PTMedicalInsurance.Forms
             //    return;
             //}
 
+            Global.pat.mutualAidFlag = "1".Equals(mutualAidFlag);
+
             // 是否使用个人账户金额
             if (cbxAccountPay.Checked)
             {