3 次代碼提交 65252354b5 ... cbe50aa88d

作者 SHA1 備註 提交日期
  zhengjie cbe50aa88d pref: 住院结算支持共济结算 8 月之前
  zhengjie ac908a6f79 Merge remote-tracking branch 'remotes/origin/ChengDu_Base' into ChengDu_Base 8 月之前
  zhengjie 5ab384ed0c pref:住院支持共济 8 月之前

二進制
.vs/ChengDu/v16/.suo


+ 97 - 1
Business/AbstractProcess.cs

@@ -1,10 +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
 {
@@ -84,5 +89,96 @@ namespace PTMedicalInsurance.Business
         /// <returns></returns>
         public abstract CallResult Process(JObject input);
 
+
+        /// <summary>
+        /// 根据是否需要使用共济支付重新计算结算数据
+        /// </summary>
+        /// <param name="setlInfo"></param>
+        /// <returns></returns>
+        protected JObject MutualAidPay(string setlInfo)
+        {
+            JObject joRtn = JObject.Parse(setlInfo);
+            if (Global.pat.mutualAidFlag)
+            {
+                try
+                {
+                    decimal psnCashPay = decimal.Parse(JsonHelper.getDestValue(joRtn, "psn_cash_pay"));
+                    if (psnCashPay == 0)
+                    {
+                        MessageBox.Show("该患者自付金额为0,不需要进行共济支付!");
+                    }
+                    else
+                    {
+                        //开启自付界面,因涉及到多次自付
+                        MutualAid frmMA = new MutualAid(joRtn);
+                        if (frmMA.dtSettlInfo.Rows.Count != 0)
+                        {
+                            frmMA.WindowState = FormWindowState.Maximized;
+                            if (frmMA.ShowDialog() == DialogResult.OK)
+                            {
+                                joRtn = JObject.Parse(frmMA.finalSettlementInfo);
+
+                            }
+                            else
+                            {
+                                MessageBox.Show("开启共济支付失败,原因为收款员取消共济支付!");
+                            }
+
+                        }
+                        else
+                        {
+                            MessageBox.Show("开启共济支付失败,原因为未检测到有效的被共济人的医保结算数据!");
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    MessageBox.Show("共济支付失败:" + ex.Message);
+                }
+            }
+            return joRtn;
+
+        }
+
+
+        protected JObject CancelMutualAidPay(JObject joRtn)
+        {
+            DataTable dtSettlInfo = (DataTable)JsonConvert.DeserializeObject(joRtn["result"]["data"].ToString(), (typeof(DataTable)));
+            if (dtSettlInfo.Rows.Count != 1)
+            {
+                Global.writeLog("无共济支付信息!");
+                return JsonHelper.setExceptionJson(-1, "未查询到相关结算信息!", "");
+            }
+
+            int mutualAidFlag = 0;
+            if (!string.IsNullOrEmpty(dtSettlInfo.Rows[0]["MutualAidFlag"].ToString()))
+            {
+                mutualAidFlag = Convert.ToInt32(dtSettlInfo.Rows[0]["MutualAidFlag"].ToString());
+            }
+            Global.writeLog("共济支付标志:" + mutualAidFlag);
+            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;
+        }
     }
 }

+ 4 - 1
Business/Inpatient/IPQuerySettlementProcess.cs

@@ -14,7 +14,7 @@ namespace PTMedicalInsurance.Business
         public override CallResult Process(JObject input)
         {
             //查询结算表
-            string sqlStr = "SELECT * FROM  BS_MedInsuSettlement WHERE billType = 1 and Hospital_Dr=" + Global.inf.hospitalDr
+            string sqlStr = "SELECT * FROM  BS_MedInsuSettlement WHERE billType = 1  and ValidFlag = 1  and Hospital_Dr=" + Global.inf.hospitalDr
                           + " and Adm_Dr='" + Global.pat.adm_Dr + "'"
                           + " and MdtrtID='" + Global.pat.mdtrtID + "'"
                           + " Order By ID DESC ";
@@ -45,6 +45,9 @@ namespace PTMedicalInsurance.Business
                 Global.pat.settlID = Global.pat.SettID_YBJSB;
             }
 
+            //取消共济(成都)
+            joSettlInfo = CancelMutualAidPay(joSettlInfo);
+
             return Success();
         }
     }

+ 6 - 2
Business/Inpatient/IPSettlementProcess.cs

@@ -35,7 +35,6 @@ namespace PTMedicalInsurance.Business
             //电子凭证存在二次校验且验证码为动态,必须使用最新码
             joSettlement["mdtrt_cert_no"] = Global.pat.mdtrtcertNO;
 
