|
@@ -1,6 +1,7 @@
|
|
|
using ADODB;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Text;
|
|
|
using ZLPlugin_MR.Domain.Units;
|
|
|
using ZLPlugin_MR.Model;
|
|
|
|
|
@@ -42,11 +43,11 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
total = 0;
|
|
|
type = "";
|
|
|
string sql = @"Select Count(1) As total,b.代码 code From 诊疗项目目录 a,ZLLPMR.字典对码表 b
|
|
|
- Where b.名称 = a.操作类型 and 分类 ='检查'
|
|
|
- and a.类别 = 'D' And a.Id = {0} --And 操作类型 In('DR','CT','MRI','X线')
|
|
|
+ Where 分类 ='检查互认项目'
|
|
|
+ and a.类别 = 'D' And b.编码 = '{0}'
|
|
|
group by b.代码";
|
|
|
sql = string.Format(sql, zlid);
|
|
|
- //Log.Info("sql2:" + sql);
|
|
|
+ Log.Info("sql2:" + sql);
|
|
|
Recordset rd = new Recordset();
|
|
|
Tools.QueryTable(sql, out rd);
|
|
|
if (!rd.EOF)
|
|
@@ -83,6 +84,8 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
Codes codes = new Codes();
|
|
|
codes.id = list[i].相关ID; //原先是 取id 不行
|
|
|
codes.code = code;
|
|
|
+ codes.yzid = list[i].ID;
|
|
|
+ codes.zlxmid = list[i].诊疗项目ID;
|
|
|
listlis.Add(codes);
|
|
|
//lis += list[i].诊疗项目ID + ",";
|
|
|
//lis_id += list[i].ID + ",";
|
|
@@ -90,7 +93,7 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- else if (list[i].诊疗类别 == "D" && list[i].相关ID == "0.0")
|
|
|
+ else if (list[i].诊疗类别 == "D" && list[i].相关ID != "0.0")
|
|
|
{
|
|
|
//pacs = list[i].诊疗项目ID + ",";
|
|
|
//pacs_id = list[i].ID + ",";
|
|
@@ -98,13 +101,17 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
string type = "";
|
|
|
//IsPacsProject(list[i].诊疗项目ID, out total, out type);
|
|
|
String param = list[i].诊疗项目ID + "_" + list[i].标本部位 + "_" + list[i].检查方法;
|
|
|
+ Log.Info("param==" + param);
|
|
|
IsPacsProject(param, out total, out type);
|
|
|
if (total > 0)
|
|
|
{
|
|
|
Codes codes = new Codes();
|
|
|
- codes.id = list[i].ID;
|
|
|
+ codes.id = list[i].相关ID;
|
|
|
codes.type = type;
|
|
|
+ codes.yzid = list[i].ID;
|
|
|
+ codes.zlxmid = list[i].诊疗项目ID;
|
|
|
listPacs.Add(codes);
|
|
|
+ codeNo += type + "#";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -121,7 +128,7 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
/// <param name="ZYID"></param>
|
|
|
/// <param name="standardItemId"></param>
|
|
|
/// <returns></returns>
|
|
|
- public static Recordset GetZYPostJson(long lngPatientID, long ZYID, string no, int type)
|
|
|
+ public static Recordset GetZYPostJson(long lngPatientID, long ZYID, string no, int type,string totalPrice,string xgid)
|
|
|
{
|
|
|
string sql = @"Select distinct a.姓名 ""PatientName"",
|
|
|
b.身份证号 ""PatientIdCard"",
|
|
@@ -135,25 +142,61 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
'{2}' ""standardItemId"",
|
|
|
'' ""reportStartTime"",
|
|
|
'' ""reportEndTime"",
|
|
|
- '{3}' ""hrType""
|
|
|
+ '{3}' ""hrType"",
|
|
|
+ sysdate ""applyTime"",
|
|
|
+ '{4}' ""hisApplyCode"",
|
|
|
+ '2' ""patientType"",
|
|
|
+ '{5}' ""totalAmount""
|
|
|
From 病案主页 a,病人信息 b, 人员表 c,部门表 d,ZLLPMR.互认配置表 e
|
|
|
Where b.病人id = a.病人id
|
|
|
And c.姓名 = a.住院医师
|
|
|
And d.Id = a.入院科室id
|
|
|
And a.病人id = {0} And a.主页id = {1}";
|
|
|
- sql = string.Format(sql, lngPatientID, ZYID, no, type);
|
|
|
+ sql = string.Format(sql, lngPatientID, ZYID, no, type, xgid, totalPrice);
|
|
|
Recordset rd = new Recordset();
|
|
|
Tools.QueryTable(sql, out rd);
|
|
|
return rd;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public static string GetZYTotalPrice(string zlxmid)
|
|
|
+ {
|
|
|
+ string sql = @"Select sum(现价) 金额 from 收费价目 where 收费细目id in (select 收费项目id from 诊疗收费关系 where 诊疗项目id = {0} )";
|
|
|
+ sql = string.Format(sql, zlxmid);
|
|
|
+ Recordset rd = new Recordset();
|
|
|
+ Tools.QueryTable(sql, out rd);
|
|
|
+ if (!rd.EOF)
|
|
|
+ {
|
|
|
+ rd.MoveFirst();
|
|
|
+ return rd.Fields["金额"].Value.ToString();
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ 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}";
|
|
|
+ sql = string.Format(sql, lngPatientID, YZID);
|
|
|
+ Recordset rd = new Recordset();
|
|
|
+ Tools.QueryTable(sql, out rd);
|
|
|
+ if (!rd.EOF)
|
|
|
+ {
|
|
|
+ rd.MoveFirst();
|
|
|
+ return rd.Fields["金额"].Value.ToString();
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 门诊
|
|
|
/// </summary>
|
|
|
/// <param name="lngPatientID"></param>
|
|
|
/// <param name="ZYID"></param>
|
|
|
/// <param name="standardItemId"></param>
|
|
|
+ /// <param name="totalAmount"> 金额</param>
|
|
|
+ /// <param name="xgid">相关</param>
|
|
|
/// <returns></returns>
|
|
|
- public static Recordset GetMZPostJson(long ZYID, string no, int type)
|
|
|
+ public static Recordset GetMZPostJson(long ZYID, string code, int type,string totalAmount, string xgid)
|
|
|
{
|
|
|
string sql = @"Select distinct a.姓名 ""PatientName"",
|
|
|
b.身份证号 ""PatientIdCard"",
|
|
@@ -167,13 +210,17 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
'{1}' ""standardItemId"",
|
|
|
'' ""reportStartTime"",
|
|
|
'' ""reportEndTime"",
|
|
|
- '{2}' ""hrType""
|
|
|
+ '{2}' ""hrType"",
|
|
|
+ sysdate ""applyTime"",
|
|
|
+ '{3}' ""hisApplyCode"",
|
|
|
+ '1' ""patientType"",
|
|
|
+ '{4}' ""totalAmount""
|
|
|
From 病人挂号记录 a,病人信息 b, 人员表 c,部门表 d,ZLLPMR.互认配置表 e
|
|
|
Where b.病人id = a.病人id
|
|
|
And c.姓名 = a.执行人
|
|
|
And d.Id = a.执行部门id
|
|
|
And a.id = {0}";
|
|
|
- sql = string.Format(sql, ZYID, no, type);
|
|
|
+ sql = string.Format(sql, ZYID, code, type, xgid,totalAmount);
|
|
|
Recordset rd = new Recordset();
|
|
|
Tools.QueryTable(sql, out rd);
|
|
|
return rd;
|
|
@@ -253,7 +300,7 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
//Log.Info("items.id:" + items.id);
|
|
|
string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
//Log.Info("items.code:" + items.code);
|
|
|
- //Log.Info("items.id:" + items.id);
|
|
|
+ Log.Info("items.id:" + items.id);
|
|
|
int res = InsertLis(lis[i], lngPatientID, lngClinicID, date, no, items.id);
|
|
|
//Log.Info("res:" + res);
|
|
|
if (res > 0)
|
|
@@ -314,13 +361,14 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
/// 是否互认
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public static void IsAgree(out int res, out int date)
|
|
|
+ public static void IsAgree(out int res, out int date, out int yzzState)
|
|
|
{
|
|
|
res = 1;
|
|
|
date = 20000;
|
|
|
+ yzzState = 0;
|
|
|
try
|
|
|
{
|
|
|
- string sql = @"Select 互认 As AGREE,WAITINGDATE From zllpmr.互认配置表";
|
|
|
+ string sql = @"Select 互认 As AGREE,WAITINGDATE ,一张纸 From zllpmr.互认配置表";
|
|
|
Recordset rd = new Recordset();
|
|
|
Tools.QueryTable(sql, out rd);
|
|
|
if (!rd.EOF)
|
|
@@ -328,6 +376,28 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
rd.MoveFirst();
|
|
|
res = int.Parse(rd.Fields["AGREE"].Value.ToString());
|
|
|
date = int.Parse(rd.Fields["WAITINGDATE"].Value.ToString());
|
|
|
+ yzzState = int.Parse(rd.Fields["一张纸"].Value.ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Log.Info(ex.Message);
|
|
|
+ Log.Info(ex.StackTrace);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void getUrlYzzCancelMedical(out string url)
|
|
|
+ {
|
|
|
+ url = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string sql = @"Select 一张纸URL From zllpmr.互认配置表";
|
|
|
+ Recordset rd = new Recordset();
|
|
|
+ Tools.QueryTable(sql, out rd);
|
|
|
+ if (!rd.EOF)
|
|
|
+ {
|
|
|
+ rd.MoveFirst();
|
|
|
+ url = rd.Fields["一张纸URL"].Value.ToString();
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -391,8 +461,10 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
to_char(b.摘要) as 摘要
|
|
|
from 病人医嘱发送 a,病人医嘱记录 b
|
|
|
where b.id = a.医嘱id and 发送号 = {0} and 诊疗类别 in('D','C')
|
|
|
- and NOT EXISTS(select 1 from 病人医嘱记录 where id = b.id and 诊疗类别 = 'D' and 相关id is not null)";
|
|
|
+ ";
|
|
|
+ //and NOT EXISTS(select 1 from 病人医嘱记录 where id = b.id and 诊疗类别 = 'D' and 相关id is not null)
|
|
|
sql = string.Format(sql, fsh);
|
|
|
+ Log.Info("医嘱记录=》》"+sql);
|
|
|
Recordset recordset = new Recordset();
|
|
|
Tools.QueryTable(sql, out recordset);
|
|
|
List<YZData> list = new List<YZData>();
|
|
@@ -453,7 +525,48 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
}
|
|
|
json = json.Substring(0, json.Length - 1);
|
|
|
json += "]}}";
|
|
|
- Tools.ExecuteStoredProc(病人id, 主医嘱id, json, lis, pacs);
|
|
|
+ //原始调用过程没有作用 改用数据处理平台中转
|
|
|
+ //Tools.ExecuteStoredProc(病人id, 主医嘱id, json, lis, pacs);
|
|
|
+ int lisMessage = 0;
|
|
|
+ int pacsMessage = 0;
|
|
|
+ //调有 http
|
|
|
+ /* Dictionary<string, string> body = new Dictionary<string, string>();
|
|
|
+ body.Add("patientId", 病人id.ToString());
|
|
|
+ body.Add("medicalOrderId", 主医嘱id.ToString());
|
|
|
+ body.Add("jsonIn", json);
|
|
|
+ if (lis > 0)
|
|
|
+ {
|
|
|
+ lisMessage = 1;
|
|
|
+ }
|
|
|
+ if (pacs > 0)
|
|
|
+ {
|
|
|
+ pacsMessage = 1;
|
|
|
+ }
|
|
|
+ body.Add("lisMessage", lisMessage.ToString());
|
|
|
+ body.Add("pacsMessage", pacsMessage.ToString());*/
|
|
|
+
|
|
|
+ if (lis > 0)
|
|
|
+ {
|
|
|
+ lisMessage = 1;
|
|
|
+ }
|
|
|
+ if (pacs > 0)
|
|
|
+ {
|
|
|
+ pacsMessage = 1;
|
|
|
+ }
|
|
|
+ YZZCancelDTO zZCancelDTO = new YZZCancelDTO();
|
|
|
+ zZCancelDTO.patientId = 病人id.ToString();
|
|
|
+ zZCancelDTO.medicalOrderId = 主医嘱id.ToString();
|
|
|
+ zZCancelDTO.jsonIn = json;
|
|
|
+ zZCancelDTO.lisMessage = lisMessage.ToString();
|
|
|
+ zZCancelDTO.pacsMessage = pacsMessage.ToString();
|
|
|
+
|
|
|
+ string url = "http://172.30.0.66:7000/cancelMedicalForYzz";
|
|
|
+ getUrlYzzCancelMedical(out url);
|
|
|
+ Log.Info("url=" + url);
|
|
|
+ string body = JSON.ObjectToJson<YZZCancelDTO>(zZCancelDTO, Encoding.UTF8);
|
|
|
+ Log.Info("body==" + body);
|
|
|
+ string resultString = HttpUtils.WSCenterData(url, body);
|
|
|
+ Log.Info("resultString==" + resultString);
|
|
|
}
|
|
|
}
|
|
|
}
|