2 Commits 466911e621 ... f9c0b800c1

Author SHA1 Message Date
  zzz f9c0b800c1 fix: bug修改 1 year ago
  zhengjie d172892462 init: 调整:住院结算前增加读卡,更新医保凭证,解决电子凭证结算提示无效token问题 1 year ago

BIN
.vs/slnx.sqlite


+ 10 - 1
Business/CenterBusiness.cs

@@ -157,7 +157,16 @@ namespace PTMedicalInsurance.Business
             {
                 dynamic jsonSignIn = new JObject();
                 dynamic jsonInput = new JObject();
-                jsonSignIn.opter_no = Global.user.ID;
+
+                if (Global.inf.interfaceDr == 12)//安徽省基线版
+                {
+                    jsonSignIn.opter_no = "A05CA9455BE8BF66";
+                }
+                if (Global.inf.interfaceDr == 16)//合肥市基线版
+                {
+                    jsonSignIn.opter_no = "7571C4995A2F4290";
+                }
+               // jsonSignIn.opter_no = Global.user.ID;
                 jsonSignIn.mac = Global.curEvt.mac;
                 
                 //MessageBox.Show(Global.inf.hospitalNO + "||" + Global.inf.CreditID + "||" + Global.inf.BusinessID);

+ 16 - 11
Business/HisMainBusiness.cs

@@ -319,6 +319,10 @@ namespace PTMedicalInsurance.Business
                         Global.pat.insuplc_admdvs = Global.pat.card.SearchAdmCode;
                         //MessageBox.Show(Global.pat.card.SearchAdmCode + Global.pat.card.SearchAdmName);
                     }
+                    //if(Global.pat.insuplc_admdvs == "340001")
+                    //{
+                    //    Global.pat.insuplc_admdvs = "349900";
+                    //}
                 }
                 else
                 {
@@ -358,8 +362,8 @@ namespace PTMedicalInsurance.Business
                 
                 joInput.Add("data",joData);
 
-               
-                JObject joRtn = invoker.invokeCenterService("1101", JsonHelper.setCenterInpar("1101", joInput));
+                
+                 JObject joRtn = invoker.invokeCenterService("1101", JsonHelper.setCenterInpar("1101", joInput));
                 if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
                 {
                     outParam = "获取病人信息失败:" + errorMsg;                    
@@ -1580,14 +1584,15 @@ namespace PTMedicalInsurance.Business
                             break;
                         }
                 }
-                //如果患者异地的则就医地需要该为369900
-                if (Global.pat.insuplc_admdvs != "")
-                {
-                    if (Global.pat.insuplc_admdvs.Substring(0, 4) != Global.inf.areaCode.Substring(0, 4))
-                    {
-                        Global.inf.areaCode = "539900";
-                    }
-                }
+                //注释
+                ////如果患者异地的则就医地需要该为369900
+                //if (Global.pat.insuplc_admdvs != "")
+                //{
+                //    if (Global.pat.insuplc_admdvs.Substring(0, 4) != Global.inf.areaCode.Substring(0, 4))
+                //    {
+                //        Global.inf.areaCode = "539900";
+                //    }
+                //}
             }
             catch (Exception ex)
             {
@@ -1964,7 +1969,7 @@ namespace PTMedicalInsurance.Business
             Global.pat.medType = JsonHelper.getDestValue(joReg, "data.MedicalType");
             Global.pat.insuType = JsonHelper.getDestValue(joReg, "data.InsuType");
             Global.pat.mdtrtcertType = JsonHelper.getDestValue(joReg, "data.CertificateType");
-            Global.pat.mdtrtcertNO = JsonHelper.getDestValue(joReg, "data.CertificateNO");
+            //Global.pat.mdtrtcertNO = JsonHelper.getDestValue(joReg, "data.CertificateNO");//结算取读卡的值,不取登记信息
             Global.pat.certType = JsonHelper.getDestValue(joReg, "data.CertificateType");
             Global.pat.certNO = JsonHelper.getDestValue(joReg, "data.CertificateNO");
             Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joReg, "data.InsuranceAreaCode");

+ 16 - 3
Common/ECTokenReader.cs

