837390164@qq.com 5 месяцев назад
Родитель
Сommit
b7389ebf0f
6 измененных файлов с 294 добавлено и 167 удалено
  1. 119 3
      Business/HisMainBusiness.cs
  2. 77 28
      Business/PreAndInProcessAnalysis.cs
  3. 10 117
      InsuBusiness.cs
  4. 3 3
      KunMingMI.csproj
  5. 83 15
      Variables/Struct.cs
  6. 2 1
      packages.config

+ 119 - 3
Business/HisMainBusiness.cs

@@ -35,6 +35,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using SettlementInfo = PTMedicalInsurance.Forms.SettlementInfo;
+using Org.BouncyCastle.Utilities.Encoders;
 
 namespace PTMedicalInsurance.Business
 {
@@ -112,6 +113,7 @@ namespace PTMedicalInsurance.Business
             inf.areaCode = JsonHelper.getDestValue(joInpar, "AreaCode");
             inf.dllName = JsonHelper.getDestValue(joInpar, "DLLName");
             inf.hospitalNO = JsonHelper.getDestValue(joInpar, "HospitalNO");
+            inf.HospitalLevel = JsonHelper.getDestValue(joInpar, "HospitalLevel");
             inf.version = "v1.0";
             inf.signatureType = "SM3";
             inf.recivedSystem = "YBXT";
@@ -152,6 +154,43 @@ namespace PTMedicalInsurance.Business
             }
 
             inf.cainfo = "";
+
+            #region【取医保平台接口信息】
+            inf.centerURL2 = JsonHelper.getDestValue(joInpar, "CenterURL2");
+
+            byte[] b = Base64.Decode(inf.centerURL2);
+            string centerURL2 = System.Text.Encoding.UTF8.GetString(b);
+
+            JObject joCenterURL2 = JObject.Parse(centerURL2);
+
+            inf.AK = JsonHelper.getDestValue(joCenterURL2, "core.ak");
+            inf.SK = JsonHelper.getDestValue(joCenterURL2, "core.sk");
+            inf.ecURL = JsonHelper.getDestValue(joCenterURL2, "core.ecURL");
+            inf.cardURL = JsonHelper.getDestValue(joCenterURL2, "core.cardURL");
+
+            inf.CreditID = JsonHelper.getDestValue(joCenterURL2, "core.CreditID");
+            inf.BusinessID = JsonHelper.getDestValue(joCenterURL2, "core.BusinessID");
+
+            //西安医保移动支付测试环境
+            //Global.inf.mobilePayURL = @"http://10.37.128.40:8086";
+            //西安医保移动支付正式环境
+            //Global.inf.mobilePayURL = @"http://10.37.128.41:8086";
+            inf.MobilePay.url = JsonHelper.getDestValue(joCenterURL2, "mobilePay.url");
+            inf.MobilePay.appid = JsonHelper.getDestValue(joCenterURL2, "mobilePay.appid");
+            inf.MobilePay.secretKey = JsonHelper.getDestValue(joCenterURL2, "mobilePay.secretKey");
+            inf.MobilePay.privateKey = JsonHelper.getDestValue(joCenterURL2, "mobilePay.privateKey");
+            inf.MobilePay.publicKey = JsonHelper.getDestValue(joCenterURL2, "mobilePay.publicKey");
+            inf.MobilePay.devSafeInfo = JsonHelper.getDestValue(joCenterURL2, "mobilePay.devSafeInfo");
+
+            inf.PresCir.ak = JsonHelper.getDestValue(joCenterURL2, "presCir.ak");
+            inf.PresCir.sk = JsonHelper.getDestValue(joCenterURL2, "presCir.sk");
+
+            inf.PresCir.url = JsonHelper.getDestValue(joCenterURL2, "presCir.url");
+            inf.PresCir.appid = JsonHelper.getDestValue(joCenterURL2, "presCir.appId");
+            inf.PresCir.secretKey = JsonHelper.getDestValue(joCenterURL2, "presCir.secretKey");
+            inf.PresCir.privateKey = JsonHelper.getDestValue(joCenterURL2, "presCir.privateKey");
+            inf.PresCir.publicKey = JsonHelper.getDestValue(joCenterURL2, "presCir.publicKey");
+            #endregion
         }
 
         /// <summary>
@@ -173,6 +212,7 @@ namespace PTMedicalInsurance.Business
             inf.areaCode = JsonHelper.getDestValue(joInpar, "areaCode");
             inf.dllName = JsonHelper.getDestValue(joInpar, "dLLName");
             inf.hospitalNO = JsonHelper.getDestValue(joInpar, "hospitalNO");
+            inf.HospitalLevel = JsonHelper.getDestValue(joInpar, "HospitalLevel");
             inf.version = "v1.0";
             inf.signatureType = "SM3";
             inf.recivedSystem = "YBXT";
@@ -215,6 +255,43 @@ namespace PTMedicalInsurance.Business
 
             inf.cainfo = "";
 
+            #region【取医保平台接口信息】
+            inf.centerURL2 = JsonHelper.getDestValue(joInpar, "CenterURL2");
+
+            byte[] b = Base64.Decode(inf.centerURL2);
+            string centerURL2 = System.Text.Encoding.UTF8.GetString(b);
+
+            JObject joCenterURL2 = JObject.Parse(centerURL2);
+
+            inf.AK = JsonHelper.getDestValue(joCenterURL2, "core.ak");
+            inf.SK = JsonHelper.getDestValue(joCenterURL2, "core.sk");
+            inf.ecURL = JsonHelper.getDestValue(joCenterURL2, "core.ecURL");
+            inf.cardURL = JsonHelper.getDestValue(joCenterURL2, "core.cardURL");
+
+            inf.CreditID = JsonHelper.getDestValue(joCenterURL2, "core.CreditID");
+            inf.BusinessID = JsonHelper.getDestValue(joCenterURL2, "core.BusinessID");
+
+            //西安医保移动支付测试环境
+            //Global.inf.mobilePayURL = @"http://10.37.128.40:8086";
+            //西安医保移动支付正式环境
+            //Global.inf.mobilePayURL = @"http://10.37.128.41:8086";
+            inf.MobilePay.url = JsonHelper.getDestValue(joCenterURL2, "mobilePay.url");
+            inf.MobilePay.appid = JsonHelper.getDestValue(joCenterURL2, "mobilePay.appid");
+            inf.MobilePay.secretKey = JsonHelper.getDestValue(joCenterURL2, "mobilePay.secretKey");
+            inf.MobilePay.privateKey = JsonHelper.getDestValue(joCenterURL2, "mobilePay.privateKey");
+            inf.MobilePay.publicKey = JsonHelper.getDestValue(joCenterURL2, "mobilePay.publicKey");
+            inf.MobilePay.devSafeInfo = JsonHelper.getDestValue(joCenterURL2, "mobilePay.devSafeInfo");
+
+            inf.PresCir.ak = JsonHelper.getDestValue(joCenterURL2, "presCir.ak");
+            inf.PresCir.sk = JsonHelper.getDestValue(joCenterURL2, "presCir.sk");
+
+            inf.PresCir.url = JsonHelper.getDestValue(joCenterURL2, "presCir.url");
+            inf.PresCir.appid = JsonHelper.getDestValue(joCenterURL2, "presCir.appId");
+            inf.PresCir.secretKey = JsonHelper.getDestValue(joCenterURL2, "presCir.secretKey");
+            inf.PresCir.privateKey = JsonHelper.getDestValue(joCenterURL2, "presCir.privateKey");
+            inf.PresCir.publicKey = JsonHelper.getDestValue(joCenterURL2, "presCir.publicKey");
+            #endregion
+
         }
 
         /// <summary>
@@ -232,6 +309,8 @@ namespace PTMedicalInsurance.Business
 
                 getInsuConfingue(out Global.insuConfig);
 
+                getLocalConfingue();
+
                 JObject joInparam = JObject.Parse(inParam);
 
                 JObject JoSession = JObject.Parse(JsonHelper.getDestValue(joInparam, "session[0]"));
