Browse Source

优化事前事中

837390164@qq.com 2 months ago
parent
commit
d45fadc82f

+ 26 - 21
Business/HisMainBusiness.cs

@@ -3175,7 +3175,6 @@ namespace PTMedicalInsurance.Business
                     {
                         return -1;
                     }
-
                 }
 
                 PreAndInProcessAnalysis preAnalysis = new PreAndInProcessAnalysis(outparam);
@@ -3183,42 +3182,48 @@ namespace PTMedicalInsurance.Business
                 {
                     return -1;
                 }
-                outparam = preAnalysis.Get3101Inpar(trig_scen, Global.pat).ToString();
-                JObject joRtn = invoker.invokeCenterService("3101", JsonHelper.setCenterInpar("3101", outparam));
+                JObject joInput = preAnalysis.Get3101Inpar(trig_scen, Global.pat);
+                JObject joRtn = invoker.invokeCenterService(TradeEnum.PreAnalysis, joInput);
                 if (JsonHelper.parseCenterRtnValue(joRtn, out outparam) != 0)
                 {
                     return -1;
                 }
                 else
                 {
-                    JArray jaResult = JArray.Parse(JsonHelper.getDestValue(joRtn, "output.result"));
-                    string HasValues = JsonHelper.getDestValue(joRtn, "output.result[0].HasValues").ToString();
-                    if (jaResult.HasValues)
+                    if (string.IsNullOrEmpty(JsonHelper.getDestValue(joRtn, "output.result")) == false)
                     {
-                        PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(joRtn);
-                        if (paipaForm.ShowDialog() == DialogResult.OK)
+                        JArray jaResult = JArray.Parse(JsonHelper.getDestValue(joRtn, "output.result"));
+                        if (jaResult.HasValues)
                         {
-                            return 0;
+                            PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(joRtn);
+                            if (paipaForm.ShowDialog() == DialogResult.OK)
+                            {
+                                //【3103】事前事中服务反馈服务
+                                if (PreAnalysisFeedBack("3101", paipaForm.JrID, out outparam) != 0)
+                                {
+                                    outparam = "【3103】事前事中服务反馈服务" + outparam;
+                                    return -1;
+                                }
+                                else
+                                {
+                                    return 0;
+                                }
+                            }
+                            else
+                            {
+                                outparam = "事前事中审核不通过,操作员取消!";
+                                return -1;
+                            }
                         }
                         else
-                        {
-                            outparam = "事前事中审核不通过,操作员取消!";
-                            return -1;
-                        }
+                            return 0;
                     }
                     else
                     {
-                        return 0;
-                    }
-
-                    if (HasValues == "")
-                    {
-                        outparam = "事前事中审核服务未返回详细说明!";
+                        outparam = "事前事中审核不通过:" + JsonHelper.getDestValue(joRtn, "err_msg");
                         return -1;
                     }
                 }
-
-
             }
             catch (Exception ex)
             {

+ 13 - 6
Business/PreAndInProcessAnalysis.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using PTMedicalInsurance.Common;
 
 namespace PTMedicalInsurance.Business
 {
@@ -138,13 +139,12 @@ namespace PTMedicalInsurance.Business
                 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", Global.inf.HospitalLevel);  //医疗机构等级
+                joInpar.Add("medins_type", "A");  //医疗服务机构类型
+                joInpar.Add("medins_lv", "1");  //医疗机构等级
                 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"));  //病床号
@@ -160,8 +160,8 @@ namespace PTMedicalInsurance.Business
                 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 = JsonHelper.getDestValue(jofsi_encounter_dtos, "med_type");
-                if (string.IsNullOrEmpty(med_type))
-                    med_type = Global.pat.medType;
+                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));  //处方(医嘱)信息
                 string matn_stas = JsonHelper.getDestValue(jofsi_encounter_dtos, "matn_stas");
@@ -188,7 +188,7 @@ namespace PTMedicalInsurance.Business
                 string outSetlFlag = JsonHelper.getDestValue(jofsi_encounter_dtos, "out_setl_flag");
                 if (string.IsNullOrEmpty(outSetlFlag))
                 {
-                    outSetlFlag = isOtherCity() ? "1" : "0";
+                    outSetlFlag = Utils.isOtherCity() ? "1" : "0";
                 }
                 joInpar.Add("out_setl_flag", outSetlFlag);
                 joInpar.Add("fsi_operation_dtos", GetFsi_operation_dtos(trig_scen, p));  //手术操作集合
@@ -286,10 +286,17 @@ namespace PTMedicalInsurance.Business
                     decimal pric = decimal.Parse(fsi_order_dtos[i]["pric"].ToString());
                     fsi_order_dtos[i]["pric"] = pric.ToString("#0.00");
                     fsi_order_dtos[i]["hilist_pric"] = pric.ToString("#0.00");
+
+                    if (fsi_order_dtos[i]["drord_bhvr"].ToString() == "2")
+                    { fsi_order_dtos[i]["drord_bhvr"] = "0"; }
+
+                    if (string.IsNullOrEmpty(fsi_order_dtos[i]["drord_dr_profttl"].ToString()))
+                    { fsi_order_dtos[i]["drord_dr_profttl"] = "234"; }
                 }
                 //调用医保平台进行转换
                 if (mis.convertFsiOrderDtos(fsi_order_dtos, out errMsg) != 0)
                 {
+                    MessageBox.Show(errMsg);
                     return null;
                 }
                 else

+ 27 - 0
Common/Utils.cs

@@ -365,5 +365,32 @@ namespace PTMedicalInsurance.Common
             //Global.writeLog("ConvertRequest", request.ToString(),joOutput.ToString());
             return joOutput;
         }
+
+        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;
+        }
     }
 }

+ 14 - 0
FormSetter/GridViewSetterBase.cs

@@ -80,5 +80,19 @@ namespace PTMedicalInsurance.FormSetter
             //dt.Columns[2].ColumnName = "拼音查找码";
             return dt;
         }
+
+        public void SetCombox(ref System.Windows.Forms.ComboBox cbx, string sqlStr, string displayMember = "Name", string valueMember = "Code")
+        {
+            try
+            {
+                cbx.DataSource = GetDBLKComboxTable(sqlStr);
+                cbx.DisplayMember = displayMember;
+                cbx.ValueMember = valueMember;
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show($"SetCombox控件{cbx.Name}设置异常:{ex.Message}");
+            }
+        }
     }
 }

+ 46 - 12
Forms/AddSignleDirectory.cs

@@ -1,4 +1,6 @@
 using Newtonsoft.Json.Linq;
+using PTMedicalInsurance.FormSetter;
+using PTMedicalInsurance.Variables;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -15,8 +17,10 @@ namespace PTMedicalInsurance
 
     public partial class AddSingleDirectory : Form
     {
-        private int direcType ;
+        private int direcType;
         public JObject joPamam = new JObject();
+        private GridViewSetterBase grdSetterBase = new GridViewSetterBase();
+
         public AddSingleDirectory()
         {
             InitializeComponent();
@@ -93,18 +97,38 @@ namespace PTMedicalInsurance
                         break;
                     }
             }
+
+            string sqlCondition = " and A.Interface_Dr = '" + Global.inf.interfaceDr.ToString() + "'";
+
+            string sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr  "
+                          + " WHERE  A.InsuCode = 'list_type'" + sqlCondition;
+
+            grdSetterBase.SetCombox(ref cbxListType, sqlStr);
+
+            //med_chrgitm_type
+
+            sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr  "
+                         + " WHERE  A.InsuCode = 'med_chrgitm_type'" + sqlCondition;
+
+            grdSetterBase.SetCombox(ref cbxChargeItemType, sqlStr);
         }
