测试 dicom 注入服务
This commit is contained in:
@@ -7,13 +7,14 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
|
||||
public class CStoreSCPService : DicomService, IDicomServiceProvider, IDicomCStoreProvider, IDicomCEchoProvider
|
||||
{
|
||||
public readonly IDicomArchiveService _dicomArchiveService;
|
||||
private IServiceProvider _serviceProvider { get; set; }
|
||||
|
||||
|
||||
private static readonly DicomTransferSyntax[] _acceptedTransferSyntaxes = new DicomTransferSyntax[]
|
||||
@@ -43,15 +44,20 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
};
|
||||
|
||||
|
||||
public CStoreSCPService(INetworkStream stream, Encoding fallbackEncoding, ILogger log, DicomServiceDependencies dependencies/*, IDicomArchiveService dicomArchiveService*/)
|
||||
public CStoreSCPService(INetworkStream stream, Encoding fallbackEncoding, ILogger log, DicomServiceDependencies dependencies)
|
||||
: base(stream, fallbackEncoding, log, dependencies)
|
||||
{
|
||||
var tt = base.UserState;
|
||||
//_dicomArchiveService = dicomArchiveService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Task OnReceiveAssociationRequestAsync(DicomAssociation association)
|
||||
{
|
||||
_serviceProvider =(IServiceProvider) this.UserState;
|
||||
|
||||
if (association.CalledAE != "STORESCP")
|
||||
{
|
||||
return SendAssociationRejectAsync(
|
||||
@@ -96,6 +102,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
public async Task<DicomCStoreResponse> OnCStoreRequestAsync(DicomCStoreRequest request)
|
||||
{
|
||||
var tt= _serviceProvider.GetService<IDicomArchiveService>();
|
||||
|
||||
var studyUid = request.Dataset.GetSingleValue<string>(DicomTag.StudyInstanceUID).Trim();
|
||||
var instUid = request.SOPInstanceUID.UID;
|
||||
|
||||
|
||||
@@ -1266,7 +1266,7 @@ namespace IRaCIS.Core.Application
|
||||
.Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > DateTime.Now)
|
||||
.CountAsync(),
|
||||
|
||||
#region PM
|
||||
#region PM
|
||||
|
||||
PM_SiteSurveryCount = isPM ? siteSurveyCount : 0,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user