@@ -1486,10 +1565,15 @@ namespace PTMedicalInsurance.Business
                 for (int i = 0; i < jaConvertedDiagnoses.Count; i++)
                 {
                     jaConvertedDiagnoses[i]["diag_srt_no"] = i + 1;
-                    if (jaConvertedDiagnoses[i]["maindiag_flag"].ToString() == "1")
+                    string diaTypeCode = jaConvertedDiagnoses[i]["diaTypeCode"].ToString();
+                    string maindiag_flag = jaConvertedDiagnoses[i]["maindiag_flag"].ToString();
+                    string diag_type = jaConvertedDiagnoses[i]["diag_type"].ToString();
+
+                    //取出院主诊断
+                    if (diaTypeCode == "DIS" || maindiag_flag == "1" || diag_type == "1")
                     {
-                        dscg_maindiag_code = jaConvertedDiagnoses[i]["diag_code"].ToString();
-                        dscg_maindiag_name = jaConvertedDiagnoses[i]["diag_name"].ToString();
+                        Global.pat.discDiagCode = dscg_maindiag_code = jaConvertedDiagnoses[i]["diag_code"].ToString();
+                        Global.pat.discDiagName = dscg_maindiag_name = jaConvertedDiagnoses[i]["diag_name"].ToString();
                     }
                     //增加就诊ID
                     jaConvertedDiagnoses[i]["mdtrt_id"] = new JObject();
@@ -1636,6 +1720,9 @@ namespace PTMedicalInsurance.Business
                     joSetlInpar.Add("preselfpay_amt", JsonHelper.getDestValue(joSumFee, "data.PreSelfPayAmount"));
                     joSetlInpar.Add("dscgTime", Global.pat.hisDischargeTime);
 
+                    joSetlInpar.Add("minpacunt_drug_trac_cnt", Global.Set.minpacunt_drug_trac_cnt); //本次结算应上传最小包装追溯码数量
+                    joSetlInpar.Add("mcs_trac_cnt", Global.Set.mcs_trac_cnt); //本次结算应上传耗材追溯码数量
+
                     JObject joDataExp = new JObject();
                     joDataExp.Add("acct_payamt", "0.00");
                     joDataExp.Add("cla_trt_flag", "");
@@ -1815,6 +1902,8 @@ namespace PTMedicalInsurance.Business
                     joSetlInpar.Add("insutype", frmReg.insuType);//险种类型
                     joSetlInpar.Add("pub_hosp_rfom_flag", "");
                     joSetlInpar.Add("exp_content11", "");
+                    joSetlInpar.Add("minpacunt_drug_trac_cnt", Global.Set.minpacunt_drug_trac_cnt); //本次结算应上传最小包装追溯码数量
+                    joSetlInpar.Add("mcs_trac_cnt", Global.Set.mcs_trac_cnt); //本次结算应上传耗材追溯码数量
 
 
                     joReg.Add("mdtrtinfo", joMdtrtinfo);
@@ -2446,6 +2535,8 @@ namespace PTMedicalInsurance.Business
                         pat.recordID = JsonHelper.getDestValue(joInparam, "params[0].recordID");
                         pat.billID = JsonHelper.getDestValue(joInparam, "params[0].billID");
                         Global.pat.insuplc_admdvs = "";
+                        Global.Set.minpacunt_drug_trac_cnt = JsonHelper.getDestValue(joInparam, "insuAdmObj.minpacunt_drug_trac_cnt");
+                        Global.Set.mcs_trac_cnt = JsonHelper.getDestValue(joInparam, "insuAdmObj.mcs_trac_cnt");
                         if (string.IsNullOrEmpty(JsonHelper.getDestValue(joInparam, "insuAdmObj.inDays")))
                         {
                             Global.Set.hospitalizationsDays = 0;
@@ -2575,6 +2666,8 @@ namespace PTMedicalInsurance.Business
                         pat.name = JsonHelper.getDestValue(joInparam, "insuAdmObj.psn_name");
                         pat.billID = JsonHelper.getDestValue(joInparam, "params[0].billID");
                         pat.hisDischargeTime = Convert.ToDateTime(JsonHelper.getDestValue(joInparam, "insuAdmObj.disDateTime")).ToString("yyyy-MM-dd HH:mm:ss");
+                        Global.Set.minpacunt_drug_trac_cnt = JsonHelper.getDestValue(joInparam, "insuAdmObj.minpacunt_drug_trac_cnt");
+                        Global.Set.mcs_trac_cnt = JsonHelper.getDestValue(joInparam, "insuAdmObj.mcs_trac_cnt");
                         if (string.IsNullOrEmpty(JsonHelper.getDestValue(joInparam, "insuAdmObj.inDays")))
                         {
                             Global.Set.hospitalizationsDays = 0;
@@ -2886,6 +2979,17 @@ namespace PTMedicalInsurance.Business
                 return -1;
             }
 
+            #region 【事中分析】      
+            if (Global.curEvt.ext.isOpenAnalysis)
+            {
+                string outMsg;
+                if (InProcessAnalysis(out outMsg) != 0)
+                {
+                    //outParam = "【3102】医保明细审核事中分析服务调用失败:" + outMsg;
+                    //return -1;
+                }
+            }
+            #endregion
 
             //编码转换
             if (mIS.convertSettlementWithInsuCode(jo2206Rtn, out outParam) != 0)
@@ -2989,6 +3093,18 @@ namespace PTMedicalInsurance.Business
             }
             #endregion
 
+            #region 【事中分析】      
+            if (Global.curEvt.ext.isOpenAnalysis)
+            {
+                string outMsg;
+                if (InProcessAnalysis(out outMsg) != 0)
+                {
+                    outParam = "【3102】医保明细审核事中分析服务调用失败:" + outMsg;
+                    //return -1;
+                }
+            }
+            #endregion
+
             //调用服务获取门诊诊断信息
             string diagnoses;
             if (hIS.getPatDiagnoses(Global.pat, out diagnoses) != 0)

+ 77 - 28
Business/PreAndInProcessAnalysis.cs

@@ -110,13 +110,14 @@ namespace PTMedicalInsurance.Business
                 joInpar.Add("patn_id", p.psn_no);
                 joInpar.Add("patn_name", p.name);
                 string gend = p.gend;
-                //if (gend == "男") gend = "1";
-                //if (gend == "女") gend = "2";
-                joInpar.Add("gend",gend);
+                if (gend == "男") gend = "1";
+                if (gend == "女") gend = "2";
+                joInpar.Add("gend", gend);
                 joInpar.Add("brdy", p.brdy);
+                if (string.IsNullOrEmpty(p.insuplc_admdvs)) p.insuplc_admdvs = Global.pat.insuplc_admdvs;
                 joInpar.Add("poolarea", p.insuplc_admdvs);
                 joInpar.Add("curr_mdtrt_id", curr_mdtrt_id);
-                joInpar.Add("fsi_encounter_dtos", GetFsi_encounter_dtos(trig_scen,p));
+                joInpar.Add("fsi_encounter_dtos", GetFsi_encounter_dtos(trig_scen, p));
                 joInpar.Add("fsi_his_data_dto", new JArray());
                 JArray ja = new JArray();
                 ja.Add(joInpar);
@@ -134,15 +135,16 @@ namespace PTMedicalInsurance.Business
             try
             {
                 JObject jofsi_encounter_dtos = JObject.FromObject(fsi_encounter_dtos[0]);
-                JObject joInpar = new JObject(); 
+                JObject joInpar = new JObject();
                 string mdtrtID = p.mdtrtID;
                 if (string.IsNullOrEmpty(mdtrtID)) mdtrtID = Global.pat.adm_Dr.ToString();
+                if (string.IsNullOrEmpty(Global.inf.HospitalLevel)) Global.inf.HospitalLevel = "02";
                 joInpar.Add("mdtrt_id", mdtrtID);  //就诊标识
                 joInpar.Add("medins_id", Global.inf.hospitalNO);  //医疗服务机构标识
                 joInpar.Add("medins_name", Global.inf.hospitalName);  //医疗机构名称
                 joInpar.Add("medins_admdvs", Global.inf.areaCode);  //医疗机构行政区划编码
                 joInpar.Add("medins_type", "A512");  //医疗服务机构类型
-                joInpar.Add("medins_lv", "2");  //医疗机构等级
+                joInpar.Add("medins_lv", Global.inf.HospitalLevel);  //医疗机构等级
                 joInpar.Add("wardarea_codg", JsonHelper.getDestValue(jofsi_encounter_dtos, "wardarea_codg"));  //病区标识
                 joInpar.Add("wardno", JsonHelper.getDestValue(jofsi_encounter_dtos, "wardno"));  //病房号
                 joInpar.Add("bedno", JsonHelper.getDestValue(jofsi_encounter_dtos, "bedno"));  //病床号
@@ -157,21 +159,14 @@ namespace PTMedicalInsurance.Business
                 joInpar.Add("dscg_dept_codg", JsonHelper.getDestValue(jofsi_encounter_dtos, "dscg_dept_codg"));  //出院科室标识
                 joInpar.Add("dscg_dept_name", JsonHelper.getDestValue(jofsi_encounter_dtos, "dscg_dept_name"));  //出院科室名称
                 joInpar.Add("med_mdtrt_type", JsonHelper.getDestValue(jofsi_encounter_dtos, "med_mdtrt_type"));  //就诊类型
-                //银海和基线版不一样
-                string med_type = Global.pat.medType;
-                if (med_type == "31") med_type = "21";
-                if (med_type == "12") med_type = "41";
-                if (med_type == "37") med_type = "23";
-                if (med_type == "11") med_type = "11";
-                if (med_type == "36") med_type = "23";
-                if (med_type == "18") med_type = "14";
-                if (med_type == "32") med_type = "92";
-                if (med_type == "1102") med_type = "91";
+                string med_type = JsonHelper.getDestValue(jofsi_encounter_dtos, "med_type");
+                if (string.IsNullOrEmpty(med_type))
+                    med_type = Global.pat.medType;
                 joInpar.Add("med_type", med_type);  //医疗类别
-                joInpar.Add("fsi_order_dtos", GetFsi_order_dtos(trig_scen,p));  //处方(医嘱)信息
+                joInpar.Add("fsi_order_dtos", GetFsi_order_dtos(trig_scen, p));  //处方(医嘱)信息
                 string matn_stas = JsonHelper.getDestValue(jofsi_encounter_dtos, "matn_stas");
                 if (string.IsNullOrEmpty(matn_stas)) matn_stas = "0";
-                joInpar.Add("matn_stas",matn_stas );  //生育状态
+                joInpar.Add("matn_stas", matn_stas);  //生育状态
                 joInpar.Add("medfee_sumamt", JsonHelper.getDestValue(jofsi_encounter_dtos, "medfee_sumamt"));  //总费用
                 joInpar.Add("ownpay_amt", JsonHelper.getDestValue(jofsi_encounter_dtos, "ownpay_amt"));  //自费金额
                 joInpar.Add("selfpay_amt", JsonHelper.getDestValue(jofsi_encounter_dtos, "selfpay_amt"));  //自付金额
@@ -179,19 +174,28 @@ namespace PTMedicalInsurance.Business
                 joInpar.Add("ma_amt", JsonHelper.getDestValue(jofsi_encounter_dtos, "ma_amt"));  //救助金支付金额
                 joInpar.Add("hifp_payamt", JsonHelper.getDestValue(jofsi_encounter_dtos, "hifp_payamt"));  //统筹金支付金额
                 joInpar.Add("setl_totlnum", JsonHelper.getDestValue(jofsi_encounter_dtos, "setl_totlnum"));  //结算总次数
-                string insutype = Global.pat.insuType;
-                if (insutype == "1") insutype = "310";
-                if (insutype == "2") insutype = "310";
-                if (insutype == "3") insutype = "390";
-                if (insutype == "4") insutype = "340";
+                string insutype = JsonHelper.getDestValue(jofsi_encounter_dtos, "insutype");
+                if (insutype == "") insutype = Global.pat.insuType;
                 joInpar.Add("insutype", insutype);  //险种
-                joInpar.Add("reim_flag", JsonHelper.getDestValue(jofsi_encounter_dtos, "reim_flag"));  //报销标志
-                joInpar.Add("out_setl_flag", JsonHelper.getDestValue(jofsi_encounter_dtos, "out_setl_flag"));  //异地结算标志
-                joInpar.Add("fsi_operation_dtos", GetFsi__operation__dtos(trig_scen,p));  //手术操作集合
+                string reimFlag = JsonHelper.getDestValue(jofsi_encounter_dtos, "reim_flag");
+                // 报销标志(必填)
+                if (string.IsNullOrEmpty(reimFlag))
+                {
+                    reimFlag = "1";
+                }
+                joInpar.Add("reim_flag", reimFlag);
+                // 异地结算标志(必填)
+                string outSetlFlag = JsonHelper.getDestValue(jofsi_encounter_dtos, "out_setl_flag");
+                if (string.IsNullOrEmpty(outSetlFlag))
+                {
+                    outSetlFlag = isOtherCity() ? "1" : "0";
+                }
+                joInpar.Add("out_setl_flag", outSetlFlag);
+                joInpar.Add("fsi_operation_dtos", GetFsi_operation_dtos(trig_scen, p));  //手术操作集合
 
                 JArray ja = new JArray();
                 ja.Add(joInpar);
-                return ja; 
+                return ja;
             }
             catch (Exception ex)
             {
@@ -199,6 +203,51 @@ namespace PTMedicalInsurance.Business
                 return null;
             }
         }
