影像转发提交
This commit is contained in:
@@ -1725,7 +1725,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
var info = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).ProjectTo<DicomTrialSiteSubjectInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
var targetPath = Path.Combine("/IMPORT-IMAGES", info.TrialCode + "_" + info.SubjectCode + "_" + info.VisitName);
|
||||
var targetPath ="/IMPORT-IMAGES/"+info.TrialCode + "_" + info.SubjectCode + "_" + info.VisitName;
|
||||
|
||||
var path = _dicomFileStoreHelper.GetSubjectVisitPath(info.TrialId, info.SiteId, info.SubjectId, info.SubjectVisitId);
|
||||
|
||||
@@ -1739,49 +1739,60 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
HostName = "CS-690-sftp.mint-imaging.com",
|
||||
UserName = "zdong",
|
||||
Password = "Everest@2021",
|
||||
//GiveUpSecurityAndAcceptAnySshHostKey = true,
|
||||
SshHostKeyFingerprint = @"ecdsa-sha2-nistp384 384 59gkjJ5lMwv3jsB8Wz2B35tBAIor5pSd8PcJYtoamPo="
|
||||
};
|
||||
|
||||
using (Session session = new Session())
|
||||
{
|
||||
var studyFolders = (new DirectoryInfo(path)).GetDirectories();
|
||||
|
||||
session.Open(sessionOptions);
|
||||
|
||||
if (!session.FileExists(targetPath))
|
||||
{
|
||||
session.CreateDirectory(targetPath);
|
||||
}
|
||||
|
||||
var files = (new DirectoryInfo(path)).GetFiles();
|
||||
|
||||
foreach (var file in files)
|
||||
foreach (var studyFolder in studyFolders)
|
||||
{
|
||||
if (file.Extension.Contains("dcm"))
|
||||
if (!session.FileExists(Path.Combine(targetPath,studyFolder.Name))
|
||||
{
|
||||
string remoteFilePath =
|
||||
RemotePath.TranslateLocalPathToRemote(file.FullName, path, targetPath);
|
||||
session.CreateDirectory(targetPath);
|
||||
}
|
||||
|
||||
var result = session.PutFiles(file.FullName, remoteFilePath, false);
|
||||
|
||||
if (!result.IsSuccess)
|
||||
foreach (var file in studyFolder.GetFiles())
|
||||
{
|
||||
if (file.Extension.Contains("dcm",StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
await _subjectVisitRepository.UpdateFromQueryAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
string remoteFilePath =
|
||||
RemotePath.TranslateLocalPathToRemote(file.FullName, studyFolder.FullName, targetPath);
|
||||
|
||||
return ResponseOutput.NotOk("Forward Failed");
|
||||
var result = session.PutFiles(file.FullName, remoteFilePath, false);
|
||||
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
await _subjectVisitRepository.UpdateFromQueryAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
|
||||
return ResponseOutput.NotOk("Forward Failed" + result.Failures.ToString() + result.ToJson());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
|
||||
await _subjectVisitRepository.UpdateFromQueryAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
await _subjectVisitRepository.UpdateFromQueryAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.Forwarded });
|
||||
@@ -1789,5 +1800,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure.ExpressionExtend;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Contracts.DTO;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
@@ -30,7 +29,14 @@ namespace IRaCIS.Core.Application.Services
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="isAllSiteUser">isAllSiteUser true : site用户列表,false :Site调研汇总表</param>
|
||||
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet, Route("{trialId:guid}/{isSiteUserNotAll:bool}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialSiteUserListExport(Guid trialId, bool isAllSiteUser,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using IRaCIS.Core.Infrastructure.ExpressionExtend;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -235,5 +234,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user