@@ -5,6 +5,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Runtime.InteropServices;
+using System.Security.Policy;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -15,9 +16,9 @@ namespace AnHuiMI.Common
         //static string URL = "https://fuwu-test.nhsa.gov.cn/localcfc/api/hsecfc/localQrCodeQuery";
 
         [DllImport("NationECCode.dll", EntryPoint = "NationEcTrans", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
-        static extern string NationEcTrans(string strUrl,string InData,out string OutData);
-
+        //static extern string NationEcTrans(string strUrl,string InData,out string OutData);
 
+        static extern IntPtr NationEcTrans(StringBuilder strUrl, StringBuilder InData, StringBuilder OutData);
         public static string ECQuery(string EcCertDecodeType) {
             Random rd = new Random();
             int iNum = rd.Next();
@@ -94,7 +95,19 @@ namespace AnHuiMI.Common
             input.transType = transType; // "ec.query";
             input.extra = "";
 
-            NationEcTrans(Global.inf.ecURL, JsonHelper.toJsonString(input), out sOutPar);
+
+            StringBuilder sbURL = new StringBuilder(Global.inf.ecURL);
+            StringBuilder sbInData = new StringBuilder(JsonHelper.toJsonString(input));
+            StringBuilder sbOutData = new StringBuilder(2048);
+
+            IntPtr pRtn = NationEcTrans(sbURL, sbInData, sbOutData);
+            sOutPar = sbOutData.ToString();
+            string rtn = Marshal.PtrToStringAnsi(pRtn);
+
+
+
+
+
             if (JsonHelper.getDestValue(JObject.Parse(sOutPar), "code") != "0")
             {
                 Global.writeLog("调用认证接口"+transType+"失败:" + sOutPar);

+ 3 - 3
Forms/Clearing.cs

@@ -636,7 +636,7 @@ namespace PTMedicalInsurance.Forms
                 //省医保和市医保对账一样,异地对账需要用到另外的对账交易
                 if (Global.inf.interfaceDr == 1)
                 {
-                    sqlStr = sqlStr + " and (InsuranceAreaCode='539900' or InsuranceAreaCode='530100')";
+                    sqlStr = sqlStr + " and (InsuranceAreaCode='349900' )";
                 }
 
                 //conditionStr = conditionStr.Substring(0,conditionStr.Length -1 );
@@ -1422,12 +1422,12 @@ namespace PTMedicalInsurance.Forms
             //省医保本地
             if ((Global.inf.interfaceDr == 1) && (cbOtherPlaceFlag.SelectedIndex == 2))
             {
-                sqlStr = sqlStr + " and (InsuranceAreaCode='539900' or InsuranceAreaCode='530100')";
+                sqlStr = sqlStr + " and (InsuranceAreaCode='349900')";
             }
             //省医保异地
             if ((Global.inf.interfaceDr == 1) && (cbOtherPlaceFlag.SelectedIndex == 1))
             {
-                sqlStr = sqlStr + " and (InsuranceAreaCode<>'539900' and InsuranceAreaCode<>'530100')";
+                sqlStr = sqlStr + " and (InsuranceAreaCode<>'349900' )";
             }
 
             sqlStr = sqlStr + " Group By Interface_Dr,ClearingType,ClearingWay";

+ 2 - 2
HeFeiMI.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.32228.343
+# Visual Studio Version 17
+VisualStudioVersion = 17.4.33213.308
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeFeiMI", "HeFeiMI.csproj", "{E9B4D618-13F0-4864-9C4C-28B8A6532653}"
 EndProject

+ 18 - 4
Helper/InvokeHelper.cs

@@ -28,6 +28,8 @@ using PTMedicalInsurance.Variables;
 using System.Runtime.InteropServices;
 using AnHuiMI.Forms;
 using AnHuiMI.Common;
+using static System.Net.WebRequestMethods;
+using File = System.IO.File;
 
 namespace PTMedicalInsurance.Helper
 {
@@ -106,10 +108,22 @@ namespace PTMedicalInsurance.Helper
         public InvokeHelper()
         {
             IniFile ini = new IniFile(Global.curEvt.path + @"\CenterServiceURL.ini");
-            Global.inf.centerURL = ini.ReadValue("CENTER", "url");
-            Global.inf.uploadURL = ini.ReadValue("CENTER", "upload");
-            Global.inf.downURL = ini.ReadValue("CENTER", "download");
-            Global.inf.ecURL = ini.ReadValue("CENTER", "ecToken");
+           // Global.inf.centerURL = ini.ReadValue("CENTER", "url");
+           if (Global.inf.interfaceDr == 12)//省
+            {
+                Global.inf.uploadURL = "http://10.88.29.31:80/fsi/api/fileupload/upload";
+                Global.inf.downURL = "http://10.88.29.31:80/fsi/api/fileupload/download";
+                Global.inf.ecURL = "http://10.67.0.49:8080/localcfc/api/hsecfc/localQrCodeQuery";
+            }
+            if (Global.inf.interfaceDr == 16)//市
+            {
+                Global.inf.uploadURL = "http://10.67.240.56:80/fsi/api/fileupload/upload";
+                Global.inf.downURL = "http://10.67.240.56:80/fsi/api/fileupload/download";
+                Global.inf.ecURL = "http://10.66.159.55:8080/localcfc/api/hsecfc/localQrCodeQuery";
+             }
+           // Global.inf.uploadURL = ini.ReadValue("CENTER", "upload");
+            //Global.inf.downURL = ini.ReadValue("CENTER", "download");
+           // Global.inf.ecURL = ini.ReadValue("CENTER", "ecToken");
         }
         
         

+ 20 - 1
Helper/JsonHelper.cs

@@ -301,6 +301,10 @@ namespace PTMedicalInsurance.Helper
             Global.curEvt.msgid = Global.inf.hospitalNO + DateTime.Now.ToString("yyyyMMddHHmmssffff");
             Jo.msgid = Global.curEvt.msgid;
 
+            if (Global.pat.insuplc_admdvs == "")
+            {
+                Global.pat.insuplc_admdvs = Global.inf.areaCode;
+            }
             
             Global.pat.insuplc_admdvs = Global.inf.areaCode;
             Global.pat.mdtrtarea_admvs = Global.inf.areaCode;
@@ -309,6 +313,12 @@ namespace PTMedicalInsurance.Helper
             Jo.insuplc_admdvs = Global.pat.insuplc_admdvs;
             // 就医地
             Jo.mdtrtarea_admvs = Global.pat.mdtrtarea_admvs;
+          
+
+            //if(Global.pat.insuplc_admdvs == "340001"&& infno=="1101"&& Global.inf.interfaceDr==12)
+            //{
+            //    Jo.insuplc_admdvs = "349900";
+            //}
 
             Jo.recer_sys_code = "MBS_LOCAL";
             Jo.dev_no = "2021";
@@ -316,7 +326,16 @@ namespace PTMedicalInsurance.Helper
             Jo.signtype = "SM2"; ;
             Jo.infver = "v1.0";
             Jo.opter_type = Global.user.type; ;
-            Jo.opter = Global.user.ID; ;
+            if(Global.inf.interfaceDr == 12)//安徽省基线版
+            {
+                Jo.opter = "A05CA9455BE8BF66";
+            }
+            if (Global.inf.interfaceDr == 16)//合肥市基线版
+            {
+                Jo.opter = "7571C4995A2F4290";
+            }
+
+            //Jo.opter = Global.user.ID; ;
             Jo.opter_name = Global.user.name; ;
             Jo.inf_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             Jo.fixmedins_code = Global.inf.hospitalNO;

+ 63 - 1
InsuBusiness.cs

@@ -869,6 +869,40 @@ namespace PTMedicalInsurance
                             */
                             #endregion
 
+                            #region【门诊预结算2206前调用1101人员信息获取】   
+                            /*   patInfo = "";
+                               //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
+                               if (hBus.readCard(out outParam) != 0)
+                               {
+                                   return JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
+                               }
+                               else
+                               {
+                                   patInfo = outParam;
+                                   //展示患者信息界面
+                                   if (hBus.showPatInfo(patInfo, out outParam) != 0)
+                                   {
+                                       return JsonHelper.setExceptionJson(-100, "操作员取消!", outParam).ToString();
+                                   }
+                               }
+                               #region 展示患者信息
+
+
+
+                               //患者信息赋值给全局变量
+                               patInfo = outParam;
+
+                               if (hBus.setGlobalPatAfaterShowPatInfo(patInfo, out errMsg) != 0)
+                               {
+                                   return JsonHelper.setExceptionJson(-1, "setGlobalPatAfaterShowPatInfo", errMsg).ToString();
+                               }
+                               //校验HIS姓名与医保姓名是否一致
+                               if (hBus.checkName(Global.pat.name, out errMsg) != 0)
+                               {
+                                   return JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
+                               }
+                               #endregion */
+                            #endregion
 
                             #region 门诊预结算[2206]
 
@@ -882,7 +916,8 @@ namespace PTMedicalInsurance
                             JObject joSettlement = JObject.Parse(JsonHelper.getDestValue(joReg, "settlement"));
                             //修改joSettlement的就诊ID ,总金额等
                             joSettlement["mdtrt_id"] = Global.pat.mdtrtID;
-                            joSettlement["medfee_sumamt"] = JsonHelper.getDestValue(joSumFee, "data.Sumamt");       
+                            joSettlement["medfee_sumamt"] = JsonHelper.getDestValue(joSumFee, "data.Sumamt");     
+                            
 
                             //预结算2206
                             if (hBus.preSettlement_OutPat(joSettlement, out outParam) != 0)
@@ -1219,6 +1254,33 @@ namespace PTMedicalInsurance
 
                             #endregion
 
+                            #region 结算前读卡
+                            //string patInfo = "";
+
+                            //errMsg = showPatientInfo(out patInfo, out outParam);
+                            //if (!errMsg.Equals("0"))
+                            //{
+                            //    return errMsg;
+                            //}
+                            if (hBus.readCard(out outParam) != 0)
+                            {
+                                rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
+                            }
+                            else
+                            {
+                                string patInfo = outParam;
+                                //展示患者信息界面
+                                if (hBus.showPatInfo(patInfo, out outParam) != 0)
+                                {
+                                    rtnResult = outParam;
+                                }
+                                else
+                                {
+                                    rtnResult = JsonHelper.setIrisReturnValue(0, "", JObject.Parse(outParam)).ToString();
+                                }
+                            }
+                            #endregion
+
                             JObject joPreSetOutpar ;
                             // 结算前先调用预结算?
                             if (hBus.preSettlement("2303",out joPreSetOutpar, out outParam) != 0)

BIN
obj/Release/HeFeiMI.csproj.AssemblyReference.cache


BIN
obj/Release/HeFeiMI.csproj.ResolveComReference.cache