浏览代码

init: 初始化调整

zhengjie 1 年之前
父节点
当前提交
6a40e82aa1

+ 10 - 10
Business/Basic/PatientService.cs

@@ -44,9 +44,9 @@ namespace PTMedicalInsurance.Business
 
                         Global.pat.mdtrtcertType = "01";
                         Global.businessType = cc.businessType;
-                        //tradeEcToken(out outParam);
-                        return trade1161(out outParam);
-                        //return 0;
+                        tradeEcToken(out outParam);
+                        //return trade1161(out outParam);
+                        return 0;
 
                     }
                     //身份证
@@ -112,15 +112,15 @@ namespace PTMedicalInsurance.Business
             {
                 joRtn = JObject.Parse(joRtn["output"].ToString());
             }
-            PersonCardInfo person = JsonHelper.toObject<PersonCardInfo>(joRtn);
+            //PersonCardInfo person = JsonHelper.toObject<PersonCardInfo>(joRtn);
 
             // 济南仅返回了身份证号和姓名,还需要调用1101获取基本信息
-            Global.pat.name = person.baseInfo.psn_name;
-            Global.pat.certNO = person.baseInfo.certno;
-            if (person.insuInfo == null)
-            {
-                this.trade1101(out outParam);
-            }
+            //Global.pat.name = person.baseInfo.psn_name;
+            //Global.pat.certNO = person.baseInfo.certno;
+            //if (person.insuInfo == null)
+            //{
+            //    this.trade1101(out outParam);
+            //}
             return 0;
         }
 

+ 15 - 15
Business/HisMainBusiness.cs

@@ -823,21 +823,21 @@ namespace PTMedicalInsurance.Business
                     joMdtrtinfo.Add("mdtrtarea_admvs", Global.inf.areaCode);          //就医地医保区划
 
                     // 异地就医标志 (济南个性化)
-                    string otherAreaFlag = "10";
-                    if (!Utils.isOtherCity() || Global.inf.interfaceDr == 28) {
-                        otherAreaFlag = "01"; //本地
-                    }
-                    joMdtrtinfo.Add("otherAreaFlag", otherAreaFlag);
-                    string insuCode = ""; //参保地编码
-                    string insuAdmOrgName = ""; //参保机构名称
-                    if (!Utils.isOtherProvice() && Utils.isOtherCity())
-                    {
-                        //省内异地
-                        insuCode = Global.pat.insuplc_admdvs;
-                        insuAdmOrgName = Global.pat.insuplc_name;
-                    }
-                    joMdtrtinfo.Add("insuCode", insuCode);
-                    joMdtrtinfo.Add("insuAdmOrgName", insuAdmOrgName);
+                    //string otherAreaFlag = "10";
+                    //if (!Utils.isOtherCity() || Global.inf.interfaceDr == 28) {
+                    //    otherAreaFlag = "01"; //本地
+                    //}
+                    //joMdtrtinfo.Add("otherAreaFlag", otherAreaFlag);
+                    //string insuCode = ""; //参保地编码
+                    //string insuAdmOrgName = ""; //参保机构名称
+                    //if (!Utils.isOtherProvice() && Utils.isOtherCity())
+                    //{
+                    //    //省内异地
+                    //    insuCode = Global.pat.insuplc_admdvs;
+                    //    insuAdmOrgName = Global.pat.insuplc_name;
+                    //}
+                    //joMdtrtinfo.Add("insuCode", insuCode);
+                    //joMdtrtinfo.Add("insuAdmOrgName", insuAdmOrgName);
 
                     joReg.Add("mdtrtinfo", joMdtrtinfo);
                     joReg.Add("diseinfo", jaConvertedDiagnoses);

+ 12 - 12
Business/Inpatient/IPPreSettlementProcess.cs

@@ -136,19 +136,19 @@ namespace PTMedicalInsurance.Business
             JObject joConverted = JObject.Parse(outParam);
 
             #region 济南扩展
-            string useAccountFlag = JsonHelper.getDestValue(jo2303Inpar, "acct_used_flag");
-            string acctPay = JsonHelper.getDestValue(joConverted, "setlinfo.acct_pay") ;
-            if (!"1".Equals(useAccountFlag))
-            {
-                //不使用个人账户
-                acctPay = "0";
-            }
+            //string useAccountFlag = JsonHelper.getDestValue(jo2303Inpar, "acct_used_flag");
+            //string acctPay = JsonHelper.getDestValue(joConverted, "setlinfo.acct_pay") ;
+            //if (!"1".Equals(useAccountFlag))
+            //{
+            //    //不使用个人账户
+            //    acctPay = "0";
+            //}
 
-            JObject expContentObj = (JObject)jo2303Inpar["exp_content"] ?? new JObject();
-            expContentObj.Add("acct_payamt", acctPay);
-            jo2303Inpar["exp_content"] = expContentObj;
-            //返回
-            joRtn["Settlement"] = jo2303Inpar;
+            //JObject expContentObj = (JObject)jo2303Inpar["exp_content"] ?? new JObject();
+            //expContentObj.Add("acct_payamt", acctPay);
+            //jo2303Inpar["exp_content"] = expContentObj;
+            ////返回
+            //joRtn["Settlement"] = jo2303Inpar;
 
             #endregion
 

+ 5 - 5
Business/Inpatient/IPSettlementProcess.cs

@@ -53,11 +53,11 @@ namespace PTMedicalInsurance.Business
                 JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(jo2304Rtn, "output.setlinfo"));
 
                 //济南未返回基金分项,手工拆分
