zhengjie před 1 rokem
rodič
revize
d93b7fc36d

+ 1 - 0
Business/CenterBusiness.cs

@@ -323,6 +323,7 @@ namespace PTMedicalInsurance.Business
                 }
                 
                 joTmp.mdtrt_id = Global.pat.mdtrtID;
+                joTmp.adm_Dr = Global.pat.adm_Dr.ToString();
                 joTmp.psn_no = Global.pat.psn_no;
 
                 JObject joData = new JObject();

+ 7 - 3
Business/HisMainBusiness.cs

@@ -207,10 +207,14 @@ namespace PTMedicalInsurance.Business
                 JObject JoSession = JObject.Parse(JsonHelper.getDestValue(joInparam, "session[0]"));
                 string  hisHospitalDr = JsonHelper.getDestValue(JoSession, "hospID");
 
-                JObject joInterface = JObject.Parse(JsonHelper.getDestValue(joInparam, "interfaceinfo"));
-
-                joInterface.Add("hisHospitalDr", hisHospitalDr); 
+                string interfaceInfo = JsonHelper.getDestValue(joInparam, "interfaceinfo");
 
+                JObject joInterface = null;
+                if (!string.IsNullOrEmpty(interfaceInfo))
+                { 
+                    joInterface = JObject.Parse(interfaceInfo);
+                    joInterface.Add("hisHospitalDr", hisHospitalDr);
+                }
                 if (joInterface != null)
                 {
                     //获取当前接口详细信息

+ 1 - 1
Business/Inpatient/IPFeeUploadProcess.cs

@@ -56,7 +56,7 @@ namespace PTMedicalInsurance.Business
 
             JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
             //按指定条数分割后上传,保存,更新
-            if (hBus.uploadFeeToCenter(TradeEnum.InpatientFeeUpload, 10, jaFeeDetail, out outParam) != 0)
+            if (hBus.uploadFeeToCenter(TradeEnum.InpatientFeeUpload, 50, jaFeeDetail, out outParam) != 0)
             {
                 return Exception("上传费用", outParam);
             }

+ 8 - 0
Common/ExpressionEvaluator.cs

@@ -68,6 +68,8 @@ namespace PTMedicalInsurance.Common
                 {
                     case "mdtrtid":
                         return Global.pat.mdtrtID;
+                    case "admid":
+                        return Global.pat.adm_Dr.ToString();
                     case "gender":
                         return Global.pat.gend;
                     case "name":
@@ -82,10 +84,16 @@ namespace PTMedicalInsurance.Common
                         return Global.pat.insuType;
                     case "medtype":
                         return Global.pat.medType;
+                    case "certtype":  //证件类型
+                        return Global.pat.mdtrtcertType;
+                    case "certno": //证件号
+                        return Global.pat.mdtrtcertNO;
                     case "clearway":
                         return Global.Set.clearingWay;
                     case "insuplc":
                         return Utils.GetInsuCode();
+                    case "insuorg":
+                        return Utils.GetInsuOrgCode();
                     case "mdtrtarea":
                         return Global.pat.mdtrtarea_admvs;
                     case "ectoken":

+ 16 - 0
Common/Utils.cs

@@ -205,6 +205,20 @@ namespace PTMedicalInsurance.Common
             return Global.pat.insuplc_admdvs;
         }
 
+        /// <summary>
+        /// 获取医院编码(社保)
+        /// </summary>
+        /// <returns></returns>
+        public static string GetInsuOrgCode()
+        {
+            // 跨省异地
+            if (Utils.isOtherProvice())
+            {
+                return "990039";
+            }
+            return "011408";
+        }
+
         /// <summary>
         /// 跨省异地
         /// </summary>
@@ -249,6 +263,7 @@ namespace PTMedicalInsurance.Common
                 {
                     JsonMappingForm form = new JsonMappingForm(request.ToString(),mapper.GetInputJson(),trade.GetCode());
                     form.ShowDialog();
+                    mapper.reload();  //修改后重新加载
                 }
                 joOutput = mapper.MapRequest<JObject, T>(request);
             }
@@ -276,6 +291,7 @@ namespace PTMedicalInsurance.Common
                 {
                     JsonMappingForm form = new JsonMappingForm(response.ToString(), mapper.GetOutputJson(), trade.GetCode(),false);
                     form.ShowDialog();
+                    mapper.reload();  //修改后重新加载
                 }
 
                 joOutput = mapper.MapResponse<JObject, T>(response);

+ 53 - 12
Forms/JsonMappingForm.Designer.cs

@@ -46,6 +46,8 @@ namespace PTMedicalInsurance.Forms
             this.medtype = new System.Windows.Forms.ToolStripMenuItem();
             this.ecToken = new System.Windows.Forms.ToolStripMenuItem();
             this.clearway = new System.Windows.Forms.ToolStripMenuItem();