+
+        /// <summary>
+        /// 跨省异地
+        /// </summary>
+        /// <returns></returns>
+        public static bool isOtherProvice(string areaCode)
+        {
+            if (!string.IsNullOrEmpty(areaCode) && areaCode.Length > 2 && areaCode.Substring(0, 2) != "36")
+            {
+                return true;
+            }
+            return false;
+        }
+
+        public static bool isOtherProvice()
+        {
+            return isOtherProvice(getAreaCode());
+        }
+
+        private static string getAreaCode()
+        {
+            string areaCode = Global.pat.insuplc_admdvs ?? Global.inf.areaCode;
+            if (Global.pat.OtherProv == 1)
+            {
+                areaCode = Global.pat.card.SearchAdmCode;
+            }
+            return areaCode;
+        }
+        public static bool isOtherCity()
+        {
+            return isOtherCity(getAreaCode());
+        }
+        /// <summary>
+        /// 省内异地
+        /// </summary>
+        /// <returns></returns>
+        public static bool isOtherCity(string areaCode)
+        {
+            if (!string.IsNullOrEmpty(areaCode) && areaCode.Length > 4 && areaCode.Substring(0, 4) != Global.inf.areaCode.Substring(0, 4))
+            {
+                return true;
+            }
+            return false;
+        }
+
         public JArray GetFsi_diagnose_dtos(string trig_scen, Patients p)
         {
             try
@@ -213,7 +262,7 @@ namespace PTMedicalInsurance.Business
         }
         
 