-
             //基线版扩展
             JObject joDataExp = (JObject)joSettlement["exp_content"] ?? new JObject();
             joDataExp.Add("card_token", Global.pat.card.Cardtoken);
@@ -43,6 +42,7 @@ namespace PTMedicalInsurance.Business
             joSettlement["exp_content"] = joDataExp;
             joSettlement.Add("data", joSettlement);
 
+
             
             JObject jo2304Rtn = invoker.invokeCenterService(TradeEnum.InpatientSettlement, joSettlement);
             if (JsonHelper.parseCenterRtnValue(jo2304Rtn, out errMsg) != 0)
@@ -66,8 +66,12 @@ namespace PTMedicalInsurance.Business
                 {
                     return Exception(-1, "云医保平台保存结算明细失败", errMsg);
                 }
+
+                // 住院共济支付
+                JObject joSetlinfoAid = MutualAidPay(JsonHelper.toJsonString(joSetlinfo));
+
                 //返回给HIS
-                if (hIS.returnInpatSettlementInfo(OrginalInput, joSetlinfo, out outParam) != 0)
+                if (hIS.returnInpatSettlementInfo(OrginalInput, joSetlinfoAid, out outParam) != 0)
                 {
                     return Exception(-1, "返回结算信息给HIS", outParam);
                 }

+ 0 - 37
Business/Outpatient/OPQuerySettlementProcess.cs

@@ -43,42 +43,5 @@ namespace PTMedicalInsurance.Business
             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;
-        }
     }
 }

+ 0 - 50
Business/Outpatient/OPSettlementProcess.cs

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

+ 1 - 0
Forms/SettlementForm.cs

@@ -108,6 +108,7 @@ namespace PTMedicalInsurance.Forms
 
         private void uiButton1_Click(object sender, EventArgs e)
         {
+            Global.pat.mutualAidFlag = cbMutualAid.Checked;
             DialogResult = DialogResult.OK;
         }
 

+ 17 - 2
Forms/SettlementForm.designer.cs

@@ -49,6 +49,7 @@ namespace PTMedicalInsurance.Forms
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
             this.pnlBottom = new Sunny.UI.UIPanel();
+            this.cbMutualAid = new Sunny.UI.UICheckBox();
             this.uiButton2 = new Sunny.UI.UIButton();
             this.uiButton1 = new Sunny.UI.UIButton();
             this.pnlClient = new Sunny.UI.UIPanel();
@@ -127,6 +128,7 @@ namespace PTMedicalInsurance.Forms
             // 
             // pnlBottom
             // 
+            this.pnlBottom.Controls.Add(this.cbMutualAid);
             this.pnlBottom.Controls.Add(this.uiButton2);
             this.pnlBottom.Controls.Add(this.uiButton1);
             this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
@@ -141,6 +143,20 @@ namespace PTMedicalInsurance.Forms
             this.pnlBottom.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
             this.pnlBottom.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
             // 
+            // cbMutualAid
+            // 
+            this.cbMutualAid.BackColor = System.Drawing.Color.Transparent;
+            this.cbMutualAid.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.cbMutualAid.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cbMutualAid.Location = new System.Drawing.Point(26, 16);
+            this.cbMutualAid.MinimumSize = new System.Drawing.Size(1, 1);
+            this.cbMutualAid.Name = "cbMutualAid";
+            this.cbMutualAid.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0);
+            this.cbMutualAid.Size = new System.Drawing.Size(202, 29);
+            this.cbMutualAid.TabIndex = 3;
+            this.cbMutualAid.Text = "启用共济支付";
+            this.cbMutualAid.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
+            // 
             // uiButton2
             // 
             this.uiButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -149,9 +165,7 @@ namespace PTMedicalInsurance.Forms
             this.uiButton2.Location = new System.Drawing.Point(380, 16);
             this.uiButton2.MinimumSize = new System.Drawing.Size(1, 1);
             this.uiButton2.Name = "uiButton2";
-            this.uiButton2.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.uiButton2.Size = new System.Drawing.Size(100, 38);
-            this.uiButton2.Style = Sunny.UI.UIStyle.Custom;
             this.uiButton2.TabIndex = 1;
             this.uiButton2.Text = "放弃";
             this.uiButton2.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -1192,5 +1206,6 @@ namespace PTMedicalInsurance.Forms
         private Sunny.UI.UITextBox tbClearingType;
         private Sunny.UI.UILabel uiLabel29;
         private Sunny.UI.UIButton uiButton2;
+        private Sunny.UI.UICheckBox cbMutualAid;
     }
 }