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
|
/// DicomAEService
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Common")]
|
[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]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput< PageOutput<DicomAEView>>> GetDicomAEList(DicomAEQuery inQuery)
|
public async Task<IResponseOutput<PageOutput<DicomAEView>>> GetDicomAEList(DicomAEQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
var dicomAEQueryable = _dicomAERepository
|
var dicomAEQueryable = _dicomAERepository
|
||||||
|
@ -53,7 +53,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
var verifyExp1 = new EntityVerifyExp<DicomAE>()
|
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和端口的记录"
|
VerifyMsg = _localizer["DicomAE_RepeatIPAndPort"] //"不允许添加相同的IP和端口的记录"
|
||||||
};
|
};
|
||||||
|
@ -106,32 +106,59 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
client.NegotiateAsyncOps();
|
client.NegotiateAsyncOps();
|
||||||
|
|
||||||
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(5);
|
if (find.PacsTypeEnum == PacsType.PacsServer)
|
||||||
|
|
||||||
var request = new DicomCFindRequest(DicomQueryRetrieveLevel.Study)
|
|
||||||
{
|
{
|
||||||
OnResponseReceived = (req, response) =>
|
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(5);
|
||||||
|
|
||||||
|
var request = new DicomCFindRequest(DicomQueryRetrieveLevel.Study)
|
||||||
{
|
{
|
||||||
//Console.WriteLine($"C-Find Response: {response.Status}");
|
OnResponseReceived = (req, response) =>
|
||||||
|
|
||||||
if (response.Status == DicomStatus.Success)
|
|
||||||
{
|
{
|
||||||
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)
|
await client.AddRequestAsync(request);
|
||||||
request.Dataset.Add(DicomTag.PatientID, "TEST123");
|
}
|
||||||
|
|
||||||
await client.AddRequestAsync(request);
|
|
||||||
|
|
||||||
|
|
||||||
await client.SendAsync();
|
|
||||||
|
await client.SendAsync();
|
||||||
|
|
||||||
|
|
||||||
await _dicomAERepository.SaveChangesAsync();
|
await _dicomAERepository.SaveChangesAsync();
|
||||||
|
|
Loading…
Reference in New Issue