837390164@qq.com 7 месяцев назад
Родитель
Сommit
9a6748e69a
3 измененных файлов с 249 добавлено и 23 удалено
  1. 111 1
      HaErBinMI/Business/HisMainBusiness.cs
  2. 18 8
      HaErBinMI/Business/IrisServices.cs
  3. 120 14
      HaErBinMI/InsuBusiness.cs

+ 111 - 1
HaErBinMI/Business/HisMainBusiness.cs

@@ -2073,7 +2073,117 @@ namespace PTMedicalInsurance.Business
             return joCenterRtn.ToString();
         }
 
-       
+        /// <summary>
+        /// 获取自助机调用时前端传入的信息,并赋值给patients结构体
+        /// </summary>
+        /// <param name="businessType"></param>
+        /// <param name="joInparam"></param>
+        /// <param name="pat"></param>
+        public void GetSelfServiceMachineInfo(string businessType, JObject joInparam, out Patients pat)
+        {
+            pat = new Patients();
+            switch (businessType)
+            {
+                case "GetPatientInfo"://读取患者信息
+                    {
+                        Global.ssmp.cardType = JsonHelper.getDestValue(joInparam, "params[0].cardType");
+                        Global.operationType = JsonHelper.getDestValue(joInparam, "operationType") + "-" + businessType;
+                        break;
+                    }
+                case "OPReg"://门诊挂号
+                    {
+                        pat.adm_Dr = int.Parse(JsonHelper.getDestValue(joInparam, "params[0].admID"));
+                        pat.recordID = JsonHelper.getDestValue(joInparam, "params[0].recordID");
+                        pat.billID = JsonHelper.getDestValue(joInparam, "params[0].billID");
+                        Global.ssmp.cardType = JsonHelper.getDestValue(joInparam, "params[0].cardType");
+                        Global.pat.insuplc_admdvs = "";
+                        Global.operationType = JsonHelper.getDestValue(joInparam, "operationType");
+                        Global.pat.IDNO = JsonHelper.getDestValue(joInparam, "params[0].idNo"); //身份证号
+
+                        break;
+                    }
+                case "OPSettl"://门诊结算
+                    {
+                        pat.adm_Dr = int.Parse(JsonHelper.getDestValue(joInparam, "params[0].admID"));
+                        pat.recordID = JsonHelper.getDestValue(joInparam, "params[0].recordID");
+                        pat.billID = JsonHelper.getDestValue(joInparam, "params[0].billID");
+                        pat.insuplc_admdvs = "";
+                        Global.ssmp.cardType = JsonHelper.getDestValue(joInparam, "params[0].cardType");
+                        Global.operationType = JsonHelper.getDestValue(joInparam, "operationType");
+                        Global.pat.IDNO = JsonHelper.getDestValue(joInparam, "params[0].idNo"); //身份证号
+                        break;
+                    }
+                case "IPInReg"://入院登记
+                    {
+                        Global.ssmp.cardType = JsonHelper.getDestValue(joInparam, "params[0].cardType");
+                        Global.operationType = JsonHelper.getDestValue(joInparam, "operationType") + "-" + businessType;
+                        pat.adm_Dr = int.Parse(JsonHelper.getDestValue(joInparam, "params[0].admID"));
+                        break;
+                    }
+                case "IPSettl"://住院结算
+                    {
+                        pat.adm_Dr = int.Parse(JsonHelper.getDestValue(joInparam, "params[0].admID"));
+                        pat.psn_no = JsonHelper.getDestValue(joInparam, "insuAdmObj.psn_no");
+                        pat.mdtrtID = JsonHelper.getDestValue(joInparam, "insuAdmObj.mdtrt_id");
+                        pat.name = JsonHelper.getDestValue(joInparam, "insuAdmObj.psn_name");
+                        pat.recordID = JsonHelper.getDestValue(joInparam, "params[0].recordID");
+                        pat.billID = JsonHelper.getDestValue(joInparam, "params[0].billID");
+                        pat.recordID = JsonHelper.getDestValue(joInparam, "params[0].recordID");
+                        pat.insuplc_admdvs = JsonHelper.getDestValue(joInparam, "insuAdmObj.insuplc_admdvs");
+                        Global.ssmp.cardType = JsonHelper.getDestValue(joInparam, "params[0].cardType");
+
+                        if (string.IsNullOrEmpty(JsonHelper.getDestValue(joInparam, "insuAdmObj.inDays")))
+                        {
+                            Global.settl.hospitalizationsDays = 0;
+                        }
+                        else
+                        {
+                            Global.settl.hospitalizationsDays = int.Parse(JsonHelper.getDestValue(joInparam, "insuAdmObj.inDays"));
+                        }
+
+                        if (string.IsNullOrEmpty(JsonHelper.getDestValue(joInparam, "insuAdmObj.inTimes")))
+                        {
+                            Global.settl.hospitalizationsTimes = 0;
+                        }
+                        else
+                        {
+                            Global.settl.hospitalizationsTimes = int.Parse(JsonHelper.getDestValue(joInparam, "insuAdmObj.inTimes"));
+                        }
+
+                        if (string.IsNullOrEmpty(JsonHelper.getDestValue(joInparam, "insuAdmObj.admDateTime")))
+                        {
+                            Global.settl.hisAdmTime = "";
+                        }
+                        else
+                        {
+                            Global.settl.hisAdmTime = Convert.ToDateTime(JsonHelper.getDestValue(joInparam, "insuAdmObj.admDateTime")).ToString("yyyy-MM-dd HH:mm:ss");
+                        }
+
+                        if (string.IsNullOrEmpty(JsonHelper.getDestValue(joInparam, "insuAdmObj.disDateTime")))
+                        {
+                            Global.settl.hisDischargeTime = "";
+                        }
+                        else
+                        {
+                            Global.settl.hisDischargeTime = Convert.ToDateTime(JsonHelper.getDestValue(joInparam, "insuAdmObj.disDateTime")).ToString("yyyy-MM-dd HH:mm:ss");
+                        }
+                        break;
+                    }
+                case "DischargeAudit"://出院核查
+                    {
+                        pat.adm_Dr = int.Parse(JsonHelper.getDestValue(joInparam, "params[0].admID"));
+                        pat.billID = JsonHelper.getDestValue(joInparam, "params[0].billID");
+                        break;
+                    }
+
+
+                default:
+                    {
+                        break;
+                    }
+            }
+
+        }
 
         /// <summary>
         /// 展示结算信息界面

+ 18 - 8
HaErBinMI/Business/IrisServices.cs

@@ -535,17 +535,23 @@ namespace PTMedicalInsurance.Business
             string errMsg;
             try
             {
-                dynamic joTmp = new JObject();
-                joTmp.settleInfo = joSetlinfo;
-                joTmp.updateUserID = Global.user.ID;
+                JObject joSumFee = new JObject();
+                if (sumInsuRtnSettlInfo(joSetlinfo, out joSumFee, out errMsg) != 0)
+                {
+                    outParam = "返回2207结算结果给HIS失败,请联系管理员!";
+                    return -1;
+                }
 
                 joSetlInpar.Add("insuplc_admdvs", Global.pat.insuplc_admdvs);
                 joSetlInpar.Add("mdtrtarea_admvs", Global.inf.areaCode);
-                joSetlInpar.Add("YBArea", Global.pat.insuplc_admdvs);
-                joSetlInpar.Add("InsuCenter", Global.inf.areaCode);
+
+                dynamic joTmp = new JObject();
+                joTmp.settleInfo = joSetlinfo;
+                joTmp.updateUserID = Global.user.ID;
                 joTmp.regInfo = joSetlInpar;
                 joTmp.middleSettleFlag = "";
                 joTmp.interfaceDr = Global.inf.interfaceDr;
+                joTmp.insuplc_admdvs = Global.pat.insuplc_admdvs; //此处增加参保地入参 HIS医保登记表插入
                 dynamic joHisInfo = new JObject();
                 joHisInfo.admID = Global.pat.adm_Dr;
                 joHisInfo.billID = Global.pat.billID;
@@ -553,7 +559,12 @@ namespace PTMedicalInsurance.Business
                 joTmp.hisInfo = joHisInfo;
                 joTmp.psn_type = Global.pat.psn_type;
 
-                JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110009", joTmp).ToString(), "返回2207结算结果给HIS");
+                joTmp.sumFeeObj = joSumFee;
+
+                //0511018 {"feeObj":{"ybAmt":"医保支付","psnAcctAmt":"个人账户","psnCashAmt":"个人现金","hospAmt":"医院垫付"}}
+
+                JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110018", joTmp).ToString(), "返回2207结算结果给HIS");
+                //JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110009", joTmp).ToString(), "返回2207结算结果给HIS");
                 if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
                 {
                     outParam = "返回2207结算结果给HIS失败,请联系管理员!" + errMsg;
@@ -567,10 +578,9 @@ namespace PTMedicalInsurance.Business
             }
             catch (Exception ex)
             {
-                outParam = "返回2207结算结果给HIS出现异常:!" + ex.Message;
+                outParam = "返回22207结算结果给HIS出现异常:!" + ex.Message;
                 return -1;
             }
-
         }
 
         /// <summary>