-        //private void setValue(DataRow dr)
-        //{
-        //    switch (direcType)
-        //    {
-        //        case 0:
-        //            {
-        //                setDrugInfo(dr);
-        //                break;
-        //            }
-        //    }
-        //}
+
+        private void SetSelectValue(System.Windows.Forms.ComboBox cbx, string targetName)
+        {
+            for (int i = 0; i < cbx.Items.Count; i++)
+            {
+                // 假设数据源是 DataTable,绑定的是 DataRowView
+                if (cbx.Items[i] is DataRowView rowView)
+                {
+                    if (rowView["Name"].ToString() == targetName)
+                    {
+                        cbx.SelectedIndex = i;
+                        break;
+                    }
+                }
+            }
+        }
+
         private void setValue(DataRow dr)
         {
             try
@@ -138,6 +162,12 @@ namespace PTMedicalInsurance
                 tbNationalCode.Text = dr["NationalCode"].ToString();
                 tbNationalName.Text = dr["NationalName"].ToString();
                 tbManufacturers.Text = dr["Manufacturers"].ToString();
+
+                tbMinPackagingQuantity.Text = dr["MinPackagingQuantity"].ToString();
+                cbxListType.SelectedValue = dr["ListType"].ToString();
+                //cbxChargeItemType.SelectedValue = dr["ChargeItemType"].ToString();
+                SetSelectValue(cbxChargeItemType, dr["ChargeItemType"].ToString());
+
                 if (dr["ChargeItemLevel"].ToString() != "")
                 {
                     cbxChargeItemLevel.SelectedIndex = int.Parse(dr["ChargeItemLevel"].ToString()) - 1;
@@ -207,6 +237,10 @@ namespace PTMedicalInsurance
             joPamam.Add("UpdateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
             joPamam.Add("ChargeItemLevel", ChargeItemLevel);
             joPamam.Add("Company", tbCompany.Text);
+
+            joPamam.Add("MinPackagingQuantity", tbMinPackagingQuantity.Text);
+            joPamam.Add("ChargeItemType", cbxChargeItemType.SelectedValue?.ToString());
+            joPamam.Add("ListType", cbxListType.SelectedValue?.ToString());
         }
 
         private void initDrugForm()

+ 72 - 0
Forms/AddSignleDirectory.designer.cs

@@ -97,6 +97,12 @@
             this.rtbLimitRange = new System.Windows.Forms.RichTextBox();
             this.gbConnotation = new System.Windows.Forms.GroupBox();
             this.rtbConnotation = new System.Windows.Forms.RichTextBox();
+            this.cbxListType = new System.Windows.Forms.ComboBox();
+            this.cbxChargeItemType = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.tbMinPackagingQuantity = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
             this.pnlTop.SuspendLayout();
             this.pnlBottom.SuspendLayout();
             this.pnlClient.SuspendLayout();
@@ -631,6 +637,12 @@
             // 
             // pnlClient
             // 
+            this.pnlClient.Controls.Add(this.cbxListType);
+            this.pnlClient.Controls.Add(this.cbxChargeItemType);
+            this.pnlClient.Controls.Add(this.label3);
+            this.pnlClient.Controls.Add(this.label2);
+            this.pnlClient.Controls.Add(this.tbMinPackagingQuantity);
+            this.pnlClient.Controls.Add(this.label1);
             this.pnlClient.Controls.Add(this.cbxChargeItemLevel);
             this.pnlClient.Controls.Add(this.tbCompany);
             this.pnlClient.Controls.Add(this.lbCompany);
@@ -838,6 +850,60 @@
             this.rtbConnotation.TabIndex = 0;
             this.rtbConnotation.Text = "";
             // 
+            // cbxListType
+            // 
+            this.cbxListType.FormattingEnabled = true;
+            this.cbxListType.Location = new System.Drawing.Point(799, 243);
+            this.cbxListType.Name = "cbxListType";
+            this.cbxListType.Size = new System.Drawing.Size(225, 23);
+            this.cbxListType.TabIndex = 101;
+            // 
+            // cbxChargeItemType
+            // 
+            this.cbxChargeItemType.FormattingEnabled = true;
+            this.cbxChargeItemType.Location = new System.Drawing.Point(455, 243);
+            this.cbxChargeItemType.Name = "cbxChargeItemType";
+            this.cbxChargeItemType.Size = new System.Drawing.Size(225, 23);
+            this.cbxChargeItemType.TabIndex = 100;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(700, 247);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(67, 15);
+            this.label3.TabIndex = 99;
+            this.label3.Text = "目录类别";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(356, 247);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(97, 15);
+            this.label2.TabIndex = 98;
+            this.label2.Text = "收费项目类别";
+            // 
+            // tbMinPackagingQuantity
+            // 
+            this.tbMinPackagingQuantity.Location = new System.Drawing.Point(154, 243);
+            this.tbMinPackagingQuantity.Margin = new System.Windows.Forms.Padding(4);
+            this.tbMinPackagingQuantity.Name = "tbMinPackagingQuantity";
+            this.tbMinPackagingQuantity.Size = new System.Drawing.Size(179, 25);
+            this.tbMinPackagingQuantity.TabIndex = 97;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(34, 247);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(112, 15);
+            this.label1.TabIndex = 96;
+            this.label1.Text = "最小包装转换数";
+            // 
             // AddSingleDirectory
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -938,5 +1004,11 @@
         private System.Windows.Forms.TextBox tbCompany;
         private System.Windows.Forms.Label lbCompany;
         private System.Windows.Forms.ComboBox cbxChargeItemLevel;
+        private System.Windows.Forms.ComboBox cbxListType;
+        private System.Windows.Forms.ComboBox cbxChargeItemType;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox tbMinPackagingQuantity;
+        private System.Windows.Forms.Label label1;
     }
 }

