|
@@ -473,10 +473,11 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
/// <param name="listpacs"></param>
|
|
|
/// <param name="lis_id"></param>
|
|
|
/// <param name="pacs_id"></param>
|
|
|
- public static void SaveDataNew(Results result, long lngPatientID, long lngClinicID, string no, List<Codes> listlis, List<Codes> listpacs, out long lis_id, out long pacs_id)
|
|
|
+ public static void SaveDataNew(Results result, long lngPatientID, long lngClinicID, string no, List<Codes> listlis, List<Codes> listpacs, out List<long> lis_ids, out List<long> pacs_ids)
|
|
|
{
|
|
|
- lis_id = -1;
|
|
|
- pacs_id = -1;
|
|
|
+
|
|
|
+ lis_ids = new List<long>();
|
|
|
+ pacs_ids = new List<long>();
|
|
|
var lis = result.ResultText[0].LIS;
|
|
|
var pacs = result.ResultText[0].PACS;
|
|
|
if (lis != null)
|
|
@@ -489,10 +490,7 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
int res = InsertLis(lis[i], lngPatientID, lngClinicID, date, no, xgid);
|
|
|
if (res > 0)
|
|
|
{
|
|
|
- if (lis_id == -1)
|
|
|
- {
|
|
|
- lis_id = long.Parse(xgid);
|
|
|
- }
|
|
|
+ lis_ids.Add(long.Parse(xgid));
|
|
|
for (int k = 0; k < lis[i].ItemList.Count; k++)
|
|
|
{
|
|
|
InsertLisItem(lis[i].ItemList[k], lis[i].LisCheckReportId, lngPatientID, lngClinicID, date);
|
|
@@ -505,7 +503,7 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
long id = long.Parse(listpacs[0].id);
|
|
|
for (int i = 0; i < pacs.Count; i++)
|
|
|
{
|
|
|
-
|
|
|
+ id = long.Parse(listpacs[i].id);
|
|
|
foreach (var items in listpacs)
|
|
|
{
|
|
|
if (pacs[i].reportTypeCode == items.type)
|
|
@@ -518,10 +516,7 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
int res = InsertPacs(pacs[i], lngPatientID, lngClinicID, no, id);
|
|
|
if (res > 0)
|
|
|
{
|
|
|
- if (pacs_id == -1)
|
|
|
- {
|
|
|
- pacs_id = id;
|
|
|
- }
|
|
|
+ pacs_ids.Add(id);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -675,6 +670,57 @@ namespace ZLPlugin_MR.ServerImpl
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public static void CancelYzzNew(long 病人id, long 主医嘱id, int lis, int pacs)
|
|
|
+ {
|
|
|
+ string sql = @"select c.no ,wm_concat(c.id) FEE_IDS
|
|
|
+ from 病人医嘱记录 a, 病人医嘱发送 b, 门诊费用记录 c
|
|
|
+ where b.医嘱id = a.id
|
|
|
+ and c.医嘱序号 = b.医嘱id
|
|
|
+ and a.病人id = {0}
|
|
|
+ and (a.id = {1} or a.相关id = {1})
|
|
|
+ group by c.no
|
|
|
+";
|
|
|
+ sql = string.Format(sql, 病人id, 主医嘱id);
|
|
|
+ Recordset recordset = new Recordset();
|
|
|
+ Tools.QueryTable(sql, out recordset);
|
|
|
+ string json = "{\"input\":{\"operator_name\":\"\",\"operator_code\":\"\",\"operator_time\":\"\",\"del_list\":[";
|
|
|
+ while (!recordset.EOF)
|
|
|
+ {
|
|
|
+ string no = recordset.Fields["NO"].Value.ToString();
|
|
|
+ string fee_ids = recordset.Fields["FEE_IDS"].Value.ToString();
|
|
|
+ json += "{\"fee_source\":1,\"fee_bill_type\":1,\"fee_no\":\"" + no + "\",\"del_type\":1,\"serial_num\":\"\",\"exe_sta_nums\":\"\",\"fee_ids\":\""+ fee_ids +"\"},";
|
|
|
+ recordset.MoveNext();
|
|
|
+ }
|
|
|
+ json = json.Substring(0, json.Length - 1);
|
|
|
+ json += "]}}";
|
|
|
+ //原始调用过程没有作用 改用数据处理平台中转
|
|
|
+ //Tools.ExecuteStoredProc(病人id, 主医嘱id, json, lis, pacs);
|
|
|
+ int lisMessage = 0;
|
|
|
+ int pacsMessage = 0;
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 作废医嘱
|
|
|
/// </summary>
|