From 7eaaaf700a8b38cdaf57d1122ee9955c0b904c5e Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Tue, 21 Oct 2025 10:59:06 +0800
Subject: [PATCH] 1021
---
.../PacsBusiness/GetCheckPacsInfoDto.cs | 14 +++
.../PacsBusiness/GetCheckPacsInfoInputDto.cs | 20 ++++
.../GetPatientRegisterPacsCheckDto.cs | 4 +
...ateCheckStatusByRegisterCheckIdInputDto.cs | 18 +++-
.../RegisterChecks/UpdateCheckResultDto.cs | 5 +
.../PacsBusiness/PacsBusinessAppService.cs | 93 ++++++++++++++++---
.../RegisterChecks/RegisterCheckAppService.cs | 2 +-
.../RegisterChecks/RegisterCheckManager.cs | 23 +++--
8 files changed, 154 insertions(+), 25 deletions(-)
create mode 100644 src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetCheckPacsInfoDto.cs
create mode 100644 src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetCheckPacsInfoInputDto.cs
diff --git a/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetCheckPacsInfoDto.cs b/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetCheckPacsInfoDto.cs
new file mode 100644
index 0000000..75eff9b
--- /dev/null
+++ b/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetCheckPacsInfoDto.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Pacs.PacsBusiness
+{
+ public class GetCheckPacsInfoDto
+ {
+ ///
+ /// 是否正确
+ ///
+ public char IsPass { get; set; }
+ }
+}
diff --git a/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetCheckPacsInfoInputDto.cs b/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetCheckPacsInfoInputDto.cs
new file mode 100644
index 0000000..e6e6ca9
--- /dev/null
+++ b/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetCheckPacsInfoInputDto.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Pacs.PacsBusiness
+{
+ public class GetCheckPacsInfoInputDto
+ {
+
+ ///
+ /// 姓名
+ ///
+ public string PatientName { get; set; }
+
+ ///
+ /// 条码号
+ ///
+ public string CheckRequestNo { get; set; }
+ }
+}
diff --git a/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckDto.cs b/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckDto.cs
index 140a6b6..19ec166 100644
--- a/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckDto.cs
+++ b/src/Shentun.Pacs.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckDto.cs
@@ -96,5 +96,9 @@ namespace Shentun.Pacs.PacsBusiness
///
public string AuditorUserName { get; set; }
+ ///
+ /// 审核时间
+ ///
+ public string AuditTime { get; set; }
}
}
diff --git a/src/Shentun.Pacs.Application.Contracts/PacsBusiness/UpdateCheckStatusByRegisterCheckIdInputDto.cs b/src/Shentun.Pacs.Application.Contracts/PacsBusiness/UpdateCheckStatusByRegisterCheckIdInputDto.cs
index f5b976e..3cf4d12 100644
--- a/src/Shentun.Pacs.Application.Contracts/PacsBusiness/UpdateCheckStatusByRegisterCheckIdInputDto.cs
+++ b/src/Shentun.Pacs.Application.Contracts/PacsBusiness/UpdateCheckStatusByRegisterCheckIdInputDto.cs
@@ -28,13 +28,27 @@ namespace Shentun.Pacs.PacsBusiness
///
- /// 审核医生 传空字符串 清空 并清理时间
+ /// 审核医生 传空字符串 清空
///
public string AuditorUserId { get; set; }
+
///
- /// 检查医生 传空字符串 清空 并清理时间
+ /// 审核时间 传空字符串 清空
+ ///
+ public string AuditTime { get; set; }
+
+ ///
+ /// 检查医生 传空字符串 清空
///
public string CheckDoctorId { get; set; }
+
+
+ ///
+ /// 检查医生 传空字符串 清空
+ ///
+ public string CheckDate { get; set; }
+
+
}
}
diff --git a/src/Shentun.Pacs.Application.Contracts/RegisterChecks/UpdateCheckResultDto.cs b/src/Shentun.Pacs.Application.Contracts/RegisterChecks/UpdateCheckResultDto.cs
index 6668771..c0be3be 100644
--- a/src/Shentun.Pacs.Application.Contracts/RegisterChecks/UpdateCheckResultDto.cs
+++ b/src/Shentun.Pacs.Application.Contracts/RegisterChecks/UpdateCheckResultDto.cs
@@ -54,6 +54,11 @@ namespace Shentun.Pacs.RegisterChecks
///
public string Remark { get; set; }
+ ///
+ /// 检查医生是否支持修改 Y=一直修改 N=只第一次保存,检查医生存在后不修改
+ ///
+ public char IsCheckDoctorUpdate { get; set; } = 'Y';
+
}
public class UpdateRegisterCheckItemDetail
diff --git a/src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs b/src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs
index 4e72948..b6dd817 100644
--- a/src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs
+++ b/src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
+using NPOI.POIFS.Properties;
using NPOI.POIFS.Storage;
using NPOI.SS.Formula.Functions;
using NPOI.Util;
@@ -13,6 +14,7 @@ using Shentun.Pacs.Devices;
using Shentun.Pacs.Enums;
using Shentun.Pacs.Migrations;
using Shentun.Pacs.Models;
+using Shentun.Pacs.OrganizationUnits;
using Shentun.Pacs.PatientRegisters;
using Shentun.Pacs.Patients;
using Shentun.Pacs.PrintReports;
@@ -84,6 +86,7 @@ namespace Shentun.Pacs.PacsBusiness
private readonly IRepository _registerCheckSummaryRepository;
private readonly SysParmValueManager _sysParmValueManager;
private readonly IRepository- _itemRepository;
+ private readonly PeisOrganizationUnitManager _peisOrganizationUnitManager;
private readonly SqlSugarClient oldDb;
@@ -121,7 +124,8 @@ namespace Shentun.Pacs.PacsBusiness
UnitOfWorkManager unitOfWorkManager,
IRepository registerCheckSummaryRepository,
SysParmValueManager sysParmValueManager,
- IRepository
- itemRepository)
+ IRepository
- itemRepository,
+ PeisOrganizationUnitManager peisOrganizationUnitManager)
{
_configuration = configuration;
_registerCheckRepository = registerCheckRepository;
@@ -156,7 +160,7 @@ namespace Shentun.Pacs.PacsBusiness
_registerCheckSummaryRepository = registerCheckSummaryRepository;
_sysParmValueManager = sysParmValueManager;
_itemRepository = itemRepository;
-
+ _peisOrganizationUnitManager = peisOrganizationUnitManager;
oldDb = new SqlSugarClient(new ConnectionConfig()
{
@@ -165,8 +169,6 @@ namespace Shentun.Pacs.PacsBusiness
IsAutoCloseConnection = true
});
-
-
}
@@ -518,7 +520,8 @@ namespace Shentun.Pacs.PacsBusiness
idNo = patient.IdNo,
age = patientRegister.Age,
mobileTelephone = patient.MobileTelephone,
- auditorUserName = _cacheService.GetSurnameAsync(registerCheck.AuditorUserId).GetAwaiter().GetResult()
+ auditorUserName = _cacheService.GetSurnameAsync(registerCheck.AuditorUserId).GetAwaiter().GetResult(),
+ auditTime = registerCheck.AuditTime
};
if (!string.IsNullOrWhiteSpace(input.PatientName))
@@ -683,7 +686,8 @@ namespace Shentun.Pacs.PacsBusiness
IdNo = fisrtItem.idNo,
OldPatientNo = fisrtItem.oldPatientNo,
CustomerOrgName = fisrtItem.customerOrgName,
- MobileTelephone = fisrtItem.mobileTelephone
+ MobileTelephone = fisrtItem.mobileTelephone,
+ AuditTime = DataHelper.ConversionDateToString(fisrtItem.auditTime)
});
}
@@ -1290,7 +1294,7 @@ namespace Shentun.Pacs.PacsBusiness
///
- /// 导入老系统人员、项目数据,并自动加入worklist
+ /// 导入老系统人员、项目数据,并自动加入worklist 老红豚
///
///
///
@@ -1340,7 +1344,15 @@ namespace Shentun.Pacs.PacsBusiness
string oldDeviceTypeId = deviceTypeCodeValues.First();
-
+ Guid medicalCenterId = Guid.Empty;
+ if (_currentUser.Id != null && _currentUser.Id != Guid.Empty)
+ {
+ var peisId = await _peisOrganizationUnitManager.GetPeisIdAsync(_currentUser.Id.Value);
+ if (peisId != null)
+ {
+ medicalCenterId = peisId.Value;
+ }
+ }
//string connectionString = _configuration.GetValue("OldPeis:ConnectionStrings", "");
//SqlSugarClient oldDb = new SqlSugarClient(new ConnectionConfig()
//{
@@ -1536,7 +1548,7 @@ namespace Shentun.Pacs.PacsBusiness
IsUpload = 'N',
IsUploadAppoint = 'N',
MaritalStatusId = maritalStatusId,
- MedicalCenterId = Guid.Empty,
+ MedicalCenterId = medicalCenterId,
MedicalTimes = 0,
PatientId = patientEnt.Id,
PatientName = patientName,
@@ -1615,7 +1627,8 @@ namespace Shentun.Pacs.PacsBusiness
AsbitemId = asbitemId,
ChargePrice = oldAsbitemPrice,
StandardPrice = oldAsbitemStandardPrice,
- IsCharge = Convert.ToChar(row["charge_flag"].ToString()),
+ //IsCharge = Convert.ToChar(row["charge_flag"].ToString()),
+ IsCharge = 'N',
OldAsbitemId = oldAsbitemId,
OldPatientRegisterId = row["patient_register_id"].ToString(),
PatientRegisterId = tempPatientRegisterId,
@@ -2095,23 +2108,37 @@ namespace Shentun.Pacs.PacsBusiness
if (string.IsNullOrWhiteSpace(input.AuditorUserId))
{
registerCheckFirst.AuditorUserId = null;
- registerCheckFirst.AuditTime = null;
}
else
{
registerCheckFirst.AuditorUserId = Guid.Parse(input.AuditorUserId);
- registerCheckFirst.AuditTime = DateTime.Now;
+ }
+
+ if (string.IsNullOrWhiteSpace(input.AuditTime))
+ {
+ registerCheckFirst.AuditTime = null;
+ }
+ else
+ {
+ registerCheckFirst.AuditTime = DateTime.Parse(input.AuditTime);
}
if (string.IsNullOrWhiteSpace(input.CheckDoctorId))
{
registerCheckFirst.CheckDoctorId = null;
- registerCheckFirst.CheckDate = null;
}
else
{
registerCheckFirst.CheckDoctorId = input.CheckDoctorId;
- registerCheckFirst.CheckDate = DateTime.Now;
+ }
+
+ if (string.IsNullOrWhiteSpace(input.CheckDate))
+ {
+ registerCheckFirst.CheckDate = null;
+ }
+ else
+ {
+ registerCheckFirst.CheckDate = DateTime.Parse(input.CheckDate);
}
await _registerCheckRepository.UpdateAsync(registerCheckFirst);
@@ -2353,6 +2380,44 @@ namespace Shentun.Pacs.PacsBusiness
#endregion
+ #region 云胶片信息校验
+ ///
+ /// 校验身份 Y=通过 N=未通过
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("api/app/PacsBusiness/GetCheckPacsInfo")]
+ public async Task GetCheckPacsInfoAsync(GetCheckPacsInfoInputDto input)
+ {
+ GetCheckPacsInfoDto entDto = new GetCheckPacsInfoDto
+ {
+ IsPass = 'N'
+ };
+
+ if (string.IsNullOrWhiteSpace(input.PatientName))
+ {
+ throw new UserFriendlyException("姓名不能为空");
+ }
+
+ if (string.IsNullOrWhiteSpace(input.CheckRequestNo))
+ {
+ throw new UserFriendlyException("条码号不能为空");
+ }
+
+ string oldSql = $"select * from patient_register where barcode_no='{input.CheckRequestNo}' and [name]='{input.PatientName}'";
+
+ var patientList = await oldDb.Ado.GetDataTableAsync(oldSql);
+
+ if (patientList.Rows.Count == 1)
+ {
+ entDto.IsPass = 'Y';
+ }
+
+ return entDto;
+ }
+
+ #endregion
///
/// 转换老系统性别
diff --git a/src/Shentun.Pacs.Application/RegisterChecks/RegisterCheckAppService.cs b/src/Shentun.Pacs.Application/RegisterChecks/RegisterCheckAppService.cs
index eb4f5e1..0fe585f 100644
--- a/src/Shentun.Pacs.Application/RegisterChecks/RegisterCheckAppService.cs
+++ b/src/Shentun.Pacs.Application/RegisterChecks/RegisterCheckAppService.cs
@@ -387,7 +387,7 @@ namespace Shentun.Pacs.RegisterChecks
{
input.CheckDoctorId = CurrentUser.Id.ToString();
}
- _registerCheckManager.UpdateCheckDoctorAndDateAsync(patientRegister, registerCheck, input.CheckDoctorId, input.CheckDate, input.ExecOrganizationUnitId);
+ _registerCheckManager.UpdateCheckDoctorAndDateAsync(patientRegister, registerCheck, input.CheckDoctorId, input.CheckDate, input.ExecOrganizationUnitId, input.IsCheckDoctorUpdate);
if (!string.IsNullOrWhiteSpace(input.AuditorName))
registerCheck.AuditorName = input.AuditorName;
if (!string.IsNullOrWhiteSpace(input.LisSampleNo))
diff --git a/src/Shentun.Pacs.Domain/RegisterChecks/RegisterCheckManager.cs b/src/Shentun.Pacs.Domain/RegisterChecks/RegisterCheckManager.cs
index c9e4d86..d7af962 100644
--- a/src/Shentun.Pacs.Domain/RegisterChecks/RegisterCheckManager.cs
+++ b/src/Shentun.Pacs.Domain/RegisterChecks/RegisterCheckManager.cs
@@ -180,7 +180,8 @@ namespace Shentun.Pacs.RegisterChecks
RegisterCheck entity,
string checkDoctorId,
DateTime? checkDate,
- Guid? execOrganizationUnitId
+ Guid? execOrganizationUnitId,
+ char isCheckDoctorUpdate
)
{
if (entity == null)
@@ -199,16 +200,22 @@ namespace Shentun.Pacs.RegisterChecks
{
throw new UserFriendlyException("检查项目已加锁不允许修改");
}
- if (checkDate == null)
- entity.CheckDate = DateTime.Now;
- else
- entity.CheckDate = checkDate;
- if (string.IsNullOrWhiteSpace(checkDoctorId))
+ if (isCheckDoctorUpdate == 'Y' || string.IsNullOrWhiteSpace(entity.CheckDoctorId))
{
- checkDoctorId = _currentUser.Id.ToString();
+ if (checkDate == null)
+ entity.CheckDate = DateTime.Now;
+ else
+ entity.CheckDate = checkDate;
+
+ if (string.IsNullOrWhiteSpace(checkDoctorId))
+ {
+ checkDoctorId = _currentUser.Id.ToString();
+ }
+ entity.CheckDoctorId = checkDoctorId;
}
- entity.CheckDoctorId = checkDoctorId;
+
+
entity.CompleteFlag = RegisterCheckCompleteFlag.Checked;
if (execOrganizationUnitId != null && execOrganizationUnitId != Guid.Empty)
{