+ 1 - 1
InsuBusiness.cs

@@ -747,7 +747,7 @@ namespace PTMedicalInsurance
                             //1.门诊挂号 2.门诊收费登记 3.住院登记 4.住院收费登记 5.住院执行医嘱 6.门诊结算 7.门诊预结算 8.住院结算 9.住院预结算 10.购药划卡
                             if (Global.curEvt.ext.isOpenAnalysis)
                             {
-                                if (hBus.PreAnalysis("1", "", out errMsg) != 0)
+                                if (hBus.PreAnalysis("2", "", out errMsg) != 0)
                                 {
                                     //调用失败后仍继续往下执行-朱鹏飞要求
                                     outParam = outParam + "门诊就诊信息上传成功后调用3101事前服务失败:" + errMsg;

+ 29 - 0
Readme.md

@@ -0,0 +1,29 @@
+## 医保业务DLL库使用说明:
+  该项目遵循以下原则:
+
+  1. Master为空项目,仅保留说明文件,便于其他新分支的建立
+
+  2. 按市+医保类型建立代码分支,如“安徽基线版”,分支名为:AnHui_Base,医保类型包括:Base(基线版)、工伤(Injury)、异地(Offsite)、其它(Other),如果没有可适当增加
+
+  3. 每个分支下存放每个省的业务逻辑代码项目,项目名应遵循与分支名保持一致,如AnHui_Base
+
+  4. 每个分支的根目录应保留本Readme.md文档,同时应将各个分支的特殊业务场景或版本更新日志放到此文档
+
+  5. 使用手册见文档:https://dqqslxaq2y.feishu.cn/docx/VxZhdSrFDonnwTxxTPZctr7onSb?from=from_copylink
+ 
+
+## 业务分支说明(分支特性,请做相应调整)
+ 名称:重庆医保
+	接口开发:东软
+	上线范围:结算(社保、身份证、电子医保卡)、进销存、事前事中、Lis项目、清单上传
+
+### 版本特性:
+  - 住院结算,默认不采用个人账户支付(结算界面默认不选中)
+
+  - 本地和异地结算单打印样式不同
+
+  - 对码界面增加了“价格”显示
+
+  - 只有省外异地(直辖市)
+
+