+ 120 - 14
HaErBinMI/InsuBusiness.cs

@@ -15,6 +15,8 @@ using System.Reflection;
 using System.Data;
 using System.Threading;
 using HaErBinMIMI.Forms;
+using PTMedicalInsurance.Business.Core.SelfServiceMachine.ProcessScheduler;
+using PTMedicalInsurance.Business.Core.Forms.DischargeAudit;
 
 namespace PTMedicalInsurance
 {
@@ -35,8 +37,9 @@ namespace PTMedicalInsurance
         HisIrisServices hIS = new HisIrisServices();
         MIIrisServices mIS= new MIIrisServices();
         InvokeHelper invoker = new InvokeHelper();
-        //
+
         private string businessType;
+        private string operationType;
 
         public InsuBusiness()
         {
@@ -688,11 +691,7 @@ namespace PTMedicalInsurance
                                 //插入患者本次就诊用的参保信息
                                 if (hBus.insertPatCurInsuInfo(patInfo, out outParam) != 0)
                                 {
-                                    if (DialogResult.Yes == MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
-                                    {
-                                        
-                                    }
-                                    else
+                                    if (DialogResult.Yes != MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
                                     {
                                         rtnResult = JsonHelper.setExceptionJson(-1, "插入患者本次就诊用的参保信息,请联系管理员!是否继续?", outParam).ToString();
                                         return rtnResult;
@@ -723,7 +722,6 @@ namespace PTMedicalInsurance
                             //事前分析
                             if ((Global.curEvt.ext.isOpenAnalysis))
                             {
-
                                 if (hBus.PreAnalysis("2", "", out errMsg) != 0)
                                 {
                                     MessageBox.Show(errMsg);
@@ -739,10 +737,7 @@ namespace PTMedicalInsurance
                             }
 
                             #region【门诊预结算2206前调用3102医保明细审核事中服务】                            
-                            //1.获取3102入参报文
-                            
-                            
-
+                            //1.获取3102入参报文                                                       
                             //事中分析
                             if ((Global.curEvt.ext.isOpenAnalysis))
                             {
@@ -785,9 +780,7 @@ namespace PTMedicalInsurance
                             {
                                 rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
                                 return rtnResult;
-                            }
-
-                            
+                            }                            
 
                             //结算
                             JObject joData = new JObject();
@@ -1409,5 +1402,118 @@ namespace PTMedicalInsurance
             }
         }
 
+        /// <summary>
+        /// 自助机
+        /// </summary>
+        /// <param name="InParam"></param>
+        /// <returns></returns>
+        public string SelfServiceMachine(string InParam)
+        {
+            Global.writeLog("SelfServiceMachine 入参:" + JsonHelper.Compress(InParam));
+            //设置返回值,错误信息
+            string errMsg, rtnResult = "", outParam;
+            try
+            {
+                //解析入参
+                if (parseInparam(InParam, out errMsg) != 0)
+                {
+                    rtnResult = JsonHelper.setExceptionJson(-1, "parseInparam", errMsg).ToString();
+                    return rtnResult;
+                }
+                //获取pat
+                hBus.GetSelfServiceMachineInfo(businessType, joInParam, out Global.pat);
+                //BS架构调用方式问题,每次调用都需要重新初始化
+                if (init(InParam, out errMsg) != 0)
+                //if (hBus.InitA(InParam, out errMsg) != 0)
+                {
+                    rtnResult = JsonHelper.setExceptionJson(-1, "InitA", errMsg).ToString(); ;
+                    return rtnResult;
+                }
+                else
+                {
+                    //joInParam.Add("patInfo", errMsg);
+                    Global.writeLog($"InitA初始化成功!");
+                }
+
+                switch (businessType)
+                {
+                    case "GetPatientInfo"://读取患者信息,该节点无需重定向
+                        {
+                            //重定向
+                            Business.Core.SelfServiceMachine.PatientService patientService = new Business.Core.SelfServiceMachine.PatientService();
+                            rtnResult = patientService.GetPatientInfo();
+                            Global.writeLog($"rtnResult:{rtnResult}");
+                            break;
+                        }
+                    case "OPReg"://门诊挂号
+                        {
+                            #region 链条式任务调度者
+                            OPRegService service = new OPRegService();
+                            rtnResult = service.Charge(operationType, joInParam);
+                            break;
+                            #endregion
+                        }
+                    case "OPSettl"://门诊结算
+                        {
+                            OPSettlementService service = new OPSettlementService();
+                            rtnResult = service.Charge(operationType, joInParam);
+                            break;
+                        }
+                    case "IPInReg"://入院登记
+                        {
+                            IPAdmRegService service = new IPAdmRegService();
+                            rtnResult = service.Register(operationType, joInParam);
+                            break;
+                        }
+                    case "IPInRegCancel"://取消入院登记
+                        {
+                            IPAdmRegService service = new IPAdmRegService();
+                            rtnResult = service.CancelRegister(operationType, joInParam);
+                            break;
+                        }
+                    case "IPOutReg"://出院登记
+                        {
+                            break;
+                        }
+                    case "IPUpoload"://住院费用上传
+                        {
+                            break;
+                        }
+                    case "IPPreSettl"://住院预计结算
+                        {
+                            break;
+                        }
+                    case "IPSettl"://住院结算
+                        {
+                            IPSettlementService service = new IPSettlementService();
+                            rtnResult = service.Charge(joInParam);
+                            return rtnResult;
+                        }
+                    case "DischargeAudit"://费用核查
+                        {
+                            DischargeAuditService service = new DischargeAuditService();
+                            rtnResult = service.Audit(joInParam);
+                            return rtnResult;
+                        }
+                    default:
+                        {
+                            rtnResult = JsonHelper.setExceptionJson(-1, "SelfServiceMachine 交易", "传入的业务编码不对!").ToString();
+                            return rtnResult;
+                        }
+
+                }
+                return rtnResult;
+            }
+            catch (Exception ex)
+            {
+                rtnResult = JsonHelper.setExceptionJson(-1, "SelfServiceMachine 交易", ex.Message).ToString();
+                return rtnResult;
+            }
+            finally
+            {
+                Global.writeLog("SelfServiceMachine 出参:" + JsonHelper.Compress(rtnResult));
+            }
+        }
+
     }
 }