-        public JArray GetFsi__operation__dtos(string trig_scen, Patients p)
+        public JArray GetFsi_operation_dtos(string trig_scen, Patients p)
         {
             try
             {

+ 10 - 117
InsuBusiness.cs

@@ -528,67 +528,15 @@ namespace PTMedicalInsurance
                             mIS.deleteFee(out errMsg);
 
                             #region【住院费用上传前调用3101事前服务】
-                            //1.获取3101入参报文
-                            /* 20221207 CM 朱鹏飞要求屏蔽调用事前事中服务交易--南宁
                             //事前分析                           
                             if (Global.curEvt.ext.isOpenAnalysis)
                             {
                                 if (hBus.PreAnalysis("4", "", out errMsg) != 0)
                                 {
-                                    rtnResult = JsonHelper.setExceptionJson(-1, "事前分析", errMsg).ToString();
-                                    return rtnResult;
-                                }
-                            }                                                       
-                            */
-
-                            if (Global.curEvt.ext.isOpenAnalysis)
-                            {
-                                if (hIS.GetInsuPatInfo("5", Global.pat, out outParam) != 0)
-                                {
-                                    rtnResult = JsonHelper.setExceptionJson(-1, "获取3101医保明细审核事前分析服务入参失败:", outParam).ToString();
-                                    return rtnResult;
-                                }
-                                else
-                                {
-                                    //2.调用医保3101明细审核事前分析服务
-                                    JObject joInput = new JObject();
-                                    joInput = JObject.Parse(outParam);
-                                    JObject jo3101Rtn = invoker.invokeCenterService("3101", JsonHelper.setCenterInpar("3101", joInput.ToString().Replace("\r\n", "")));
-                                    if (JsonHelper.parseCenterRtnValue(jo3101Rtn, out errMsg) != 0)
-                                    {
-                                        rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
-                                        return rtnResult;
-                                    }
-                                    else
-                                    {
-                                        JArray jaResult = JArray.Parse(JsonHelper.getDestValue(jo3101Rtn, "output.result"));
-
-                                        if (jaResult.HasValues)
-                                        {
-                                            PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(jo3101Rtn);
-                                            paipaForm.Text = "事前事中智能审核-3101医保明细审核事前分析服务调用失败返回";
-                                            if (paipaForm.ShowDialog() != DialogResult.OK)
-                                            {
-                                                errMsg = "事前事中审核不通过,操作员取消!";
-                                                rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
-                                                return rtnResult;
-                                            }
-                                            else
-                                            {
-                                                //【3103】事前事中服务反馈服务
-                                                if (hBus.PreAnalysisFeedBack("3101", paipaForm.JrID, out errMsg) != 0)
-                                                {
-                                                    rtnResult = JsonHelper.setExceptionJson(-1, "【3103】事前事中服务反馈服务", errMsg).ToString();
-                                                    return rtnResult;
-                                                }
-
-                                            }
-                                        }
-                                    }
+                                    //rtnResult = JsonHelper.setExceptionJson(-1, "事前分析", errMsg).ToString();
+                                    //return rtnResult;
                                 }
                             }
-
-                            
                             #endregion
 
                             //开始进行费用传送
@@ -765,11 +713,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;
@@ -799,43 +743,17 @@ namespace PTMedicalInsurance
                             }
 
                             #region【门诊就诊信息上传成功后调用3101事前服务】
-                            ////事前分析
+                            //事前分析
+                            //1.门诊挂号 2.门诊收费登记 3.住院登记 4.住院收费登记 5.住院执行医嘱 6.门诊结算 7.门诊预结算 8.住院结算 9.住院预结算 10.购药划卡
                             if (Global.curEvt.ext.isOpenAnalysis)
                             {
                                 if (hBus.PreAnalysis("1", "", out errMsg) != 0)
                                 {
-                                    rtnResult = JsonHelper.setExceptionJson(-1, "门诊就诊信息上传成功后调用3101事前服务失败:", errMsg).ToString();
-                                    return rtnResult;
+                                    //调用失败后仍继续往下执行-朱鹏飞要求
+                                    outParam = outParam + "门诊就诊信息上传成功后调用3101事前服务失败:" + errMsg;
+                                    //return Error("门诊就诊信息上传成功后调用3101事前服务失败:" + errMsg);
                                 }
-                            }
-
-                            //1.获取3101入参报文
-                            /*
-                            if (hIS.GetInsuPatInfo("1", Global.pat, out outParam) != 0)
-                            {
-                                rtnResult = JsonHelper.setExceptionJson(-1, "获取3101医保明细审核事前分析服务入参失败:", outParam).ToString();
-                                return rtnResult;
-                            }
-                            else
-                            {
-                                //2.调用医保3101明细审核事前分析服务
-                                JObject joInput = new JObject();
-                                //joInput.Add("data", JObject.Parse(outParam));
-                                joInput = JObject.Parse(outParam);
-
-                                JObject jo3101Rtn = invoker.invokeCenterService("3101", JsonHelper.setCenterInpar("3101", joInput.ToString().Replace("\r\n", ""))); //.Replace(" ", "")
-                                if (JsonHelper.parseCenterRtnValue(jo3101Rtn, out errMsg) != 0)
-                                {
-
-                                    DialogResult dr = MessageBox.Show("【3101】医保明细审核事前分析服务医保中心返回结果:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
-                                    if (dr != DialogResult.OK)
-                                    {
-                                        rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
-                                        return rtnResult;
-                                    }
-                                }
-                            }
-                            */
+                            }                           
                             #endregion
 
                             //费用上传
@@ -846,32 +764,7 @@ namespace PTMedicalInsurance
                             }
 
                             #region【门诊预结算2206前调用3102医保明细审核事中服务】                            
-                            //1.获取3102入参报文
-                            /*
-                            if (hIS.GetInsuPatInfo("2", Global.pat, out outParam) != 0)
-                            {
-                                rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
-                                return rtnResult;
-                            }
-                            else
-                            {
-                                //2.调用医保3102明细审核事前分析服务
-                                JObject joInput = new JObject();
-                                //joInput.Add("data", JObject.Parse(outParam));
-                                joInput = JObject.Parse(outParam);
-
-                                JObject jo3101Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
-                                if (JsonHelper.parseCenterRtnValue(jo3101Rtn, out errMsg) != 0)
-                                {
-                                    DialogResult dr = MessageBox.Show("【3102】医保明细审核事中分析服务医保中心返回结果:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
-                                    if (dr != DialogResult.OK)
-                                    {
-                                        rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
-                                        return rtnResult;
-                                    }
-                                }
-                            }
-                            */
+                           
                             #endregion
 
                             //调用IRIS获取医保各项金额

+ 3 - 3
KunMingMI.csproj

@@ -32,8 +32,8 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
-      <HintPath>packages\BouncyCastle.1.8.9\lib\BouncyCastle.Crypto.dll</HintPath>
+    <Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
+      <HintPath>packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
     </Reference>
     <Reference Include="FastReport">
       <HintPath>..\..\..\..\ThirdDLL\FastReport.dll</HintPath>
