|
@@ -37,9 +37,11 @@
|
|
|
using ADODB;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Net;
|
|
|
using System.Runtime.InteropServices;
|
|
|
using System.Text;
|
|
|
using System.Windows.Forms;
|
|
|
+using ZLPlugin_MR.Domain;
|
|
|
using ZLPlugin_MR.Domain.Units;
|
|
|
using ZLPlugin_MR.Model;
|
|
|
using ZLPlugin_MR.ServerImpl;
|
|
@@ -85,7 +87,6 @@ namespace ZLPlugin_MR
|
|
|
//' lngSendID=发送号(病人医嘱发送.id)
|
|
|
Log.Info("AdviceSend lngModual == " + lngModual );
|
|
|
Log.Info("AdviceSend lngSys == " + lngSys);
|
|
|
-
|
|
|
//住院的时候发送 不需要 20241015
|
|
|
if (lngModual == 1254)
|
|
|
{
|
|
@@ -93,7 +94,6 @@ namespace ZLPlugin_MR
|
|
|
}
|
|
|
//-------------- 20241015
|
|
|
Log.Info("AdviceSend enter=="+ lngSendID);
|
|
|
-
|
|
|
try
|
|
|
{
|
|
|
Log.Info("AdviceSend enter==");
|
|
@@ -107,14 +107,13 @@ namespace ZLPlugin_MR
|
|
|
}
|
|
|
List<YZData> ss_list = LisPacs_MR_Bll.GetYZList(lngSendID);
|
|
|
string code = "";
|
|
|
+ string billProjectNames = ""; //开单项目名称
|
|
|
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";
|
|
|
+ LisPacs_MR_Bll.GetTreatmentId(ss_list, out code, out listlis, out listpacs,out billProjectNames);
|
|
|
+ Log.Info("code==" + code);
|
|
|
+ Log.Info("billProjectNames==" + billProjectNames);
|
|
|
+ decimal totalPrice = 0;
|
|
|
int hrType = 0;
|
|
|
if (listlis.Count == 0 && listpacs.Count == 0)
|
|
|
{
|
|
@@ -124,20 +123,34 @@ 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;
|
|
|
}
|
|
|
-
|
|
|
- totalPrice= LisPacs_MR_Bll.GetMZTotalPrice(lngPatientID, yzid);
|
|
|
- Recordset rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, totalPrice, xgid);
|
|
|
+ if (hrType == 1)
|
|
|
+ {
|
|
|
+ totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZlxmIds(LisPacs_MR_Bll.GetZlxmIdFromList(listlis));// 获取总金额
|
|
|
+ //totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZLXM(zlxmid);
|
|
|
+ }
|
|
|
+ else if (hrType == 2)
|
|
|
+ {
|
|
|
+ for (var ii = 0; ii < listpacs.Count; ii++)
|
|
|
+ {
|
|
|
+ totalPrice += LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(listpacs[ii].zlxmid, listpacs[ii].zxksid, listpacs[ii].part, listpacs[ii].method, 2);
|
|
|
+ }
|
|
|
+ // totalPrice = LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(zlxmid, listpacs[0].zxksid, listpacs[0].part, listpacs[0].method, 2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //获取合单之后 同时有检查和检验 的开单项目唯一id 以及金额
|
|
|
+ totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZlxmIds(LisPacs_MR_Bll.GetZlxmIdFromList(listlis));// 获取总金额
|
|
|
+ for (var ii = 0; ii < listpacs.Count; ii++)
|
|
|
+ {
|
|
|
+ totalPrice += LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(listpacs[ii].zlxmid, listpacs[ii].zxksid, listpacs[ii].part, listpacs[ii].method, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Recordset rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, totalPrice.ToString(), code);
|
|
|
string json = Tools.RecordsetToJson(rd);
|
|
|
Log.Info(json);
|
|
|
SocketClient clientSend = new SocketClient("127.0.0.1", 6061);
|
|
@@ -181,6 +194,9 @@ namespace ZLPlugin_MR
|
|
|
clientSend.Receive();
|
|
|
// SocketClient.Message = null;
|
|
|
SaveData(waittingdate, lngPatientID, lngClinicID, listlis, listpacs, 1);
|
|
|
+ //保存开单项目
|
|
|
+ int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, billProjectNames, 999, Tools.GetHostIp(), Infos.UserInfo.ID.ToString(), code, hrType.ToString(), Infos.UserInfo.用户名);
|
|
|
+ Log.Info("开单状态=" + ii);
|
|
|
clientSend.Close();
|
|
|
return true;
|
|
|
}
|
|
@@ -192,6 +208,9 @@ namespace ZLPlugin_MR
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ MessageBox.Show(rex.ResultText.ToString(), "中联软件", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
|
|
+ int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, billProjectNames, 999, Tools.GetHostIp(), Infos.UserInfo.ID.ToString(), code, hrType.ToString(), Infos.UserInfo.用户名);
|
|
|
+ Log.Info("开单状态=" + ii);
|
|
|
clientSend.Close();
|
|
|
return true;//此病人不存在互认信息
|
|
|
}
|
|
@@ -250,16 +269,14 @@ namespace ZLPlugin_MR
|
|
|
}
|
|
|
List<YZData> ss_list = JSON.JsonToObject<List<YZData>>(Tools.FormatStr(str), Encoding.UTF8);
|
|
|
string code = "";
|
|
|
+ string billProjectNames = ""; //开单项目名称
|
|
|
List<Codes> listlis;
|
|
|
List<Codes> listpacs;
|
|
|
- LisPacs_MR_Bll.GetTreatmentId(ss_list, out code, out listlis, out listpacs);
|
|
|
+ LisPacs_MR_Bll.GetTreatmentId(ss_list, out code, out listlis, out listpacs, out billProjectNames);
|
|
|
Log.Info("code==" + code);
|
|
|
+ Log.Info("billProjectNames==" + billProjectNames);
|
|
|
Recordset rd = new Recordset();
|
|
|
-
|
|
|
- string xgid = "";
|
|
|
- string yzid = "";
|
|
|
- string zlxmid = "";
|
|
|
- string totalPrice = "0";
|
|
|
+ decimal totalPrice = 0;
|
|
|
int hrType = 0;
|
|
|
if (listlis.Count == 0 && listpacs.Count == 0)
|
|
|
{
|
|
@@ -269,37 +286,64 @@ 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;
|
|
|
}
|
|
|
|
|
|
if (lngModual == 1253)//住院
|
|
|
{
|
|
|
if (hrType == 1)
|
|
|
{
|
|
|
- totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZLXM(zlxmid);
|
|
|
+ totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZlxmIds(LisPacs_MR_Bll.GetZlxmIdFromList(listlis));// 获取总金额
|
|
|
+ //totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZLXM(zlxmid);
|
|
|
+ }
|
|
|
+ else if (hrType == 2)
|
|
|
+ {
|
|
|
+ for (var ii = 0; ii < listpacs.Count; ii++)
|
|
|
+ {
|
|
|
+ totalPrice += LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(listpacs[ii].zlxmid, listpacs[ii].zxksid, listpacs[ii].part, listpacs[ii].method, 1);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
-
|
|
|
- totalPrice = LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(zlxmid, listpacs[0].zxksid, listpacs[0].part, listpacs[0].method, 1);
|
|
|
+ //获取合单之后 同时有检查和检验 的开单项目唯一id 以及金额
|
|
|
+ totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZlxmIds(LisPacs_MR_Bll.GetZlxmIdFromList(listlis));// 获取总金额
|
|
|
+ for (var ii = 0; ii < listpacs.Count; ii++)
|
|
|
+ {
|
|
|
+ totalPrice += LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(listpacs[ii].zlxmid, listpacs[ii].zxksid, listpacs[ii].part, listpacs[ii].method, 1);
|
|
|
+ }
|
|
|
}
|
|
|
//totalPrice = LisPacs_MR_Bll.GetZYTotalPrice(zlxmid);
|
|
|
- rd = LisPacs_MR_Bll.GetZYPostJson(lngPatientID, lngClinicID, code, hrType, totalPrice, xgid);
|
|
|
+ rd = LisPacs_MR_Bll.GetZYPostJson(lngPatientID, lngClinicID, code, hrType, totalPrice.ToString(), code);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- totalPrice = LisPacs_MR_Bll.GetMZTotalPrice(lngPatientID, yzid);
|
|
|
-
|
|
|
- rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, totalPrice,xgid);
|
|
|
+ //totalPrice = LisPacs_MR_Bll.GetMZTotalPrice(lngPatientID, yzid);
|
|
|
+ if (hrType == 1)
|
|
|
+ {
|
|
|
+ totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZlxmIds(LisPacs_MR_Bll.GetZlxmIdFromList(listlis));// 获取总金额
|
|
|
+ //totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZLXM(zlxmid);
|
|
|
+ }
|
|
|
+ else if (hrType == 2)
|
|
|
+ {
|
|
|
+ for (var ii = 0; ii < listpacs.Count; ii++)
|
|
|
+ {
|
|
|
+ totalPrice += LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(listpacs[ii].zlxmid, listpacs[ii].zxksid, listpacs[ii].part, listpacs[ii].method, 2);
|
|
|
+ }
|
|
|
+ // totalPrice = LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(zlxmid, listpacs[0].zxksid, listpacs[0].part, listpacs[0].method, 2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //获取合单之后 同时有检查和检验 的开单项目唯一id 以及金额
|
|
|
+ totalPrice = LisPacs_MR_Bll.GetTotalPriceForLisByZlxmIds(LisPacs_MR_Bll.GetZlxmIdFromList(listlis));// 获取总金额
|
|
|
+ for (var ii = 0; ii < listpacs.Count; ii++)
|
|
|
+ {
|
|
|
+ totalPrice += LisPacs_MR_Bll.GetTotalPriceForPacsByZLXM(listpacs[ii].zlxmid, listpacs[ii].zxksid, listpacs[ii].part, listpacs[ii].method, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ rd = LisPacs_MR_Bll.GetMZPostJson(lngClinicID, code, hrType, totalPrice.ToString(),code);
|
|
|
}
|
|
|
SocketClient socketClient = new SocketClient("127.0.0.1", 6061);
|
|
|
//Results result = new Results();
|
|
@@ -333,7 +377,6 @@ namespace ZLPlugin_MR
|
|
|
|
|
|
}
|
|
|
Log.Info("22222" + SocketClient.Message);
|
|
|
-
|
|
|
if (!string.IsNullOrWhiteSpace(SocketClient.Message))
|
|
|
{
|
|
|
Log.Info(SocketClient.Message);
|
|
@@ -345,6 +388,9 @@ namespace ZLPlugin_MR
|
|
|
socketClient.Receive();
|
|
|
//SocketClient.Message = null;
|
|
|
SaveData(waittingdate, lngPatientID, lngClinicID, listlis, listpacs, -1);
|
|
|
+ //保存开单项目
|
|
|
+ int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, billProjectNames, 999, Tools.GetHostIp(), Infos.UserInfo.ID.ToString(), code, hrType.ToString(), Infos.UserInfo.用户名);
|
|
|
+ Log.Info("开单状态=" + ii);
|
|
|
socketClient.Close();
|
|
|
return true;
|
|
|
}
|
|
@@ -356,10 +402,12 @@ namespace ZLPlugin_MR
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ MessageBox.Show(rex.ResultText.ToString(), "中联软件", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
|
|
+ int ii = LisPacs_MR_Bll.InsertHuRenBillProject(Dns.GetHostName(), lngPatientID, billProjectNames, 999, Tools.GetHostIp(), Infos.UserInfo.ID.ToString(), code, hrType.ToString(), Infos.UserInfo.用户名);
|
|
|
+ Log.Info("开单状态=" + ii);
|
|
|
socketClient.Close();
|
|
|
return true;//此病人不存在互认信息
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
socketClient.Close();
|
|
|
}
|
|
@@ -405,7 +453,7 @@ namespace ZLPlugin_MR
|
|
|
long lisId;
|
|
|
long pacsId;
|
|
|
Log.Info("Domain.Infos.UserInfo.编号 = " + Domain.Infos.UserInfo.编号);
|
|
|
- LisPacs_MR_Bll.SaveData(result, lngPatientID, lngClinicID, Domain.Infos.UserInfo.编号, listlis, listpacs, out lisId, out pacsId);
|
|
|
+ LisPacs_MR_Bll.SaveDataNew(result, lngPatientID, lngClinicID, Domain.Infos.UserInfo.编号, listlis, listpacs, out lisId, out pacsId);
|
|
|
Log.Info("state:"+ state + " lisId"+ lisId);
|
|
|
if (state < 1)
|
|
|
{
|