Bläddra i källkod

印江县一张纸互认金额版本新增

zackhua 7 månader sedan
förälder
incheckning
2ba957e2d1
5 ändrade filer med 93 tillägg och 14 borttagningar
  1. 47 1
      LisPacs_MR_Bll.cs
  2. 4 0
      Model/Codes.cs
  3. 3 3
      Properties/AssemblyInfo.cs
  4. 3 1
      ZLPlugin_MR.csproj
  5. 36 9
      clsPlugin.cs

+ 47 - 1
LisPacs_MR_Bll.cs

@@ -110,6 +110,9 @@ namespace ZLPlugin_MR.ServerImpl
                         codes.type = type;
                         codes.yzid = list[i].ID;
                         codes.zlxmid = list[i].诊疗项目ID;
+                        codes.zxksid = list[i].执行科室ID;
+                        codes.part = list[i].标本部位;
+                        codes.method = list[i].检查方法;
                         listPacs.Add(codes);
                         codeNo += type + "#";
                     }
@@ -175,7 +178,7 @@ namespace ZLPlugin_MR.ServerImpl
 
         public static string GetMZTotalPrice(long lngPatientID, string YZID)
         {
-            string sql = @"Select sum(a.实收金额) 金额 from 门诊费用记录 a,病人医嘱记录 b where a.医嘱序号 = b.id and b.病人id ={0} and b.id = {1}";
+            string sql = @"Select nvl(sum(a.实收金额),'0') 金额 from 门诊费用记录 a,病人医嘱记录 b where a.医嘱序号 = b.id and b.病人id ={0} and b.id = {1}";
             sql = string.Format(sql, lngPatientID, YZID);
             Recordset rd = new Recordset();
             Tools.QueryTable(sql, out rd);
@@ -187,6 +190,49 @@ namespace ZLPlugin_MR.ServerImpl
             return "";
         }
 
+        public static string GetTotalPriceForLisByZLXM(string zlxmid)
+        {
+            string sql = @"Select nvl(sum(现价),'0') 金额 from 收费价目 where  终止日期 > sysdate  and 收费细目id in (select 收费项目id from 诊疗收费关系 where 诊疗项目id = {0} )";
+            sql = string.Format(sql, zlxmid);
+            Log.Info("GetTotalPriceForLisByZLXM==" + sql);
+            Recordset rd = new Recordset();
+            Tools.QueryTable(sql, out rd);
+            if (!rd.EOF)
+            {
+                rd.MoveFirst();
+                return rd.Fields["金额"].Value.ToString();
+            }
+            return "0";
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="zlxmid"> 诊疗项目id</param>
+        /// <param name="zlksid"> 执行科室id</param>
+        /// <param name="part"> 部位</param>
+        /// <param name="method"> 方法</param>
+        /// <param name="patientResource"> 病人来源   门诊  1  还是住院  2   0 所有</param>
+        /// <returns></returns>
+        public static string GetTotalPriceForPacsByZLXM(string zlxmid, string zlksid, string part, string method, int patientResource)
+        {
+            string sql = @"select nvl(sum(a.现价* b.收费数量),'0') 金额 from 收费价目 a,(
+                    select * from 诊疗收费关系  where 诊疗项目id = {0} and ( 适用科室id  is null or  适用科室id = {1} )and 检查部位 = '{2}' and 检查方法 = '{3}'  and 病人来源 <> {4}
+                    union all
+                    select * from 诊疗收费关系  where 诊疗项目id = {0} and 固有对照 = 1 and 适用科室id = {1} and 病人来源 <> {4}
+                    ) b where a.收费细目id = b.收费项目id and   a.终止日期 > sysdate ";
+            sql = string.Format(sql, zlxmid, zlksid, part, method, patientResource);
+            Log.Info("GetTotalPriceForPacsByZLXM==" + sql);
+            Recordset rd = new Recordset();
+            Tools.QueryTable(sql, out rd);
+            if (!rd.EOF)
+            {
+                rd.MoveFirst();
+                return rd.Fields["金额"].Value.ToString();
+            }
+            return "0";
+        }
+
         /// <summary>
         /// 门诊
         /// </summary>

+ 4 - 0
Model/Codes.cs

@@ -9,5 +9,9 @@ namespace ZLPlugin_MR.Model
         public string type { get; set; }
         public string yzid { get; set; } // 医嘱id 
         public string zlxmid { get; set; } //诊疗项目id
+
+        public string zxksid { get; set; } //执行科室id 
+        public string part { get; set; } //部位 
+        public string method { get; set; } //方法 
     }
 }

+ 3 - 3
Properties/AssemblyInfo.cs

@@ -5,8 +5,8 @@ using System.Runtime.InteropServices;
 // General Information about an assembly is controlled through the following 
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("ZLPlugin_MR")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyTitle("互认金额版本新加")]
+[assembly: AssemblyDescription("ZLPlugin_MR")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("ZLPlugin_MR")]
@@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.4.35.140")]
-[assembly: AssemblyFileVersion("1.4.35.140")]
+[assembly: AssemblyFileVersion("1.0.1.1")]