@@ -49,7 +49,7 @@
     </Reference>
     <Reference Include="Microsoft.VisualBasic" />
     <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
-      <HintPath>packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+      <HintPath>packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="Office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
       <HintPath>packages\Microsoft.Office.Excel.14.0.4760.1000\lib\net20\Office.dll</HintPath>

+ 83 - 15
Variables/Struct.cs

@@ -43,14 +43,13 @@ namespace PTMedicalInsurance.Variables
         public int hisHospitalDr;
         public int hospitalDr;
         public string hospitalName;
+        public string hisHospCode;
         public string hospitalNO;
+        public string HospitalLevel;
         public string centerURL;
-        public string uploadURL;
-        public string downURL;
+        public string centerURL2;
         public string cardURL;
-        public string mobilePayURL;
         public string ecURL;
-        public string ecPrescURL;
         public string areaCode;
         public string dllName;
         public string version;
@@ -65,10 +64,31 @@ namespace PTMedicalInsurance.Variables
         public string CreditID;
         public string operatoType;
         public string fileName;
+
+        public BranchBusinessInfo MobilePay;  //移动支付密钥信息
+        public BranchBusinessInfo PresCir;//处方流转密钥信息
+
+        //public int interfaceDr_TY;
+        public int InsuCurrencyCataLogue;//指向目录
+        public string hospitalLevel;
+        public string uploadURL;
+        public string downURL;
+        public string mobilePayURL;
+        public string ecPrescURL;
+      
+        // 三方对接
+        public string apiName;
         public string appId;
         public string privateKey;
         public string secretKey;
         public string publicKey;
+        public string passId;
+        public string apiSecretKey;  //不与移动支付等冲突
+
+        public string EcCertDecodeTradeNO;
+        //定点类型
+        public string fixedPointType;
+
 
     }
 
@@ -82,12 +102,28 @@ namespace PTMedicalInsurance.Variables
         public string officeName;
         public string deptID;
         public string deptName;
+        public string hosCode;
+    }
+
+    //分支业务
+    public struct BranchBusinessInfo
+    {
+        public string ak;
+        public string sk;
+        public string url;
+        public string appid;  //APPID 或 密钥id
+        public string secretKey; //密钥id  密钥KEY
+        public string privateKey; //私钥  渠道私钥
+        public string channelPublicKey;// 渠道公钥
+        public string publicKey; //平台公钥
+        public string devSafeInfo; //设备安全信息
     }
 
     //患者信息
     public struct Patients
     {
         public int adm_Dr;
+        public string admID;
         public string mdtrtID;
         public string name;
         public string gend;
@@ -108,11 +144,8 @@ namespace PTMedicalInsurance.Variables
         public string discDiagCode; //Discharge Diagnosis
         public string discDiagName;
         public string insuplc_admdvs;
-        public string insuplc_name;  //参保机构名称
         public string mdtrtarea_admvs; //就医地区划
         public string ecToken; //电子凭证令牌
-        public string ecCardNo;  //电子医保卡号
-        public string ecBusinessType;//电子凭证业务类型
         public Card card;
         public string settlID;
         public string billID;
@@ -131,17 +164,17 @@ namespace PTMedicalInsurance.Variables
 
         public string DiseasecCode;  //病种编码
         public string DiseasecName;  //病种名称
-        public string DiseasecType;
-
-        public string operCode; //手术编码
-        public string operName; //手术名称
 
         public string SettID_HISJSB;
         public string SettID_YBJSB;
 
         public string RYorCY;   //1入院 2出院
-        public string hisDischargeTime; //出院时间
         public int admType;
+        public Boolean bOtherProvLocal;  //是否异地
+        public Boolean bChangePIN; //更改社保卡密码
+        public Boolean bPresCirul;
+
+        public string hisDischargeTime; //出院时间
 
         public string ExpContent; //扩展字段
         public object ExpContentObj;
@@ -153,7 +186,18 @@ namespace PTMedicalInsurance.Variables
         public string payOrdId;
         public string payToken;
         public string AdmInDepCode;
-        public string admAttendDoctorNO;
+        public string admAttendDoctorNO;      
+        public string insuplc_name;  //参保机构名称       
+        public string ecCardNo;  //电子医保卡号
+        public string ecBusinessType;//电子凭证业务类型    
+        public string DiseasecType;
+        public string operCode; //手术编码
+        public string operName; //手术名称
+        public string presetIDNO;//预设身份证号码,用于脱卡支付      
+        // 传递给医保的就诊号
+        public string insuAdmNo;
+        public int iRes_Chronic; //0是,1否
+        public JObject joExpContent; //扩展字段     
     }
 
     public struct Card
@@ -168,6 +212,13 @@ namespace PTMedicalInsurance.Variables
         public string SearchAdmCode;
         public string SearchAdmName;
         public string transType;
+        public string pKey;
+        public string ecBizType;
+
+        /// <summary>
+        /// 业务串码
+        /// </summary>
+        public string BusinessCode;
     }
 
     //费用信息
@@ -258,18 +309,31 @@ namespace PTMedicalInsurance.Variables
         public string path;
         public string mac;
         public string ip;
-
+        /// <summary>
+        /// 签到号
+        /// </summary>
         public string signno;
+        /// <summary>
+        /// 交易流水号
+        /// </summary>
         public string msgid;
         public string URL;
         public JArray jaSession;
 
+        /// <summary>
+        /// 当前交易的接口方法
+        /// </summary>
+        public string funNo;
+
+        public string year;
+        public string month;
+        public int totalrow;
+
         /// <summary>
         /// 调试模式
         /// </summary>
         public bool enabledDebug;
 
-        public CurEvtExtend ext;
         /// <summary>
         /// 测试环境
         /// </summary>
@@ -277,5 +341,9 @@ namespace PTMedicalInsurance.Variables
 
         public bool showJson;
 
+        public bool checkPassWord;
+
+        public CurEvtExtend ext;
+
     }
 }

+ 2 - 1
packages.config

@@ -4,7 +4,8 @@
   <package id="Datatable.Activities.UiPath" version="1.0.1" targetFramework="net45" />
   <package id="Microsoft.Office.Excel" version="14.0.4760.1000" targetFramework="net45" />
   <package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1001" targetFramework="net45" />
-  <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
+  <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net48" />
+  <package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net48" />
   <package id="SunnyUI" version="3.2.0" targetFramework="net48" />
   <package id="SunnyUI.Common" version="3.2.0" targetFramework="net48" />
 </packages>