+            this.insuOrgCode = new System.Windows.Forms.ToolStripMenuItem();
+            this.admid = new System.Windows.Forms.ToolStripMenuItem();
             this.saveToExpand = new System.Windows.Forms.ToolStripMenuItem();
             this.label1 = new System.Windows.Forms.Label();
             this.lstLocal = new System.Windows.Forms.ListBox();
@@ -59,6 +61,7 @@ namespace PTMedicalInsurance.Forms
             this.mapContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.numToDate = new System.Windows.Forms.ToolStripMenuItem();
             this.stringToDate = new System.Windows.Forms.ToolStripMenuItem();
+            this.ToString = new System.Windows.Forms.ToolStripMenuItem();
             this.txtName = new System.Windows.Forms.TextBox();
             this.btnMap = new System.Windows.Forms.Button();
             this.panel1 = new System.Windows.Forms.Panel();
@@ -74,7 +77,8 @@ namespace PTMedicalInsurance.Forms
             this.btnChange = new System.Windows.Forms.Button();
             this.txtLocalName = new System.Windows.Forms.TextBox();
             this.txtBaseName = new System.Windows.Forms.TextBox();
-            this.ToString = new System.Windows.Forms.ToolStripMenuItem();
+            this.certtype = new System.Windows.Forms.ToolStripMenuItem();
+            this.certno = new System.Windows.Forms.ToolStripMenuItem();
             this.localContextMenu.SuspendLayout();
             this.mapContextMenu.SuspendLayout();
             this.panel1.SuspendLayout();
@@ -102,12 +106,12 @@ namespace PTMedicalInsurance.Forms
             this.globalVar,
             this.saveToExpand});
             this.localContextMenu.Name = "localContextMenu";
-            this.localContextMenu.Size = new System.Drawing.Size(184, 76);
+            this.localContextMenu.Size = new System.Drawing.Size(211, 104);
             // 
             // fixValue
             // 
             this.fixValue.Name = "fixValue";
-            this.fixValue.Size = new System.Drawing.Size(183, 24);
+            this.fixValue.Size = new System.Drawing.Size(210, 24);
             this.fixValue.Text = "设定固定值";
             this.fixValue.Click += new System.EventHandler(this.fixValue_Click);
             // 
@@ -125,9 +129,14 @@ namespace PTMedicalInsurance.Forms
             this.insutype,
             this.medtype,
             this.ecToken,
-            this.clearway});
+            this.clearway,
+            this.insuOrgCode,
+            this.admid,
+            this.certtype,
+            this.certno});
             this.globalVar.Name = "globalVar";
-            this.globalVar.Size = new System.Drawing.Size(183, 24);
+            this.globalVar.ShowShortcutKeys = false;
+            this.globalVar.Size = new System.Drawing.Size(210, 24);
             this.globalVar.Text = "设置全局变量";
             // 
             // medtrt_id
@@ -214,10 +223,24 @@ namespace PTMedicalInsurance.Forms
             this.clearway.Text = "清算方式";
             this.clearway.Click += new System.EventHandler(this.clearway_Click);
             // 
+            // insuOrgCode
+            // 
+            this.insuOrgCode.Name = "insuOrgCode";
+            this.insuOrgCode.Size = new System.Drawing.Size(224, 26);
+            this.insuOrgCode.Text = "医院编码(社保)";
+            this.insuOrgCode.Click += new System.EventHandler(this.insuOrgCode_Click);
+            // 
+            // admid
+            // 
+            this.admid.Name = "admid";
+            this.admid.Size = new System.Drawing.Size(224, 26);
+            this.admid.Text = "就诊ID";
+            this.admid.Click += new System.EventHandler(this.admid_Click);
+            // 
             // saveToExpand
             // 
             this.saveToExpand.Name = "saveToExpand";
-            this.saveToExpand.Size = new System.Drawing.Size(183, 24);
+            this.saveToExpand.Size = new System.Drawing.Size(210, 24);
             this.saveToExpand.Text = "保存到扩展节点";
             this.saveToExpand.Click += new System.EventHandler(this.saveToExpand_Click);
             // 
@@ -325,7 +348,7 @@ namespace PTMedicalInsurance.Forms
             this.stringToDate,
             this.ToString});
             this.mapContextMenu.Name = "mapContextMenu";
-            this.mapContextMenu.Size = new System.Drawing.Size(258, 104);
+            this.mapContextMenu.Size = new System.Drawing.Size(258, 76);
             // 
             // numToDate
             // 
@@ -341,6 +364,13 @@ namespace PTMedicalInsurance.Forms
             this.stringToDate.Text = "日期格式(yyyy-MM-dd)";
             this.stringToDate.Click += new System.EventHandler(this.stringToDate_Click);
             // 
+            // ToString
+            // 
+            this.ToString.Name = "ToString";
+            this.ToString.Size = new System.Drawing.Size(257, 24);
+            this.ToString.Text = "字符串格式";
+            this.ToString.Click += new System.EventHandler(this.ToString_Click);
+            // 
             // txtName
             // 
             this.txtName.Location = new System.Drawing.Point(363, 45);
