diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 7cd66ced2..1adcaa98f 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -17998,6 +17998,16 @@ 数据 + + + C-move 检查 数组 + + + + + PacsAE 的名字 + + 后台 工作量审核视图模型 @@ -18539,14 +18549,18 @@ - + 拉取影像 - - - + + + + + 同济医院 第三方系统 发送命令拉取影像 + + diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 83dc87dd2..2ac776fa9 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -648,40 +648,40 @@ namespace IRaCIS.Core.Application.Service //本地测试地址接口 - //var apiUrl = "http://192.168.40.88:8080/dock/userinfo"; - //var headers = new Dictionary - //{ - // { "Content-Type", "application/json" } // 根据需要添加其他头部信息 - //}; + var apiUrl = "http://192.168.40.88:8080/dock/userinfo"; + var headers = new Dictionary + { + { "Content-Type", "application/json" } // 根据需要添加其他头部信息 + }; - //var requestData = new - //{ - // token = token, - // appId = "third-hirs", - //}; + var requestData = new + { + token = token, + appId = "third-hirs", + }; - //var tjUserInfo = await RestClientAPI.PostAsync(apiUrl, requestData, headers); + var tjUserInfo = await RestClientAPI.PostAsync(apiUrl, requestData, headers); #endregion #region 测试数据 - var tjUserInfo = new TJUserInfoDto - { - Code = "200", - Msg = "操作成功", - Success = true, - Data = new TJUserInfoData - { - UserCode = "YS10138", - UserName = "胡学梅", - DeptCode = "2121", - Sex = "未知", - Birthday = "", - Title = "", - UserType = "doctor", - Roles = new List { "pm", "crc" } - } - }; + //var tjUserInfo = new TJUserInfoDto + //{ + // Code = "200", + // Msg = "操作成功", + // Success = true, + // Data = new TJUserInfoData + // { + // UserCode = "YS10138", + // UserName = "胡学梅", + // DeptCode = "2121", + // Sex = "未知", + // Birthday = "", + // Title = "", + // UserType = "doctor", + // Roles = new List { "pm", "crc" } + // } + //}; #endregion diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/SCUClientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/SCUClientViewModel.cs index 10a90bae2..93d0d2878 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/SCUClientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/SCUClientViewModel.cs @@ -61,4 +61,19 @@ namespace IRaCIS.Application.Contracts public string? ModalitiesInStudy { get; set; } } + + public class TJCmoveStudyCommand + { + public string Token { get; set; } + + /// + /// C-move 检查 数组 + /// + public List StudyInstanceUIDList { get; set; } + + /// + ///PacsAE 的名字 + /// + public string CalledAE { get; set; } + } } diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 5b898b884..03f2136f2 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -52,6 +52,7 @@ using IRaCIS.Core.Infra.EFCore.Migrations; using System.Dynamic; using System.Threading.Channels; using NPOI.HSSF.Record.Chart; +using IRaCIS.Core.Application.Helper.OtherTool; namespace IRaCIS.Application.Services @@ -68,6 +69,9 @@ namespace IRaCIS.Application.Services IRepository _SCPImageUploadRepository, IRepository _userRepository, IRepository _hIRHospitalRepository, + IRepository _dicomAEReposiotry, + IRepository _scpInstanceRepository, + IOptionsMonitor _basicSystemConfigConfig, ILogger _logger, IDistributedLockProvider _distributedLockProvider, IMapper _mapper, IUserInfo _userInfo, IWebHostEnvironment _hostEnvironment, IStringLocalizer _localizer, IFusionCache _fusionCache @@ -385,7 +389,7 @@ namespace IRaCIS.Application.Services var query = _hIRHospitalRepository.Where(t => t.IsDefault == true).ProjectTo(_mapper.ConfigurationProvider); - var hospitalInfo= await query.FirstNotNullAsync(); + var hospitalInfo = await query.FirstNotNullAsync(); var trialInfo = _trialRepository.Where(t => t.Id == trialId, ignoreQueryFilters: true).FirstOrDefault(); @@ -3308,14 +3312,8 @@ namespace IRaCIS.Application.Services /// 拉取影像 /// /// - /// - /// - /// /// - public async Task CmoveStudyList(SCUCmoveCommand inCommand, - [FromServices] IRepository _dicomAEReposiotry, - [FromServices] IRepository _scpInstanceRepository, - [FromServices] IOptionsMonitor _basicSystemConfigConfig) + public async Task CmoveStudyList(SCUCmoveCommand inCommand) { var result = new List(); @@ -3407,7 +3405,57 @@ namespace IRaCIS.Application.Services } + /// + /// 同济医院 第三方系统 发送命令拉取影像 + /// + /// + /// + [HttpPost] + [AllowAnonymous] + public async Task TjCmoveStudy(TJCmoveStudyCommand inCommand) + { + var apiUrl = "http://192.168.40.88:8080/dock/userinfo"; + var headers = new Dictionary + { + { "Content-Type", "application/json" } // 根据需要添加其他头部信息 + }; + + var requestData = new + { + token = inCommand.Token, + appId = "third-hirs", + }; + + var tjUserInfo = await RestClientAPI.PostAsync(apiUrl, requestData, headers); + + + + if (tjUserInfo != null && tjUserInfo.Data?.Roles != null && + tjUserInfo.Data.Roles.Any(role => string.Equals("PM", role, StringComparison.OrdinalIgnoreCase))) + { + var find = await _dicomAEReposiotry.FirstOrDefaultAsync(t => t.CalledAE == inCommand.CalledAE && t.PacsTypeEnum == PacsType.PacsServer); + + if (find == null) + { + return ResponseOutput.NotOk($"{inCommand.CalledAE}在系统中未配置,请联系维护人员核查"); + } + else + { + var cmoveCommand = new SCUCmoveCommand() { PacsDicomAEId = find.Id, StudyInstanceUIDList = inCommand.StudyInstanceUIDList }; + + + return await CmoveStudyList(cmoveCommand); + } + } + else + { + return ResponseOutput.NotOk("未获取到该用户信息或者该用户token 不包含PM 角色"); + + } + + + } #endregion