修改dicomAE 测试
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ed94423f32
commit
63e2ca07b5
|
@ -61,6 +61,15 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
|
|
||||||
public bool IsPACSConnect { get; set; }
|
public bool IsPACSConnect { get; set; }
|
||||||
|
|
||||||
|
public bool IsTestOK { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TestAECommand
|
||||||
|
{
|
||||||
|
public string CalledAE { get; set; } = string.Empty;
|
||||||
|
public string IP { get; set; } = string.Empty;
|
||||||
|
public int Port { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ using FellowOakDicom.Network.Client;
|
||||||
using FellowOakDicom.Network;
|
using FellowOakDicom.Network;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using DocumentFormat.OpenXml.InkML;
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -84,6 +85,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
VerifyMsg = _localizer["TrialDicomAE_RepeatCalledAE"]
|
VerifyMsg = _localizer["TrialDicomAE_RepeatCalledAE"]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var verifyExp3 = new EntityVerifyExp<TrialDicomAE>()
|
||||||
|
{
|
||||||
|
VerifyExp = u => u.TrialId == addOrEditDicomAE.TrialId,
|
||||||
|
|
||||||
|
//"AE名称不能与其他项目相同"
|
||||||
|
VerifyMsg = "该项目只允许添加一条dicom AE记录(前端对接有bug时出现)"
|
||||||
|
};
|
||||||
|
|
||||||
//var verifyExp2 = new EntityVerifyExp<TrialDicomAE>()
|
//var verifyExp2 = new EntityVerifyExp<TrialDicomAE>()
|
||||||
//{
|
//{
|
||||||
// VerifyExp = u => u.TrialId == addOrEditDicomAE.TrialId,
|
// VerifyExp = u => u.TrialId == addOrEditDicomAE.TrialId,
|
||||||
|
@ -98,7 +107,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
if (addOrEditDicomAE.IsPACSConnect)
|
if (addOrEditDicomAE.IsPACSConnect)
|
||||||
{
|
{
|
||||||
// 在此处拷贝automapper 映射
|
// 在此处拷贝automapper 映射
|
||||||
var entity = await _dicomAERepository.InsertOrUpdateAsync(addOrEditDicomAE, true, verifyExp1, verifyExp2);
|
var entity = await _dicomAERepository.InsertOrUpdateAsync(addOrEditDicomAE, true, verifyExp3, verifyExp1, verifyExp2);
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
}
|
}
|
||||||
|
@ -123,23 +132,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// 测试scp server 是否可以连接
|
/// 测试scp server 是否可以连接
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("{dicomAEId:guid}")]
|
[HttpPost]
|
||||||
public async Task<bool> TestSCPServerConnect(Guid dicomAEId)
|
public async Task<bool> TestSCPServerConnect(TestAECommand inCommand)
|
||||||
{
|
{
|
||||||
var find = await _dicomAERepository.FirstOrDefaultAsync(t => t.Id == dicomAEId);
|
|
||||||
|
|
||||||
if (find == null)
|
|
||||||
{
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
find.LatestTestTime = DateTime.Now;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var client = DicomClientFactory.Create(find.IP, find.Port, false, "test-callingAE", find.CalledAE);
|
var client = DicomClientFactory.Create(inCommand.IP, inCommand.Port, false, "test-callingAE", inCommand.CalledAE);
|
||||||
|
|
||||||
client.NegotiateAsyncOps();
|
client.NegotiateAsyncOps();
|
||||||
|
|
||||||
|
@ -156,22 +154,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
throw new TimeoutException("DICOM 请求超时。");
|
throw new TimeoutException("DICOM 请求超时。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
find.IsTestOK = true;
|
|
||||||
|
|
||||||
await _dicomAERepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
find.IsTestOK = false;
|
|
||||||
await _dicomAERepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue