修改增加接口
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
1104c1481e
commit
0a368c0607
|
@ -18260,6 +18260,13 @@
|
|||
<param name="_logger"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.PatientService.CMoveVerify(IRaCIS.Application.Contracts.SCUCmoveCommand)">
|
||||
<summary>
|
||||
批量验证Cmove 检查在系统存在与否
|
||||
</summary>
|
||||
<param name="inCommand"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.PatientService.CmoveStudyList(IRaCIS.Application.Contracts.SCUCmoveCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomAE})">
|
||||
<summary>
|
||||
拉取影像
|
||||
|
|
|
@ -100,7 +100,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode));
|
||||
|
||||
|
||||
CreateMap<InternationalizationAddOrEdit, IRCGlobalInfoDTO>();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public string? ModalitiesInStudy { get; set; }
|
||||
|
||||
|
||||
public string? AccessionNumber { get; set; }
|
||||
|
||||
public string? StudyDate { get; set; }
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace IRaCIS.Application.Contracts
|
|||
[NotDefault]
|
||||
public Guid PacsDicomAEId { get; set; }
|
||||
|
||||
public List<string> StudyIDList { get; set; }
|
||||
public List<string> StudyInstanceUIDList { get; set; }
|
||||
}
|
||||
|
||||
public class SCUStudyView : SCUBasicInfo
|
||||
|
|
|
@ -47,6 +47,7 @@ using FellowOakDicom.Network;
|
|||
using Microsoft.Extensions.Logging;
|
||||
using DocumentFormat.OpenXml.Wordprocessing;
|
||||
using System;
|
||||
using Amazon.Runtime.Internal.Transform;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -2873,6 +2874,7 @@ namespace IRaCIS.Application.Services
|
|||
request.Dataset.AddOrUpdate(DicomTag.PatientBirthDate, inQuery.PatientBirthDate.IsNullOrEmpty() ? "" : inQuery.PatientBirthDate);
|
||||
//检查号 设备类型
|
||||
request.Dataset.AddOrUpdate(DicomTag.StudyID, inQuery.StudyID.IsNullOrEmpty() ? "" : inQuery.StudyID);
|
||||
request.Dataset.AddOrUpdate(DicomTag.AccessionNumber, inQuery.StudyID.IsNullOrEmpty() ? "" : inQuery.AccessionNumber);
|
||||
|
||||
request.Dataset.AddOrUpdate(DicomTag.ModalitiesInStudy, inQuery.ModalitiesInStudy.IsNullOrEmpty() ? "" : inQuery.ModalitiesInStudy);
|
||||
|
||||
|
@ -2904,6 +2906,9 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取 检查列表
|
||||
/// </summary>
|
||||
|
@ -2950,6 +2955,7 @@ namespace IRaCIS.Application.Services
|
|||
PatientSex = response.Dataset?.GetSingleValueOrDefault<string>(DicomTag.PatientSex, ""),
|
||||
PatientBirthDate = response.Dataset?.GetSingleValueOrDefault<string>(DicomTag.PatientBirthDate, ""),
|
||||
StudyID = response.Dataset?.GetSingleValueOrDefault<string>(DicomTag.StudyID, ""),
|
||||
AccessionNumber = response.Dataset?.GetSingleValueOrDefault<string>(DicomTag.AccessionNumber, ""),
|
||||
ModalitiesInStudy = response.Dataset?.GetSingleValueOrDefault<string>(DicomTag.ModalitiesInStudy, ""),
|
||||
StudyDate = datePart.ToString(),
|
||||
StudyTime = timePart.ToString("HH:mm:ss"),
|
||||
|
@ -2968,6 +2974,26 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量验证Cmove 检查在系统存在与否
|
||||
/// </summary>
|
||||
/// <param name="inCommand"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Dictionary<string, bool>> CMoveVerify(SCUCmoveCommand inCommand)
|
||||
{
|
||||
var existStudyIdList = _studyRepository.Where(t => inCommand.StudyInstanceUIDList.Contains(t.StudyInstanceUid)).Select(t => t.StudyInstanceUid).ToList();
|
||||
|
||||
var dic = new Dictionary<string, bool>();
|
||||
foreach (var item in inCommand.StudyInstanceUIDList)
|
||||
{
|
||||
dic.Add(item, existStudyIdList.Any(t => t == item));
|
||||
}
|
||||
|
||||
return dic;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 拉取影像
|
||||
/// </summary>
|
||||
|
@ -2976,14 +3002,6 @@ namespace IRaCIS.Application.Services
|
|||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> CmoveStudyList(SCUCmoveCommand inCommand, [FromServices] IRepository<DicomAE> _dicomAEReposiotry)
|
||||
{
|
||||
var existStudyIdList = _studyRepository.Where(t => inCommand.StudyIDList.Contains(t.StudyId)).Select(t => t.StudyId).ToList();
|
||||
|
||||
var needMoveList = inCommand.StudyIDList.Except(existStudyIdList).ToList();
|
||||
|
||||
if (needMoveList.Count == 0)
|
||||
{
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
var result = new List<SCUStudyView>();
|
||||
|
||||
|
@ -2993,24 +3011,30 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (hirServer == null)
|
||||
{
|
||||
return ResponseOutput.NotOk("未找到服务端AE配置,请核查后再拉取");
|
||||
//"未找到服务端AE配置,请核查后再拉取"
|
||||
return ResponseOutput.NotOk(_localizer["Patient_NoPacsAE"]);
|
||||
}
|
||||
|
||||
if (find != null)
|
||||
{
|
||||
|
||||
var client = DicomClientFactory.Create(find.IP, find.Port, false, "HIRSCUAE", find.CalledAE);
|
||||
client.NegotiateAsyncOps();
|
||||
|
||||
var cmoveRequestList = new List<DicomCMoveRequest>();
|
||||
|
||||
foreach (var item in inCommand.StudyIDList)
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
cmoveRequestList.Add(new DicomCMoveRequest(hirServer.CalledAE, item));
|
||||
}
|
||||
|
||||
await client.AddRequestsAsync(cmoveRequestList);
|
||||
await client.SendAsync();
|
||||
var client = DicomClientFactory.Create(find.IP, find.Port, false, "HIRSCUAE", find.CalledAE);
|
||||
client.NegotiateAsyncOps();
|
||||
|
||||
var cmoveRequestList = new List<DicomCMoveRequest>();
|
||||
|
||||
foreach (var item in inCommand.StudyInstanceUIDList)
|
||||
{
|
||||
cmoveRequestList.Add(new DicomCMoveRequest(hirServer.CalledAE, item));
|
||||
}
|
||||
|
||||
await client.AddRequestsAsync(cmoveRequestList);
|
||||
await client.SendAsync();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
|
Loading…
Reference in New Issue