-                JArray fundArray = new LocalPayFundSplitService().Split(joSetlinfo);
-                if (fundArray?.Count > 0)
-                {
-                    jo2304Rtn["output"]["setldetail"] = fundArray;
-                }
+                //JArray fundArray = new LocalPayFundSplitService().Split(joSetlinfo);
+                //if (fundArray?.Count > 0)
+                //{
+                //    jo2304Rtn["output"]["setldetail"] = fundArray;
+                //}
 
                 Global.pat.admType = 2;
                 //返回给云医保平台结算信息

+ 0 - 44
Business/Local/LocalIPSettlementService.cs

@@ -1,44 +0,0 @@
-using Newtonsoft.Json.Linq;
-using PTMedicalInsurance.Variables;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PTMedicalInsurance.Business
-{
-    class LocalIPSettlementService : IChargeService
-    {
-
-        /// <summary>
-        /// 收费
-        /// </summary>
-        public string Charge(string operationType, JObject joInput)
-        {
-            Global.pat.admType = 2;
-            Global.pat.RYorCY = "2";
-
-            ProcessManager pManager = new ProcessManager()
-            .Add(new IPPreSettlementProcess())
-            // 结算
-            .Add(new IPSettlementProcess(joInput));
-            // 执行
-            return pManager.Run(joInput);
-        }
-
-        public string DisCharge(JObject joParam)
-        {
-            ProcessManager pManager = new ProcessManager()
-               // 查询结算信息
-               .Add(new IPQuerySettlementProcess())
-               // 撤销出院
-               .Add(new InpatientExitCancelProcess())
-               // 结算撤销 
-               .Add(new IPSettlementCancelProcess(joParam));
-
-            // 执行
-            return pManager.Run(joParam);
-        }
-    }
-}

+ 0 - 421
Business/Local/LocalMedDirDownloadProcess.cs

@@ -1,421 +0,0 @@
-using Newtonsoft.Json.Linq;
-using PTMedicalInsurance.Common;
-using PTMedicalInsurance.Entity;
-using PTMedicalInsurance.Helper;
-using PTMedicalInsurance.Variables;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace PTMedicalInsurance.Business
-{
-    class LocalMedDirDownloadProcess : AbstractProcess
-    {
-        int maxNo = 0;
-        /// <summary>
-        /// 药品、诊疗目录
-        /// </summary>
-        /// <param name="input"></param>
-        /// <returns></returns>
-        public override CallResult Process(JObject input)
-        {
-            // sbjgbh传需要查询的社保局编号,济南医疗传370100(或37010101),工伤传37019L(或37019L01)省医保37000000
-            if(!string.IsNullOrEmpty(input["ver"].Text()))
-            {
-                maxNo = int.Parse(input["ver"].Text());
-            }
-            bool hasMore = true;
-
-            while (hasMore)
-            {
-                //核心目录
-                //var ret = FetchDirectory(TradeEnum.DirectoryDownload, "ylxm_ds", "sxzfbl_ds", "xj_ds");
-                //医院项目
-                //var ret = FetchDirectory(TradeEnum.DirectoryDownload, "yyxm_ds", "", "xj_ds");
-                var ret = FetchDirectory(TradeEnum.DirectoryDownloadExt, "yyxm_ds", "", "xj_ds");
-                hasMore = ret.hasMore;
-
-                updateDirectory(ret.data);
-
-                updateLimitPrice(ret.limitData);
-                // 多自费项目
-                updateSelfPercent(ret.percentData);
-            }
-
-            return IrisReturn("更新成功!", null);
-        }
-
-        
-        private void updateDirectory(JArray data)
-        {
-            List<HBMedInsuDirectory> list = new List<HBMedInsuDirectory>();
-            try
-            {
-                foreach (var dir in data)
-                {
-                    HBMedInsuDirectory obj = ConvertToEntity((JObject)dir);
-                    list.Add(obj);
-                }
-                // 保存
-                saveToServer(list);
-            }
-            catch (Exception ex)
-            {
-
-            }
-        }
-
-        private JObject saveToServer(List<HBMedInsuDirectory> data)
-        {
-            JObject joIn = new JObject();
-            JObject joRtn = new JObject();
-            string outParam = "";
-            try
-            {
-
-                joIn.Add("params", JArray.Parse(JsonHelper.toJsonString(data)));
-                joIn.Add("code", "09010035");
-                joIn.Add("updateUserID", Global.user.ID);
-                InvokeHelper invoker = new InvokeHelper();
-                string sInput = joIn.ToString();
-                joRtn = invoker.invokeInsuService(sInput, "applyDataToIris");
-                outParam = joRtn.ToString();
-                return joRtn;
-            }
-            catch (Exception ex)
-            {
-                joRtn = JsonHelper.setExceptionJson(-1, "applyDataToIris", ex.Message);
-                outParam = joRtn.ToString();
-                return joRtn;
-            }
-        }
-
-        private (bool hasMore, JArray data, JArray percentData, JArray limitData) FetchDirectory(TradeEnum trade, string dsName)
-        {
-            return FetchDirectory(trade,dsName,null,null);
-        }
-
-        private (bool hasMore, JArray data,JArray percentData,JArray limitData) FetchDirectory(TradeEnum trade, string dsName,string percentName,string limitName)
-        {
-            JObject joInput = new JObject();
-            joInput["p_sxh"] = maxNo.ToString(); //全量下载0,后面传最大
-            Global.pat.insuplc_admdvs = "370100";
-            JObject joRtn = invoker.invokeCenterService(trade, joInput);
-            if ("0".Equals(JsonHelper.getDestValue(joRtn, "resultcode")))
-            {
-                // 是否还有数据
-                bool hasMore = "1".Equals(JsonHelper.getDestValue(joRtn, "sfjxxz"));
-                JArray data = JArray.Parse(JsonHelper.getDestValue(joRtn, dsName));
-                JArray percent = new JArray();
-                if (!string.IsNullOrEmpty(percentName))
-                {
-                    percent = JArray.Parse(JsonHelper.getDestValue(joRtn, percentName));
-                }
-                else {
-                    //自付比例在项目中
-                    foreach (var item in data)
-                    {
-                        if (!string.IsNullOrEmpty(item["zfbl"].Text()))
-                        {
-                            dynamic percentObj = new JObject();
-                            percentObj.ylxmbm = item["gbxmbm"].Text();
-                            percentObj.rqlb = item["rqlb"].Text();
-                            percentObj.yltclb = item["yltclb"].Text();
-                            percentObj.sm = item["sm"].Text();
-                            percentObj.qsrq = item["qsrq"].Text();
-                            percentObj.zzrq = item["zzrq"].Text();
-                            percentObj.xzbz = item["xzbz"].Text();
-                            percentObj.sxzfbl = item["zfbl"].Text();
-                            percent.Add(percentObj);
-                        }
-                    }
-                }
-                JArray limit = new JArray();
-                if (!string.IsNullOrEmpty(limitName))
-                {
-                    limit = JArray.Parse(JsonHelper.getDestValue(joRtn, limitName));
-                }
-                return (hasMore, data, percent, limit);
-            }
-            else
-            { 
-                MessageBox.Show(JsonHelper.getDestValue(joRtn, "err_msg"));
-            }
-
-            return (false, new JArray(), new JArray(), new JArray());
-        }
-
-        public CallResult DownloadSelfpay(JObject input)
-        {
-
-            string code = input["code"].Text();
-
-            //if (!string.IsNullOrEmpty(code))
-            //{
-                dynamic joInput = new JObject();
-                joInput.p_yyxmbm = code;
-                joInput.p_rq = "";
-                //单个更新比例
-                Global.pat.insuplc_admdvs = "370100";
-                JObject joRtn = invoker.invokeCenterService(TradeEnum.SelfPayPercent, joInput);
-                if ("0".Equals(JsonHelper.getDestValue(joRtn, "resultcode")))
-                {
-                    JArray percent = new JArray();
-                    JArray data = JArray.Parse(JsonHelper.getDestValue(joRtn, "zfbl_ds"));
-                    foreach (var item in data)
-                    {
-                        if (!string.IsNullOrEmpty(item["zfbl"].Text()))
-                        {
-                            dynamic percentObj = new JObject();
-                            percentObj.ylxmbm = code;
-                            percentObj.rqlb = item["rqlb"].Text();
-                            percentObj.yltclb = "6";
-                            percentObj.sm = item["sm"].Text();
-                            percentObj.sxzfbl = item["zfbl"].Text();
-                            percent.Add(percentObj);
-                        }
-                    }
-                    updateSelfPercent(percent);
-                }
-            //}
-
-            return Success();
-
-        }
-
-            /// <summary>
-            /// 诊断目录下载
-            /// </summary>
-            /// <param name="input"></param>
-            /// <returns></returns>
-            public CallResult DownloadDiagnosis(JObject input)
-        {
-            //sbjgbh传需要查询的社保局编号,济南医疗传370100(或37010101),工伤传37019L(或37019L01)
-            if (!string.IsNullOrEmpty(input["ver"].Text()))
-            {
-                maxNo = int.Parse(input["ver"].Text());
-            }
-            bool hasMore = true;
-            while (hasMore)
-            {
-                var ret = FetchDirectory(TradeEnum.DirectoryDownloadCore, "ybjb_ds");
-                hasMore = ret.hasMore;
-                List<HBMedInsuDirectory> list = new List<HBMedInsuDirectory>();
-                foreach (var d in ret.data)
-                {
-                    list.Add(NewDiagnosis((JObject)d));
-                }
-                saveToServer(list);
-            }
-            return IrisReturn("下载成功",null);
-        }
-
-        /// <summary>
-        /// 科室查询
-        /// </summary>
-        /// <param name="input"></param>
-        /// <returns></returns>
-        public CallResult QueryDepartment()
-        {
-            JObject joInput = new JObject();
-            joInput["p_ksbm"] = ""; //全量下载
-            Global.pat.insuplc_admdvs = "370100";
-            JObject joRtn = invoker.invokeCenterService(TradeEnum.DepartmentQuery, joInput);
-            if ("0".Equals(JsonHelper.getDestValue(joRtn, "resultcode")))
-            {
-                // 是否还有数据
-                outParam = JsonHelper.getDestValue(joRtn, "dept_ds");
-            }
-            return Success();
-        }
-        private HBMedInsuDirectory NewDiagnosis(JObject obj)
-        {
-            HBMedInsuDirectory jsonTemp = new HBMedInsuDirectory();
-            jsonTemp.updateUserID = Global.user.ID;
-            jsonTemp.HospitalDr = Global.inf.hospitalDr;
-            jsonTemp.InterfaceDr = Global.inf.interfaceDr;
-            jsonTemp.Code = obj["jbbm"].Text();
-            jsonTemp.Name = obj["jbmc"].Text();
-            jsonTemp.HisType = "4";
-            jsonTemp.HisTypeName = "诊断";
-            jsonTemp.ValidFlag = "1".Equals(obj["zxbz"].Text()) ? 0 : 1;
-            jsonTemp.Note = obj["bz"].Text();
-            jsonTemp.PinyinSearchCode = obj["py"].Text();
-            jsonTemp.DrugSafetyStandardCode = "";
-            return jsonTemp;
-        }
-
-        private HBMedInsuDirectory ConvertToEntity(JObject obj)
-        {
-            string hisType = obj["ypbz"].Text() ?? "2";
-            string hisTypeName = hisType.Equals("1") ? "药品" : "诊疗";             HBMedInsuDirectory insu = new HBMedInsuDirectory();
-
-            maxNo = Math.Max(maxNo, int.Parse(obj["sxh"].ToString()));
-            insu.ID = "";
-            insu.updateUserID = Global.user.ID;
-            insu.HospitalDr = Global.inf.hospitalDr;
-            insu.InterfaceDr = Global.inf.interfaceDr;
-            insu.Code = obj["ylxmbm"].Text();
-            insu.Name = obj["ylxmbzmc"].Text();
-            insu.NationalCode = obj["gbxmbm"].Text();
-            insu.NationalName = obj["gbxmmc"].Text();
-            insu.HisType = hisType;
-            insu.HisTypeName = hisTypeName;
-            insu.LocateCode = obj["pms_id"].Text();
-            insu.LocateName = obj["pms_name"].Text();
-            insu.DosageFormCode = obj["jxm"].Text();
-            insu.DosageFormName = obj["jxm"].Text();
-            insu.CategoryCode = obj["listtype"].Text();
-            insu.CategoryName = "";
-            // 规格
-            insu.Specification = obj["bzgg"].Text();
-            insu.SpecificationCode = obj["gg"].Text();
-            insu.UnitOfPackag = obj["dw"].Text();
-            insu.UnitOfValuation = obj["ms_charge_unit"].Text();
-            //insu.StartDate = obj["qsrq"].Text();
-            //insu.EndDate = obj["zzrq"].Text();
-            insu.PinyinSearchCode = obj["py"].Text();
-            insu.Instructions = obj["ms_explain"].Text();
-            insu.ExceptContent = obj["cwnr"].Text();
-            insu.Connotation = obj["xmnh"].Text();    
-            insu.ValidFlag = obj["spbz"].Int();
-            insu.Note = "";
-            insu.VersionNO = obj["sxh"].Text();
-            insu.VersionName = obj["sxh"].Text();
-            string cancelFlag = obj["zxbz"].Text();
-            insu.UseFlag = "1".Equals(cancelFlag)?0:1;
-            insu.DrugSafetyStandardCode = obj["ypbwm"].Text();
-            insu.ApprovalNO = obj["bzwh"].Text(); ;
-            //insu.SpecialFlag = obj[""].Int();
-            //insu.LimitFlag = obj[""].Int();
-            //insu.LimitRange = obj[""].Text();
-            insu.UniqueRecordNO = obj["sxh"].Text();
-            insu.Manufacturers = obj["scqy"].Text();
-            insu.SelfPercent = obj["zfbl"].Text(); 
-            insu.ChargeItemLevelName = obj["mldj"].Text();
-            insu.MinPackagingQuantity = obj["zxbzsl"].Text();
-            insu.MinPackagingUnit = obj["gjjzxbzdw"].Text();
-
-            insu.UpdateTime = obj["gxsj"].Text();
-
-            if (insu.SelfPercent == "0")
-            {
-                insu.ChargeItemLevel = "01";
-                insu.ChargeItemLevelName = "甲";
-            }
-            else if (insu.ChargeItemLevelName == "1")
-            {
-                insu.ChargeItemLevel = "03";
-                insu.ChargeItemLevelName = "丙";
-            }
-            else
-            {
-                insu.ChargeItemLevel = "02";
-                insu.ChargeItemLevelName = "乙";
-            }
-
-            return insu;
-        }
-
-        private int updateLimitPrice(JArray data)
-        {
-            if (data?.Count < 1) return 0;
-            string errMsg = "";
-            JArray joArray = new JArray();
-
-            try
-            {
-                foreach (var dir in data)
-                {
-                    dynamic joTmp = new JObject();
-                    joTmp.HospitalDr = Global.inf.hospitalDr;
-                    joTmp.InterfaceDr = Global.inf.interfaceDr;
-                    joTmp.updateUserID = Global.user.ID;
-                    joTmp.Code = dir["ylxmbm"].Text();
-
-                    joTmp.PersonnelType = dir["rqlb"].Text();  //人群类别
-                    joTmp.LimitType = dir["yltclb"].Text();     //限价类型(统筹类别)
-                    joTmp.BeginDate = Utils.ConvertShortDate(dir["qsrq"].Text());
-                    joTmp.EndDate = Utils.ConvertShortDate(dir["zzrq"].Text());
-                    joTmp.UpLimitAmount = dir["xj"].Text(); //限价
-                    joArray.Add(joTmp);
-                }
-                JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010084", joArray).ToString(), "更新限价信息");
-
-                if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
-                {
-                    return -1;
-                }
-                else
-                {
-                    outParam = joRtn.ToString();
-                    return 0;
-                }
-            }
-            catch (Exception ex)
-            {
-                outParam = "更新项目自费比例:" + ex.Message;
-                return -1;
-            }
-        }
-
-        /// <summary>
-        /// 如果存在同一个目录多个比例,则保存在比例扩展表
-        /// </summary>
-        /// <param name="data"></param>
-        /// <returns></returns>
-        private int updateSelfPercent(JArray data)
-        {
-            if (data?.Count < 1) return 0;
-            string errMsg = "";
-            JArray joArray = new JArray();
-            
-            try
-            {
-                foreach (var dir in data)
-                {
-                    dynamic joTmp = new JObject();
-                    joTmp.HospitalDr = Global.inf.hospitalDr;
-                    joTmp.InterfaceDr = Global.inf.interfaceDr;
-                    joTmp.updateUserID = Global.user.ID;
-                    joTmp.Code = dir["ylxmbm"].Text();
-                    string personType = dir["rqlb"].Text(); //人群类别
-                    if (string.IsNullOrEmpty(personType))
-                    {
-                        personType = "A"; //职工
-                    }
-                    joTmp.PersonnelType = personType;
-                    string proportionType = dir["yltclb"].Text(); //自费类型(统筹类别)
-                    if (string.IsNullOrEmpty(proportionType))
-                    {
-                        proportionType = "6"; //普通门诊
-                    }
-                    joTmp.ProportionType = proportionType;
-                    joTmp.BeginDate = Utils.ConvertShortDate(dir["qsrq"].Text());
-                    joTmp.EndDate = Utils.ConvertShortDate(dir["zzrq"].Text());
-                    joTmp.Proportion = dir["sxzfbl"].Text();
-                    joArray.Add(joTmp);
-                 }
-                JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010085", joArray).ToString(), "更新项目自费比例");
-
-                if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
-                {
-                    return -1;
-                }
-                else
-                {
-                    outParam = joRtn.ToString();
-                    return 0;
-                }
-            }
-            catch (Exception ex)
-            {
-                outParam = "更新项目自费比例:" + ex.Message;
-                return -1;
-            }
-        }
-    }
-}

+ 0 - 41
Business/Local/LocalOPSettleService.cs

@@ -1,41 +0,0 @@
-using Newtonsoft.Json.Linq;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PTMedicalInsurance.Business
-{
-    class LocalOPSettleService : IChargeService
-    {
-        public string Charge(string operationType, JObject joInput)
-        {
-            //joInput 包括( data、mdtrtinfo、diseinfo、settlement)
-            ProcessManager pManager = new ProcessManager()
-            .Add(new ReadPatientProcess())
-            // 挂号[2201] 
-            .Add(new OPRegFakeProcess())
-            // 门诊预结算[2206]
-            .Add(new OPPreSettlementProcess())
-            // 正式结算[2207]
-            .Add(new OPSettlementProcess());
-            // 执行
-            return pManager.Run(joInput);
-        }
-
-        public string DisCharge(JObject joParam)
-        {
-            ProcessManager pManager = new ProcessManager()
-                // 查询结算信息
-                .Add(new OPQuerySettlementProcess())
-                // 门诊结算撤销 [2208]
-                .Add(new OPSettlementCancelProcess())
-                // 退HIS结算
-                .Add(new OPSettlementCancelHisProcess(true));
-
-            // 执行
-            return pManager.Run(joParam);
-        }
-    }
-}

+ 0 - 96
Business/Local/LocalPayFundSplitService.cs

@@ -1,96 +0,0 @@
-using Newtonsoft.Json.Linq;
-using PTMedicalInsurance.Common;
-using PTMedicalInsurance.Helper;
-using PTMedicalInsurance.Variables;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-/**
- * 
- * 
- * 310100 职工基本医疗保险统筹基金 501000 一至六级残疾军人医疗补助基金
- * 310200 职工基本医疗保险个人账户基金 370100 企业补充医疗保险基金
- * 320100 公务员医疗补助基金 390100 城乡居民基本医疗保险基金
- * 330100 职工大额医疗费用补助基金 610100 医疗救助基金
- * 340100 离休人员医疗保障基金 999999 其他基金
- * 391100 城乡居民大病医疗保险资
-*/
-
-namespace PTMedicalInsurance.Business
-{
-    class LocalPayFundSplitService
-    {
-        /// <summary>
-        /// 根据返回的金额进行拆分基金分类
-        /// </summary>
-        /// <param name="joSettle">结算返回值</param>
-        /// <returns></returns>
-        public JArray Split(JObject joSettle)
-        {
-            JArray joRtn = new JArray();
-            try
-            {
-                Dictionary<string, string> medTypeDict = new Dictionary<string, string>()
-            {
-                { "A","310100"},  //职工
-                { "B","390100"}     //居民
-            };
-                Dictionary<string, Dictionary<string, string>> fundDict = new Dictionary<string, Dictionary<string, string>>()
-                {
-                    ["hifp_pay"] = new Dictionary<string, string>() {
-                     { "310100", "职工基本医疗保险统筹基金" },
-                     { "390100","城乡居民基本医疗保险基金"} },
-                    ["acct_pay"] = CreateKeyPair("310200", "职工基本医疗保险个人账户基金"),
-                    ["hifob_pay"] = CreateKeyPair("330100", "职工大额医疗费用补助基金"),
-                    ["hifes_pay"] = CreateKeyPair("370100", "企业补充医疗保险基金"),
-                    ["hifmi_pay"] = CreateKeyPair("391100", "城乡居民大病医疗保险资"),
-                    ["maf_pay"] = CreateKeyPair("610100", "医疗救助基金"),
-                    ["cvlserv_pay"] = CreateKeyPair("320100", "公务员医疗补助基金"),
-                };
-
-                string inscopeAmt = joSettle["inscp_scp_amt"].Text();
-                string medType = Global.pat.medType ?? "A"; //默认职工
-                string medFundCode = medTypeDict.ToList().FirstOrDefault(s => s.Key == medType).Value;
-                foreach (var k in fundDict.Keys)
-                {
-                    if (!string.IsNullOrEmpty(joSettle[k].Text()))
-                    {
-                        dynamic fund = new JObject();
-                        fund.fund_payamt = decimal.Parse(joSettle[k].Text());
-                        if (fund.fund_payamt <= 0.0D) continue;
-                        fund.inscp_scp_amt = inscopeAmt;
-                        if (fundDict[k].Count > 1)
-                        {
-
-                            fund.fund_pay_type = medFundCode;
-                            fund.fund_pay_type_name = fundDict[k].ToList().FirstOrDefault(s => s.Key == medFundCode).Value;
-                        }
-                        else
-                        {
-                            fund.fund_pay_type = fundDict[k].First().Key;
-                            fund.fund_pay_type_name = fundDict[k].First().Value;
-                        }
-
-                        joRtn.Add(fund);
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                Global.writeLog("基金分类转换错误:"+e.Message);
-            }
-            return joRtn;
-
-        }
-
-        private Dictionary<string, string> CreateKeyPair(string key, string value)
-        {
-            return new Dictionary<string, string>() { { key, value } };
-        }
-
-    }
-       
-}

+ 0 - 74
Business/Local/LocalSettleBillPrintProcess.cs

@@ -1,74 +0,0 @@
-using Newtonsoft.Json.Linq;
-using PTMedicalInsurance.Forms;
-using PTMedicalInsurance.Helper;
-using Spire.Pdf;
-using Spire.Pdf.Print;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Printing;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace PTMedicalInsurance.Business
-{
-    class LocalSettleBillPrintProcess : AbstractProcess
-    {
-        public override CallResult Process(JObject joInParam)
-        {
-            string errMsg = "";
-            string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
-            JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
-            JObject joRtn = invoker.invokeCenterService(TradeEnum.PrintSettlementList, joInsuAdmObj);
-
-            if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
-            {
-                return Exception("读卡失败:", errMsg);
-            }
-            else
-            {
-                // 仅有一个report映射到output节点
-                string reportData = JsonHelper.getDestValue(joRtn, "output");
-                if (!string.IsNullOrEmpty(reportData))
-                {
-                    PrintBase64Pdf(reportData);
-                }
-                return IrisReturn("打印成功",joRtn);
-            }
-        }
-
-        public void PrintBase64Pdf(string base64Pdf)
-        {
-            string pdfFile = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\bill.pdf";
-            byte[] bytes = Convert.FromBase64String(base64Pdf);
-            try
-            {
-                using (PdfDocument doc = new PdfDocument())
-                {
-                    File.WriteAllBytes(pdfFile, bytes);
-                    doc.LoadFromFile(pdfFile);
-
-                    PrintersForm printers = new PrintersForm();
-                    if (printers.ShowDialog() == DialogResult.OK)
-                    {
-                        PdfPrintSettings settings = new PdfPrintSettings();
-                        settings.PrinterName = printers.PrinterName;
-                        settings.Landscape = printers.Landscape;
-                        doc.Print(settings);
-                    }
-                   
-                }
-            }
-            finally
-            {
-                if (File.Exists(pdfFile))
-                {
-                    File.Delete(pdfFile);
-                }
-            }
-        }
-    }
-}

+ 21 - 22
Business/Outpatient/OPPreSettlementProcess.cs

@@ -40,19 +40,18 @@ namespace PTMedicalInsurance.Business
             }
 
             // 个性化(济南),费用不单独上传
-            joSettlement["patient"] = joReg;
-            joSettlement.Add("psn_name", Global.pat.name);
-            joSettlement.Add("gend", ("1".Equals(Global.pat.gend)?"男":"女"));
-            joSettlement.Add("cardno", Global.pat.card.NO);
-            joSettlement["admNo"] = Global.pat.adm_Dr; // 病历号
-
+            //joSettlement["patient"] = joReg;
+            //joSettlement.Add("psn_name", Global.pat.name);
+            //joSettlement.Add("gend", ("1".Equals(Global.pat.gend)?"男":"女"));
+            //joSettlement.Add("cardno", Global.pat.card.NO);
+            //joSettlement["admNo"] = Global.pat.adm_Dr; // 病历号
             // 异地就医标志
-            string otherAreaFlag = "10";
-            if (!Utils.isOtherCity() || Global.inf.interfaceDr == 28)
-            {
-                otherAreaFlag = "01"; //本地
-            }
-            joSettlement.Add("other_area_flag", otherAreaFlag);
+            //string otherAreaFlag = "10";
+            //if (!Utils.isOtherCity() || Global.inf.interfaceDr == 28)
+            //{
+            //    otherAreaFlag = "01"; //本地
+            //}
+            //joSettlement.Add("other_area_flag", otherAreaFlag);
 
 
             var ret = hBus.getFeeDetail();
@@ -105,16 +104,16 @@ namespace PTMedicalInsurance.Business
             joRtn = (JObject)joSettlement.DeepClone();
 
             //济南扩展
-            string useAccountFlag = JsonHelper.getDestValue(joSettlement, "acct_used_flag");
-            string acctPay = Global.Set.acctPay;
-            if (!"1".Equals(useAccountFlag))
-            {
-                //不使用个人账户
-                acctPay = "0";
-            }
-            JObject joDataExp = new JObject();
-            joDataExp.Add("acct_payamt", acctPay);
-            joRtnSettle["exp_content"] = joDataExp;
+            //string useAccountFlag = JsonHelper.getDestValue(joSettlement, "acct_used_flag");
+            //string acctPay = Global.Set.acctPay;
+            //if (!"1".Equals(useAccountFlag))
+            //{
+            //    //不使用个人账户
+            //    acctPay = "0";
+            //}
+            //JObject joDataExp = new JObject();
+            //joDataExp.Add("acct_payamt", acctPay);
+            //joRtnSettle["exp_content"] = joDataExp;
 
             joRtn.Add("setlinfo", joRtnSettle);
 

+ 22 - 38
Forms/BasicData.cs

@@ -764,18 +764,15 @@ namespace PTMedicalInsurance.Forms
             string ver = tbVer.Text;
             JObject input = new JObject();
             input["ver"] = ver;
-            input["code"] = tbDirectoryCode.Text.Trim();
-            input["date"] = TexDate.Text.Trim();
-            LocalMedDirDownloadProcess download = new LocalMedDirDownloadProcess();
 
             // 目录查询
             if (rbgDirecType.SelectedIndex == 15)
             {
-                CallResult cr = download.QueryDepartment();
-                if (cr.Success)
-                {
-                    Global.writeLog(cr.Data);
-                }
+                //CallResult cr = download.QueryDepartment();
+                //if (cr.Success)
+                //{
+                //    Global.writeLog(cr.Data);
+                //}
             }
             // 医保字典数据下载
             else if (rbgDirecType.SelectedIndex == 8)
@@ -792,38 +789,25 @@ namespace PTMedicalInsurance.Forms
                     this.downloadDict(dict);
                 });
             }
-            // 诊断
-            else if (rbgDirecType.SelectedIndex == 3)
-            {
-                download.DownloadDiagnosis(input);
-            }
-            // 自付比例
-            else if (rbgDirecType.SelectedIndex == 19)
-            {
-                download.DownloadSelfpay(input);
-                return;
-            }
             else if (rbgDirecType.SelectedIndex <= 10)
             {
-                //MedDirDownloadProcess mp = new MedDirDownloadProcess();
-                //if (rbSingleDown.Checked)
-                //{
-                //    if (mp.SingleDownload(ver, rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
-                //    {
-                //        MessageBox.Show("医保目录下载失败:" + errorMessage);
-                //        return;
-                //    }
-                //}
-                //if (rbAutoDown.Checked)
-                //{
-                //    if (mp.AutoDownload(rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
-                //    {
-                //        MessageBox.Show("医保目录下载失败:" + errorMessage);
-                //        return;
-                //    }
-                //}
-
-                download.Process(input);
+                MedDirDownloadProcess mp = new MedDirDownloadProcess();
+                if (rbSingleDown.Checked)
+                {
+                    if (mp.SingleDownload(ver, rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
+                    {
+                        MessageBox.Show("医保目录下载失败:" + errorMessage);
+                        return;
+                    }
+                }
+                if (rbAutoDown.Checked)
+                {
+                    if (mp.AutoDownload(rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
+                    {
+                        MessageBox.Show("医保目录下载失败:" + errorMessage);
+                        return;
+                    }
+                }
             }
 
 

+ 4 - 13
InsuBusiness.cs

@@ -426,13 +426,13 @@ namespace PTMedicalInsurance
                     case "M5"://门诊结算
                         {
                             Global.Set.clearingWay = "6"; //门诊
-                            LocalOPSettleService opService = new LocalOPSettleService();
+                            OPSettlementService opService = new OPSettlementService();
                             rtnResult = opService.Charge(operationType, joInParam);
                             break;
                         }
                     case "M5C"://门诊结算撤销
                         {
-                            LocalOPSettleService opService = new LocalOPSettleService();
+                            OPSettlementService opService = new OPSettlementService();
                             rtnResult = opService.DisCharge(joParam);
                             break;
                         }
@@ -512,13 +512,13 @@ namespace PTMedicalInsurance
                     case "Z5"://住院结算
                         {
                             Global.Set.clearingWay = "1"; //住院
-                            LocalIPSettlementService ipService = new LocalIPSettlementService();
+                            IPSettlementService ipService = new IPSettlementService();
                             rtnResult = ipService.Charge(operationType,joParam);
                             break;
                         }
                     case "Z5C"://住院结算撤销
                         {
-                            LocalIPSettlementService ipService = new LocalIPSettlementService();
+                            IPSettlementService ipService = new IPSettlementService();
                             rtnResult = ipService.DisCharge(joParam);
                             break;
                         }
@@ -605,20 +605,11 @@ namespace PTMedicalInsurance
                         }
                     case "Print"://打印
                         {
-                            try
-                            {
-                                rtnResult = new LocalSettleBillPrintProcess().Process(joInParam).Data;
-                            }
-                            catch (Exception ex)
-                            {
-                                MessageBox.Show(ex.Message);
-                            }
                             break;
                         }
                     case "Log"://日志
                         {
                             MessageBox.Show(businessType);
-
                             break;
                         }
                     case "RecordUpload"://上传记录

+ 0 - 5
ShenYangMI.csproj

@@ -107,11 +107,6 @@
     <Compile Include="Business\Inpatient\IPSettlementCancelProcess.cs" />
     <Compile Include="Business\InsuServices.cs" />
     <Compile Include="Business\Basic\IPSettlementService.cs" />
-    <Compile Include="Business\Local\LocalIPSettlementService.cs" />
-    <Compile Include="Business\Local\LocalOPSettleService.cs" />
-    <Compile Include="Business\Local\LocalMedDirDownloadProcess.cs" />
-    <Compile Include="Business\Local\LocalPayFundSplitService.cs" />
-    <Compile Include="Business\Local\LocalSettleBillPrintProcess.cs" />
     <Compile Include="Business\Local\TestProcess.cs" />
     <Compile Include="Business\Other\MedDirDownloadProcess.cs" />
     <Compile Include="Business\Other\SettleBillPrintProcess.cs" />

+ 17 - 59
Variables/TradeEnum.cs

@@ -20,23 +20,19 @@ namespace PTMedicalInsurance
         SingOut,
 
         // 1101
-        [Trade("query_basic_info", "获取个人信息",ModeEnum.DLL)]
+        [Trade("1101", "获取个人信息",ModeEnum.DLL)]
         PatientInfo,
 
         /// <summary>
         /// 1161,读卡并获取个人信息
         /// </summary>
-        [Trade("read_card", "读卡并获取个人信息", ModeEnum.DLL)]
+        [Trade("1101", "读卡并获取个人信息", ModeEnum.DLL)]
         ReadCardInfo,
-        
-        // 济南
-        [Trade("read_card_qgyd", "读卡并获取个人信息(异地)", ModeEnum.DLL)]
-        ReadExtCardInfo,
 
         /// <summary>
         /// 1162,读电子凭证
         /// </summary>
-        [Trade("read_ewm", "读电子凭证")]
+        [Trade("1162", "读电子凭证")]
         ReadECToken,
 
         // 1193
@@ -171,7 +167,7 @@ namespace PTMedicalInsurance
         /// <summary>
         /// 1901(字典下载)
         /// </summary>
-        [Trade("query_si_code", "字典下载", ModeEnum.DLL)]
+        [Trade("1901", "字典下载", ModeEnum.DLL)]
         DictionaryDownload,
 
         #endregion
@@ -220,19 +216,19 @@ namespace PTMedicalInsurance
         OutpatientFeeCancel,
 
         // 2206
-        [Trade("settle_mz_pre", "门诊预结算", ModeEnum.DLL)]
+        [Trade("2206", "门诊预结算", ModeEnum.DLL)]
         OutpatientPreSettlement,
 
         /// <summary>
         /// 2207,门诊结算
         /// </summary>
-        [Trade("settle_mz", "门诊结算", ModeEnum.DLL)]
+        [Trade("2207", "门诊结算", ModeEnum.DLL)]
         OutpatientSettlement,
 
         /// <summary>
         /// 2208,门诊结算取消
         /// </summary>
-        [Trade("destroy_mz", "门诊结算取消", ModeEnum.DLL)]
+        [Trade("2208", "门诊结算取消", ModeEnum.DLL)]
         OutpatientSettlementCancel,
 
         #endregion
@@ -241,13 +237,13 @@ namespace PTMedicalInsurance
         /// <summary>
         /// 2401,入院登记
         /// </summary>
-        [Trade("save_zydj", "入院登记", ModeEnum.DLL)]
+        [Trade("2401", "入院登记", ModeEnum.DLL)]
         InpatientReg,
 
         /// <summary>
         /// 2402,出院办理
         /// </summary>
-        [Trade("outhosp", "出院办理", ModeEnum.DLL)]
+        [Trade("2402", "出院办理", ModeEnum.DLL)]
         InpatientExit,
 
         /// <summary>
@@ -259,43 +255,43 @@ namespace PTMedicalInsurance
         /// <summary>
         /// 2404,撤销入院登记
         /// </summary>
-        [Trade("destroy_zydj", "撤销入院登记", ModeEnum.DLL)]
+        [Trade("2404", "撤销入院登记", ModeEnum.DLL)]
         InpaitentRegCancel,
 
         /// <summary>
         /// 2405,出院撤销
         /// </summary>
-        [Trade("destroy_cy", "出院撤销", ModeEnum.DLL)]
+        [Trade("2405", "出院撤销", ModeEnum.DLL)]
         InpatientExitCancel,
 
         /// <summary>
         /// 2301,住院费用明细上传
         /// </summary>
-        [Trade("save_zy_script", "住院费用明细上传", ModeEnum.DLL)]
+        [Trade("2301", "住院费用明细上传", ModeEnum.DLL)]
         InpatientFeeUpload,
 
         /// <summary>
         /// 2302,住院费用明细撤销
         /// </summary>
-        [Trade("destroy_all_fypd", "住院费用明细撤销", ModeEnum.DLL)]
+        [Trade("2302", "住院费用明细撤销", ModeEnum.DLL)]
         InpatientFeeCancel,
 
         /// <summary>
         /// 2303,住院预结算
         /// </summary>
-        [Trade("settle_zy_pre", "住院预结算", ModeEnum.DLL)]
+        [Trade("2303", "住院预结算", ModeEnum.DLL)]
         InpatientPreSettlement,
 
         /// <summary>
         /// 2304,住院结算
         /// </summary>
-        [Trade("settle_zy", "住院结算", ModeEnum.DLL)]
+        [Trade("2304", "住院结算", ModeEnum.DLL)]
         InpatientSettlement,
 
         /// <summary>
         /// 2305,住院结算撤销
         /// </summary>
-        [Trade("destroy_zyjs", "住院结算撤销", ModeEnum.DLL)]
+        [Trade("2305", "住院结算撤销", ModeEnum.DLL)]
         InpatientSettlementCancel,
 
         #endregion
@@ -331,7 +327,7 @@ namespace PTMedicalInsurance
         /// <summary>
         /// 3202,费用结算对明细账
         /// </summary>
-        [Trade("query_jsxx", "费用结算对明细账", ModeEnum.DLL)]
+        [Trade("3202", "费用结算对明细账", ModeEnum.DLL)]
         FeeDetailCheck,
 
         #endregion
@@ -437,44 +433,6 @@ namespace PTMedicalInsurance
 
         #region 地方扩展
 
-        [Trade("get_zfbl","获取自费比例",ModeEnum.DLL)]
-        SelfPayPercent,
-
-        [Trade("query_yyxm_info_mz_by_sxh", "目录下载(门诊专用)", ModeEnum.DLL)]
-        DirectoryDownloadExt,
-
-        [Trade("query_ml_by_sxh", "目录下载核心", ModeEnum.DLL)]
-        DirectoryDownloadCore,
-
-        [Trade("query_yyxm_info_by_sxh", "下载医院项目目录", ModeEnum.DLL)]
-        DirectoryDownload,
-
-        [Trade("query_ml_mz_by_sxh", "目录下载核心(门诊专用)", ModeEnum.DLL)]
-        DirectoryDownloadCoreExt,
-
-        [Trade("query_si_sick_by_sxh", "医保疾病目录", ModeEnum.DLL)]
-        DiseaseDownload,
-   
-        [Trade("print_rytzd", "打印入院清单", ModeEnum.DLL)]
-        PrintRegList,
-
-        [Trade("print_jsd", "打印结算清单", ModeEnum.DLL)]
-        PrintSettlementList,
-
-        [Trade("print_cyd", "打印出院单", ModeEnum.DLL)]
-        PrintExitList,
-
-        [Trade("print_jsfp", "打印门诊结算发票", ModeEnum.DLL)]
-        PrintOPInvoice,
-
-        [Trade("print_zyzfmxd", "打印自费住院明细单", ModeEnum.DLL)]
-        PrintIPFeeList,
-
-        [Trade("query_ys","查询医生",ModeEnum.DLL)]
-        DoctorQuery,
-
-        [Trade("query_hosp_dept", "查询科室", ModeEnum.DLL)]
-        DepartmentQuery,
 
         #endregion