zhengjie 1 год назад
Родитель
Сommit
1700dc3fea

+ 7 - 4
Business/Basic/PatientService.cs

@@ -51,10 +51,13 @@ namespace PTMedicalInsurance.Business
             {
                 patInfo = outParam;
                 //展示患者信息界面(合并到后面登记界面)
-                //if (hBus.showPatInfo(patInfo, out outParam) != 0)
-                //{
-                //    return JsonHelper.setExceptionJson(-100, "操作员取消!", outParam).ToString();
-                //}
+                if (hBus.showPatInfo(patInfo, out outParam) != 0)
+                {
+                    return JsonHelper.setExceptionJson(-100, "操作员取消!", outParam).ToString();
+                }
+                // 转换后的信息
+                patInfo = outParam;
+
                 hBus.convertPatientInfo(patInfo, out outParam);
 
             }

+ 113 - 18
Business/HisMainBusiness.cs

@@ -452,33 +452,128 @@ namespace PTMedicalInsurance.Business
             JArray jaIdInfo = JArray.Parse(JsonHelper.getDestValue(joConvertCodeRtn, "idetinfo"));
             JObject jaBaseInfo = JObject.Parse(JsonHelper.getDestValue(joConvertCodeRtn, "baseinfo"));
             joOutput["baseinfo"] = jaBaseInfo;
-
-            JObject joSelectedInsuInfo = (JObject)jaInsuInfo[0];
-            joSelectedInsuInfo.Add("mdtrt_cert_type", Global.pat.mdtrtcertType);
-            joSelectedInsuInfo.Add("mdtrt_cert_no", Global.pat.mdtrtcertNO);
-            if (joOutparam["selectedInsuInfo"] != null)
-            {
-                joOutparam["selectedInsuInfo"] = joSelectedInsuInfo;
-            }
-            else
+            string jaSelectedInsuInfo = JsonHelper.getDestValue(joOutparam, "selectedInsuInfo");
+            if (string.IsNullOrEmpty(jaSelectedInsuInfo))
             {
-                joOutparam.Property("output").AddBeforeSelf(new JProperty("selectedInsuInfo", joSelectedInsuInfo));
+                JObject joSelectedInsuInfo = (JObject)jaInsuInfo[0];
+                joSelectedInsuInfo.Add("mdtrt_cert_type", Global.pat.mdtrtcertType);
+                joSelectedInsuInfo.Add("mdtrt_cert_no", Global.pat.mdtrtcertNO);
+                if (joOutparam["selectedInsuInfo"] != null)
+                {
+                    joOutparam["selectedInsuInfo"] = joSelectedInsuInfo;
+                }
+                else
+                {
+                    joOutparam.Property("output").AddBeforeSelf(new JProperty("selectedInsuInfo", joSelectedInsuInfo));
+                }
+
+                if (joOutparam["selectedIdInfo"] != null)
+                {
+                    joOutparam["selectedIdInfo"] = joSelectedInsuInfo;
+                }
+                else
+                {
+                    joOutparam.Property("output").AddBeforeSelf(new JProperty("selectedIdInfo", joSelectedInsuInfo));
+                }
             }
 
