diff --git a/src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs b/src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs index b983eac..77f69a9 100644 --- a/src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs +++ b/src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs @@ -2082,7 +2082,8 @@ namespace Shentun.Pacs.PacsBusiness select new { oldPatientNo = patientRegister.OldPatientNo, - asbitemId = registerCheckAsbitem.AsbitemId + oldAsbitemId = registerCheckAsbitem.OldAsbitemId, + oldPatientRegisterId = registerCheckAsbitem.OldPatientRegisterId }).ToList(); if (!paraQuery.Any()) @@ -2090,14 +2091,20 @@ namespace Shentun.Pacs.PacsBusiness throw new UserFriendlyException("检查id未找到数据"); } - var asbitemId = paraQuery.FirstOrDefault().asbitemId; + var oldAsbitemId = paraQuery.FirstOrDefault().oldAsbitemId; var oldPatientNo = paraQuery.FirstOrDefault().oldPatientNo; + var oldPatientRegisterId = paraQuery.FirstOrDefault().oldPatientRegisterId; if (string.IsNullOrWhiteSpace(oldPatientNo)) { throw new UserFriendlyException("当前记录未存体检档案号,无法查询"); } + if (string.IsNullOrWhiteSpace(oldPatientRegisterId)) + { + throw new UserFriendlyException("当前记录未存体检人员Id,无法查询"); + } + string oldSql = "select b.check_date,b.summary,d.item_name,d.display_order,c.result,e.user_name,a.barcode_no,a.patient_register_id," + @@ -2106,7 +2113,7 @@ namespace Shentun.Pacs.PacsBusiness " left join register_item as c on b.asbitem_id=c.asbitem_id and a.patient_register_id=c.patient_register_id " + " left join item as d on c.item_id=d.item_id " + " left join users as e on b.check_doctor=e.user_id " + - $" where a.patient_id={oldPatientNo} and b.asbitem_id={asbitemId}"; + $" where a.patient_id={oldPatientNo} and b.asbitem_id={oldAsbitemId} and a.patient_register_id!={oldPatientRegisterId} "; var oldPeisCheckResultList = oldDb.Ado.SqlQuery(oldSql); diff --git a/src/Shentun.Pacs.HttpApi.Host/appsettings.json b/src/Shentun.Pacs.HttpApi.Host/appsettings.json index 81a65a1..7df7369 100644 --- a/src/Shentun.Pacs.HttpApi.Host/appsettings.json +++ b/src/Shentun.Pacs.HttpApi.Host/appsettings.json @@ -63,7 +63,7 @@ "BaseApiUrl": "http://192.168.2.74:8042" }, "OldPeis": { - "ConnectionStrings": "server=192.168.0.3;uid=sa;pwd=;database=reddolphin;Encrypt=false;", + "ConnectionStrings": "server=140.143.162.39;uid=sa;pwd=shentun;database=mypeis;Encrypt=false;", "AsbitemColumnReferenId": "", "ItemColumnReferenId": "", "DeviceTypeColumnReferenId": "",