@@ -500,12 +530,19 @@ namespace PTMedicalInsurance.Forms
             this.txtBaseName.TabIndex = 9;
             this.txtBaseName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBaseName_KeyDown);
             // 
-            // ToString
+            // certtype
             // 
-            this.ToString.Name = "ToString";
-            this.ToString.Size = new System.Drawing.Size(257, 24);
-            this.ToString.Text = "字符串格式";
-            this.ToString.Click += new System.EventHandler(this.ToString_Click);
+            this.certtype.Name = "certtype";
+            this.certtype.Size = new System.Drawing.Size(224, 26);
+            this.certtype.Text = "证件类型";
+            this.certtype.Click += new System.EventHandler(this.certtype_Click);
+            // 
+            // certno
+            // 
+            this.certno.Name = "certno";
+            this.certno.Size = new System.Drawing.Size(224, 26);
+            this.certno.Text = "证件号";
+            this.certno.Click += new System.EventHandler(this.certno_Click);
             // 
             // JsonMappingForm
             // 
@@ -594,5 +631,9 @@ namespace PTMedicalInsurance.Forms
         private System.Windows.Forms.ToolStripMenuItem saveToExpand;
         private System.Windows.Forms.ToolStripMenuItem clearway;
         private System.Windows.Forms.ToolStripMenuItem ToString;
+        private System.Windows.Forms.ToolStripMenuItem insuOrgCode;
+        private System.Windows.Forms.ToolStripMenuItem admid;
+        private System.Windows.Forms.ToolStripMenuItem certtype;
+        private System.Windows.Forms.ToolStripMenuItem certno;
     }
 }

+ 20 - 0
Forms/JsonMappingForm.cs

@@ -616,5 +616,25 @@ namespace PTMedicalInsurance.Forms
                 mapping.Expression = "ConvertToString";
             }
         }
+
+        private void insuOrgCode_Click(object sender, EventArgs e)
+        {
+            AddGlobalVar("insuorg");
+        }
+
+        private void admid_Click(object sender, EventArgs e)
+        {
+            AddGlobalVar("admid");
+        }
+
+        private void certtype_Click(object sender, EventArgs e)
+        {
+            AddGlobalVar("certtype");
+        }
+
+        private void certno_Click(object sender, EventArgs e)
+        {
+            AddGlobalVar("certno");
+        }
     }
 }

+ 15 - 11
Helper/InvokeCenterFactory.cs

@@ -9,6 +9,7 @@ namespace PTMedicalInsurance.Helper
     class InvokeCenterFactory
     {
         private static IInvokeCenter __invoker = null;
+        private static object lockObject = new object();
 
         /// <summary>
         /// 创建调用模式
@@ -18,18 +19,21 @@ namespace PTMedicalInsurance.Helper
         {
             if (__invoker != null) return __invoker;
 
-            switch (mode)
+            lock(lockObject)
             {
-                case ModeEnum.DLL:
-                    __invoker = new InvokeDllCenter();
-                    break;
-                case ModeEnum.COM:
-                    __invoker = new InvokeOcxCenter();
-                    break;
-                case ModeEnum.REST:
-                default:
-                    __invoker = new InvokeRestCenter();
-                    break;
+                switch (mode)
+                {
+                    case ModeEnum.DLL:
+                        __invoker = new InvokeDllCenter();
+                        break;
+                    case ModeEnum.COM:
+                        __invoker = new InvokeOcxCenter();
+                        break;
+                    case ModeEnum.REST:
+                    default:
+                        __invoker = new InvokeRestCenter();
+                        break;
+                }
             }
             return __invoker;
             

+ 3 - 2
Helper/InvokeHelper.cs

@@ -178,7 +178,8 @@ namespace PTMedicalInsurance.Helper
         private JObject invokeCenterService(string data, ModeEnum mode = ModeEnum.REST)
         {
             JObject joRtn = new JObject();
-            IInvokeCenter center = InvokeCenterFactory.create(mode);
+            //IInvokeCenter center = InvokeCenterFactory.create(mode);
+            InvokeDllCenter center = new InvokeDllCenter();
             string outputData = "";
             string errMsg = "";
             int iInt = center.Init(ref errMsg);
@@ -194,7 +195,7 @@ namespace PTMedicalInsurance.Helper
                     catch (Exception ex)
                     {
                         joRtn.Add("infcode", iInt);
-                        joRtn.Add("err_msg", ex.Message);
+                        joRtn.Add("err_msg", "返回参数异常:"+outputData);
                     }
                 }
                 else

+ 1 - 1
Variables/Struct.cs

@@ -94,7 +94,7 @@ namespace PTMedicalInsurance.Variables
         public string admDiagName;
         public string discDiagCode; //Discharge Diagnosis
         public string discDiagName;
-        public string insuplc_admdvs;
+        public string insuplc_admdvs;   
         public string mdtrtarea_admvs; //就医地区划
         public string ecToken; //电子凭证令牌
         public Card card;