-            if (joOutparam["selectedIdInfo"] != null)
+            outparam = joOutparam.ToString();
+        }
+
+        /// <summary>
+        /// 展示患者信息界面,转换相关编码为中文,并获取操作员选中的信息
+        /// </summary>
+        /// <param name="patInfo"></param>
+        /// <param name="outparam"></param>
+        /// <returns></returns>
+        public int showPatInfo(String patInfo, out string outparam)
+        {
+            outparam = "";
+            //展示信息界面
+            JObject joOutparam = JObject.Parse(patInfo);
+            JObject joOutput = JObject.Parse(JsonHelper.getDestValue(joOutparam, "output"));
+
+            // 日期处理
+            JObject joBaseInfo = JObject.Parse(JsonHelper.getDestValue(joOutput, "baseinfo"));
+            JArray joInsuInfo = JArray.Parse(JsonHelper.getDestValue(joOutput, "insuinfo"));
+            joOutput["baseinfo"] = joBaseInfo;
+            joOutput["insuinfo"] = joInsuInfo;
+            joOutparam["output"] = joOutput;
+
+            //编码转换
+            JArray jaConvertCode = new JArray();
+            JObject joConvertCodeParam = new JObject();
+            joConvertCodeParam.Add("hospitalDr", Global.inf.hospitalDr);
+            joConvertCodeParam.Add("interfaceDr", Global.inf.interfaceDr);
+            joConvertCodeParam.Add("output", joOutput);
+            jaConvertCode.Add(joConvertCodeParam);
+            JObject joConvertCode = new JObject();
+            joConvertCode.Add("code", "09010054");
+            joConvertCode.Add("params", jaConvertCode);
+            InvokeHelper invoker = new InvokeHelper();
+            JObject joConvertCodeRtn = invoker.invokeInsuService(joConvertCode.ToString(), "患者信息编码转换");
+            PatientInsuInfo frmPatientInfo = new PatientInsuInfo(joConvertCodeRtn);
+            //相关信息转换到登记面板
+            try
             {
-                joOutparam["selectedIdInfo"] = joSelectedInsuInfo;
+                if (frmPatientInfo.ShowDialog() == DialogResult.OK)
+                {
+                    //原来用的是转换后的
+                    //frmPatientInfo.joSelectedInsuInfo.Add("mdtrt_cert_type", Global.pat.mdtrtcertType);
+                    //frmPatientInfo.joSelectedInsuInfo.Add("mdtrt_cert_no", Global.pat.mdtrtcertNO);
+                    //joOutparam.Property("output").AddBeforeSelf(new JProperty("selectedInsuInfo", frmPatientInfo.joSelectedInsuInfo));
+
+                    //现在用转换之前的
+                    JArray jaInsuInfo = JArray.Parse(JsonHelper.getDestValue(joOutput, "insuinfo"));
+                    JArray jaIdInfo = JArray.Parse(JsonHelper.getDestValue(joOutput, "idetinfo"));
+                    JObject joSelectedInsuInfo = (JObject)jaInsuInfo[frmPatientInfo.insuInfoIndex];
+                    JObject joSelectedIdInfo;
+                    if (jaIdInfo.Count != 0)
+                    {
+                        joSelectedIdInfo = (JObject)jaIdInfo[frmPatientInfo.idInfoIndex];
+                    }
+                    else
+                    {
+                        joSelectedIdInfo = new JObject();
+                    }
+                    joSelectedInsuInfo.Add("mdtrt_cert_type", Global.pat.mdtrtcertType);
+                    joSelectedInsuInfo.Add("mdtrt_cert_no", Global.pat.mdtrtcertNO);
+                    if (joOutparam["selectedInsuInfo"] != null)
+                    {
+                        joOutparam["selectedInsuInfo"] = joSelectedInsuInfo;
+                    }
+                    else
+                    {
+                        joOutparam.Property("output").AddBeforeSelf(new JProperty("selectedInsuInfo", joSelectedInsuInfo));
+                    }
+
+                    if (joOutparam["selectedIdInfo"] != null)
+                    {
+                        joOutparam["selectedIdInfo"] = joSelectedInsuInfo;
+                    }
+                    else
+                    {
+                        joOutparam.Property("output").AddBeforeSelf(new JProperty("selectedIdInfo", joSelectedInsuInfo));
+                    }
+
+
+                    outparam = joOutparam.ToString();
+
+                    return 0;
+                }
+                else
+                {
+                    outparam = JsonHelper.setExceptionJson(-1, "门诊读卡", "收款员取消读卡").ToString();
+                    return -1;
+                }
             }
-            else
+            catch (Exception e)
             {
-                joOutparam.Property("output").AddBeforeSelf(new JProperty("selectedIdInfo", joSelectedInsuInfo));
+                outparam = JsonHelper.setExceptionJson(-1, "患者参保信息展示", e.Message).ToString();
+                return -1;
             }
-
-
-            outparam = joOutparam.ToString();
         }
 
-
         /// <summary>
         /// 患者读卡并获取中心信息(1101)后设置PAT结构体
         /// </summary>

+ 13 - 5
Common/Utils.cs

@@ -210,13 +210,21 @@ namespace PTMedicalInsurance.Common
             }
             Global.writeLog("参保地判断:"+ Global.pat.insuplc_admdvs);
 
-            //自动识别是否异地
-            if (isOtherCity() || isOtherProvice()) {
-                //南昌异地固定参保地
-                Global.writeLog("【异地】");
+            if (Global.pat.insuplc_admdvs.Substring(0, 4) == "3699") //省医保
+            {
                 Global.pat.insuplc_admdvs = "369900";
+                Global.pat.mdtrtarea_admvs = "369900";
+
+            }
+            else
+            {
+                //异地判断
+                if (Global.pat.insuplc_admdvs.Substring(0, 4) != Global.inf.areaCode.Substring(0, 4))
+                {
+                    Global.pat.insuplc_admdvs = "369900";
+                }
             }
-           
+
             return Global.pat.insuplc_admdvs;
         }
 

+ 8 - 7
Forms/OutpatientRegistration.cs

@@ -21,8 +21,9 @@ namespace PTMedicalInsurance.Forms
 
         public void initBaseInfo(JObject jObject)
         {
+
             JObject jo = JObject.Parse(jObject["output"].ToString());
-            DataTable dtInsuInfo = (DataTable)jo["insuinfo"].ToObject(typeof(DataTable));
+            JObject insuInfo = JObject.Parse(jObject["selectedInsuInfo"].Text());
             JObject joBaseInfo = JObject.FromObject(jo["baseinfo"]);
             this.txtName.Text = joBaseInfo["psn_name"].Text();
             this.txtPsnNO.Text = joBaseInfo["psn_no"].Text();
@@ -31,13 +32,13 @@ namespace PTMedicalInsurance.Forms
             this.txtCertType.Text = joBaseInfo["psn_cert_type"].Text();
             this.txtCertNO.Text = joBaseInfo["certno"].Text();
             this.txtAge.Text = joBaseInfo["age"].Text();
-            if (dtInsuInfo?.Rows.Count > 0)
+            if (insuInfo != null)
             {
-                this.txtCorp.Text = dtInsuInfo.Rows[0]["emp_name"].ToString();
-                this.txtBalc.Text = dtInsuInfo.Rows[0]["balc"].ToString();
-                this.txtAdmvs.Text = dtInsuInfo.Rows[0]["insuplc_admdvs"].ToString();
-                this.txtPsnType.Text = dtInsuInfo.Rows[0]["psn_type"].ToString();
-                this.txtInsuType.Text = dtInsuInfo.Rows[0]["insutype"].ToString();
+                this.txtCorp.Text = insuInfo["emp_name"].ToString();
+                this.txtBalc.Text = insuInfo["balc"].ToString();
+                this.txtAdmvs.Text = insuInfo["insuplc_admdvs"].ToString();
+                this.txtPsnType.Text = insuInfo["psn_type"].ToString();
+                this.txtInsuType.Text = insuInfo["insutype"].ToString();
             }
         }
 

+ 1 - 1
Forms/PatientInsuInfo.cs

@@ -90,9 +90,9 @@ namespace PTMedicalInsurance.Forms
         {
             AddDGVColumn(dgvIDInfo, "人员身份类别", "psn_idet_type", 140);
             AddDGVColumn(dgvIDInfo, "人员类别等级", "psn_type_lv", 140);
-            AddDGVColumn(dgvIDInfo, "备注", "memo", 150);
             AddDGVColumn(dgvIDInfo, "开始时间", "begntime", 200);
             AddDGVColumn(dgvIDInfo, "结束时间", "endtime", 200);
+            AddDGVColumn(dgvIDInfo, "备注", "memo", 150);
             dgvIDInfo.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Bold);
             dgvIDInfo.ColumnHeadersHeight = 40;
         }