修改dicomAE 测试使用c-find,同时在c-find前不进行测试

Test_HIR_Net8
hang 2025-07-17 14:20:47 +08:00
parent 7c7ce6632a
commit 38f408d1de
3 changed files with 18 additions and 11 deletions

View File

@ -279,7 +279,7 @@ namespace IRaCIS.Core.Application.Service
[UnitOfWork] [UnitOfWork]
public async Task<IResponseOutput> ResetPassword(Guid userId) public async Task<IResponseOutput> ResetPassword(Guid userId)
{ {
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital,async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7)); var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
//var pwd = IRCEmailPasswordHelper.GenerateRandomPassword(10); //var pwd = IRCEmailPasswordHelper.GenerateRandomPassword(10);
@ -363,7 +363,7 @@ namespace IRaCIS.Core.Application.Service
await VerifyUserPwdAsync(userId, newPwd); await VerifyUserPwdAsync(userId, newPwd);
await _userRepository.UpdatePartialFromQueryAsync(t => t.Id == userId, u => new User() await _userRepository.UpdatePartialFromQueryAsync(t => t.Id == userId, u => new User()
{ {
Password = newPwd, Password = newPwd,
IsFirstAdd = false IsFirstAdd = false
@ -433,10 +433,13 @@ namespace IRaCIS.Core.Application.Service
[UnitOfWork] [UnitOfWork]
public async Task<IResponseOutput<UserAddedReturnDTO>> AddUser(UserCommand userAddModel) public async Task<IResponseOutput<UserAddedReturnDTO>> AddUser(UserCommand userAddModel)
{ {
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7)); var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
if (userAddModel.UserName.IsNotNullOrEmpty())
{
await VerifyUserNameAsync(null, userAddModel.UserName);
await VerifyUserNameAsync(null, userAddModel.UserName); }
await VerifyUserEmailAsync(null, userAddModel.UserTypeId, userAddModel.EMail); await VerifyUserEmailAsync(null, userAddModel.UserTypeId, userAddModel.EMail);

View File

@ -13,6 +13,7 @@ using FellowOakDicom.Network;
using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure;
using FellowOakDicom;
namespace IRaCIS.Core.Application.Service namespace IRaCIS.Core.Application.Service
{ {
/// <summary> /// <summary>
@ -105,13 +106,13 @@ namespace IRaCIS.Core.Application.Service
client.NegotiateAsyncOps(); client.NegotiateAsyncOps();
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(3); client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(5);
var request = new DicomCEchoRequest var request = new DicomCFindRequest(DicomQueryRetrieveLevel.Study)
{ {
OnResponseReceived = (req, response) => OnResponseReceived = (req, response) =>
{ {
Console.WriteLine($"C-ECHO Response: {response.Status}"); //Console.WriteLine($"C-Find Response: {response.Status}");
if (response.Status == DicomStatus.Success) if (response.Status == DicomStatus.Success)
{ {
@ -124,6 +125,9 @@ namespace IRaCIS.Core.Application.Service
} }
}; };
// 设置你要查询的条件(比如 PatientID
request.Dataset.Add(DicomTag.PatientID, "TEST123");
await client.AddRequestAsync(request); await client.AddRequestAsync(request);

View File

@ -3043,10 +3043,10 @@ namespace IRaCIS.Application.Services
if (find != null) if (find != null)
{ {
//测试失败 //测试失败
if (!CEchoTest(find, hirClient.CalledAE)) //if (!CEchoTest(find, hirClient.CalledAE))
{ //{
throw new BusinessValidationFailedException(_localizer["Patient_PacsAENotOnline"]); // throw new BusinessValidationFailedException(_localizer["Patient_PacsAENotOnline"]);
} //}
var @lock = _distributedLockProvider.CreateLock($"CFind"); var @lock = _distributedLockProvider.CreateLock($"CFind");