+ 3 - 1
ZLPlugin_MR.csproj

@@ -50,8 +50,10 @@
     <Reference Include="System.Windows.Forms" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Domain\Units\HttpUtils.cs" />
+    <Compile Include="Model\YZZCancelDTO.cs" />
     <Compile Include="SocketClient.cs" />
-    <Compile Include="Domain\Units\Tools.cs" />
+    <Compile Include="Tools.cs" />
     <Compile Include="IclsPlugIn.cs" />
     <Compile Include="clsPlugin.cs" />
     <Compile Include="Domain\Units\Log.cs" />

+ 36 - 9
clsPlugin.cs

@@ -110,6 +110,11 @@ namespace ZLPlugin_MR
                 List<Codes> listlis;
                 List<Codes> listpacs;
                 LisPacs_MR_Bll.GetTreatmentId(ss_list, out code, out listlis, out listpacs);
+
+                string xgid = "";
+                string yzid = "";
+                string zlxmid = "";
+                string totalPrice = "0";
                 int hrType = 0;
                 if (listlis.Count == 0 && listpacs.Count == 0)
                 {
@@ -119,15 +124,19 @@ namespace ZLPlugin_MR
                 else if (listlis.Count > 0 && listpacs.Count == 0)//只有检验
                 {
                     hrType = 1;
+                    yzid = listlis[0].yzid;
+                    xgid = listlis[0].id;
+                    zlxmid = listlis[0].zlxmid;
                 }
                 else if (listpacs.Count > 0 && listlis.Count == 0)//只有检查
                 {
                     hrType = 2;
+                    yzid = listpacs[0].yzid;
+                    xgid = listpacs[0].id;
+                    zlxmid = listpacs[0].zlxmid;
                 }
-                string yzid = listlis[0].yzid;
-                string xgid = listlis[0].id;
 
-                string totalPrice= LisPacs_MR_Bll.GetMZTotalPrice(lngPatientID, yzid);
+                totalPrice= LisPacs_MR_Bll.GetMZTotalPrice(lngPatientID, yzid);
                 Recordset rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, totalPrice, xgid);
                 string json = Tools.RecordsetToJson(rd);
                 Log.Info(json);
@@ -246,31 +255,49 @@ namespace ZLPlugin_MR
                 LisPacs_MR_Bll.GetTreatmentId(ss_list, out code, out listlis, out listpacs);
                 Log.Info("code==" + code);
                 Recordset rd = new Recordset();
+
+                string xgid = "";
+                string yzid = "";
+                string zlxmid = "";
+                string totalPrice = "0";
                 int hrType = 0;
                 if (listlis.Count == 0 && listpacs.Count == 0)
                 {
+                    Log.Info("listlis.Count == 0 && listpacs.Count == 0");
                     return true;
                 }
                 else if (listlis.Count > 0 && listpacs.Count == 0)//只有检验
                 {
                     hrType = 1;
+                    yzid = listlis[0].yzid;
+                    xgid = listlis[0].id;
+                    zlxmid = listlis[0].zlxmid;
                 }
                 else if (listpacs.Count > 0 && listlis.Count == 0)//只有检查
                 {
                     hrType = 2;
+                    yzid = listpacs[0].yzid;
+                    xgid = listpacs[0].id;
+                    zlxmid = listpacs[0].zlxmid;
                 }
 
-                string yzid = listlis[0].yzid;
-                string xgid = listlis[0].id;
                 if (lngModual == 1253)//住院
                 {
-                    string zlxmid = listlis[0].zlxmid;
-                    string totalPrice = LisPacs_MR_Bll.GetZYTotalPrice(zlxmid);
+                    if (hrType == 1)
+                    {
+                        totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZLXM(zlxmid);
+                    }
+                    else
+                    {
+
+                        totalPrice = LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(zlxmid, listpacs[0].zxksid, listpacs[0].part, listpacs[0].method, 1);
+                    }
+                    //totalPrice = LisPacs_MR_Bll.GetZYTotalPrice(zlxmid);
                     rd = LisPacs_MR_Bll.GetZYPostJson(lngPatientID, lngClinicID, code, hrType, totalPrice, xgid);
                 }
                 else
                 {
-                    string totalPrice = LisPacs_MR_Bll.GetMZTotalPrice(lngPatientID, yzid);
+                     totalPrice = LisPacs_MR_Bll.GetMZTotalPrice(lngPatientID, yzid);
                     
                     rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, totalPrice,xgid);
                 }
@@ -360,7 +387,7 @@ namespace ZLPlugin_MR
             }
             try
             {
-                Log.Info("互认的信息" + SocketClient.Message);
+                Log.Info("互认的信息》》" + SocketClient.Message);
                 result = JSON.JsonToObject<Results>(Tools.FormatStr(SocketClient.Message), Encoding.UTF8);
             }
             catch (Exception ex)//插件关闭时,返回格式不一样