pacs server 使用c-find 其他的c-echo
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
011a75714e
commit
7b456c9008
|
@ -20,13 +20,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// DicomAEService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class DicomAEService (IRepository<DicomAE> _dicomAERepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IDicomAEService
|
||||
public class DicomAEService(IRepository<DicomAE> _dicomAERepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IDicomAEService
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput< PageOutput<DicomAEView>>> GetDicomAEList(DicomAEQuery inQuery)
|
||||
public async Task<IResponseOutput<PageOutput<DicomAEView>>> GetDicomAEList(DicomAEQuery inQuery)
|
||||
{
|
||||
|
||||
var dicomAEQueryable = _dicomAERepository
|
||||
|
@ -53,7 +53,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
var verifyExp1 = new EntityVerifyExp<DicomAE>()
|
||||
{
|
||||
VerifyExp = u => u.IP == addOrEditDicomAE.IP && u.Port == addOrEditDicomAE.Port && u.PacsTypeEnum==addOrEditDicomAE.PacsTypeEnum,
|
||||
VerifyExp = u => u.IP == addOrEditDicomAE.IP && u.Port == addOrEditDicomAE.Port && u.PacsTypeEnum == addOrEditDicomAE.PacsTypeEnum,
|
||||
|
||||
VerifyMsg = _localizer["DicomAE_RepeatIPAndPort"] //"不允许添加相同的IP和端口的记录"
|
||||
};
|
||||
|
@ -106,39 +106,66 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
client.NegotiateAsyncOps();
|
||||
|
||||
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(5);
|
||||
|
||||
var request = new DicomCFindRequest(DicomQueryRetrieveLevel.Study)
|
||||
if (find.PacsTypeEnum == PacsType.PacsServer)
|
||||
{
|
||||
OnResponseReceived = (req, response) =>
|
||||
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(5);
|
||||
|
||||
var request = new DicomCFindRequest(DicomQueryRetrieveLevel.Study)
|
||||
{
|
||||
//Console.WriteLine($"C-Find Response: {response.Status}");
|
||||
|
||||
if (response.Status == DicomStatus.Success)
|
||||
OnResponseReceived = (req, response) =>
|
||||
{
|
||||
find.IsTestOK = true;
|
||||
Console.WriteLine($"C-Find Response: {response.Status}");
|
||||
|
||||
if (response.Status == DicomStatus.Success)
|
||||
{
|
||||
find.IsTestOK = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
find.IsTestOK = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
};
|
||||
|
||||
// 设置你要查询的条件(比如 PatientID)
|
||||
request.Dataset.Add(DicomTag.PatientID, "TEST123");
|
||||
|
||||
await client.AddRequestAsync(request);
|
||||
}
|
||||
else
|
||||
{
|
||||
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(3);
|
||||
|
||||
var request = new DicomCEchoRequest
|
||||
{
|
||||
OnResponseReceived = (req, response) =>
|
||||
{
|
||||
find.IsTestOK = false;
|
||||
Console.WriteLine($"C-ECHO Response: {response.Status}");
|
||||
|
||||
if (response.Status == DicomStatus.Success)
|
||||
{
|
||||
find.IsTestOK = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
find.IsTestOK = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// 设置你要查询的条件(比如 PatientID)
|
||||
request.Dataset.Add(DicomTag.PatientID, "TEST123");
|
||||
await client.AddRequestAsync(request);
|
||||
}
|
||||
|
||||
await client.AddRequestAsync(request);
|
||||
|
||||
|
||||
await client.SendAsync();
|
||||
|
||||
await client.SendAsync();
|
||||
|
||||
|
||||
await _dicomAERepository.SaveChangesAsync();
|
||||
|
||||
|
||||
|
||||
return find.IsTestOK;
|
||||
return find.IsTestOK;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue