配置从数据库取,同时返回控制开关
continuous-integration/drone/push Build is passing Details

Test_HIR_Net8
hang 2025-10-30 11:18:06 +08:00
parent 3328c18279
commit 46ab1fc7bc
8 changed files with 38 additions and 33 deletions

View File

@ -36,9 +36,6 @@ namespace IRaCIS.Core.SCP.Service
{
public bool IsSupportThirdService { get; set; }
public List<ThirdDestinationAE> ThirdDestinationAEList { get; set; }
public List<string> CalledAEList { get; set; }
public string ServerPort { get; set; }
@ -77,6 +74,8 @@ namespace IRaCIS.Core.SCP.Service
private bool _isCurrentThirdForward = false;
private List<ThirdDestinationAE> ThirdDestinationAEList { get; set; }
private static readonly DicomTransferSyntax[] _acceptedTransferSyntaxes = new DicomTransferSyntax[]
{
@ -132,8 +131,11 @@ namespace IRaCIS.Core.SCP.Service
var _dicomAERepository = _serviceProvider.GetService<IRepository<DicomAE>>();
var aeList = _dicomAERepository/*.Where(t => t.PacsTypeEnum == PacsType.PacsServer)*/.Select(t => t.CalledAE).ToList();
ThirdDestinationAEList = _dicomAERepository.Where(t => t.PacsTypeEnum == PacsType.Destination).Select(t => new ThirdDestinationAE() { IP = t.IP, Port = t.Port, Name = t.CalledAE }).ToList();
var aeList = _dicomAERepository/*.Where(t => t.PacsTypeEnum == PacsType.PacsServer)*/.Select(t => t.CalledAE).ToList();
var list = _hospitalGroupRepository.Where(t => t.IsEnable).ToList();
@ -330,7 +332,7 @@ namespace IRaCIS.Core.SCP.Service
var cmoveInfo = _cmoveStudyRepository.Where(t => t.StudyInstanceUIDList.Any(c => c == studyInstanceUid)).OrderByDescending(t => t.CreateTime).FirstOrDefault();
//确定是第三方请求
if (cmoveInfo != null && DicomSCPServiceConfig.ThirdDestinationAEList.Any(t => t.Name == cmoveInfo.DestinationAE))
if (cmoveInfo != null && ThirdDestinationAEList.Any(t => t.Name == cmoveInfo.DestinationAE))
{
_isCurrentThirdForward = true;
@ -339,7 +341,7 @@ namespace IRaCIS.Core.SCP.Service
try
{
var findDestination = DicomSCPServiceConfig.ThirdDestinationAEList.FirstOrDefault(t => t.Name == cmoveInfo.DestinationAE);
var findDestination = ThirdDestinationAEList.FirstOrDefault(t => t.Name == cmoveInfo.DestinationAE);
var forwardRequest = new DicomCStoreRequest(request.File.Clone());

View File

@ -25,19 +25,6 @@
},
"DicomSCPServiceConfig": {
"IsSupportThirdService": true,
"ThirdDestinationAEList": [
{
"Name": "LYAE",
"IP": "192.168.3.194",
"Port": "6000"
},
{
"Name": "HIRLAE",
"IP": "192.168.3.194",
"Port": "6000"
}
],
"CalledAEList": [
"HIRAE",
"STORESCP"

View File

@ -3,6 +3,7 @@ using DocumentFormat.OpenXml.Bibliography;
using FellowOakDicom;
using FellowOakDicom.Network;
using FellowOakDicom.Network.Client;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Infrastructure.Extention;
@ -20,18 +21,7 @@ using System.Threading.Tasks;
namespace IRaCIS.Core.API.HostService
{
public class DicomSCPServiceOption
{
public bool IsSupportThirdService { get; set; }
public string ThirdSearchPacsAE { get; set; }
public string ThirdCallningAE { get; set; }
public List<string> CalledAEList { get; set; }
public string ServerPort { get; set; }
}
public class DicomSCPService : DicomService, IDicomServiceProvider, IDicomCFindProvider, IDicomCEchoProvider, IDicomCMoveProvider
{

View File

@ -28,6 +28,7 @@ using System.Reflection;
using System.Runtime.InteropServices;
using FellowOakDicom.Imaging.NativeCodec;
using FellowOakDicom.Imaging;
using IRaCIS.Core.Application.Contracts;
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);

View File

@ -13857,7 +13857,7 @@
DicomAEService
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Service.DicomAEService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomAE},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
<member name="M:IRaCIS.Core.Application.Service.DicomAEService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomAE},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Application.Contracts.DicomSCPServiceOption})">
<summary>
DicomAEService
</summary>

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Contracts
{
public class DicomSCPServiceOption
{
public bool IsSupportThirdService { get; set; }
public string ThirdSearchPacsAE { get; set; }
public string ThirdCallningAE { get; set; }
public List<string> CalledAEList { get; set; }
public string ServerPort { get; set; }
}
}

View File

@ -14,13 +14,15 @@ using IRaCIS.Application.Contracts;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using FellowOakDicom;
using Microsoft.Extensions.Options;
using IRaCIS.Core.Application.Contracts;
namespace IRaCIS.Core.Application.Service
{
/// <summary>
/// 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, IOptionsMonitor<DicomSCPServiceOption> _dicomSCPServiceOption) : BaseService, IDicomAEService
{
@ -45,7 +47,7 @@ namespace IRaCIS.Core.Application.Service
var pageList = await dicomAEQueryable.ToPagedListAsync(inQuery, nameof(DicomAEView.CalledAE));
return ResponseOutput.Ok(pageList);
return ResponseOutput.Ok(pageList, _dicomSCPServiceOption.CurrentValue);
}

View File

@ -54,5 +54,7 @@ namespace IRaCIS.Core.Domain.Models
HIRClient = 1,
PacsServer = 2,
Destination=3
}
}