Compare commits
No commits in common. "Test_IRC_Net8" and "EICS-V2.0.0" have entirely different histories.
Test_IRC_N
...
EICS-V2.0.
|
|
@ -231,8 +231,8 @@ public class OSSService : IOSSService
|
||||||
//提供awsEndPoint(域名)进行访问配置
|
//提供awsEndPoint(域名)进行访问配置
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
@ -320,8 +320,8 @@ public class OSSService : IOSSService
|
||||||
//提供awsEndPoint(域名)进行访问配置
|
//提供awsEndPoint(域名)进行访问配置
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
@ -397,8 +397,8 @@ public class OSSService : IOSSService
|
||||||
//提供awsEndPoint(域名)进行访问配置
|
//提供awsEndPoint(域名)进行访问配置
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
@ -493,8 +493,8 @@ public class OSSService : IOSSService
|
||||||
//提供awsEndPoint(域名)进行访问配置
|
//提供awsEndPoint(域名)进行访问配置
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
@ -625,8 +625,8 @@ public class OSSService : IOSSService
|
||||||
//提供awsEndPoint(域名)进行访问配置
|
//提供awsEndPoint(域名)进行访问配置
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
|
||||||
|
|
@ -1,175 +0,0 @@
|
||||||
using IRaCIS.Core.Application.Helper;
|
|
||||||
using IRaCIS.Core.Application.Service;
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
|
||||||
using IRaCIS.Core.SCP.Service;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.SCP;
|
|
||||||
|
|
||||||
|
|
||||||
public class SyncFileRecoveryService(IServiceScopeFactory _scopeFactory, FileSyncQueue _fileSyncQueue) : BackgroundService
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly int _pageSize = 500;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 多个程序,如果恢复同一份数据,造成重复同步,SCP服务不恢复任务
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="stoppingToken"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
||||||
{
|
|
||||||
//在本地调试的时候,不干涉部署同步任务
|
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
await Task.CompletedTask;
|
|
||||||
|
|
||||||
//using var scope = _scopeFactory.CreateScope();
|
|
||||||
//var fileUploadRecordRepository = scope.ServiceProvider.GetRequiredService<IRepository<FileUploadRecord>>();
|
|
||||||
|
|
||||||
//// 延迟启动,保证主机快速启动
|
|
||||||
//await Task.Delay(5000, stoppingToken);
|
|
||||||
|
|
||||||
//int page = 0;
|
|
||||||
|
|
||||||
|
|
||||||
//while (!stoppingToken.IsCancellationRequested)
|
|
||||||
//{
|
|
||||||
// // 分页获取未入队任务
|
|
||||||
// var pending = await fileUploadRecordRepository
|
|
||||||
// .Where(x => x.IsNeedSync == true && (x.IsSync == false || x.IsSync == null))
|
|
||||||
// .OrderByDescending(x => x.Priority)
|
|
||||||
// .Select(t => new { t.Id, t.Priority })
|
|
||||||
// .Skip(page * _pageSize)
|
|
||||||
// .Take(_pageSize)
|
|
||||||
// .ToListAsync(stoppingToken);
|
|
||||||
|
|
||||||
// if (!pending.Any())
|
|
||||||
// break; // 扫描完毕,退出循环
|
|
||||||
|
|
||||||
// foreach (var file in pending)
|
|
||||||
// {
|
|
||||||
// //file.IsQueued = true; // 避免重复入队
|
|
||||||
// _fileSyncQueue.Enqueue(file.Id, file.Priority ?? 0); // 放入队列
|
|
||||||
// }
|
|
||||||
|
|
||||||
// page++; // 下一页
|
|
||||||
// await Task.Delay(200, stoppingToken); // 缓解数据库压力
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FileSyncWorker(IServiceScopeFactory _scopeFactory, ILogger<FileSyncWorker> _logger, FileSyncQueue _fileSyncQueue) : BackgroundService
|
|
||||||
{
|
|
||||||
|
|
||||||
// ⭐ 自动根据服务器CPU
|
|
||||||
private readonly int _workerCount = Math.Max(1, Environment.ProcessorCount - 1);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected override Task ExecuteAsync(CancellationToken stoppingToken)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < _workerCount; i++)
|
|
||||||
Task.Run(() => WorkerLoop(stoppingToken));
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private async Task WorkerLoop(CancellationToken stoppingToken)
|
|
||||||
{
|
|
||||||
while (!stoppingToken.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
var id = await _fileSyncQueue.DequeueAsync(stoppingToken);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using var scope = _scopeFactory.CreateScope();
|
|
||||||
var _fileUploadRecordRepository = scope.ServiceProvider.GetRequiredService<IRepository<FileUploadRecord>>();
|
|
||||||
var _uploadFileSyncRecordRepository = scope.ServiceProvider.GetRequiredService<IRepository<UploadFileSyncRecord>>();
|
|
||||||
|
|
||||||
var syncConfig = (scope.ServiceProvider.GetRequiredService<IOptionsMonitor<ObjectStoreServiceOptions>>()).CurrentValue;
|
|
||||||
|
|
||||||
var oss = scope.ServiceProvider.GetRequiredService<IOSSService>();
|
|
||||||
|
|
||||||
var file = await _fileUploadRecordRepository.FirstOrDefaultAsync(t => t.Id == id);
|
|
||||||
|
|
||||||
// ✅ 不要 return
|
|
||||||
if (file == null || file.IsNeedSync != true || syncConfig.IsOpenStoreSync == false)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (syncConfig.SyncConfigList.Any(t => t.UploadRegion == file.UploadRegion && t.IsOpenSync == false))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//如果发现系统配置某一边同步进行了关闭,那么就直接返回,不执行任务
|
|
||||||
if (syncConfig.SyncConfigList.Any(t => t.UploadRegion == file.UploadRegion && t.IsOpenSync == false))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var log = new UploadFileSyncRecord
|
|
||||||
{
|
|
||||||
FileUploadRecordId = id,
|
|
||||||
StartTime = DateTime.Now,
|
|
||||||
JobState = jobState.RUNNING
|
|
||||||
};
|
|
||||||
|
|
||||||
await _uploadFileSyncRecordRepository.AddAsync(log);
|
|
||||||
await _uploadFileSyncRecordRepository.SaveChangesAsync(stoppingToken);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await oss.SyncFileAsync(file.Path.TrimStart('/'), file.UploadRegion == "CN" ? ObjectStoreUse.AliyunOSS : ObjectStoreUse.AWS, file.UploadRegion == "CN" ? ObjectStoreUse.AWS : ObjectStoreUse.AliyunOSS);
|
|
||||||
|
|
||||||
file.IsSync = true;
|
|
||||||
file.SyncFinishedTime = DateTime.Now;
|
|
||||||
|
|
||||||
log.JobState = jobState.SUCCESS;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
log.JobState = jobState.FAILED;
|
|
||||||
|
|
||||||
log.Msg = ex.Message[..300];
|
|
||||||
}
|
|
||||||
|
|
||||||
log.EndTime = DateTime.Now;
|
|
||||||
|
|
||||||
await _uploadFileSyncRecordRepository.SaveChangesAsync(stoppingToken);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Sync failed {Id}", id);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
// ⭐⭐⭐ 永远执行
|
|
||||||
_fileSyncQueue.Complete(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -63,10 +63,6 @@ builder.Host
|
||||||
#region 配置服务
|
#region 配置服务
|
||||||
var _configuration = builder.Configuration;
|
var _configuration = builder.Configuration;
|
||||||
|
|
||||||
builder.Services.AddSingleton<FileSyncQueue>();
|
|
||||||
builder.Services.AddHostedService<SyncFileRecoveryService>();
|
|
||||||
builder.Services.AddHostedService<FileSyncWorker>();
|
|
||||||
|
|
||||||
//健康检查
|
//健康检查
|
||||||
builder.Services.AddHealthChecks();
|
builder.Services.AddHealthChecks();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -644,7 +644,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
ms.Position = 0;
|
ms.Position = 0;
|
||||||
|
|
||||||
//irc 从路径最后一截取Guid
|
//irc 从路径最后一截取Guid
|
||||||
storeRelativePath = await ossService.UploadToOSSAsync(ms, ossFolderPath, instanceId.ToString(), false, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = _trialId, BatchDataType = BatchDataType.PACSReceive });
|
storeRelativePath = await ossService.UploadToOSSAsync(ms, ossFolderPath, instanceId.ToString(), false);
|
||||||
|
|
||||||
fileSize = ms.Length;
|
fileSize = ms.Length;
|
||||||
|
|
||||||
|
|
@ -674,7 +674,7 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
|
|
||||||
// 上传缩略图到 OSS
|
// 上传缩略图到 OSS
|
||||||
|
|
||||||
var seriesPath = await ossService.UploadToOSSAsync(memoryStream, ossFolderPath, $"{seriesId.ToString()}_{instanceId.ToString()}.preview.jpg", false,uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = _trialId, BatchDataType = BatchDataType.PACSReceive });
|
var seriesPath = await ossService.UploadToOSSAsync(memoryStream, ossFolderPath, $"{seriesId.ToString()}_{instanceId.ToString()}.preview.jpg", false);
|
||||||
|
|
||||||
|
|
||||||
series.ImageResizePath = seriesPath;
|
series.ImageResizePath = seriesPath;
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,6 @@ public static class CacheKeys
|
||||||
public static string UserMFAVerifyPass(Guid userId, string browserFingerprint) => $"UserMFAVerifyPass:{userId}:{browserFingerprint}";
|
public static string UserMFAVerifyPass(Guid userId, string browserFingerprint) => $"UserMFAVerifyPass:{userId}:{browserFingerprint}";
|
||||||
|
|
||||||
public static string TrialSiteInfo(Guid trialSiteId) => $"{trialSiteId}TrialSiteInfo";
|
public static string TrialSiteInfo(Guid trialSiteId) => $"{trialSiteId}TrialSiteInfo";
|
||||||
|
|
||||||
public static string TrialDataStoreType(Guid trialId) => $"TrialDataStoreType:{trialId}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CacheHelper
|
public static class CacheHelper
|
||||||
|
|
|
||||||
|
|
@ -1,317 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-10 06:15:17Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using AutoMapper;
|
|
||||||
using IRaCIS.Core.Application.Helper;
|
|
||||||
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
|
||||||
using IRaCIS.Core.Infrastructure.Extention;
|
|
||||||
using IRaCIS.Core.SCP;
|
|
||||||
using IRaCIS.Core.SCP.Service;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Threading.Channels;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using ZiggyCreatures.Caching.Fusion;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.SCP.Service;
|
|
||||||
|
|
||||||
public class FileUploadRecordAddOrEdit
|
|
||||||
{
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string FileName { get; set; }
|
|
||||||
|
|
||||||
public long FileSize { get; set; }
|
|
||||||
|
|
||||||
public string FileType { get; set; }
|
|
||||||
|
|
||||||
public string Path { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string UploadBatchId { get; set; }
|
|
||||||
public BatchDataType BatchDataType { get; set; }
|
|
||||||
|
|
||||||
public string StudyCode { get; set; }
|
|
||||||
|
|
||||||
public Guid? TrialId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectVisitId { get; set; }
|
|
||||||
|
|
||||||
public Guid? DicomStudyId { get; set; }
|
|
||||||
|
|
||||||
public Guid? NoneDicomStudyId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public string FileMarkId { get; set; }
|
|
||||||
|
|
||||||
public int? Priority { get; set; }
|
|
||||||
public string IP { get; set; }
|
|
||||||
public bool? IsNeedSync { get; set; }
|
|
||||||
public string UploadRegion { get; set; }
|
|
||||||
public string TargetRegion { get; set; }
|
|
||||||
}
|
|
||||||
public interface IFileUploadRecordService
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Task<IResponseOutput> AddOrUpdateFileUploadRecord(FileUploadRecordAddOrEdit addOrEditFileUploadRecord);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[ApiExplorerSettings(GroupName = "Common")]
|
|
||||||
public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRecordRepository,
|
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IOptionsMonitor<ObjectStoreServiceOptions> options,
|
|
||||||
IFusionCache _fusionCache, IRepository<Trial> _trialRepository, FileSyncQueue _fileSyncQueue) : BaseService, IFileUploadRecordService
|
|
||||||
{
|
|
||||||
|
|
||||||
ObjectStoreServiceOptions ObjectStoreServiceConfig = options.CurrentValue;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateFileUploadRecord(FileUploadRecordAddOrEdit addOrEditFileUploadRecord)
|
|
||||||
{
|
|
||||||
|
|
||||||
addOrEditFileUploadRecord.IP = _userInfo.IP;
|
|
||||||
|
|
||||||
if (ObjectStoreServiceConfig.IsOpenStoreSync && _userInfo.Domain.IsNotNullOrEmpty())
|
|
||||||
{
|
|
||||||
var find = ObjectStoreServiceConfig.SyncConfigList.FirstOrDefault(t => t.Domain == _userInfo.Domain);
|
|
||||||
if (find != null)
|
|
||||||
{
|
|
||||||
addOrEditFileUploadRecord.UploadRegion = find.UploadRegion;
|
|
||||||
addOrEditFileUploadRecord.TargetRegion = find.TargetRegion;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//前后端调试的时候,上传的时候域名不对应,自动按照后端配置设置上传区域和同步区域
|
|
||||||
var apiDefalut = ObjectStoreServiceConfig.SyncConfigList.FirstOrDefault(t => t.UploadRegion == ObjectStoreServiceConfig.ApiDeployRegion);
|
|
||||||
|
|
||||||
if (apiDefalut != null)
|
|
||||||
{
|
|
||||||
addOrEditFileUploadRecord.UploadRegion = apiDefalut.UploadRegion;
|
|
||||||
addOrEditFileUploadRecord.TargetRegion = apiDefalut.TargetRegion;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addOrEditFileUploadRecord.TrialId != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
var trialDataStore = await _fusionCache.GetOrSetAsync(CacheKeys.TrialDataStoreType(addOrEditFileUploadRecord.TrialId.Value), async _ =>
|
|
||||||
{
|
|
||||||
return await _trialRepository.Where(t => t.Id == addOrEditFileUploadRecord.TrialId).Select(t => t.TrialDataStoreType)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
},
|
|
||||||
TimeSpan.FromDays(7)
|
|
||||||
);
|
|
||||||
|
|
||||||
//项目配置了,那么就设置需要同步
|
|
||||||
if (trialDataStore == TrialDataStore.MUtiCenter)
|
|
||||||
{
|
|
||||||
addOrEditFileUploadRecord.IsNeedSync = true;
|
|
||||||
|
|
||||||
addOrEditFileUploadRecord.Priority = 0;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
addOrEditFileUploadRecord.IsNeedSync = false;
|
|
||||||
|
|
||||||
//addOrEditFileUploadRecord.TargetRegion = "";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//系统文件,默认同步
|
|
||||||
addOrEditFileUploadRecord.IsNeedSync = true;
|
|
||||||
|
|
||||||
addOrEditFileUploadRecord.Priority = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
var entity = await _fileUploadRecordRepository.InsertOrUpdateAsync(addOrEditFileUploadRecord, true);
|
|
||||||
|
|
||||||
if (addOrEditFileUploadRecord.IsNeedSync == true)
|
|
||||||
{
|
|
||||||
_fileSyncQueue.Enqueue(entity.Id, addOrEditFileUploadRecord.Priority ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public sealed class FileSyncQueue
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 优先级队列(仅负责排序)
|
|
||||||
/// </summary>
|
|
||||||
private readonly PriorityQueue<Guid, int> _queue = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当前等待中的任务(唯一真实数据)
|
|
||||||
/// key = Guid
|
|
||||||
/// value = 最新 priority
|
|
||||||
/// </summary>
|
|
||||||
private readonly Dictionary<Guid, int> _waiting = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 正在执行的任务(防止重复执行)
|
|
||||||
/// </summary>
|
|
||||||
private readonly HashSet<Guid> _running = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// worker 等待信号
|
|
||||||
/// </summary>
|
|
||||||
private readonly SemaphoreSlim _signal = new(0);
|
|
||||||
|
|
||||||
|
|
||||||
private readonly object _lock = new();
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// Enqueue
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 入队(同 Guid 会覆盖优先级)
|
|
||||||
/// </summary>
|
|
||||||
public void Enqueue(Guid id, int priority)
|
|
||||||
{
|
|
||||||
bool needSignal = false;
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
// 如果正在执行,忽略(防止重复)
|
|
||||||
if (_running.Contains(id))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// 是否新任务(用于减少 signal 风暴)
|
|
||||||
if (!_waiting.ContainsKey(id))
|
|
||||||
needSignal = true;
|
|
||||||
|
|
||||||
// 更新为最新优先级(最后一次为准)
|
|
||||||
_waiting[id] = priority; //等价于添加或者更新
|
|
||||||
|
|
||||||
// PriorityQueue 无法更新节点
|
|
||||||
// 允许旧节点存在,Dequeue 时过滤
|
|
||||||
_queue.Enqueue(id, -priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 只有新增任务才唤醒 worker
|
|
||||||
if (needSignal)
|
|
||||||
_signal.Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// Dequeue
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取一个待执行任务(无任务时自动等待)
|
|
||||||
/// </summary>
|
|
||||||
public async Task<Guid> DequeueAsync(CancellationToken ct)
|
|
||||||
{
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
await _signal.WaitAsync(ct);
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
while (_queue.Count > 0)
|
|
||||||
{
|
|
||||||
var id = _queue.Dequeue();
|
|
||||||
|
|
||||||
// 已被覆盖或取消
|
|
||||||
if (!_waiting.TryGetValue(id, out _))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// 标记为运行中
|
|
||||||
_waiting.Remove(id);
|
|
||||||
_running.Add(id);
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// Complete
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务执行完成(必须调用)
|
|
||||||
/// </summary>
|
|
||||||
public void Complete(Guid id)
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
_running.Remove(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// Snapshot
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当前等待中的任务快照
|
|
||||||
/// </summary>
|
|
||||||
public Guid[] Snapshot()
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
return _waiting.Keys.ToArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// 状态信息(调试用)
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
public int WaitingCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
return _waiting.Count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int RunningCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
return _running.Count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Information",
|
|
||||||
"Microsoft": "Warning",
|
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ObjectStoreService": {
|
|
||||||
"ObjectStoreUse": "AliyunOSS",
|
|
||||||
"AliyunOSS": {
|
|
||||||
"RegionId": "cn-shanghai",
|
|
||||||
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
|
||||||
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
|
||||||
"AccessKeyId": "LTAI5tFUCCmz5TwghZHsj45Y",
|
|
||||||
"AccessKeySecret": "8evrBy1fVfzJG25i67Jm0xqn9Xcw2T",
|
|
||||||
"RoleArn": "acs:ram::1078130221702011:role/uat-oss-access",
|
|
||||||
"BucketName": "tl-med-irc-event-store",
|
|
||||||
"ViewEndpoint": "https://tl-med-irc-event-store.oss-cn-shanghai.aliyuncs.com",
|
|
||||||
"Region": "oss-cn-shanghai",
|
|
||||||
"DurationSeconds": 7200
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"ConnectionStrings": {
|
|
||||||
"RemoteNew": "Server=101.132.253.119,1435;Database=irc_Prpd_bak;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
|
||||||
"Hangfire": "Server=101.132.253.119,1435;Database=irc_Hangfire_bak;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
|
||||||
},
|
|
||||||
|
|
||||||
"DicomSCPServiceConfig": {
|
|
||||||
"CalledAEList": [
|
|
||||||
"STORESCP"
|
|
||||||
],
|
|
||||||
"ServerPort": 11112
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -25,7 +25,6 @@ using Microsoft.Extensions.Options;
|
||||||
using Org.BouncyCastle.Tls;
|
using Org.BouncyCastle.Tls;
|
||||||
using RestSharp;
|
using RestSharp;
|
||||||
using RestSharp.Authenticators;
|
using RestSharp.Authenticators;
|
||||||
using Serilog;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
@ -138,14 +137,9 @@ namespace IRaCIS.Api.Controllers
|
||||||
public async Task<IResponseOutput> GetObjectStoreTokenAsync([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options, [FromServices] IOSSService _oSSService)
|
public async Task<IResponseOutput> GetObjectStoreTokenAsync([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options, [FromServices] IOSSService _oSSService)
|
||||||
{
|
{
|
||||||
|
|
||||||
var domain = HttpContext.Request.Host.Host;
|
var result = _oSSService.GetObjectStoreTempToken();
|
||||||
|
|
||||||
|
//result.AWS = await GetAWSTemToken(options.CurrentValue);
|
||||||
var result = _oSSService.GetObjectStoreTempToken(domain);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log.Logger.Information($"使用域名:{domain}请求token.返回{result.ToJsonStr()}");
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,19 +155,10 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> FinishMedicalReview(DataInspectionDto<CloseAndFinishMedicalReview> opt)
|
public async Task<IResponseOutput> FinishMedicalReview(DataInspectionDto<FinishMedicalReviewInDto> opt)
|
||||||
{
|
{
|
||||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||||
|
var result = await _readingMedicalReviewService.FinishMedicalReview(opt.Data);
|
||||||
await _readingMedicalReviewService.ClosedMedicalReviewDialog(new ClosedMedicalReviewDialogInDto() {
|
|
||||||
DialogCloseReason=opt.Data.DialogCloseReason,
|
|
||||||
IsClosedDialog=opt.Data.IsClosedDialog,
|
|
||||||
MedicalDialogCloseEnum=opt.Data.MedicalDialogCloseEnum,
|
|
||||||
TaskMedicalReviewId=opt.Data.TaskMedicalReviewId
|
|
||||||
});
|
|
||||||
var result = await _readingMedicalReviewService.FinishMedicalReview(new FinishMedicalReviewInDto() {
|
|
||||||
TaskMedicalReviewId=opt.Data.TaskMedicalReviewId
|
|
||||||
});
|
|
||||||
await _inspectionService.CompletedSign(singid, result);
|
await _inspectionService.CompletedSign(singid, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Application.MassTransit.Command;
|
using IRaCIS.Core.Application.MassTransit.Command;
|
||||||
using IRaCIS.Core.Application.Service;
|
using IRaCIS.Core.Application.Service;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
|
|
@ -599,7 +598,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
templateFileStream.Seek(0, SeekOrigin.Begin);
|
templateFileStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
|
||||||
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, $"{trialId.ToString()}/InspectionUpload/DataReconciliation", realFileName, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = trialId, BatchDataType = BatchDataType.DataReconciliation });
|
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, $"{trialId.ToString()}/InspectionUpload/DataReconciliation", realFileName);
|
||||||
|
|
||||||
var addEntity = await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId }, true);
|
var addEntity = await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId }, true);
|
||||||
|
|
||||||
|
|
@ -857,7 +856,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_TemplateUploadData"]);
|
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_TemplateUploadData"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, $"{trialId.ToString()}/InspectionUpload/SiteSurvey", realFileName, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = trialId ,BatchDataType=BatchDataType.SiteUserSurvey});
|
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, $"{trialId.ToString()}/InspectionUpload/SiteSurvey", realFileName);
|
||||||
|
|
||||||
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId }, true);
|
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId }, true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,168 +0,0 @@
|
||||||
using IRaCIS.Core.Application.Helper;
|
|
||||||
using IRaCIS.Core.Application.Service;
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.API.HostService;
|
|
||||||
|
|
||||||
|
|
||||||
public class SyncFileRecoveryService(IServiceScopeFactory _scopeFactory, FileSyncQueue _fileSyncQueue) : BackgroundService
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly int _pageSize = 500;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 多个程序,如果恢复同一份数据,造成重复同步,SCP服务不恢复任务
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="stoppingToken"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
||||||
{
|
|
||||||
//在本地调试的时候,不干涉部署同步任务
|
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using var scope = _scopeFactory.CreateScope();
|
|
||||||
var fileUploadRecordRepository = scope.ServiceProvider.GetRequiredService<IRepository<FileUploadRecord>>();
|
|
||||||
|
|
||||||
// 延迟启动,保证主机快速启动
|
|
||||||
await Task.Delay(5000, stoppingToken);
|
|
||||||
|
|
||||||
int page = 0;
|
|
||||||
|
|
||||||
|
|
||||||
while (!stoppingToken.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
// 分页获取未入队任务
|
|
||||||
var pending = await fileUploadRecordRepository
|
|
||||||
.Where(x => x.IsNeedSync == true && (x.IsSync == false || x.IsSync == null))
|
|
||||||
.OrderByDescending(x => x.Priority)
|
|
||||||
.Select(t => new { t.Id, t.Priority })
|
|
||||||
.Skip(page * _pageSize)
|
|
||||||
.Take(_pageSize)
|
|
||||||
.ToListAsync(stoppingToken);
|
|
||||||
|
|
||||||
if (!pending.Any())
|
|
||||||
break; // 扫描完毕,退出循环
|
|
||||||
|
|
||||||
foreach (var file in pending)
|
|
||||||
{
|
|
||||||
//file.IsQueued = true; // 避免重复入队
|
|
||||||
_fileSyncQueue.Enqueue(file.Id, file.Priority ?? 0); // 放入队列
|
|
||||||
}
|
|
||||||
|
|
||||||
page++; // 下一页
|
|
||||||
await Task.Delay(200, stoppingToken); // 缓解数据库压力
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FileSyncWorker(IServiceScopeFactory _scopeFactory, ILogger<FileSyncWorker> _logger, FileSyncQueue _fileSyncQueue) : BackgroundService
|
|
||||||
{
|
|
||||||
|
|
||||||
// ⭐ 自动根据服务器CPU
|
|
||||||
private readonly int _workerCount = Math.Max(1, Environment.ProcessorCount - 1);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected override Task ExecuteAsync(CancellationToken stoppingToken)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < _workerCount; i++)
|
|
||||||
Task.Run(() => WorkerLoop(stoppingToken));
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task WorkerLoop(CancellationToken stoppingToken)
|
|
||||||
{
|
|
||||||
while (!stoppingToken.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
var id = await _fileSyncQueue.DequeueAsync(stoppingToken);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using var scope = _scopeFactory.CreateScope();
|
|
||||||
var _fileUploadRecordRepository = scope.ServiceProvider.GetRequiredService<IRepository<FileUploadRecord>>();
|
|
||||||
var _uploadFileSyncRecordRepository = scope.ServiceProvider.GetRequiredService<IRepository<UploadFileSyncRecord>>();
|
|
||||||
|
|
||||||
var syncConfig = (scope.ServiceProvider.GetRequiredService<IOptionsMonitor<ObjectStoreServiceOptions>>()).CurrentValue;
|
|
||||||
|
|
||||||
var oss = scope.ServiceProvider.GetRequiredService<IOSSService>();
|
|
||||||
|
|
||||||
var file = await _fileUploadRecordRepository.FirstOrDefaultAsync(t => t.Id == id);
|
|
||||||
|
|
||||||
// ✅ 不要 return
|
|
||||||
if (file == null || file.IsNeedSync != true || syncConfig.IsOpenStoreSync == false)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (syncConfig.SyncConfigList.Any(t => t.UploadRegion == file.UploadRegion && t.IsOpenSync == false))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//如果发现系统配置某一边同步进行了关闭,那么就直接返回,不执行任务
|
|
||||||
if (syncConfig.SyncConfigList.Any(t => t.UploadRegion == file.UploadRegion && t.IsOpenSync == false))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var log = new UploadFileSyncRecord
|
|
||||||
{
|
|
||||||
FileUploadRecordId = id,
|
|
||||||
StartTime = DateTime.Now,
|
|
||||||
JobState = jobState.RUNNING
|
|
||||||
};
|
|
||||||
|
|
||||||
await _uploadFileSyncRecordRepository.AddAsync(log);
|
|
||||||
await _uploadFileSyncRecordRepository.SaveChangesAsync(stoppingToken);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await oss.SyncFileAsync(file.Path.TrimStart('/'), file.UploadRegion == "CN" ? ObjectStoreUse.AliyunOSS : ObjectStoreUse.AWS, file.UploadRegion == "CN" ? ObjectStoreUse.AWS : ObjectStoreUse.AliyunOSS);
|
|
||||||
|
|
||||||
file.IsSync = true;
|
|
||||||
file.SyncFinishedTime = DateTime.Now;
|
|
||||||
|
|
||||||
log.JobState = jobState.SUCCESS;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
log.JobState = jobState.FAILED;
|
|
||||||
|
|
||||||
log.Msg = ex.Message[..300];
|
|
||||||
}
|
|
||||||
|
|
||||||
log.EndTime = DateTime.Now;
|
|
||||||
|
|
||||||
await _uploadFileSyncRecordRepository.SaveChangesAsync(stoppingToken);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Sync failed {Id}", id);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
// ⭐⭐⭐ 永远执行
|
|
||||||
_fileSyncQueue.Complete(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -136,7 +136,7 @@
|
||||||
<param name="opt"></param>
|
<param name="opt"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.FinishMedicalReview(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CloseAndFinishMedicalReview})">
|
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.FinishMedicalReview(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.FinishMedicalReviewInDto})">
|
||||||
<summary>
|
<summary>
|
||||||
医学审核完成
|
医学审核完成
|
||||||
</summary>
|
</summary>
|
||||||
|
|
@ -344,13 +344,6 @@
|
||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.API.HostService.SyncFileRecoveryService.ExecuteAsync(System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
多个程序,如果恢复同一份数据,造成重复同步,SCP服务不恢复任务
|
|
||||||
</summary>
|
|
||||||
<param name="stoppingToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.API.IpPolicyRateLimitSetup">
|
<member name="T:IRaCIS.Core.API.IpPolicyRateLimitSetup">
|
||||||
<summary>
|
<summary>
|
||||||
IPLimit限流 启动服务
|
IPLimit限流 启动服务
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
@ -89,10 +88,6 @@ builder.Services.ConfigureServices(_configuration);
|
||||||
|
|
||||||
builder.Services.AddHostedService<HangfireHostService>();
|
builder.Services.AddHostedService<HangfireHostService>();
|
||||||
|
|
||||||
builder.Services.AddSingleton<FileSyncQueue>();
|
|
||||||
builder.Services.AddHostedService<SyncFileRecoveryService>();
|
|
||||||
builder.Services.AddHostedService<FileSyncWorker>();
|
|
||||||
|
|
||||||
//minimal api 异常处理
|
//minimal api 异常处理
|
||||||
builder.Services.AddExceptionHandler<GlobalExceptionHandler>();
|
builder.Services.AddExceptionHandler<GlobalExceptionHandler>();
|
||||||
//builder.Services.AddProblemDetails();
|
//builder.Services.AddProblemDetails();
|
||||||
|
|
|
||||||
|
|
@ -40,12 +40,12 @@ namespace IRaCIS.Core.API
|
||||||
var dbType = configuration.GetSection("ConnectionStrings:Db_Type").Value;
|
var dbType = configuration.GetSection("ConnectionStrings:Db_Type").Value;
|
||||||
if (!string.IsNullOrWhiteSpace(dbType) && dbType == "pgsql")
|
if (!string.IsNullOrWhiteSpace(dbType) && dbType == "pgsql")
|
||||||
{
|
{
|
||||||
options.UseNpgsql(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure().CommandTimeout(90));
|
options.UseNpgsql(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure());
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
options.UseSqlServer(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure().CommandTimeout(90));
|
options.UseSqlServer(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure()/*.CommandTimeout(60)*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
@ -116,9 +116,6 @@ public static class SwaggerSetup
|
||||||
//DocExpansion设置为none可折叠所有方法
|
//DocExpansion设置为none可折叠所有方法
|
||||||
options.DocExpansion(DocExpansion.None);
|
options.DocExpansion(DocExpansion.None);
|
||||||
|
|
||||||
// 开启Swagger UI的搜索/过滤功能
|
|
||||||
options.EnableFilter();
|
|
||||||
|
|
||||||
//DefaultModelsExpandDepth设置为 - 1 可不显示models
|
//DefaultModelsExpandDepth设置为 - 1 可不显示models
|
||||||
options.DefaultModelsExpandDepth(-1);
|
options.DefaultModelsExpandDepth(-1);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,8 @@
|
||||||
"RemoteNew": "Server=101.132.253.119,1435;Database=irc_Prpd_bak;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
"RemoteNew": "Server=101.132.253.119,1435;Database=irc_Prpd_bak;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=101.132.253.119,1435;Database=irc_Hangfire_bak;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
"Hangfire": "Server=101.132.253.119,1435;Database=irc_Hangfire_bak;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
"WeComNoticeConfig": {
|
|
||||||
"IsOpenWeComNotice": true,
|
|
||||||
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
|
||||||
"APINoticeUserList": [ "u", "wait..." ],
|
|
||||||
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ]
|
|
||||||
},
|
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
|
|
||||||
"ObjectStoreUse": "AliyunOSS",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
|
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
"RegionId": "cn-shanghai",
|
"RegionId": "cn-shanghai",
|
||||||
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
|
|
@ -32,30 +24,13 @@
|
||||||
"Region": "oss-cn-shanghai",
|
"Region": "oss-cn-shanghai",
|
||||||
"DurationSeconds": 7200
|
"DurationSeconds": 7200
|
||||||
},
|
},
|
||||||
|
|
||||||
"MinIO": {
|
"MinIO": {
|
||||||
"endPoint": "hir-oss.uat.extimaging.com",
|
"endpoint": "http://192.168.3.68",
|
||||||
"port": "80",
|
"port": "8001",
|
||||||
"useSSL": false,
|
"useSSL": false,
|
||||||
"viewEndpoint": "http://hir-oss.uat.extimaging.com/irc-uat",
|
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||||
//"port": "443",
|
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||||
//"useSSL": true,
|
"bucketName": "test"
|
||||||
//"viewEndpoint": "https://hir-oss.uat.extimaging.com/irc-uat",
|
|
||||||
"accessKey": "b9Ul0e98xPzt6PwRXA1Q",
|
|
||||||
"secretKey": "DzMaU2L4OXl90uytwOmDXF2encN0Jf4Nxu2XkYqQ",
|
|
||||||
"bucketName": "irc-uat"
|
|
||||||
|
|
||||||
},
|
|
||||||
"AWS": {
|
|
||||||
"Region": "us-east-1",
|
|
||||||
"EndPoint": "s3.us-east-1.amazonaws.com",
|
|
||||||
"UseSSL": true,
|
|
||||||
"RoleArn": "arn:aws:iam::471112624751:role/sts_s3_upload",
|
|
||||||
"AccessKeyId": "AKIAW3MEAFJXWRCGSX5Z",
|
|
||||||
"SecretAccessKey": "miais4jQGSd37A+TfBEP11AQM5u/CvotSmznJd8k",
|
|
||||||
"BucketName": "ei-med-s3-lili-uat-store",
|
|
||||||
"ViewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com/",
|
|
||||||
"DurationSeconds": 7200
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -63,26 +38,27 @@
|
||||||
// 启用质控风险控制功能
|
// 启用质控风险控制功能
|
||||||
"QCRiskControl": true,
|
"QCRiskControl": true,
|
||||||
"OpenUserComplexPassword": true,
|
"OpenUserComplexPassword": true,
|
||||||
|
|
||||||
"OpenSignDocumentBeforeWork": true,
|
"OpenSignDocumentBeforeWork": true,
|
||||||
|
|
||||||
"OpenLoginLimit": true,
|
"OpenLoginLimit": true,
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 120,
|
"AutoLoginOutMinutes": 60,
|
||||||
|
|
||||||
"OpenLoginMFA": false,
|
|
||||||
|
|
||||||
"ContinuousReadingTimeMin": 120,
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
"ReadingRestTimeMin": 10,
|
"ReadingRestTimeMin": 10,
|
||||||
|
|
||||||
"IsNeedChangePassWord": true,
|
"IsNeedChangePassWord": true,
|
||||||
|
|
||||||
"ChangePassWordDays": 90,
|
"ChangePassWordDays": 90,
|
||||||
|
|
||||||
// 模板类型 1 Elevate 2 Extensive
|
// 模板类型 1 Elevate 2 Extensive
|
||||||
"TemplateType": 2,
|
"TemplateType": 2,
|
||||||
//MFA免验证发送天数
|
|
||||||
"UserMFAVerifyMinutes": 1440
|
|
||||||
|
|
||||||
|
"UserMFAVerifyMinutes": 1440
|
||||||
},
|
},
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
"Port": 465,
|
"Port": 465,
|
||||||
|
|
@ -90,29 +66,14 @@
|
||||||
"Imap": "imap.qiye.aliyun.com",
|
"Imap": "imap.qiye.aliyun.com",
|
||||||
"ImapPort": 993,
|
"ImapPort": 993,
|
||||||
"FromEmail": "uat@extimaging.com",
|
"FromEmail": "uat@extimaging.com",
|
||||||
"FromName": "Uat IRC Imaging System",
|
"FromName": "UAT_IRC",
|
||||||
"AuthorizationCode": "SHzyyl2021",
|
"AuthorizationCode": "SHzyyl2021",
|
||||||
"SiteUrl": "http://irc.uat.extimaging.com/login",
|
"SiteUrl": "http://irc.event.extimaging.com/login",
|
||||||
|
|
||||||
"PlatformName": "EICS",
|
|
||||||
"PlatformNameCN": "展影云平台",
|
|
||||||
"SystemShortName": "IRC",
|
|
||||||
"OrganizationName": "ExtImaging",
|
|
||||||
"OrganizationNameCN": "ExtImaging",
|
|
||||||
"CompanyName": "Extensive Imaging",
|
"CompanyName": "Extensive Imaging",
|
||||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
"CompanyShortName": "Extensive Imaging",
|
"CompanyShortName": "Extensive Imaging",
|
||||||
"CompanyShortNameCN": "展影医疗",
|
"CompanyShortNameCN": "展影医疗",
|
||||||
"IsEnv_US": false,
|
"IsEnv_US": false
|
||||||
"IsOpenErrorNoticeEmail": false,
|
|
||||||
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
|
||||||
"CronEmailDefaultCulture": "zh-CN",
|
|
||||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
|
||||||
},
|
|
||||||
|
|
||||||
"SystemPacsConfig": {
|
|
||||||
"Port": "11116",
|
|
||||||
"IP": "101.132.253.119"
|
|
||||||
},
|
},
|
||||||
"RequestDuplicationOptions": {
|
"RequestDuplicationOptions": {
|
||||||
"IsEnabled": true,
|
"IsEnabled": true,
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
"IsOpenWeComNotice": true,
|
"IsOpenWeComNotice": true,
|
||||||
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
||||||
"APINoticeUserList": [ "u", "wait..." ],
|
"APINoticeUserList": [ "u", "wait..." ],
|
||||||
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ]
|
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621697b96f74e6f3d" ]
|
||||||
},
|
},
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
"ObjectStoreUse": "AliyunOSS",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
|
|
|
||||||
|
|
@ -22,32 +22,12 @@
|
||||||
"IsOpenWeComNotice": true,
|
"IsOpenWeComNotice": true,
|
||||||
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
||||||
"APINoticeUserList": [ "u", "wait..." ],
|
"APINoticeUserList": [ "u", "wait..." ],
|
||||||
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ]
|
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621697b96f74e6f3d" ]
|
||||||
},
|
},
|
||||||
// 对象存储服务配置
|
// 对象存储服务配置
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
// 使用的对象存储服务类型
|
// 使用的对象存储服务类型
|
||||||
"ObjectStoreUse": "AliyunOSS",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
"IsOpenStoreSync": true,
|
|
||||||
"ApiDeployRegion": "CN",
|
|
||||||
"SyncConfigList": [
|
|
||||||
{
|
|
||||||
"Domain": "irc.test.extimaging.com",
|
|
||||||
"Primary": "AliyunOSS",
|
|
||||||
"Target": "AWS",
|
|
||||||
"UploadRegion": "CN",
|
|
||||||
"TargetRegion": "US",
|
|
||||||
"IsOpenSync": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Domain": "lili.test.extimaging.com",
|
|
||||||
"Primary": "AWS",
|
|
||||||
"Target": "AliyunOSS",
|
|
||||||
"UploadRegion": "US",
|
|
||||||
"TargetRegion": "CN",
|
|
||||||
"IsOpenSync": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 阿里云对象存储服务的配置
|
// 阿里云对象存储服务的配置
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
// 阿里云 OSS 的 Region ID
|
// 阿里云 OSS 的 Region ID
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
"IsOpenWeComNotice": true,
|
"IsOpenWeComNotice": true,
|
||||||
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
||||||
"APINoticeUserList": [ "u", "wait..." ],
|
"APINoticeUserList": [ "u", "wait..." ],
|
||||||
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ]
|
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621697b96f74e6f3d" ]
|
||||||
},
|
},
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
"ObjectStoreUse": "AWS",
|
"ObjectStoreUse": "AWS",
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
"IsOpenWeComNotice": true,
|
"IsOpenWeComNotice": true,
|
||||||
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
||||||
"APINoticeUserList": [ "u", "wait..." ],
|
"APINoticeUserList": [ "u", "wait..." ],
|
||||||
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ]
|
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621697b96f74e6f3d" ]
|
||||||
},
|
},
|
||||||
|
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
"IsOpenWeComNotice": true,
|
"IsOpenWeComNotice": true,
|
||||||
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
||||||
"APINoticeUserList": [ "u", "wait..." ],
|
"APINoticeUserList": [ "u", "wait..." ],
|
||||||
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ]
|
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621697b96f74e6f3d" ]
|
||||||
},
|
},
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- HTML for static distribution bundle build -->
|
<!-- HTML for static distribution bundle build -->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|
@ -112,23 +112,8 @@
|
||||||
}, info: function () {
|
}, info: function () {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
fn: {
|
|
||||||
opsFilter: function (taggedOps, phrase) {
|
|
||||||
var normalPhrase = phrase.toLowerCase();
|
|
||||||
return taggedOps.map(function (tagObj, tag) {
|
|
||||||
var operations = tagObj.get("operations").filter(function (op) {
|
|
||||||
var summary = op.getIn(["operation", "summary"]) || "";
|
|
||||||
var path = op.get("path") || "";
|
|
||||||
var tagMatch = tag.toLowerCase().indexOf(normalPhrase) !== -1;
|
|
||||||
return tagMatch || summary.toLowerCase().indexOf(normalPhrase) !== -1 || path.toLowerCase().indexOf(normalPhrase) !== -1;
|
|
||||||
});
|
|
||||||
return tagObj.set("operations", operations);
|
|
||||||
}).filter(function (tagObj) {
|
|
||||||
return tagObj.get("operations").size > 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,11 @@ public class TrialGlobalLimitActionFilter(IFusionCache _fusionCache, IUserInfo _
|
||||||
var requestHost = context.HttpContext.Request.Host;
|
var requestHost = context.HttpContext.Request.Host;
|
||||||
|
|
||||||
// 检查请求是否来自 localhost:6100
|
// 检查请求是否来自 localhost:6100
|
||||||
if (requestHost.Host == "localhost" && (requestHost.Port == 6100 || requestHost.Port == 3305))
|
//if (requestHost.Host == "localhost" && (requestHost.Port == 6100 || requestHost.Port == 3305))
|
||||||
{
|
//{
|
||||||
await next();
|
// await next();
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
#region 特殊用户类型拦截
|
#region 特殊用户类型拦截
|
||||||
// 用户类型检查
|
// 用户类型检查
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using DocumentFormat.OpenXml.Spreadsheet;
|
namespace IRaCIS.Core.Application.Helper;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Helper;
|
|
||||||
|
|
||||||
|
|
||||||
public static class CacheKeys
|
public static class CacheKeys
|
||||||
|
|
@ -68,9 +66,6 @@ public static class CacheKeys
|
||||||
|
|
||||||
public static string UserMFATag(Guid userId) => $"UserMFAVerifyPass:{userId}";
|
public static string UserMFATag(Guid userId) => $"UserMFAVerifyPass:{userId}";
|
||||||
|
|
||||||
public static string TrialDataStoreType(Guid trialId) => $"TrialDataStoreType:{trialId}";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CacheHelper
|
public static class CacheHelper
|
||||||
|
|
@ -82,9 +77,6 @@ public static class CacheHelper
|
||||||
return statusStr;
|
return statusStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static async Task<List<SystemAnonymization>> GetSystemAnonymizationListAsync(IRepository<SystemAnonymization> _systemAnonymizationRepository)
|
public static async Task<List<SystemAnonymization>> GetSystemAnonymizationListAsync(IRepository<SystemAnonymization> _systemAnonymizationRepository)
|
||||||
{
|
{
|
||||||
var list = await _systemAnonymizationRepository.Where(t => t.IsEnable).ToListAsync();
|
var list = await _systemAnonymizationRepository.Where(t => t.IsEnable).ToListAsync();
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
using DocumentFormat.OpenXml.Office.CustomUI;
|
using DocumentFormat.OpenXml.Office.CustomUI;
|
||||||
using FellowOakDicom;
|
using FellowOakDicom;
|
||||||
using FellowOakDicom.Media;
|
using FellowOakDicom.Media;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
@ -60,10 +58,6 @@ namespace IRaCIS.Core.Application.Helper
|
||||||
var mappings = new List<string>();
|
var mappings = new List<string>();
|
||||||
int index = 1;
|
int index = 1;
|
||||||
|
|
||||||
var trialId = Guid.Empty;
|
|
||||||
|
|
||||||
Guid.TryParse(ossFolder.Split('/', StringSplitOptions.RemoveEmptyEntries)[0], out trialId);
|
|
||||||
|
|
||||||
var studyUid=list.FirstOrDefault()?.StudyInstanceUid;
|
var studyUid=list.FirstOrDefault()?.StudyInstanceUid;
|
||||||
|
|
||||||
var dicomDir = new DicomDirectory();
|
var dicomDir = new DicomDirectory();
|
||||||
|
|
@ -136,7 +130,7 @@ namespace IRaCIS.Core.Application.Helper
|
||||||
// 重置流位置
|
// 重置流位置
|
||||||
memoryStream.Position = 0;
|
memoryStream.Position = 0;
|
||||||
|
|
||||||
var relativePath = await _oSSService.UploadToOSSAsync(memoryStream, ossFolder, "DICOMDIR", true, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = trialId, BatchDataType = BatchDataType.DICOMDIR });
|
var relativePath= await _oSSService.UploadToOSSAsync(memoryStream, ossFolder, "DICOMDIR", true);
|
||||||
|
|
||||||
dic.Add($"{studyUid}_DICOMDIR" , relativePath.Split('/').Last());
|
dic.Add($"{studyUid}_DICOMDIR" , relativePath.Split('/').Last());
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +146,7 @@ namespace IRaCIS.Core.Application.Helper
|
||||||
var mappingText = string.Join(Environment.NewLine, mappings);
|
var mappingText = string.Join(Environment.NewLine, mappings);
|
||||||
await using var mappingStream = new MemoryStream(Encoding.UTF8.GetBytes(mappingText));
|
await using var mappingStream = new MemoryStream(Encoding.UTF8.GetBytes(mappingText));
|
||||||
|
|
||||||
await _oSSService.UploadToOSSAsync(mappingStream, ossFolder, $"Download_{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}", false, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = trialId, BatchDataType = BatchDataType.DICOMDIR });
|
await _oSSService.UploadToOSSAsync(mappingStream, ossFolder, $"Download_{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}", false);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,6 @@ using Amazon.S3;
|
||||||
using Amazon.S3.Model;
|
using Amazon.S3.Model;
|
||||||
using Amazon.SecurityToken;
|
using Amazon.SecurityToken;
|
||||||
using Amazon.SecurityToken.Model;
|
using Amazon.SecurityToken.Model;
|
||||||
using DocumentFormat.OpenXml.Bibliography;
|
|
||||||
using IRaCIS.Application.Contracts;
|
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using IRaCIS.Core.Infrastructure.NewtonsoftJson;
|
using IRaCIS.Core.Infrastructure.NewtonsoftJson;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
|
@ -20,8 +16,6 @@ using Minio;
|
||||||
using Minio.DataModel;
|
using Minio.DataModel;
|
||||||
using Minio.DataModel.Args;
|
using Minio.DataModel.Args;
|
||||||
using Minio.Exceptions;
|
using Minio.Exceptions;
|
||||||
using Serilog.Parsing;
|
|
||||||
using SkiaSharp;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
@ -86,28 +80,6 @@ public class ObjectStoreServiceOptions
|
||||||
|
|
||||||
public AWSOptions AWS { get; set; }
|
public AWSOptions AWS { get; set; }
|
||||||
|
|
||||||
public bool IsOpenStoreSync { get; set; }
|
|
||||||
|
|
||||||
public string ApiDeployRegion { get; set; }
|
|
||||||
|
|
||||||
public List<SyncStoreConfig> SyncConfigList { get; set; } = new List<SyncStoreConfig>();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SyncStoreConfig
|
|
||||||
{
|
|
||||||
public string Domain { get; set; }
|
|
||||||
|
|
||||||
public string UploadRegion { get; set; }
|
|
||||||
|
|
||||||
public string TargetRegion { get; set; }
|
|
||||||
|
|
||||||
public string Primary { get; set; }
|
|
||||||
|
|
||||||
public string Target { get; set; }
|
|
||||||
|
|
||||||
public bool IsOpenSync { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ObjectStoreDTO
|
public class ObjectStoreDTO
|
||||||
|
|
@ -121,10 +93,6 @@ public class ObjectStoreDTO
|
||||||
|
|
||||||
public AWSTempToken AWS { get; set; }
|
public AWSTempToken AWS { get; set; }
|
||||||
|
|
||||||
public bool IsOpenStoreSync { get; set; }
|
|
||||||
|
|
||||||
public List<SyncStoreConfig> SyncConfigList { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[LowerCamelCaseJson]
|
[LowerCamelCaseJson]
|
||||||
|
|
@ -169,7 +137,6 @@ public enum ObjectStoreUse
|
||||||
AWS = 2,
|
AWS = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// aws 参考链接 https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv3/S3/S3_Basics
|
// aws 参考链接 https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv3/S3/S3_Basics
|
||||||
|
|
@ -180,8 +147,8 @@ public interface IOSSService
|
||||||
public Task RestoreFilesByPrefixAsync(string prefix, int restoreDays = 3, int batchSize = 100);
|
public Task RestoreFilesByPrefixAsync(string prefix, int restoreDays = 3, int batchSize = 100);
|
||||||
|
|
||||||
|
|
||||||
public Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true, FileUploadRecordAddOrEdit? uploadInfo = null);
|
public Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true);
|
||||||
public Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true, bool randomFileName = false, FileUploadRecordAddOrEdit? uploadInfo = null);
|
public Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true, bool randomFileName = false);
|
||||||
|
|
||||||
public Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath);
|
public Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath);
|
||||||
|
|
||||||
|
|
@ -197,27 +164,28 @@ public interface IOSSService
|
||||||
|
|
||||||
List<string> GetRootFolderNames();
|
List<string> GetRootFolderNames();
|
||||||
|
|
||||||
public ObjectStoreDTO GetObjectStoreTempToken(string? domain = null, bool? isGetAllTempToken = null, string? objectUse = null);
|
public ObjectStoreDTO GetObjectStoreTempToken();
|
||||||
|
|
||||||
public Task MoveObject(string sourcePath, string destPath, bool overwrite = true);
|
public Task MoveObject(string sourcePath, string destPath, bool overwrite = true);
|
||||||
|
|
||||||
public Task<long> GetObjectSizeAsync(string sourcePath);
|
public Task<long> GetObjectSizeAsync(string sourcePath);
|
||||||
|
|
||||||
public Task SyncFileAsync(string objectKey, ObjectStoreUse source, ObjectStoreUse destination, CancellationToken ct = default);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
public class OSSService : IOSSService
|
||||||
IFileUploadRecordService _fileUploadRecordService) : IOSSService
|
|
||||||
{
|
{
|
||||||
public ObjectStoreServiceOptions ObjectStoreServiceOptions { get; set; } = options.CurrentValue;
|
public ObjectStoreServiceOptions ObjectStoreServiceOptions { get; set; }
|
||||||
|
|
||||||
private AliyunOSSTempToken AliyunOSSTempToken { get; set; }
|
private AliyunOSSTempToken AliyunOSSTempToken { get; set; }
|
||||||
|
|
||||||
private AWSTempToken AWSTempToken { get; set; }
|
private AWSTempToken AWSTempToken { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||||
|
{
|
||||||
|
ObjectStoreServiceOptions = options.CurrentValue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将指定前缀下的所有现有文件立即转为目标存储类型
|
/// 将指定前缀下的所有现有文件立即转为目标存储类型
|
||||||
|
|
@ -538,8 +506,8 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region),
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
using var client = new AmazonS3Client(credentials, clientConfig);
|
using var client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
@ -718,8 +686,8 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
//提供awsEndPoint(域名)进行访问配置
|
//提供awsEndPoint(域名)进行访问配置
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
@ -732,9 +700,6 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
/// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -742,9 +707,8 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
/// <param name="oosFolderPath"></param>
|
/// <param name="oosFolderPath"></param>
|
||||||
/// <param name="fileRealName"></param>
|
/// <param name="fileRealName"></param>
|
||||||
/// <param name="isFileNameAddGuid"></param>
|
/// <param name="isFileNameAddGuid"></param>
|
||||||
/// <param name="uploadInfo"> 只用赋值业务参数Id 和批次信息即可,其他信息不用传递</param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true, FileUploadRecordAddOrEdit? uploadInfo = null)
|
public async Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true)
|
||||||
{
|
{
|
||||||
BackBatchGetToken();
|
BackBatchGetToken();
|
||||||
|
|
||||||
|
|
@ -752,9 +716,14 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (fileStream.CanSeek)
|
using (var memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
fileStream.Seek(0, SeekOrigin.Begin);
|
fileStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
fileStream.CopyTo(memoryStream);
|
||||||
|
|
||||||
|
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
|
||||||
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
{
|
{
|
||||||
|
|
@ -765,7 +734,7 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
|
|
||||||
// 上传文件
|
// 上传文件
|
||||||
var result = _ossClient.PutObject(aliConfig.BucketName, ossRelativePath, fileStream);
|
var result = _ossClient.PutObject(aliConfig.BucketName, ossRelativePath, memoryStream);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
|
|
@ -780,8 +749,8 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
var putObjectArgs = new PutObjectArgs()
|
var putObjectArgs = new PutObjectArgs()
|
||||||
.WithBucket(minIOConfig.BucketName)
|
.WithBucket(minIOConfig.BucketName)
|
||||||
.WithObject(ossRelativePath)
|
.WithObject(ossRelativePath)
|
||||||
.WithStreamData(fileStream)
|
.WithStreamData(memoryStream)
|
||||||
.WithObjectSize(fileStream.Length);
|
.WithObjectSize(memoryStream.Length);
|
||||||
|
|
||||||
await minioClient.PutObjectAsync(putObjectArgs);
|
await minioClient.PutObjectAsync(putObjectArgs);
|
||||||
}
|
}
|
||||||
|
|
@ -805,7 +774,7 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
var putObjectRequest = new Amazon.S3.Model.PutObjectRequest()
|
var putObjectRequest = new Amazon.S3.Model.PutObjectRequest()
|
||||||
{
|
{
|
||||||
BucketName = awsConfig.BucketName,
|
BucketName = awsConfig.BucketName,
|
||||||
InputStream = fileStream,
|
InputStream = memoryStream,
|
||||||
Key = ossRelativePath,
|
Key = ossRelativePath,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -816,6 +785,7 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -823,27 +793,13 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var returnPath = "/" + ossRelativePath;
|
|
||||||
|
|
||||||
|
|
||||||
if (ObjectStoreServiceOptions.IsOpenStoreSync && uploadInfo != null)
|
return "/" + ossRelativePath;
|
||||||
{
|
|
||||||
uploadInfo.FileSize = fileStream.CanSeek ? fileStream.Length : 0;
|
|
||||||
uploadInfo.Path = returnPath;
|
|
||||||
uploadInfo.FileName = fileRealName;
|
|
||||||
uploadInfo.FileType = Path.GetExtension(returnPath);
|
|
||||||
|
|
||||||
|
|
||||||
await _fileUploadRecordService.AddOrUpdateFileUploadRecord(uploadInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return returnPath;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//后端批量上传 或者下载,不每个文件获取临时token
|
//后端批量上传 或者下载,不每个文件获取临时token
|
||||||
private void BackBatchGetToken()
|
private void BackBatchGetToken()
|
||||||
{
|
{
|
||||||
|
|
@ -885,12 +841,10 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
/// <param name="randomFileName">随机文件名</param>
|
/// <param name="randomFileName">随机文件名</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
public async Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true, bool randomFileName = false, FileUploadRecordAddOrEdit? uploadInfo = null)
|
public async Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true, bool randomFileName = false)
|
||||||
{
|
{
|
||||||
BackBatchGetToken();
|
BackBatchGetToken();
|
||||||
|
|
||||||
long fileSize = 0;
|
|
||||||
|
|
||||||
var localFileName = Path.GetFileName(localFilePath);
|
var localFileName = Path.GetFileName(localFilePath);
|
||||||
|
|
||||||
var ossRelativePath = isFileNameAddGuid ? $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}" : $"{oosFolderPath}/{localFileName}";
|
var ossRelativePath = isFileNameAddGuid ? $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}" : $"{oosFolderPath}/{localFileName}";
|
||||||
|
|
@ -910,8 +864,6 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
// 上传文件
|
// 上传文件
|
||||||
var result = _ossClient.PutObject(aliConfig.BucketName, ossRelativePath, localFilePath);
|
var result = _ossClient.PutObject(aliConfig.BucketName, ossRelativePath, localFilePath);
|
||||||
|
|
||||||
fileSize = result.ContentLength;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
{
|
{
|
||||||
|
|
@ -927,9 +879,7 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
.WithObject(ossRelativePath)
|
.WithObject(ossRelativePath)
|
||||||
.WithFileName(localFilePath);
|
.WithFileName(localFilePath);
|
||||||
|
|
||||||
var result = await minioClient.PutObjectAsync(putObjectArgs);
|
await minioClient.PutObjectAsync(putObjectArgs);
|
||||||
|
|
||||||
fileSize = result.Size;
|
|
||||||
}
|
}
|
||||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||||
{
|
{
|
||||||
|
|
@ -954,30 +904,14 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
Key = ossRelativePath,
|
Key = ossRelativePath,
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = await amazonS3Client.PutObjectAsync(putObjectRequest);
|
await amazonS3Client.PutObjectAsync(putObjectRequest);
|
||||||
fileSize = result.ContentLength;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||||
}
|
}
|
||||||
|
return "/" + ossRelativePath;
|
||||||
var returnPath = "/" + ossRelativePath;
|
|
||||||
|
|
||||||
|
|
||||||
if (ObjectStoreServiceOptions.IsOpenStoreSync && uploadInfo != null)
|
|
||||||
{
|
|
||||||
uploadInfo.FileSize = fileSize;
|
|
||||||
uploadInfo.Path = returnPath;
|
|
||||||
uploadInfo.FileName = Path.GetFileName(localFilePath);
|
|
||||||
uploadInfo.FileType = Path.GetExtension(returnPath);
|
|
||||||
|
|
||||||
|
|
||||||
await _fileUploadRecordService.AddOrUpdateFileUploadRecord(uploadInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return returnPath;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1089,6 +1023,11 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
// 直接返回流
|
// 直接返回流
|
||||||
return result.Content;
|
return result.Content;
|
||||||
|
|
||||||
|
//// 将OSS返回的流复制到内存流中并返回
|
||||||
|
//var memoryStream = new MemoryStream();
|
||||||
|
//await result.Content.CopyToAsync(memoryStream);
|
||||||
|
//memoryStream.Position = 0; // 重置位置以便读取
|
||||||
|
//return memoryStream;
|
||||||
}
|
}
|
||||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
{
|
{
|
||||||
|
|
@ -1137,8 +1076,8 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
@ -1154,6 +1093,10 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
// ⭐ 直接返回流
|
// ⭐ 直接返回流
|
||||||
return response.ResponseStream;
|
return response.ResponseStream;
|
||||||
|
|
||||||
|
//var memoryStream = new MemoryStream();
|
||||||
|
//await response.ResponseStream.CopyToAsync(memoryStream);
|
||||||
|
//memoryStream.Position = 0;
|
||||||
|
//return memoryStream;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1394,8 +1337,8 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
var clientConfig = new AmazonS3Config
|
var clientConfig = new AmazonS3Config
|
||||||
{
|
{
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
//,UseHttp = true,
|
UseHttp = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
@ -1496,33 +1439,10 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
/// <param name="prefix"></param>
|
/// <param name="prefix"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task DeleteFromPrefix(string prefix, bool isCache = false)
|
public async Task DeleteFromPrefix(string prefix, bool isCache = false)
|
||||||
{
|
|
||||||
|
|
||||||
//打开了同步的,删除的时候,一起删除
|
|
||||||
if (ObjectStoreServiceOptions.IsOpenStoreSync && ObjectStoreServiceOptions.SyncConfigList.Any(t => t.IsOpenSync))
|
|
||||||
{
|
|
||||||
foreach (var config in ObjectStoreServiceOptions.SyncConfigList.Where(t => t.IsOpenSync))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
GetObjectStoreTempToken(objectUse: config.Primary);
|
|
||||||
|
|
||||||
await DeleteFromPrefixInternal(config.Primary,prefix, isCache);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
GetObjectStoreTempToken();
|
GetObjectStoreTempToken();
|
||||||
|
|
||||||
await DeleteFromPrefixInternal(ObjectStoreServiceOptions.ObjectStoreUse,prefix, isCache);
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private async Task DeleteFromPrefixInternal(string objectUse ,string prefix, bool isCache = false)
|
|
||||||
{
|
|
||||||
if (objectUse == "AliyunOSS")
|
|
||||||
{
|
{
|
||||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
|
|
@ -1578,7 +1498,7 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (objectUse == "MinIO")
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
{
|
{
|
||||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||||
|
|
||||||
|
|
@ -1615,7 +1535,7 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (objectUse == "AWS")
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||||
{
|
{
|
||||||
|
|
||||||
var awsConfig = ObjectStoreServiceOptions.AWS;
|
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
@ -1671,31 +1591,8 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task DeleteObjects(List<string> objectKeys, bool isCache = false)
|
public async Task DeleteObjects(List<string> objectKeys, bool isCache = false)
|
||||||
{
|
{
|
||||||
//打开了同步的,删除的时候,一起删除
|
|
||||||
if (ObjectStoreServiceOptions.IsOpenStoreSync && ObjectStoreServiceOptions.SyncConfigList.Any(t => t.IsOpenSync))
|
|
||||||
{
|
|
||||||
foreach (var config in ObjectStoreServiceOptions.SyncConfigList.Where(t => t.IsOpenSync))
|
|
||||||
{
|
|
||||||
|
|
||||||
GetObjectStoreTempToken(objectUse: config.Primary);
|
|
||||||
|
|
||||||
await DeleteObjectsInternal(objectKeys, isCache);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GetObjectStoreTempToken();
|
|
||||||
|
|
||||||
await DeleteObjectsInternal(objectKeys, isCache);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public async Task DeleteObjectsInternal(List<string> objectKeys, bool isCache = false)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
GetObjectStoreTempToken();
|
GetObjectStoreTempToken();
|
||||||
|
|
||||||
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
|
|
@ -1858,42 +1755,13 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ObjectStoreDTO GetObjectStoreTempToken(string? domain = null, bool? isGetAllTempToken = null, string? objectUse = null)
|
public ObjectStoreDTO GetObjectStoreTempToken()
|
||||||
{
|
|
||||||
string objectStoreUse = string.Empty;
|
|
||||||
//使用指定配置
|
|
||||||
if (objectUse != null)
|
|
||||||
{
|
|
||||||
objectStoreUse = objectUse?.Trim() ?? string.Empty;
|
|
||||||
}
|
|
||||||
//根据域名动态判断
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//如果传递了域名,并且打开了存储同步,根据域名使用的具体存储覆盖之前的配置,否则就用固定的配置
|
|
||||||
if (ObjectStoreServiceOptions.IsOpenStoreSync && domain.IsNotNullOrEmpty() && ObjectStoreServiceOptions.SyncConfigList.Any(t => t.Domain == domain))
|
|
||||||
{
|
{
|
||||||
|
|
||||||
var find = ObjectStoreServiceOptions.SyncConfigList.FirstOrDefault(t => t.Domain == domain);
|
|
||||||
if (find != null)
|
|
||||||
{
|
|
||||||
objectStoreUse = find.Primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//兜底,如果是本地测试环境,那就使用部署默认配置
|
|
||||||
objectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var objectStoreDTO = new ObjectStoreDTO() { ObjectStoreUse = objectStoreUse, IsOpenStoreSync = ObjectStoreServiceOptions.IsOpenStoreSync, SyncConfigList = ObjectStoreServiceOptions.SyncConfigList };
|
|
||||||
|
|
||||||
if (objectStoreUse == "AliyunOSS" || isGetAllTempToken == true)
|
|
||||||
{
|
|
||||||
var ossOptions = ObjectStoreServiceOptions.AliyunOSS;
|
var ossOptions = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
|
{
|
||||||
var client = new Client(new AlibabaCloud.OpenApiClient.Models.Config()
|
var client = new Client(new AlibabaCloud.OpenApiClient.Models.Config()
|
||||||
{
|
{
|
||||||
AccessKeyId = ossOptions.AccessKeyId,
|
AccessKeyId = ossOptions.AccessKeyId,
|
||||||
|
|
@ -1935,14 +1803,13 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
|
|
||||||
AliyunOSSTempToken = tempToken;
|
AliyunOSSTempToken = tempToken;
|
||||||
|
|
||||||
objectStoreDTO.AliyunOSS = tempToken;
|
return new ObjectStoreDTO() { ObjectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse, AliyunOSS = tempToken };
|
||||||
|
|
||||||
}
|
}
|
||||||
if (objectStoreUse == "MinIO")
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
{
|
{
|
||||||
objectStoreDTO.MinIO = ObjectStoreServiceOptions.MinIO;
|
return new ObjectStoreDTO() { ObjectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse, MinIO = ObjectStoreServiceOptions.MinIO };
|
||||||
}
|
}
|
||||||
if (objectStoreUse == "AWS" || isGetAllTempToken == true)
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||||
{
|
{
|
||||||
var awsOptions = ObjectStoreServiceOptions.AWS;
|
var awsOptions = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
||||||
|
|
@ -1984,111 +1851,12 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
||||||
};
|
};
|
||||||
|
|
||||||
AWSTempToken = tempToken;
|
AWSTempToken = tempToken;
|
||||||
|
return new ObjectStoreDTO() { ObjectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse, AWS = tempToken };
|
||||||
objectStoreDTO.AWS = tempToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (objectStoreUse.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
|
||||||
}
|
|
||||||
|
|
||||||
return objectStoreDTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public async Task SyncFileAsync(string objectKey, ObjectStoreUse source, ObjectStoreUse destination, CancellationToken ct = default)
|
|
||||||
{
|
|
||||||
var tempConfig = GetObjectStoreTempToken(isGetAllTempToken: true);
|
|
||||||
|
|
||||||
|
|
||||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
|
||||||
|
|
||||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
|
||||||
|
|
||||||
var awsConfig = ObjectStoreServiceOptions.AWS;
|
|
||||||
|
|
||||||
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
|
|
||||||
|
|
||||||
//提供awsEndPoint(域名)进行访问配置
|
|
||||||
var clientConfig = new AmazonS3Config
|
|
||||||
{
|
|
||||||
RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region)
|
|
||||||
};
|
|
||||||
|
|
||||||
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
|
||||||
|
|
||||||
// ⭐ 关键变量
|
|
||||||
IDisposable? owner = null;
|
|
||||||
Stream sourceStream;
|
|
||||||
long contentLength;
|
|
||||||
|
|
||||||
// ========= 获取流 + 长度 =========
|
|
||||||
switch (source)
|
|
||||||
{
|
|
||||||
case ObjectStoreUse.AliyunOSS:
|
|
||||||
{
|
|
||||||
|
|
||||||
var obj = _ossClient.GetObject(
|
|
||||||
aliConfig.BucketName,
|
|
||||||
objectKey);
|
|
||||||
|
|
||||||
owner = obj;
|
|
||||||
sourceStream = obj.Content;
|
|
||||||
contentLength = obj.ContentLength;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ObjectStoreUse.AWS:
|
|
||||||
{
|
|
||||||
var response = await amazonS3Client.GetObjectAsync(
|
|
||||||
awsConfig.BucketName,
|
|
||||||
objectKey,
|
|
||||||
ct);
|
|
||||||
|
|
||||||
owner = response;
|
|
||||||
sourceStream = response.ResponseStream;
|
|
||||||
contentLength = response.Headers.ContentLength;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new BusinessValidationFailedException("未定义的同步类型");
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// ========= 上传 =========
|
|
||||||
if (destination == ObjectStoreUse.AWS)
|
|
||||||
{
|
|
||||||
var putRequest = new Amazon.S3.Model.PutObjectRequest
|
|
||||||
{
|
|
||||||
BucketName = awsConfig.BucketName,
|
|
||||||
Key = objectKey,
|
|
||||||
InputStream = sourceStream,
|
|
||||||
Headers = { ContentLength = contentLength }
|
|
||||||
};
|
|
||||||
|
|
||||||
await amazonS3Client.PutObjectAsync(putRequest, ct);
|
|
||||||
}
|
|
||||||
else if (destination == ObjectStoreUse.AliyunOSS)
|
|
||||||
{
|
|
||||||
_ossClient.PutObject(
|
|
||||||
aliConfig.BucketName,
|
|
||||||
objectKey,
|
|
||||||
sourceStream);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("未定义的同步类型");
|
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
// ⭐⭐⭐ 真正释放 HTTP 连接
|
|
||||||
owner?.Dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,193 +0,0 @@
|
||||||
|
|
||||||
using FellowOakDicom.Imaging;
|
|
||||||
using SixLabors.ImageSharp;
|
|
||||||
using SixLabors.ImageSharp.Formats.Jpeg;
|
|
||||||
using SixLabors.ImageSharp.Processing;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Helper;
|
|
||||||
|
|
||||||
|
|
||||||
public static class DicomSliceSorterFast
|
|
||||||
{
|
|
||||||
public static List<T> Sort<T>(
|
|
||||||
IEnumerable<T> source,
|
|
||||||
Func<T, string?> ippSelector,
|
|
||||||
Func<T, string?> iopSelector,
|
|
||||||
Func<T, int?> instanceSelector)
|
|
||||||
{
|
|
||||||
var items = source.ToList();
|
|
||||||
if (items.Count < 2)
|
|
||||||
return items;
|
|
||||||
|
|
||||||
var refIPP = Parse(ippSelector(items[0]));
|
|
||||||
var refIOP = Parse(iopSelector(items[0]));
|
|
||||||
|
|
||||||
if (refIPP == null || refIOP == null || refIOP.Length != 6)
|
|
||||||
return items.OrderBy(instanceSelector).ToList();
|
|
||||||
|
|
||||||
// normal
|
|
||||||
var nx = refIOP[1] * refIOP[5] - refIOP[2] * refIOP[4];
|
|
||||||
var ny = refIOP[2] * refIOP[3] - refIOP[0] * refIOP[5];
|
|
||||||
var nz = refIOP[0] * refIOP[4] - refIOP[1] * refIOP[3];
|
|
||||||
|
|
||||||
var projections = new (T item, double dist)[items.Count];
|
|
||||||
|
|
||||||
double min = double.MaxValue;
|
|
||||||
double max = double.MinValue;
|
|
||||||
|
|
||||||
// ---------- projection pass ----------
|
|
||||||
for (int i = 0; i < items.Count; i++)
|
|
||||||
{
|
|
||||||
var ipp = Parse(ippSelector(items[i]));
|
|
||||||
if (ipp == null)
|
|
||||||
return items.OrderBy(instanceSelector).ToList();
|
|
||||||
|
|
||||||
var dx = refIPP[0] - ipp[0];
|
|
||||||
var dy = refIPP[1] - ipp[1];
|
|
||||||
var dz = refIPP[2] - ipp[2];
|
|
||||||
|
|
||||||
var dist = dx * nx + dy * ny + dz * nz;
|
|
||||||
|
|
||||||
projections[i] = (items[i], dist);
|
|
||||||
|
|
||||||
if (dist < min) min = dist;
|
|
||||||
if (dist > max) max = dist;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- estimate spacing ----------
|
|
||||||
var spacing = (max - min) / (items.Count - 1);
|
|
||||||
if (Math.Abs(spacing) < 1e-6)
|
|
||||||
return items.OrderBy(instanceSelector).ToList();
|
|
||||||
|
|
||||||
var result = new T[items.Count];
|
|
||||||
|
|
||||||
// ---------- O(n) placement ----------
|
|
||||||
foreach (var p in projections)
|
|
||||||
{
|
|
||||||
var index = (int)Math.Round((p.dist - min) / spacing);
|
|
||||||
|
|
||||||
index = Math.Clamp(index, 0, items.Count - 1);
|
|
||||||
|
|
||||||
// collision fallback(极少发生)
|
|
||||||
while (result[index] != null!)
|
|
||||||
index = Math.Min(index + 1, items.Count - 1);
|
|
||||||
|
|
||||||
result[index] = p.item;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static double[]? Parse(string? value)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(value))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var s = value.Split('\\');
|
|
||||||
var r = new double[s.Length];
|
|
||||||
|
|
||||||
for (int i = 0; i < s.Length; i++)
|
|
||||||
if (!double.TryParse(s[i], out r[i]))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class DicomSortHelper
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// DICOM Slice 排序(IPP + IOP)
|
|
||||||
/// 自动 fallback InstanceNumber
|
|
||||||
/// </summary>
|
|
||||||
public static List<T> SortSlices<T>(
|
|
||||||
IEnumerable<T> source,
|
|
||||||
Func<T, string?> ippSelector,
|
|
||||||
Func<T, string?> iopSelector,
|
|
||||||
Func<T, int?> instanceNumberSelector)
|
|
||||||
{
|
|
||||||
var list = source.ToList();
|
|
||||||
if (list.Count < 2)
|
|
||||||
return list;
|
|
||||||
|
|
||||||
var first = list[0];
|
|
||||||
|
|
||||||
var reference = ParseVector(ippSelector(first));
|
|
||||||
var iop = ParseVector(iopSelector(first));
|
|
||||||
|
|
||||||
// ===== fallback 条件 =====
|
|
||||||
if (reference == null || iop == null || iop.Length != 6)
|
|
||||||
return list.OrderBy(instanceNumberSelector).ToList();
|
|
||||||
|
|
||||||
// row / column direction
|
|
||||||
var row = new[] { iop[0], iop[1], iop[2] };
|
|
||||||
var col = new[] { iop[3], iop[4], iop[5] };
|
|
||||||
|
|
||||||
// normal = row × col
|
|
||||||
var normal = new[]
|
|
||||||
{
|
|
||||||
row[1]*col[2] - row[2]*col[1],
|
|
||||||
row[2]*col[0] - row[0]*col[2],
|
|
||||||
row[0]*col[1] - row[1]*col[0]
|
|
||||||
};
|
|
||||||
|
|
||||||
// 如果法向量异常 → fallback
|
|
||||||
if (IsZeroVector(normal))
|
|
||||||
return list.OrderBy(instanceNumberSelector).ToList();
|
|
||||||
|
|
||||||
// ===== 计算距离 =====
|
|
||||||
var sorted = list
|
|
||||||
.Select(item =>
|
|
||||||
{
|
|
||||||
var ipp = ParseVector(ippSelector(item));
|
|
||||||
|
|
||||||
if (ipp == null)
|
|
||||||
return (item, distance: double.MinValue);
|
|
||||||
|
|
||||||
var vec0 = reference[0] - ipp[0];
|
|
||||||
var vec1 = reference[1] - ipp[1];
|
|
||||||
var vec2 = reference[2] - ipp[2];
|
|
||||||
|
|
||||||
var distance =
|
|
||||||
vec0 * normal[0] +
|
|
||||||
vec1 * normal[1] +
|
|
||||||
vec2 * normal[2];
|
|
||||||
|
|
||||||
return (item, distance);
|
|
||||||
})
|
|
||||||
.OrderByDescending(x => x.distance)
|
|
||||||
.Select(x => x.item)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
return sorted;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------- helpers ----------------
|
|
||||||
|
|
||||||
private static double[]? ParseVector(string? value)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(value))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var parts = value.Split('\\');
|
|
||||||
var result = new double[parts.Length];
|
|
||||||
|
|
||||||
for (int i = 0; i < parts.Length; i++)
|
|
||||||
{
|
|
||||||
if (!double.TryParse(parts[i], out result[i]))
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool IsZeroVector(double[] v)
|
|
||||||
{
|
|
||||||
const double eps = 1e-6;
|
|
||||||
return Math.Abs(v[0]) < eps &&
|
|
||||||
Math.Abs(v[1]) < eps &&
|
|
||||||
Math.Abs(v[2]) < eps;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -47,11 +47,11 @@
|
||||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.2.2" />
|
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.2.2" />
|
||||||
<PackageReference Include="fo-dicom.Codecs" Version="5.16.4" />
|
<PackageReference Include="fo-dicom.Codecs" Version="5.16.4" />
|
||||||
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
||||||
<PackageReference Include="MailKit" Version="4.15.1" />
|
<PackageReference Include="MailKit" Version="4.11.0" />
|
||||||
<PackageReference Include="Masa.Contrib.Service.MinimalAPIs" Version="1.0.0" />
|
<PackageReference Include="Masa.Contrib.Service.MinimalAPIs" Version="1.0.0" />
|
||||||
<PackageReference Include="MaxMind.GeoIP2" Version="5.3.0" />
|
<PackageReference Include="MaxMind.GeoIP2" Version="5.3.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
|
||||||
<PackageReference Include="MimeKit" Version="4.15.1" />
|
<PackageReference Include="MimeKit" Version="4.11.0" />
|
||||||
<PackageReference Include="MiniExcel" Version="1.41.2" />
|
<PackageReference Include="MiniExcel" Version="1.41.2" />
|
||||||
<PackageReference Include="Minio" Version="6.0.3" />
|
<PackageReference Include="Minio" Version="6.0.3" />
|
||||||
<PackageReference Include="MiniWord" Version="0.9.2" />
|
<PackageReference Include="MiniWord" Version="0.9.2" />
|
||||||
|
|
|
||||||
|
|
@ -1556,103 +1556,6 @@
|
||||||
<param name="_attachmentrepository"></param>
|
<param name="_attachmentrepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileUploadRecordService.GetSubjectUploadRecordList(IRaCIS.Core.Application.ViewModel.SubjectFileUploadRecordQuery)">
|
|
||||||
<summary>
|
|
||||||
按照 subject visit studyCode 三个维度进行分组的查询列表 (subject相关)
|
|
||||||
</summary>
|
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileUploadRecordService.GetFileUploadRecordList(IRaCIS.Core.Application.ViewModel.FileUploadRecordQuery)">
|
|
||||||
<summary>
|
|
||||||
上传记录表--里面包含待同步任务 DataFileType= 0 :代表系统文件 1:Subject相关 2:项目相关,但是和subject 没关系
|
|
||||||
</summary>
|
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileUploadRecordService.GetUploadFileSyncRecordList(IRaCIS.Core.Application.ViewModel.UploadFileSyncRecordQuery)">
|
|
||||||
<summary>
|
|
||||||
任务具体执行记录表
|
|
||||||
</summary>
|
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileUploadRecordService.BatchAddSyncFileTask(IRaCIS.Core.Application.ViewModel.BatchAddSyncFileCommand)">
|
|
||||||
<summary>
|
|
||||||
批量设置为需要同步,并且设置优先级
|
|
||||||
</summary>
|
|
||||||
<param name="inComand"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.Application.Service.FileSyncQueue._queue">
|
|
||||||
<summary>
|
|
||||||
优先级队列(仅负责排序)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.Application.Service.FileSyncQueue._waiting">
|
|
||||||
<summary>
|
|
||||||
当前等待中的任务(唯一真实数据)
|
|
||||||
key = Guid
|
|
||||||
value = 最新 priority
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.Application.Service.FileSyncQueue._running">
|
|
||||||
<summary>
|
|
||||||
正在执行的任务(防止重复执行)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.Application.Service.FileSyncQueue._signal">
|
|
||||||
<summary>
|
|
||||||
worker 等待信号
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileSyncQueue.Enqueue(System.Guid,System.Int32)">
|
|
||||||
<summary>
|
|
||||||
入队(同 Guid 会覆盖优先级)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileSyncQueue.DequeueAsync(System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
获取一个待执行任务(无任务时自动等待)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileSyncQueue.Complete(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
任务执行完成(必须调用)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileSyncQueue.Snapshot">
|
|
||||||
<summary>
|
|
||||||
当前等待中的任务快照
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SyncQueueUseChannel.Enqueue(System.Guid,System.Int32)">
|
|
||||||
<summary>
|
|
||||||
入队任务
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SyncQueueUseChannel.DequeueAsync(System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
Worker 等待并获取任务
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.SyncQueueUseChannel.Count">
|
|
||||||
<summary>
|
|
||||||
当前排队数量(调试用)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.Application.Service.FileSyncScheduler">
|
|
||||||
<summary>
|
|
||||||
同步调度器
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.FileSyncScheduler.WaitAsync(System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
如果没有任务 → 挂起等待 有任务 → 被唤醒并返回
|
|
||||||
</summary>
|
|
||||||
<param name="ct"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.Application.Service.InternationalizationService">
|
<member name="T:IRaCIS.Core.Application.Service.InternationalizationService">
|
||||||
<summary>
|
<summary>
|
||||||
InternationalizationService
|
InternationalizationService
|
||||||
|
|
@ -4504,27 +4407,6 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetEmmSum(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
获取EMM求和
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetEEMLumenSum(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
(EEM-Lumen)求和
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetPAV(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
PAV(冠状动脉粥样硬化体积百分比)
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.AddTaskLesionAnswerFromLastTask(IRaCIS.Core.Application.ViewModel.AddTaskLesionAnswerFromLastTaskInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.AddTaskLesionAnswerFromLastTask(IRaCIS.Core.Application.ViewModel.AddTaskLesionAnswerFromLastTaskInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
将上一次的访视病灶添加到这一次
|
将上一次的访视病灶添加到这一次
|
||||||
|
|
@ -6102,62 +5984,6 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMinFCT(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
匹配动脉段最小FCT (平均值的最小值)
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetAvgFCT(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
平均最小FCT (平均值的平均值)
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetAvgLipidAngle(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
脂质角度平均值
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMaxLipidAngle(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
脂质角度最大
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMacrophageInfiltration(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
获取巨噬细胞浸润测量
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMacrophageExtensionAngle(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
巨噬细胞浸润角度测量
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMicrochannels(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
获取微通道汇总
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetCholesterolCrystallization(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
获取胆固醇结晶汇总
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.VerifyVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.VerifyVisitTaskQuestionsInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.VerifyVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.VerifyVisitTaskQuestionsInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
验证访视提交
|
验证访视提交
|
||||||
|
|
@ -7631,13 +7457,6 @@
|
||||||
影像阅片临床数据签名
|
影像阅片临床数据签名
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingClinicalDataService.UpdateReadModuleClinicalData(IRaCIS.Core.Application.Service.Inspection.DTO.UpdateReadModuleClinicalDataInDto)">
|
|
||||||
<summary>
|
|
||||||
修改临床数据后 将签名状态变更为未签名
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingClinicalDataService.GetVisitClinicalDataName(IRaCIS.Core.Application.Service.Reading.Dto.GetVisitClinicalDataNameInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingClinicalDataService.GetVisitClinicalDataName(IRaCIS.Core.Application.Service.Reading.Dto.GetVisitClinicalDataNameInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取访视临床数据名称
|
获取访视临床数据名称
|
||||||
|
|
@ -8833,9 +8652,9 @@
|
||||||
IVUS测量值导入
|
IVUS测量值导入
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.FrameNumber">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.PlaqueNum">
|
||||||
<summary>
|
<summary>
|
||||||
帧数
|
斑块编号
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.Emm">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.Emm">
|
||||||
|
|
@ -8853,9 +8672,9 @@
|
||||||
外弹力膜面积- 管腔面积
|
外弹力膜面积- 管腔面积
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.FrameNumber">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.PlaqueNum">
|
||||||
<summary>
|
<summary>
|
||||||
帧数
|
斑块编号
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.FirstData">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.FirstData">
|
||||||
|
|
@ -8898,11 +8717,6 @@
|
||||||
官腔面积测量
|
官腔面积测量
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.LipidAngle">
|
|
||||||
<summary>
|
|
||||||
脂质角度
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTInfo.PlaqueNum">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTInfo.PlaqueNum">
|
||||||
<summary>
|
<summary>
|
||||||
斑块编号
|
斑块编号
|
||||||
|
|
@ -10993,21 +10807,6 @@
|
||||||
IR阅片页面是否可以查看既往任务结果
|
IR阅片页面是否可以查看既往任务结果
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CloseAndFinishMedicalReview.IsClosedDialog">
|
|
||||||
<summary>
|
|
||||||
是否关闭
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CloseAndFinishMedicalReview.MedicalDialogCloseEnum">
|
|
||||||
<summary>
|
|
||||||
医学审核对话关闭原因
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CloseAndFinishMedicalReview.DialogCloseReason">
|
|
||||||
<summary>
|
|
||||||
对话关闭原因
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.JointMedicalReviewI18n.Msg1">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.JointMedicalReviewI18n.Msg1">
|
||||||
<summary>
|
<summary>
|
||||||
trials:medicalFeedback:message:msg1
|
trials:medicalFeedback:message:msg1
|
||||||
|
|
@ -11753,11 +11552,6 @@
|
||||||
影像标记
|
影像标记
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionTrialAddOrEdit.ImageMarkTypeEnum">
|
|
||||||
<summary>
|
|
||||||
影像标记类型
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionTrialAddOrEdit.IsPreinstall">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionTrialAddOrEdit.IsPreinstall">
|
||||||
<summary>
|
<summary>
|
||||||
是否预设
|
是否预设
|
||||||
|
|
@ -12164,11 +11958,6 @@
|
||||||
影像标记
|
影像标记
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionTrialView.ImageMarkTypeEnum">
|
|
||||||
<summary>
|
|
||||||
影像标记类型
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionTrialView.ImageTool">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionTrialView.ImageTool">
|
||||||
<summary>
|
<summary>
|
||||||
影像工具
|
影像工具
|
||||||
|
|
@ -13109,11 +12898,6 @@
|
||||||
影像标记
|
影像标记
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionTrialInDto.ImageMarkTypeEnum">
|
|
||||||
<summary>
|
|
||||||
影像标记类型
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionTrialInDto.ImageTool">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionTrialInDto.ImageTool">
|
||||||
<summary>
|
<summary>
|
||||||
影像工具
|
影像工具
|
||||||
|
|
@ -14383,20 +14167,6 @@
|
||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingQuestionService.GetReadingQuestionTrialById(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
根据项目问题id获取项目问题信息
|
|
||||||
</summary>
|
|
||||||
<param name="id"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingQuestionService.GetReadingTableQuestionTrialById(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
根据项目表格问题id获取项目表格问题信息
|
|
||||||
</summary>
|
|
||||||
<param name="id"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.Application.Service.SystemCriterionKeyFileService">
|
<member name="T:IRaCIS.Core.Application.Service.SystemCriterionKeyFileService">
|
||||||
<summary>
|
<summary>
|
||||||
系统标准阅片关键点文件服务
|
系统标准阅片关键点文件服务
|
||||||
|
|
@ -14529,7 +14299,7 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingNoneDicomMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingNoneDicomMarkBinding},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserLog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Segmentation},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService,IRaCIS.Core.Application.Service.IReadingCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserFeedBack},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskRelation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganTrialInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService,IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoWithoutPETCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTrialCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CriterionKeyFileRead},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialCriterionKeyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Application.Service.IGeneralCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskStudy},IRaCIS.Core.Application.Service.ImageAndDoc.IDownloadAndUploadService,IRaCIS.Core.Application.Interfaces.ITrialEmailNoticeConfigService,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,ZiggyCreatures.Caching.Fusion.IFusionCache)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingNoneDicomMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingNoneDicomMarkBinding},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserLog},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService,IRaCIS.Core.Application.Service.IReadingCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserFeedBack},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskRelation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganTrialInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService,IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoWithoutPETCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTrialCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CriterionKeyFileRead},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialCriterionKeyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Application.Service.IGeneralCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskStudy},IRaCIS.Core.Application.Service.ImageAndDoc.IDownloadAndUploadService,IRaCIS.Core.Application.Interfaces.ITrialEmailNoticeConfigService,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,ZiggyCreatures.Caching.Fusion.IFusionCache)">
|
||||||
<summary>
|
<summary>
|
||||||
IR影像阅片
|
IR影像阅片
|
||||||
</summary>
|
</summary>
|
||||||
|
|
@ -15307,109 +15077,6 @@
|
||||||
<param name="readModuleId"></param>
|
<param name="readModuleId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.Service.SegmentationService">
|
|
||||||
<summary>
|
|
||||||
分割
|
|
||||||
</summary>
|
|
||||||
<param name="_segmentationRepository"></param>
|
|
||||||
<param name="_mapper"></param>
|
|
||||||
<param name="_userInfo"></param>
|
|
||||||
<param name="_localizer"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Segmentation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SegmentBinding},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Segment},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
|
||||||
<summary>
|
|
||||||
分割
|
|
||||||
</summary>
|
|
||||||
<param name="_segmentationRepository"></param>
|
|
||||||
<param name="_mapper"></param>
|
|
||||||
<param name="_userInfo"></param>
|
|
||||||
<param name="_localizer"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.GetSegmentationList(IRaCIS.Core.Application.ViewModel.SegmentationQuery)">
|
|
||||||
<summary>
|
|
||||||
获取分割组
|
|
||||||
</summary>
|
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.AddOrUpdateSegmentation(IRaCIS.Core.Application.ViewModel.SegmentationAddOrEdit)">
|
|
||||||
<summary>
|
|
||||||
新增修改分割组
|
|
||||||
</summary>
|
|
||||||
<param name="addOrEditSegmentation"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.DeleteSegmentation(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
删除分割组
|
|
||||||
</summary>
|
|
||||||
<param name="segmentationId"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.ChangeSegmentationSavedStatus(IRaCIS.Core.Application.ViewModel.ChangeSegmentationSavedStatusInDto)">
|
|
||||||
<summary>
|
|
||||||
修改分割组的保存状态
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.GetSegmentList(IRaCIS.Core.Application.ViewModel.SegmentQuery)">
|
|
||||||
<summary>
|
|
||||||
获取分割
|
|
||||||
</summary>
|
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.AddOrUpdateSegment(IRaCIS.Core.Application.ViewModel.SegmentAddOrEdit)">
|
|
||||||
<summary>
|
|
||||||
新增修改分割
|
|
||||||
</summary>
|
|
||||||
<param name="addOrEditSegment"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.DeleteSegment(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
删除分割
|
|
||||||
</summary>
|
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.GetSegmentBindingList(IRaCIS.Core.Application.ViewModel.SegmentBindingQuery)">
|
|
||||||
<summary>
|
|
||||||
获取分割绑定
|
|
||||||
</summary>
|
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.AddOrUpdateSegmentBinding(IRaCIS.Core.Application.ViewModel.SegmentBindingAddOrEdit)">
|
|
||||||
<summary>
|
|
||||||
新增修改分割绑定
|
|
||||||
</summary>
|
|
||||||
<param name="addOrEditSegmentBinding"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.DeleteSegmentBinding(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
删除分割
|
|
||||||
</summary>
|
|
||||||
<param name="segmentBindingId"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.SaveSegmentBindingAndAnswer(IRaCIS.Core.Application.ViewModel.SaveSegmentBindingAndAnswerInDto)">
|
|
||||||
<summary>
|
|
||||||
保存分割绑定和答案
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.DeleteBindingsAndAnswersAsync(System.Nullable{System.Guid},System.Nullable{System.Guid})">
|
|
||||||
<summary>
|
|
||||||
删除分割组和分割时的关联数据删除逻辑
|
|
||||||
</summary>
|
|
||||||
<param name="segmentationId"></param>
|
|
||||||
<param name="segmentId"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.Application.Service.ShortcutKeyService">
|
<member name="T:IRaCIS.Core.Application.Service.ShortcutKeyService">
|
||||||
<summary>
|
<summary>
|
||||||
快捷键服务
|
快捷键服务
|
||||||
|
|
@ -16096,7 +15763,7 @@
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.IO.Stream,System.String,System.String,System.Boolean,IRaCIS.Core.Application.ViewModel.FileUploadRecordAddOrEdit)">
|
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.IO.Stream,System.String,System.String,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||||
</summary>
|
</summary>
|
||||||
|
|
@ -16104,10 +15771,9 @@
|
||||||
<param name="oosFolderPath"></param>
|
<param name="oosFolderPath"></param>
|
||||||
<param name="fileRealName"></param>
|
<param name="fileRealName"></param>
|
||||||
<param name="isFileNameAddGuid"></param>
|
<param name="isFileNameAddGuid"></param>
|
||||||
<param name="uploadInfo"> 只用赋值业务参数Id 和批次信息即可,其他信息不用传递</param>
|
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.String,System.String,System.Boolean,System.Boolean,IRaCIS.Core.Application.ViewModel.FileUploadRecordAddOrEdit)">
|
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.String,System.String,System.Boolean,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||||
</summary>
|
</summary>
|
||||||
|
|
@ -16139,12 +15805,6 @@
|
||||||
<param name="prefix"></param>
|
<param name="prefix"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Helper.DicomSortHelper.SortSlices``1(System.Collections.Generic.IEnumerable{``0},System.Func{``0,System.String},System.Func{``0,System.String},System.Func{``0,System.Nullable{System.Int32}})">
|
|
||||||
<summary>
|
|
||||||
DICOM Slice 排序(IPP + IOP)
|
|
||||||
自动 fallback InstanceNumber
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Helper.HolidayHelper._client">
|
<member name="P:IRaCIS.Core.Application.Helper.HolidayHelper._client">
|
||||||
<summary>
|
<summary>
|
||||||
github 链接:https://github.com/lanceliao/china-holiday-calender?tab=readme-ov-file
|
github 链接:https://github.com/lanceliao/china-holiday-calender?tab=readme-ov-file
|
||||||
|
|
@ -17918,31 +17578,6 @@
|
||||||
任务类型
|
任务类型
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentationView.IsSaved">
|
|
||||||
<summary>
|
|
||||||
是否保存
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.ViewModel.ChangeSegmentationSavedStatusInDto.IsSaved">
|
|
||||||
<summary>
|
|
||||||
是否保存
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentBindingView.SegmentationName">
|
|
||||||
<summary>
|
|
||||||
分割分组名称
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentBindingView.SegmentName">
|
|
||||||
<summary>
|
|
||||||
SegmentName
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentAddOrEdit.SegmentJson">
|
|
||||||
<summary>
|
|
||||||
分割的Json
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.Application.ViewModel.UserWLTemplateView">
|
<member name="T:IRaCIS.Core.Application.ViewModel.UserWLTemplateView">
|
||||||
<summary> UserWLTemplateView 列表视图模型 </summary>
|
<summary> UserWLTemplateView 列表视图模型 </summary>
|
||||||
</member>
|
</member>
|
||||||
|
|
@ -18979,11 +18614,6 @@
|
||||||
阅片工具
|
阅片工具
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Contracts.GetTrialReadingInfoOutDto.SegmentToolList">
|
|
||||||
<summary>
|
|
||||||
分割工具
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Contracts.GetTrialReadingInfoOutDto.TrialId">
|
<member name="P:IRaCIS.Core.Application.Contracts.GetTrialReadingInfoOutDto.TrialId">
|
||||||
<summary>
|
<summary>
|
||||||
项目ID
|
项目ID
|
||||||
|
|
@ -19244,11 +18874,6 @@
|
||||||
表单类型
|
表单类型
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Contracts.SetCriterionReadingInfoInDto.SegmentToolList">
|
|
||||||
<summary>
|
|
||||||
分割工具
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Contracts.SetCriterionReadingInfoInDto.TrialReadingCriterionId">
|
<member name="P:IRaCIS.Core.Application.Contracts.SetCriterionReadingInfoInDto.TrialReadingCriterionId">
|
||||||
<summary>
|
<summary>
|
||||||
项目标准ID
|
项目标准ID
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Contracts.DTO;
|
using IRaCIS.Core.Application.Contracts.DTO;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Application.MassTransit.Command;
|
using IRaCIS.Core.Application.MassTransit.Command;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
|
@ -449,7 +448,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
||||||
|
|
||||||
var fileStreamResult = (FileStreamResult)await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialConsistentFUllCheckList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(FullCheckResult));
|
var fileStreamResult = (FileStreamResult)await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialConsistentFUllCheckList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(FullCheckResult));
|
||||||
|
|
||||||
var ossRelativePath = await _oSSService.UploadToOSSAsync(fileStreamResult.FileStream, $"{trialId.ToString()}/InspectionUpload/DataReconciliation", "DataReconciliation", uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = trialId, BatchDataType = BatchDataType.DataReconciliation });
|
var ossRelativePath = await _oSSService.UploadToOSSAsync(fileStreamResult.FileStream, $"{trialId.ToString()}/InspectionUpload/DataReconciliation", "DataReconciliation");
|
||||||
|
|
||||||
|
|
||||||
//var add = await _inspectionFileRepository.FindAsync(inspectionFileId);
|
//var add = await _inspectionFileRepository.FindAsync(inspectionFileId);
|
||||||
|
|
|
||||||
|
|
@ -703,10 +703,6 @@ public class QCClaimTaskEventConsumer(
|
||||||
|
|
||||||
|
|
||||||
var userinfo = subjectVisit.CurrentActionUser;
|
var userinfo = subjectVisit.CurrentActionUser;
|
||||||
if (userinfo == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
|
|
|
||||||
|
|
@ -1,234 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-10 06:15:31Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using System;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
namespace IRaCIS.Core.Application.ViewModel;
|
|
||||||
|
|
||||||
public class SubjectFileUploadRecordView
|
|
||||||
{
|
|
||||||
public string? SubjectCode { get; set; }
|
|
||||||
|
|
||||||
public string? VisitName { get; set; }
|
|
||||||
|
|
||||||
public string StudyCode { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectVisitId { get; set; }
|
|
||||||
|
|
||||||
public int FileCount { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string? UploadRegion { get; set; }
|
|
||||||
public string? TargetRegion { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public DateTime CreateTime { get; set; }
|
|
||||||
public DateTime? SyncFinishedTime { get; set; }
|
|
||||||
|
|
||||||
public bool IsSync { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FileUploadRecordView : FileUploadRecordAddOrEdit
|
|
||||||
{
|
|
||||||
|
|
||||||
public DateTime CreateTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime UpdateTime { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Comment("同步结束时间-最后一个任务的时间")]
|
|
||||||
public DateTime? SyncFinishedTime { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string? SubjectCode { get; set; }
|
|
||||||
|
|
||||||
public string? VisitName { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class FileUploadRecordAddOrEdit
|
|
||||||
{
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string FileName { get; set; }
|
|
||||||
|
|
||||||
public long FileSize { get; set; }
|
|
||||||
|
|
||||||
public string FileType { get; set; }
|
|
||||||
|
|
||||||
public string Path { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string UploadBatchId { get; set; }
|
|
||||||
public BatchDataType BatchDataType { get; set; }
|
|
||||||
|
|
||||||
public string StudyCode { get; set; }
|
|
||||||
|
|
||||||
public Guid? TrialId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectVisitId { get; set; }
|
|
||||||
|
|
||||||
public Guid? DicomStudyId { get; set; }
|
|
||||||
|
|
||||||
public Guid? NoneDicomStudyId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public string FileMarkId { get; set; }
|
|
||||||
|
|
||||||
public int? Priority { get; set; }
|
|
||||||
public string IP { get; set; }
|
|
||||||
public bool? IsNeedSync { get; set; }
|
|
||||||
public string UploadRegion { get; set; }
|
|
||||||
public string TargetRegion { get; set; }
|
|
||||||
|
|
||||||
public bool? IsSync { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class SubjectFileUploadRecordQuery : PageInput
|
|
||||||
{
|
|
||||||
public Guid TrialId { get; set; }
|
|
||||||
|
|
||||||
public string? SubjectCode { get; set; }
|
|
||||||
|
|
||||||
public string? VisitName { get; set; }
|
|
||||||
|
|
||||||
public string? StudyCode { get; set; }
|
|
||||||
|
|
||||||
public string? UploadRegion { get; set; }
|
|
||||||
public string? TargetRegion { get; set; }
|
|
||||||
|
|
||||||
public bool? IsSync { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FileUploadRecordQuery : PageInput
|
|
||||||
{
|
|
||||||
|
|
||||||
public BatchDataType? BatchDataType { get; set; }
|
|
||||||
|
|
||||||
public Guid? TrialId { get; set; }
|
|
||||||
|
|
||||||
public int? DataFileType { get; set; }
|
|
||||||
|
|
||||||
public string StudyCode { get; set; }
|
|
||||||
|
|
||||||
public string? SubjectCode { get; set; }
|
|
||||||
|
|
||||||
public string? VisitName { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public Guid? SubjectId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectVisitId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public string? FileMarkId { get; set; }
|
|
||||||
|
|
||||||
public string? FileName { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string? FileType { get; set; }
|
|
||||||
|
|
||||||
public string? IP { get; set; }
|
|
||||||
|
|
||||||
public bool? IsNeedSync { get; set; }
|
|
||||||
|
|
||||||
public bool? IsSync { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string? Path { get; set; }
|
|
||||||
|
|
||||||
public int? Priority { get; set; }
|
|
||||||
|
|
||||||
public string? TargetRegion { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string? UploadBatchId { get; set; }
|
|
||||||
|
|
||||||
public string? UploadRegion { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public DateTime? SyncFinishedStartTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime? SyncFinishedEndTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime? UploadStartTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime? UploadEndTime { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class UploadFileSyncRecordView
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public DateTime? StartTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime? EndTime { get; set; }
|
|
||||||
|
|
||||||
public jobState JobState { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string Msg { get; set; }
|
|
||||||
|
|
||||||
public DateTime CreateTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime UpdateTime { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public Guid? FileUploadRecordId { get; set; }
|
|
||||||
public string? FileName { get; set; }
|
|
||||||
|
|
||||||
public string? FileType { get; set; }
|
|
||||||
|
|
||||||
public string? Path { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string StudyCode { get; set; }
|
|
||||||
|
|
||||||
public string? SubjectCode { get; set; }
|
|
||||||
|
|
||||||
public string? VisitName { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class UploadFileSyncRecordQuery : PageInput
|
|
||||||
{
|
|
||||||
|
|
||||||
public Guid? FileUploadRecordId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public jobState? JobState { get; set; }
|
|
||||||
|
|
||||||
public string? SubjectCode { get; set; }
|
|
||||||
|
|
||||||
public string? VisitName { get; set; }
|
|
||||||
|
|
||||||
public string? StudyCode { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BatchAddSyncFileCommand
|
|
||||||
{
|
|
||||||
public List<Guid> FileUploadRecordIdList { get; set; }
|
|
||||||
|
|
||||||
public int? Priority { get; set; }
|
|
||||||
}
|
|
||||||
|
|
@ -155,8 +155,7 @@ public class EmailLogService(IRepository<EmailLog> _emailLogRepository,
|
||||||
fileStream: decodeStream,
|
fileStream: decodeStream,
|
||||||
oosFolderPath: $"EmailAttachment/{emailInfo.Id}", // OSS 虚拟目录
|
oosFolderPath: $"EmailAttachment/{emailInfo.Id}", // OSS 虚拟目录
|
||||||
fileRealName: emaliAttachmentInfo.AttachmentName,
|
fileRealName: emaliAttachmentInfo.AttachmentName,
|
||||||
isFileNameAddGuid: true,
|
isFileNameAddGuid: true); // 让方法自己在文件名前加 Guid
|
||||||
uploadInfo: new FileUploadRecordAddOrEdit() {TrialId= inDto.TrialId, BatchDataType = BatchDataType.EmailAttach }); // 让方法自己在文件名前加 Guid
|
|
||||||
|
|
||||||
attachmentInfos.Add(emaliAttachmentInfo);
|
attachmentInfos.Add(emaliAttachmentInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -984,7 +984,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||||
.Where(t => t.Subject.IsSubjectQuit == false || t.SubmitState >= SubmitStateEnum.ToSubmit)
|
.Where(t => t.Subject.IsSubjectQuit == false || t.SubmitState >= SubmitStateEnum.ToSubmit)
|
||||||
.WhereIf(inQuery.SubjectStatus != null, t => t.Subject.Status == inQuery.SubjectStatus)
|
|
||||||
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId)
|
.WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId)
|
||||||
|
|
@ -1034,7 +1034,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||||
|
|
||||||
.Where(t => t.Subject.IsSubjectQuit == false || t.AuditState > AuditStateEnum.ToAudit)
|
.Where(t => t.Subject.IsSubjectQuit == false || t.AuditState > AuditStateEnum.ToAudit)
|
||||||
.WhereIf(inQuery.SubjectStatus != null, t => t.Subject.Status == inQuery.SubjectStatus)
|
|
||||||
.WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId)
|
.WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId)
|
||||||
.WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId)
|
.WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId)
|
||||||
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
|
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
|
||||||
|
|
@ -2774,7 +2774,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
{
|
{
|
||||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.IVUS_CDISC_Export, ExportCatogory = ExportResult.IVUS_CDISC_Export });
|
list.Add(new ExportDocumentDes() { Code = StaticData.Export.IVUS_CDISC_Export, ExportCatogory = ExportResult.IVUS_CDISC_Export });
|
||||||
}
|
}
|
||||||
if (criterion.CriterionGroup != CriterionGroup.Tumor /*&& criterion.CriterionType != CriterionType.OCT && criterion.CriterionType != CriterionType.IVUS*/)
|
if (criterion.CriterionGroup != CriterionGroup.Tumor && criterion.CriterionType != CriterionType.OCT && criterion.CriterionType != CriterionType.IVUS)
|
||||||
{
|
{
|
||||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CDISC_Reading_Export, ExportCatogory = ExportResult.NoneTumorCDISC });
|
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CDISC_Reading_Export, ExportCatogory = ExportResult.NoneTumorCDISC });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,589 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-10 06:15:17Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using DocumentFormat.OpenXml.Office2010.ExcelAc;
|
|
||||||
using IRaCIS.Core.Application.Helper;
|
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
|
||||||
using IRaCIS.Core.Infrastructure.Extention;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using Spire.Doc.Interface;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Threading.Channels;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service;
|
|
||||||
|
|
||||||
[ApiExplorerSettings(GroupName = "Common")]
|
|
||||||
public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRecordRepository, IRepository<UploadFileSyncRecord> _uploadFileSyncRecordRepository,
|
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IOptionsMonitor<ObjectStoreServiceOptions> options,
|
|
||||||
IFusionCache _fusionCache, IRepository<Trial> _trialRepository, FileSyncQueue _fileSyncQueue) : BaseService, IFileUploadRecordService
|
|
||||||
{
|
|
||||||
|
|
||||||
ObjectStoreServiceOptions ObjectStoreServiceConfig = options.CurrentValue;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 按照 subject visit studyCode 三个维度进行分组的查询列表 (subject相关)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<PageOutput<SubjectFileUploadRecordView>> GetSubjectUploadRecordList(SubjectFileUploadRecordQuery inQuery)
|
|
||||||
{
|
|
||||||
|
|
||||||
var query = _fileUploadRecordRepository.Where(t => t.TrialId == inQuery.TrialId && t.SubjectId != null)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.VisitName), t => t.SubjectVisit.VisitName.Contains(inQuery.VisitName))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.UploadRegion), t => t.UploadRegion == inQuery.UploadRegion)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TargetRegion), t => t.TargetRegion == inQuery.TargetRegion)
|
|
||||||
.WhereIf(inQuery.IsSync != null, t => t.IsSync == inQuery.IsSync)
|
|
||||||
.GroupBy(t => new { t.StudyCode, SubjectCode = t.Subject.Code, t.SubjectVisit.VisitName, t.SubjectId, t.SubjectVisitId })
|
|
||||||
.Select(g => new SubjectFileUploadRecordView()
|
|
||||||
{
|
|
||||||
SubjectCode = g.Key.SubjectCode,
|
|
||||||
VisitName = g.Key.VisitName,
|
|
||||||
StudyCode = g.Key.StudyCode,
|
|
||||||
SubjectId = g.Key.SubjectId,
|
|
||||||
SubjectVisitId = g.Key.SubjectVisitId,
|
|
||||||
|
|
||||||
FileCount = g.Count(),
|
|
||||||
|
|
||||||
CreateTime = g.Max(t => t.CreateTime),
|
|
||||||
|
|
||||||
SyncFinishedTime = g.Max(t => t.SyncFinishedTime),
|
|
||||||
|
|
||||||
UploadRegion = g.First().UploadRegion,
|
|
||||||
|
|
||||||
TargetRegion = g.First().TargetRegion,
|
|
||||||
|
|
||||||
IsSync = !g.Any(t => t.IsSync == false || t.IsSync == null)
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
var pageList = await query.ToPagedListAsync(inQuery);
|
|
||||||
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 上传记录表--里面包含待同步任务 DataFileType= 0 :代表系统文件 1:Subject相关 2:项目相关,但是和subject 没关系
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<PageOutput<FileUploadRecordView>> GetFileUploadRecordList(FileUploadRecordQuery inQuery)
|
|
||||||
{
|
|
||||||
|
|
||||||
var fileUploadRecordQueryable = _fileUploadRecordRepository
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.FileName), t => t.FileName.Contains(inQuery.FileName))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.FileType), t => t.FileType.Contains(inQuery.FileType))
|
|
||||||
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
|
||||||
|
|
||||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
|
||||||
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectVisitId == inQuery.SubjectVisitId)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.VisitName), t => t.SubjectVisit.VisitName.Contains(inQuery.VisitName))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
|
||||||
|
|
||||||
.WhereIf(inQuery.DataFileType == 1 && inQuery.SubjectId != null && inQuery.SubjectVisitId == null, t => t.SubjectVisitId == null)
|
|
||||||
.WhereIf(inQuery.DataFileType == 1 && inQuery.SubjectVisitId != null && inQuery.StudyCode == "", t => t.StudyCode == "")
|
|
||||||
.WhereIf(inQuery.DataFileType == 1 && inQuery.SubjectCode.IsNotNullOrEmpty() && inQuery.VisitName.IsNullOrEmpty(), t => t.SubjectVisitId == null)
|
|
||||||
.WhereIf(inQuery.DataFileType == 1 && inQuery.VisitName.IsNotNullOrEmpty() && inQuery.StudyCode == "", t => t.StudyCode == "")
|
|
||||||
|
|
||||||
.WhereIf(inQuery.DataFileType == 0, t => t.TrialId == null)
|
|
||||||
.WhereIf(inQuery.DataFileType == 1, t => t.SubjectId != null)
|
|
||||||
.WhereIf(inQuery.DataFileType == 2, t => t.SubjectId == null)
|
|
||||||
|
|
||||||
.WhereIf(inQuery.IsNeedSync != null, t => t.IsNeedSync == inQuery.IsNeedSync)
|
|
||||||
|
|
||||||
.WhereIf(inQuery.IsSync != null, t => t.IsSync == inQuery.IsSync)
|
|
||||||
.WhereIf(inQuery.Priority != null, t => t.Priority == inQuery.Priority)
|
|
||||||
.WhereIf(inQuery.BatchDataType != null, t => t.BatchDataType == inQuery.BatchDataType)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.UploadRegion), t => t.UploadRegion == inQuery.UploadRegion)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TargetRegion), t => t.TargetRegion == inQuery.TargetRegion)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.UploadBatchId), t => t.UploadBatchId.Contains(inQuery.UploadBatchId))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Path), t => t.Path.Contains(inQuery.Path))
|
|
||||||
.WhereIf(inQuery.UploadStartTime != null, t => t.CreateTime >= inQuery.UploadStartTime)
|
|
||||||
.WhereIf(inQuery.UploadEndTime != null, t => t.CreateTime <= inQuery.UploadEndTime)
|
|
||||||
.WhereIf(inQuery.SyncFinishedStartTime != null, t => t.SyncFinishedTime >= inQuery.SyncFinishedStartTime)
|
|
||||||
.WhereIf(inQuery.SyncFinishedEndTime != null, t => t.SyncFinishedTime <= inQuery.SyncFinishedEndTime)
|
|
||||||
|
|
||||||
.ProjectTo<FileUploadRecordView>(_mapper.ConfigurationProvider);
|
|
||||||
|
|
||||||
var pageList = await fileUploadRecordQueryable.ToPagedListAsync(inQuery);
|
|
||||||
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务具体执行记录表
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<PageOutput<UploadFileSyncRecordView>> GetUploadFileSyncRecordList(UploadFileSyncRecordQuery inQuery)
|
|
||||||
{
|
|
||||||
|
|
||||||
var fileUploadRecordQueryable = _uploadFileSyncRecordRepository
|
|
||||||
.WhereIf(inQuery.JobState != null, t => t.JobState == inQuery.JobState)
|
|
||||||
.WhereIf(inQuery.FileUploadRecordId != null, t => t.FileUploadRecordId == inQuery.FileUploadRecordId)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.FileUploadRecord.StudyCode.Contains(inQuery.StudyCode))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.VisitName), t => t.FileUploadRecord.SubjectVisit.VisitName.Contains(inQuery.VisitName))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.FileUploadRecord.Subject.Code.Contains(inQuery.SubjectCode))
|
|
||||||
|
|
||||||
.ProjectTo<UploadFileSyncRecordView>(_mapper.ConfigurationProvider);
|
|
||||||
|
|
||||||
var pageList = await fileUploadRecordQueryable.ToPagedListAsync(inQuery);
|
|
||||||
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 批量设置为需要同步,并且设置优先级
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inComand"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<IResponseOutput> BatchAddSyncFileTask(BatchAddSyncFileCommand inComand)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
await _fileUploadRecordRepository.BatchUpdateNoTrackingAsync(t => inComand.FileUploadRecordIdList.Contains(t.Id), u => new FileUploadRecord() { IsNeedSync = true, Priority = inComand.Priority ?? 0 });
|
|
||||||
|
|
||||||
foreach (var item in inComand.FileUploadRecordIdList)
|
|
||||||
{
|
|
||||||
_fileSyncQueue.Enqueue(item, inComand.Priority ?? 0);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
await _fileUploadRecordRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateFileUploadRecord(FileUploadRecordAddOrEdit addOrEditFileUploadRecord)
|
|
||||||
{
|
|
||||||
|
|
||||||
addOrEditFileUploadRecord.IP = _userInfo.IP;
|
|
||||||
|
|
||||||
if (ObjectStoreServiceConfig.IsOpenStoreSync && _userInfo.Domain.IsNotNullOrEmpty())
|
|
||||||
{
|
|
||||||
var find = ObjectStoreServiceConfig.SyncConfigList.FirstOrDefault(t => t.Domain == _userInfo.Domain);
|
|
||||||
if (find != null)
|
|
||||||
{
|
|
||||||
addOrEditFileUploadRecord.UploadRegion = find.UploadRegion;
|
|
||||||
addOrEditFileUploadRecord.TargetRegion = find.TargetRegion;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//前后端调试的时候,上传的时候域名不对应,自动按照后端配置设置上传区域和同步区域
|
|
||||||
var apiDefalut = ObjectStoreServiceConfig.SyncConfigList.FirstOrDefault(t => t.UploadRegion == ObjectStoreServiceConfig.ApiDeployRegion);
|
|
||||||
|
|
||||||
if (apiDefalut != null)
|
|
||||||
{
|
|
||||||
addOrEditFileUploadRecord.UploadRegion = apiDefalut.UploadRegion;
|
|
||||||
addOrEditFileUploadRecord.TargetRegion = apiDefalut.TargetRegion;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addOrEditFileUploadRecord.TrialId != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
var trialDataStore = await _fusionCache.GetOrSetAsync(CacheKeys.TrialDataStoreType(addOrEditFileUploadRecord.TrialId.Value), async _ =>
|
|
||||||
{
|
|
||||||
return await _trialRepository.Where(t => t.Id == addOrEditFileUploadRecord.TrialId).Select(t => t.TrialDataStoreType)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
},
|
|
||||||
TimeSpan.FromDays(7)
|
|
||||||
);
|
|
||||||
|
|
||||||
//项目配置了,那么就设置需要同步
|
|
||||||
if (trialDataStore == TrialDataStore.MUtiCenter)
|
|
||||||
{
|
|
||||||
addOrEditFileUploadRecord.IsNeedSync = true;
|
|
||||||
|
|
||||||
addOrEditFileUploadRecord.Priority = 0;
|
|
||||||
|
|
||||||
addOrEditFileUploadRecord.IsSync = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
addOrEditFileUploadRecord.IsNeedSync = false;
|
|
||||||
|
|
||||||
//addOrEditFileUploadRecord.TargetRegion = "";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//系统文件,默认同步
|
|
||||||
addOrEditFileUploadRecord.IsNeedSync = true;
|
|
||||||
|
|
||||||
addOrEditFileUploadRecord.IsSync = false;
|
|
||||||
|
|
||||||
addOrEditFileUploadRecord.Priority = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
var entity = await _fileUploadRecordRepository.InsertOrUpdateAsync(addOrEditFileUploadRecord, true);
|
|
||||||
|
|
||||||
if (addOrEditFileUploadRecord.IsNeedSync == true)
|
|
||||||
{
|
|
||||||
_fileSyncQueue.Enqueue(entity.Id, addOrEditFileUploadRecord.Priority ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[HttpDelete("{fileUploadRecordId:guid}")]
|
|
||||||
public async Task<IResponseOutput> DeleteFileUploadRecord(Guid fileUploadRecordId)
|
|
||||||
{
|
|
||||||
var success = await _fileUploadRecordRepository.BatchDeleteNoTrackingAsync(t => t.Id == fileUploadRecordId);
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#region 同步队列
|
|
||||||
|
|
||||||
|
|
||||||
public sealed class FileSyncQueue
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 优先级队列(仅负责排序)
|
|
||||||
/// </summary>
|
|
||||||
private readonly PriorityQueue<Guid, int> _queue = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当前等待中的任务(唯一真实数据)
|
|
||||||
/// key = Guid
|
|
||||||
/// value = 最新 priority
|
|
||||||
/// </summary>
|
|
||||||
private readonly Dictionary<Guid, int> _waiting = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 正在执行的任务(防止重复执行)
|
|
||||||
/// </summary>
|
|
||||||
private readonly HashSet<Guid> _running = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// worker 等待信号
|
|
||||||
/// </summary>
|
|
||||||
private readonly SemaphoreSlim _signal = new(0);
|
|
||||||
|
|
||||||
|
|
||||||
private readonly object _lock = new();
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// Enqueue
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 入队(同 Guid 会覆盖优先级)
|
|
||||||
/// </summary>
|
|
||||||
public void Enqueue(Guid id, int priority)
|
|
||||||
{
|
|
||||||
bool needSignal = false;
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
// 如果正在执行,忽略(防止重复)
|
|
||||||
if (_running.Contains(id))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// 是否新任务(用于减少 signal 风暴)
|
|
||||||
if (!_waiting.ContainsKey(id))
|
|
||||||
needSignal = true;
|
|
||||||
|
|
||||||
// 更新为最新优先级(最后一次为准)
|
|
||||||
_waiting[id] = priority; //等价于添加或者更新
|
|
||||||
|
|
||||||
// PriorityQueue 无法更新节点
|
|
||||||
// 允许旧节点存在,Dequeue 时过滤
|
|
||||||
_queue.Enqueue(id, -priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 只有新增任务才唤醒 worker
|
|
||||||
if (needSignal)
|
|
||||||
_signal.Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// Dequeue
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取一个待执行任务(无任务时自动等待)
|
|
||||||
/// </summary>
|
|
||||||
public async Task<Guid> DequeueAsync(CancellationToken ct)
|
|
||||||
{
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
await _signal.WaitAsync(ct);
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
while (_queue.Count > 0)
|
|
||||||
{
|
|
||||||
var id = _queue.Dequeue();
|
|
||||||
|
|
||||||
// 已被覆盖或取消 如果这个任务已经不是“当前最新版任务”,那它只是 PriorityQueue 里的垃圾数据,直接跳过。
|
|
||||||
if (!_waiting.TryGetValue(id, out _)) //能从等待任务中取到,那么就是有效的,不能取到那么就是覆盖的
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// 标记为运行中
|
|
||||||
_waiting.Remove(id);
|
|
||||||
_running.Add(id);
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// Complete
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务执行完成(必须调用)
|
|
||||||
/// </summary>
|
|
||||||
public void Complete(Guid id)
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
_running.Remove(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// Snapshot
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当前等待中的任务快照
|
|
||||||
/// </summary>
|
|
||||||
public Guid[] Snapshot()
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
return _waiting.Keys.ToArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// 状态信息(调试用)
|
|
||||||
// ============================================================
|
|
||||||
|
|
||||||
public int WaitingCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
return _waiting.Count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int RunningCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
return _running.Count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 同步队列 信号量
|
|
||||||
///// </summary>
|
|
||||||
//public class FileSyncQueue
|
|
||||||
//{
|
|
||||||
// private readonly PriorityQueue<Guid, int> _queue = new();
|
|
||||||
// private readonly SemaphoreSlim _signal = new(0);
|
|
||||||
// private readonly object _lock = new();
|
|
||||||
|
|
||||||
// public void Enqueue(Guid id, int priority)
|
|
||||||
// {
|
|
||||||
// lock (_lock)
|
|
||||||
// {
|
|
||||||
// // priority 越大越优先
|
|
||||||
// _queue.Enqueue(id, -priority);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //类似于计数器,不会产生通知风暴,可消费资源 +1
|
|
||||||
// //if (有等待线程) 唤醒一个 else 仅增加计数
|
|
||||||
// _signal.Release(); // 唤醒一个 worker
|
|
||||||
// }
|
|
||||||
|
|
||||||
// /// <summary>
|
|
||||||
// /// 如果没有任务 → 挂起等待 有任务 → 被唤醒并返回
|
|
||||||
// /// </summary>
|
|
||||||
// /// <param name="ct"></param>
|
|
||||||
// /// <returns></returns>
|
|
||||||
// public async Task<Guid> DequeueAsync(CancellationToken ct)
|
|
||||||
// {
|
|
||||||
// await _signal.WaitAsync(ct);
|
|
||||||
|
|
||||||
// lock (_lock)
|
|
||||||
// {
|
|
||||||
// return _queue.Dequeue();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// /// <summary>
|
|
||||||
// /// 获取队列任务Id
|
|
||||||
// /// </summary>
|
|
||||||
// /// <returns></returns>
|
|
||||||
// public Guid[] Snapshot()
|
|
||||||
// {
|
|
||||||
// lock (_lock)
|
|
||||||
// {
|
|
||||||
// return _queue.UnorderedItems
|
|
||||||
// .Select(x => x.Element)
|
|
||||||
// .ToArray();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
#region 这里不用 SyncQueueUseChannel 和调度器 SyncScheduler
|
|
||||||
public class SyncQueueUseChannel
|
|
||||||
{
|
|
||||||
// 优先级队列(priority 越大越先执行)
|
|
||||||
private readonly PriorityQueue<Guid, int> _queue = new();
|
|
||||||
|
|
||||||
// Worker 唤醒信号
|
|
||||||
private readonly Channel<bool> _signal =
|
|
||||||
Channel.CreateUnbounded<bool>(new UnboundedChannelOptions
|
|
||||||
{
|
|
||||||
SingleReader = false,
|
|
||||||
SingleWriter = false
|
|
||||||
});
|
|
||||||
|
|
||||||
// 队列任务数量(不是CPU数量!)
|
|
||||||
private int _count = 0;
|
|
||||||
|
|
||||||
|
|
||||||
private readonly object _lock = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 入队任务
|
|
||||||
/// </summary>
|
|
||||||
public void Enqueue(Guid id, int priority)
|
|
||||||
{
|
|
||||||
bool needSignal = false;
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
// priority 越大越优先 → 转负数
|
|
||||||
_queue.Enqueue(id, -priority);
|
|
||||||
|
|
||||||
// 只有从 0 → 1 才需要唤醒 worker
|
|
||||||
if (_count == 0)
|
|
||||||
needSignal = true;
|
|
||||||
|
|
||||||
_count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 避免 signal 风暴
|
|
||||||
if (needSignal)
|
|
||||||
_signal.Writer.TryWrite(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Worker 等待并获取任务
|
|
||||||
/// </summary>
|
|
||||||
public async Task<Guid> DequeueAsync(CancellationToken ct)
|
|
||||||
{
|
|
||||||
|
|
||||||
// 没任务时挂起(不会占CPU)
|
|
||||||
await _signal.Reader.ReadAsync(ct);
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
var id = _queue.Dequeue();
|
|
||||||
|
|
||||||
_count--;
|
|
||||||
|
|
||||||
// 如果还有任务,继续唤醒下一个 worker
|
|
||||||
if (_count > 0)
|
|
||||||
_signal.Writer.TryWrite(true);
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当前排队数量(调试用)
|
|
||||||
/// </summary>
|
|
||||||
public int Count
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
return _count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 同步调度器
|
|
||||||
/// </summary>
|
|
||||||
public class FileSyncScheduler
|
|
||||||
{
|
|
||||||
private readonly FileSyncQueue _queue;
|
|
||||||
|
|
||||||
public FileSyncScheduler(FileSyncQueue queue)
|
|
||||||
{
|
|
||||||
_queue = queue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Enqueue(FileUploadRecord file)
|
|
||||||
{
|
|
||||||
if (file.IsNeedSync != true)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_queue.Enqueue(file.Id, file.Priority ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 如果没有任务 → 挂起等待 有任务 → 被唤醒并返回
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="ct"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public Task<Guid> WaitAsync(CancellationToken ct)
|
|
||||||
=> _queue.DequeueAsync(ct);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-10 06:15:31Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using System;
|
|
||||||
using IRaCIS.Core.Infrastructure.Extention;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
namespace IRaCIS.Core.Application.Interfaces;
|
|
||||||
|
|
||||||
public interface IFileUploadRecordService
|
|
||||||
{
|
|
||||||
|
|
||||||
Task<PageOutput<FileUploadRecordView>> GetFileUploadRecordList(FileUploadRecordQuery inQuery);
|
|
||||||
|
|
||||||
Task<IResponseOutput> AddOrUpdateFileUploadRecord(FileUploadRecordAddOrEdit addOrEditFileUploadRecord);
|
|
||||||
|
|
||||||
Task<IResponseOutput> DeleteFileUploadRecord(Guid fileUploadRecordId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -124,21 +124,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<IVUS_OCTBaseDto, IvusExportDto>();
|
CreateMap<IVUS_OCTBaseDto, IvusExportDto>();
|
||||||
CreateMap<IVUS_OCTBaseDto, OctExportDto>();
|
CreateMap<IVUS_OCTBaseDto, OctExportDto>();
|
||||||
|
|
||||||
|
|
||||||
CreateMap<FileUploadRecord, FileUploadRecordView>()
|
|
||||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
|
||||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName));
|
|
||||||
CreateMap<FileUploadRecord, FileUploadRecordAddOrEdit>().ReverseMap();
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<UploadFileSyncRecord, UploadFileSyncRecordView>()
|
|
||||||
.ForMember(d => d.FileName, u => u.MapFrom(s => s.FileUploadRecord.FileName))
|
|
||||||
.ForMember(d => d.FileType, u => u.MapFrom(s => s.FileUploadRecord.FileType))
|
|
||||||
.ForMember(d => d.Path, u => u.MapFrom(s => s.FileUploadRecord.Path))
|
|
||||||
.ForMember(d => d.StudyCode, u => u.MapFrom(s => s.FileUploadRecord.StudyCode))
|
|
||||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.FileUploadRecord.Subject.Code))
|
|
||||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.FileUploadRecord.SubjectVisit.VisitName));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//重新插入新的 Title记录
|
//重新插入新的 Title记录
|
||||||
updateModel.TitleIds.ForEach(titleId => adddata.Add(new DoctorDictionary() { DoctorId = updateModel.Id.Value, KeyName = StaticData.Title, DictionaryId = titleId }));
|
updateModel.TitleIds.ForEach(titleId => adddata.Add(new DoctorDictionary() { DoctorId = updateModel.Id.Value, KeyName = StaticData.Title, DictionaryId = titleId }));
|
||||||
|
|
||||||
indto.ReviewerCode = doctor.ReviewerCode;
|
|
||||||
await _doctorDictionaryRepository.AddRangeAsync(adddata);
|
await _doctorDictionaryRepository.AddRangeAsync(adddata);
|
||||||
|
|
||||||
_mapper.Map(indto, doctor);
|
_mapper.Map(indto, doctor);
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,6 @@
|
||||||
|
|
||||||
public string SliceThickness { get; set; } = String.Empty;
|
public string SliceThickness { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string ImagePositionPatient { get; set; }
|
|
||||||
public string ImageOrientationPatient { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,10 +108,6 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
||||||
public string WindowCenter { get; set; }
|
public string WindowCenter { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string WindowWidth { get; set; }
|
public string WindowWidth { get; set; }
|
||||||
[JsonIgnore]
|
|
||||||
public string ImagePositionPatient { get; set; }
|
|
||||||
[JsonIgnore]
|
|
||||||
public string ImageOrientationPatient { get; set; }
|
|
||||||
|
|
||||||
public DateTime? RowDate { get; set; }
|
public DateTime? RowDate { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -265,11 +265,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid StudyMonitorId { get; set; }
|
public Guid StudyMonitorId { get; set; }
|
||||||
|
|
||||||
[NotDefault]
|
|
||||||
public string UploadBatchId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public int FailedFileCount { get; set; }
|
public int FailedFileCount { get; set; }
|
||||||
|
|
||||||
public string RecordPath { get; set; } = string.Empty;
|
public string RecordPath { get; set; } = string.Empty;
|
||||||
|
|
@ -294,10 +289,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid StudyMonitorId { get; set; }
|
public Guid StudyMonitorId { get; set; }
|
||||||
|
|
||||||
[NotDefault]
|
|
||||||
public string UploadBatchId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public int FailedFileCount { get; set; }
|
public int FailedFileCount { get; set; }
|
||||||
|
|
||||||
public string RecordPath { get; set; } = string.Empty;
|
public string RecordPath { get; set; } = string.Empty;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IOSSService _oSSService,
|
IOSSService _oSSService,
|
||||||
IRepository<FileUploadRecord> _fileUploadRecordRepository,
|
|
||||||
IRepository<Dictionary> _dictionaryRepository,
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<StudyMonitor> _studyMonitorRepository,
|
IRepository<StudyMonitor> _studyMonitorRepository,
|
||||||
|
|
@ -804,8 +803,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
await _taskStudyRepository.SaveChangesAsync();
|
await _taskStudyRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
await _fileUploadRecordRepository.BatchUpdateNoTrackingAsync(t => t.UploadBatchId == incommand.UploadBatchId, u => new FileUploadRecord() { StudyCode = findStudy.StudyCode });
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -941,9 +938,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
//存在ivus 和oct 这两种的项目
|
//存在ivus 和oct 这两种的项目
|
||||||
if (_readingQuestionCriterionTrialRepository.Where(t => t.TrialId == info.TrialId &&
|
if (_readingQuestionCriterionTrialRepository.Where(t => t.TrialId == info.TrialId &&
|
||||||
((t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT) && t.IsConfirm)).Distinct().Count() == 2
|
(t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT)).Distinct().Count() == 2
|
||||||
&& _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS").Count() != _dicomStudyRepository.Where(t => t.SubjectId == inQuery.SubjectId).Select(t => t.SubjectVisitId).Distinct().Count()
|
&& !_noneDicomStudyReposiotry.Any(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS"))
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#region ivus 自动创建非dicom检查
|
#region ivus 自动创建非dicom检查
|
||||||
|
|
||||||
|
|
@ -961,7 +957,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
var noneDicomStudyVisitIdList = _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS").Select(t => t.SubjectVisitId).ToList();
|
|
||||||
|
|
||||||
var @lock = _distributedLockProvider.CreateLock($"NoneDicomCode");
|
var @lock = _distributedLockProvider.CreateLock($"NoneDicomCode");
|
||||||
|
|
||||||
|
|
@ -972,12 +967,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
//默认会是0
|
//默认会是0
|
||||||
var code = await _noneDicomStudyReposiotry.Where(t => t.TrialId == trialId).Select(x => x.Code).DefaultIfEmpty().MaxAsync();
|
var code = await _noneDicomStudyReposiotry.Where(t => t.TrialId == trialId).Select(x => x.Code).DefaultIfEmpty().MaxAsync();
|
||||||
|
|
||||||
foreach (var g in addList.Where(t => !noneDicomStudyVisitIdList.Contains(t.SubjectVisitId)).GroupBy(t => t.SubjectVisitId))
|
foreach (var g in addList.GroupBy(t => t.SubjectVisitId))
|
||||||
{
|
{
|
||||||
var addOrEditNoneDicomStudy = g.First();
|
var addOrEditNoneDicomStudy = g.First();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var optEntity = await _noneDicomStudyReposiotry.InsertFromDTOAsync(addOrEditNoneDicomStudy);
|
var optEntity = await _noneDicomStudyReposiotry.InsertFromDTOAsync(addOrEditNoneDicomStudy);
|
||||||
|
|
||||||
optEntity.Code = code + 1;
|
optEntity.Code = code + 1;
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,6 @@ namespace IRaCIS.Core.Application.Services
|
||||||
.OrderBy(s => s.InstanceNumber).ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
.OrderBy(s => s.InstanceNumber).ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
||||||
.ProjectTo<DicomInstanceDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<DicomInstanceDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
// ⭐ DICOM 空间排序(带兜底)
|
|
||||||
var sorted = DicomSortHelper.SortSlices(
|
|
||||||
list,
|
|
||||||
x => x.ImagePositionPatient,
|
|
||||||
x => x.ImageOrientationPatient,
|
|
||||||
x => x.InstanceNumber
|
|
||||||
);
|
|
||||||
|
|
||||||
var seriesInfo = await _instanceRepository.Where(s => s.SeriesId == seriesId).Select(t => new
|
var seriesInfo = await _instanceRepository.Where(s => s.SeriesId == seriesId).Select(t => new
|
||||||
{
|
{
|
||||||
t.DicomSerie.ImageResizePath,
|
t.DicomSerie.ImageResizePath,
|
||||||
|
|
@ -46,7 +38,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
t.DicomSerie.SubjectVisit.VisitName
|
t.DicomSerie.SubjectVisit.VisitName
|
||||||
}).FirstOrDefaultAsync();
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
return ResponseOutput.Ok(sorted, seriesInfo);
|
return ResponseOutput.Ok(list, seriesInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
|
|
@ -78,7 +77,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
//ivus-在访视的时候visitTaskId==null 需要过滤掉空检查 ,但是在靶段标注的查看访视级别的时候不能过滤
|
//ivus-在访视的时候visitTaskId==null 需要过滤掉空检查 ,但是在靶段标注的查看访视级别的时候不能过滤
|
||||||
if (_subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.Trial.TrialReadingCriterionList)
|
if (_subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.Trial.TrialReadingCriterionList)
|
||||||
.Where(t => (t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT) && t.IsConfirm).Distinct().Count() == 2
|
.Where(t => t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT).Distinct().Count() == 2
|
||||||
&& visitTaskId == null)
|
&& visitTaskId == null)
|
||||||
{
|
{
|
||||||
isFilterIVUSNoneDicom = true;
|
isFilterIVUSNoneDicom = true;
|
||||||
|
|
@ -155,13 +154,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
if (addOrEditNoneDicomStudy.Id == Guid.Empty || addOrEditNoneDicomStudy.Id == null)
|
if (addOrEditNoneDicomStudy.Id == Guid.Empty || addOrEditNoneDicomStudy.Id == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_subjectVisitRepository.Where(t => t.Id == addOrEditNoneDicomStudy.SubjectVisitId).SelectMany(t => t.Trial.TrialReadingCriterionList)
|
|
||||||
.Where(t => (t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT) && t.IsConfirm).Distinct().Count() == 2 && addOrEditNoneDicomStudy.Modality != "OCT")
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["NoneDicomStudy_OnlyNeedOCT"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//默认会是0
|
//默认会是0
|
||||||
var code = await _noneDicomStudyRepository.Where(t => t.TrialId == addOrEditNoneDicomStudy.TrialId).Select(x => x.Code).DefaultIfEmpty().MaxAsync();
|
var code = await _noneDicomStudyRepository.Where(t => t.TrialId == addOrEditNoneDicomStudy.TrialId).Select(x => x.Code).DefaultIfEmpty().MaxAsync();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,23 +46,13 @@ namespace IRaCIS.Core.Application.Services
|
||||||
var instanceList = await _scpInstanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters()
|
var instanceList = await _scpInstanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters()
|
||||||
.OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
.OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
||||||
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
||||||
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.FileSize, t.ImagePositionPatient, t.ImageOrientationPatient }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.FileSize }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||||
|
|
||||||
|
|
||||||
foreach (var series in seriesList)
|
foreach (var series in seriesList)
|
||||||
{
|
{
|
||||||
|
|
||||||
var instances = instanceList.Where(x => x.SeriesId == series.Id);
|
series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k =>
|
||||||
|
|
||||||
// ⭐ DICOM 空间排序(带兜底)
|
|
||||||
var sorted = DicomSortHelper.SortSlices(
|
|
||||||
instances,
|
|
||||||
x => x.ImagePositionPatient,
|
|
||||||
x => x.ImageOrientationPatient,
|
|
||||||
x => x.InstanceNumber
|
|
||||||
);
|
|
||||||
|
|
||||||
series.InstanceInfoList = sorted.Select(k =>
|
|
||||||
new InstanceBasicInfo()
|
new InstanceBasicInfo()
|
||||||
{
|
{
|
||||||
Id = k.Id,
|
Id = k.Id,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<SCPStudy> _scpStudyRepository,
|
IRepository<SCPStudy> _scpStudyRepository,
|
||||||
IRepository<FileUploadRecord> _fileUploadRecordRepository,
|
|
||||||
IRepository<Subject> _subjectRepository,
|
IRepository<Subject> _subjectRepository,
|
||||||
IRepository<StudyMonitor> _studyMonitorRepository,
|
IRepository<StudyMonitor> _studyMonitorRepository,
|
||||||
IRepository<SystemAnonymization> _systemAnonymizationRepository,
|
IRepository<SystemAnonymization> _systemAnonymizationRepository,
|
||||||
|
|
@ -333,8 +332,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
await _dicomInstanceRepository.SaveChangesAsync();
|
await _dicomInstanceRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
await _fileUploadRecordRepository.BatchUpdateNoTrackingAsync(t => t.UploadBatchId == incommand.UploadBatchId, u => new FileUploadRecord() { StudyCode = findStudy.StudyCode });
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -260,11 +260,6 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
||||||
public bool obtaionOrCancel { get; set; }
|
public bool obtaionOrCancel { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UpdateReadModuleClinicalDataInDto
|
|
||||||
{
|
|
||||||
public Guid ReadingClinicalDataId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ReadingClinicalDataSignIndto
|
public class ReadingClinicalDataSignIndto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public string[]? VisitPlanArray { get; set; }
|
public string[]? VisitPlanArray { get; set; }
|
||||||
public bool? IsSubjectQuit { get; set; }
|
public bool? IsSubjectQuit { get; set; }
|
||||||
|
|
||||||
public SubjectStatus? SubjectStatus { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetNextQCInfoInDto
|
public class GetNextQCInfoInDto
|
||||||
|
|
@ -100,8 +98,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public DateTime? EndAuditTime { get; set; }
|
public DateTime? EndAuditTime { get; set; }
|
||||||
|
|
||||||
public SubjectStatus? SubjectStatus { get; set; }
|
|
||||||
|
|
||||||
public bool? IsSubjectQuit { get; set; }
|
public bool? IsSubjectQuit { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
|
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
|
||||||
|
|
||||||
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||||
.WhereIf(inQuery.SubjectStatus != null, t => t.Subject.Status == inQuery.SubjectStatus)
|
|
||||||
.Where(t => !(t.Subject.Status == SubjectStatus.EndOfVisit && t.SubmitState == SubmitStateEnum.None && !t.Subject.SubjectVisitList.Any(c => c.VisitNum > t.VisitNum && c.SubmitState > SubmitStateEnum.None)))
|
.Where(t => !(t.Subject.Status == SubjectStatus.EndOfVisit && t.SubmitState == SubmitStateEnum.None && !t.Subject.SubjectVisitList.Any(c => c.VisitNum > t.VisitNum && c.SubmitState > SubmitStateEnum.None)))
|
||||||
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||||
|
|
@ -281,7 +280,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
|
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId)
|
.WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId)
|
||||||
.WhereIf(inQuery.SubjectStatus != null, t => t.Subject.Status == inQuery.SubjectStatus)
|
|
||||||
.WhereIf(inQuery.IsSubjectQuit != null, t => t.Subject.IsSubjectQuit == inQuery.IsSubjectQuit)
|
.WhereIf(inQuery.IsSubjectQuit != null, t => t.Subject.IsSubjectQuit == inQuery.IsSubjectQuit)
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectInfo), t => /*t.Subject.FirstName.Contains(subjectInfo) || t.Subject.LastName.Contains(subjectInfo) ||*/ t.Subject.Code.Contains(inQuery.SubjectInfo))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectInfo), t => /*t.Subject.FirstName.Contains(subjectInfo) || t.Subject.LastName.Contains(subjectInfo) ||*/ t.Subject.Code.Contains(inQuery.SubjectInfo))
|
||||||
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
|
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||||
|
|
|
||||||
|
|
@ -372,34 +372,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return ResponseOutput.Result(result);
|
return ResponseOutput.Result(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 修改临床数据后 将签名状态变更为未签名
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<IResponseOutput> UpdateReadModuleClinicalData(UpdateReadModuleClinicalDataInDto inDto)
|
|
||||||
{
|
|
||||||
var data = await _readingClinicalDataRepository.FirstOrDefaultAsync(t => t.Id == inDto.ReadingClinicalDataId);
|
|
||||||
|
|
||||||
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.ReadingClinicalDataId, x => new ReadingClinicalData()
|
|
||||||
{
|
|
||||||
IsSign = false,
|
|
||||||
ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded
|
|
||||||
});
|
|
||||||
|
|
||||||
var result = await _readModuleRepository.Where(x=>x.Id== data.ReadingId).Include(x=>x.SubjectVisit).FirstNotNullAsync();
|
|
||||||
|
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(x => x.TrialReadingCriterionId == result.TrialReadingCriterionId && x.VisitTaskNum > result.SubjectVisit.VisitNum, x => new VisitTask()
|
|
||||||
{
|
|
||||||
IsFrontTaskNeedSignButNotSign = false,
|
|
||||||
});
|
|
||||||
await _visitTaskRepository.SaveChangesAsync();
|
|
||||||
return ResponseOutput.Result(true);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
///// 一致性分析的临床数据
|
///// 一致性分析的临床数据
|
||||||
///// </summary>
|
///// </summary>
|
||||||
|
|
|
||||||
|
|
@ -208,30 +208,25 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class IVUSMeasuredValue
|
public class IVUSMeasuredValue
|
||||||
{
|
{
|
||||||
///// <summary>
|
|
||||||
///// 斑块编号
|
|
||||||
///// </summary>
|
|
||||||
//public int PlaqueNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 帧数
|
/// 斑块编号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FrameNumber { get; set; }
|
public int PlaqueNum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 外弹力膜面积Emm
|
/// 外弹力膜面积Emm
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? Emm { get; set; }
|
public decimal Emm { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 管腔面积Lumen
|
/// 管腔面积Lumen
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? Lumen { get; set; }
|
public decimal Lumen { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 外弹力膜面积- 管腔面积
|
/// 外弹力膜面积- 管腔面积
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? EmmSubtractionLumen
|
public decimal EmmSubtractionLumen
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
@ -250,24 +245,24 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public class OCTFCTUploadData
|
public class OCTFCTUploadData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 帧数
|
/// 斑块编号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FrameNumber { get; set; }
|
public int PlaqueNum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 第一次
|
/// 第一次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? FirstData { get; set; }
|
public decimal FirstData { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 第二次
|
/// 第二次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? SecondData { get; set; }
|
public decimal SecondData { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 第三次
|
/// 第三次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? ThirdData { get; set; }
|
public decimal ThirdData { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 巨噬细胞浸润测量
|
/// 巨噬细胞浸润测量
|
||||||
|
|
@ -295,27 +290,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? LumenAreaMeasurement { get; set; }
|
public decimal? LumenAreaMeasurement { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度
|
|
||||||
/// </summary>
|
|
||||||
public decimal? LipidAngle { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public decimal? Avg
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var values = new[] { FirstData, SecondData, ThirdData };
|
|
||||||
|
|
||||||
var count = values.Count(x => x.HasValue);
|
public decimal Avg { get {
|
||||||
if (count == 0)
|
|
||||||
{
|
return ( FirstData + SecondData + ThirdData) / 3;
|
||||||
return null;
|
} }
|
||||||
}
|
|
||||||
var avg = values.Where(x => x.HasValue).Select(x => x.Value).Average();
|
|
||||||
return avg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -203,27 +203,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public Guid TaskMedicalReviewId { get; set; }
|
public Guid TaskMedicalReviewId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CloseAndFinishMedicalReview
|
|
||||||
{
|
|
||||||
public Guid TaskMedicalReviewId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否关闭
|
|
||||||
/// </summary>
|
|
||||||
public bool IsClosedDialog { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 医学审核对话关闭原因
|
|
||||||
/// </summary>
|
|
||||||
public MedicalDialogClose MedicalDialogCloseEnum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 对话关闭原因
|
|
||||||
/// </summary>
|
|
||||||
public string DialogCloseReason { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class JointMedicalReviewI18n
|
public class JointMedicalReviewI18n
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -324,11 +324,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ImageMark? ImageMarkEnum { get; set; }
|
public ImageMark? ImageMarkEnum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 影像标记类型
|
|
||||||
/// </summary>
|
|
||||||
public ImageMarkType? ImageMarkTypeEnum { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否预设
|
/// 是否预设
|
||||||
|
|
@ -988,11 +983,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ImageMark? ImageMarkEnum { get; set; }
|
public ImageMark? ImageMarkEnum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 影像标记类型
|
|
||||||
/// </summary>
|
|
||||||
public ImageMarkType? ImageMarkTypeEnum { get; set; }
|
|
||||||
|
|
||||||
public string QuestionGroupName { get; set; }
|
public string QuestionGroupName { get; set; }
|
||||||
|
|
||||||
public string QuestionGroupEnName { get; set; }
|
public string QuestionGroupEnName { get; set; }
|
||||||
|
|
@ -2473,11 +2463,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ImageMark? ImageMarkEnum { get; set; }
|
public ImageMark? ImageMarkEnum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 影像标记类型
|
|
||||||
/// </summary>
|
|
||||||
public ImageMarkType? ImageMarkTypeEnum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 影像工具
|
/// 影像工具
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-19 07:13:41Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using System;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
namespace IRaCIS.Core.Application.ViewModel;
|
|
||||||
|
|
||||||
public class SegmentBindingView : SegmentBindingAddOrEdit
|
|
||||||
{
|
|
||||||
|
|
||||||
public DateTime CreateTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime UpdateTime { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分割分组名称
|
|
||||||
/// </summary>
|
|
||||||
public string SegmentationName { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// SegmentName
|
|
||||||
/// </summary>
|
|
||||||
public string SegmentName { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SaveSegmentBindingAndAnswerInDto
|
|
||||||
{
|
|
||||||
public Guid VisitTaskId { get; set; }
|
|
||||||
public List<SaveSegmentBindingDto> BindingList { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SaveSegmentBindingDto
|
|
||||||
{
|
|
||||||
public string Answer { get; set; }
|
|
||||||
|
|
||||||
public Guid? QuestionId { get; set; }
|
|
||||||
|
|
||||||
public Guid? RowId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SegmentId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SegmentationId { get; set; }
|
|
||||||
|
|
||||||
public Guid? TableQuestionId { get; set; }
|
|
||||||
|
|
||||||
public Guid VisitTaskId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SegmentBindingAddOrEdit
|
|
||||||
{
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
public Guid? QuestionId { get; set; }
|
|
||||||
|
|
||||||
public Guid? RowId { get; set; }
|
|
||||||
|
|
||||||
public Guid SegmentId { get; set; }
|
|
||||||
|
|
||||||
public Guid SegmentationId { get; set; }
|
|
||||||
|
|
||||||
public Guid? TableQuestionId { get; set; }
|
|
||||||
|
|
||||||
public Guid VisitTaskId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SegmentBindingQuery:PageInput
|
|
||||||
{
|
|
||||||
public Guid? QuestionId { get; set; }
|
|
||||||
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public Guid? RowId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SegmentId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SegmentationId { get; set; }
|
|
||||||
|
|
||||||
public Guid? TableQuestionId { get; set; }
|
|
||||||
|
|
||||||
public Guid? VisitTaskId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-10 05:44:27Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
namespace IRaCIS.Core.Application.ViewModel;
|
|
||||||
|
|
||||||
public class SegmentView : SegmentAddOrEdit
|
|
||||||
{
|
|
||||||
|
|
||||||
public DateTime CreateTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime UpdateTime { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class SegmentAddOrEdit
|
|
||||||
{
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
public decimal? AvgValue { get; set; }
|
|
||||||
|
|
||||||
public string ColorRgb { get; set; }
|
|
||||||
|
|
||||||
public decimal? MTV { get; set; }
|
|
||||||
|
|
||||||
public decimal? MajorAxis { get; set; }
|
|
||||||
|
|
||||||
public decimal? MaxValue { get; set; }
|
|
||||||
|
|
||||||
public decimal? Median { get; set; }
|
|
||||||
|
|
||||||
public decimal? MinValue { get; set; }
|
|
||||||
|
|
||||||
public decimal? Peak { get; set; }
|
|
||||||
|
|
||||||
public int SegmentNumber { get; set; }
|
|
||||||
|
|
||||||
public string SegmentName { get; set; }
|
|
||||||
|
|
||||||
public Guid SegmentationId { get; set; }
|
|
||||||
|
|
||||||
public decimal? ShortAxis { get; set; }
|
|
||||||
|
|
||||||
public decimal? TLG { get; set; }
|
|
||||||
|
|
||||||
public decimal? Variance { get; set; }
|
|
||||||
|
|
||||||
public decimal? Volume { get; set; }
|
|
||||||
|
|
||||||
public Guid VisitTaskId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分割的Json
|
|
||||||
/// </summary>
|
|
||||||
public string SegmentJson { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SegmentQuery:PageInput
|
|
||||||
{
|
|
||||||
public decimal? AvgValue { get; set; }
|
|
||||||
|
|
||||||
public string? ColorRgb { get; set; }
|
|
||||||
|
|
||||||
public decimal? MTV { get; set; }
|
|
||||||
|
|
||||||
public decimal? MajorAxis { get; set; }
|
|
||||||
|
|
||||||
public decimal? MaxValue { get; set; }
|
|
||||||
|
|
||||||
public decimal? Median { get; set; }
|
|
||||||
|
|
||||||
public decimal? MinValue { get; set; }
|
|
||||||
|
|
||||||
public decimal? Peak { get; set; }
|
|
||||||
|
|
||||||
public int? SegmentNumber { get; set; }
|
|
||||||
|
|
||||||
public string? SegmentName { get; set; }
|
|
||||||
|
|
||||||
public Guid? SegmentationId { get; set; }
|
|
||||||
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public Guid? VisitTaskId { get; set; }
|
|
||||||
|
|
||||||
public decimal? ShortAxis { get; set; }
|
|
||||||
|
|
||||||
public decimal? TLG { get; set; }
|
|
||||||
|
|
||||||
public decimal? Variance { get; set; }
|
|
||||||
|
|
||||||
public decimal? Volume { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-10 06:17:31Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using System;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
namespace IRaCIS.Core.Application.ViewModel;
|
|
||||||
|
|
||||||
public class SegmentationView : SegmentationAddOrEdit
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 是否保存
|
|
||||||
/// </summary>
|
|
||||||
public bool IsSaved { get; set; } = false;
|
|
||||||
public DateTime CreateTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime UpdateTime { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class ChangeSegmentationSavedStatusInDto
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否保存
|
|
||||||
/// </summary>
|
|
||||||
public bool IsSaved { get; set; } = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SegmentationAddOrEdit
|
|
||||||
{
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
public string SEGUrl { get; set; }
|
|
||||||
|
|
||||||
public string SegmentationJson { get; set; }
|
|
||||||
|
|
||||||
public string SegmentationName { get; set; }
|
|
||||||
|
|
||||||
public Guid SeriesId { get; set; }
|
|
||||||
|
|
||||||
public Guid StudyId { get; set; }
|
|
||||||
|
|
||||||
public Guid SubjectId { get; set; }
|
|
||||||
|
|
||||||
public Guid SubjectVisitId { get; set; }
|
|
||||||
|
|
||||||
public Guid TrialId { get; set; }
|
|
||||||
|
|
||||||
public Guid VisitTaskId { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SegmentationQuery:PageInput
|
|
||||||
{
|
|
||||||
public string? SEGUrl { get; set; }
|
|
||||||
|
|
||||||
public string? SegmentationJson { get; set; }
|
|
||||||
|
|
||||||
public string? SegmentationName { get; set; }
|
|
||||||
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
public Guid? SeriesId { get; set; }
|
|
||||||
|
|
||||||
public Guid? StudyId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectVisitId { get; set; }
|
|
||||||
|
|
||||||
public Guid? TrialId { get; set; }
|
|
||||||
|
|
||||||
public Guid? VisitTaskId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -9,7 +9,5 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
Task<IResponseOutput> FinishMedicalReview(FinishMedicalReviewInDto inDto);
|
Task<IResponseOutput> FinishMedicalReview(FinishMedicalReviewInDto inDto);
|
||||||
|
|
||||||
Task<IResponseOutput> ClosedMedicalReviewDialog(ClosedMedicalReviewDialogInDto inDto);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-10 06:17:31Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using System;
|
|
||||||
using IRaCIS.Core.Infrastructure.Extention;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
namespace IRaCIS.Core.Application.Interfaces;
|
|
||||||
|
|
||||||
public interface ISegmentationService
|
|
||||||
{
|
|
||||||
|
|
||||||
Task<PageOutput<SegmentationView>> GetSegmentationList(SegmentationQuery inQuery);
|
|
||||||
|
|
||||||
Task<IResponseOutput> AddOrUpdateSegmentation(SegmentationAddOrEdit addOrEditSegmentation);
|
|
||||||
|
|
||||||
Task<IResponseOutput> DeleteSegmentation(Guid segmentationId);
|
|
||||||
|
|
||||||
|
|
||||||
Task<PageOutput<SegmentView>> GetSegmentList(SegmentQuery inQuery);
|
|
||||||
|
|
||||||
Task<IResponseOutput> AddOrUpdateSegment(SegmentAddOrEdit addOrEditSegment);
|
|
||||||
|
|
||||||
Task<IResponseOutput> DeleteSegment(Guid segmentId);
|
|
||||||
|
|
||||||
Task<PageOutput<SegmentBindingView>> GetSegmentBindingList(SegmentBindingQuery inQuery);
|
|
||||||
|
|
||||||
Task<IResponseOutput> AddOrUpdateSegmentBinding(SegmentBindingAddOrEdit addOrEditSegmentBinding);
|
|
||||||
|
|
||||||
Task<IResponseOutput> DeleteSegmentBinding(Guid segmentBindingId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
|
|
@ -787,7 +787,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.Select(x => new GetTrialGroupNameOutDto
|
.Select(x => new GetTrialGroupNameOutDto
|
||||||
{
|
{
|
||||||
GroupId = x.Id,
|
GroupId = x.Id,
|
||||||
GroupName =_userInfo.IsEn_Us?x.GroupEnName: x.GroupName,
|
GroupName = x.GroupName,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -1485,9 +1485,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
toolList = toolList.Distinct().ToList();
|
toolList = toolList.Distinct().ToList();
|
||||||
|
|
||||||
var alltool = trialCriterion.ReadingToolList.Union(trialCriterion.SegmentToolList).ToList();
|
if (tabletoolList.Except(trialCriterion.ReadingToolList).Count() > 0)
|
||||||
|
|
||||||
if (tabletoolList.Except(alltool).Count() > 0)
|
|
||||||
{
|
{
|
||||||
//---问题的阅片工具不在标准配置的阅片工具列表中
|
//---问题的阅片工具不在标准配置的阅片工具列表中
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_TableToolNotInStdTool"]);
|
throw new BusinessValidationFailedException(_localizer["TrialConfig_TableToolNotInStdTool"]);
|
||||||
|
|
@ -1782,28 +1780,5 @@ namespace IRaCIS.Core.Application.Service
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 根据项目问题id获取项目问题信息
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<ReadingQuestionTrialView> GetReadingQuestionTrialById(Guid id)
|
|
||||||
{
|
|
||||||
var result = await _readingQuestionTrialRepository.Where(x => x.Id == id).ProjectTo<ReadingQuestionTrialView>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 根据项目表格问题id获取项目表格问题信息
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<ReadingTableQuestionTrialView> GetReadingTableQuestionTrialById(Guid id)
|
|
||||||
{
|
|
||||||
var result = await _readingTableQuestionTrialRepository.Where(x => x.Id == id).ProjectTo<ReadingTableQuestionTrialView>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IRepository<UserLog> _userLogRepository,
|
IRepository<UserLog> _userLogRepository,
|
||||||
IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository,
|
IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository,
|
||||||
IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository,
|
IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository,
|
||||||
IRepository<Segmentation> _segmentationRepository,
|
|
||||||
IVisitTaskHelpeService _visitTaskHelpeService,
|
IVisitTaskHelpeService _visitTaskHelpeService,
|
||||||
IVisitTaskService _visitTaskService,
|
IVisitTaskService _visitTaskService,
|
||||||
IReadingClinicalDataService _readingClinicalDataService,
|
IReadingClinicalDataService _readingClinicalDataService,
|
||||||
|
|
@ -3372,12 +3371,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return ResponseOutput.NotOk(_localizer["ReadingImage_BackImageNotExist"]);
|
return ResponseOutput.NotOk(_localizer["ReadingImage_BackImageNotExist"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await _segmentationRepository.AnyAsync(x => !x.IsSaved && x.VisitTaskId == inDto.VisitTaskId))
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_SegmentationNeedSave"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||||
await VerifyDefaultQuestionBeAnswer(inDto);
|
await VerifyDefaultQuestionBeAnswer(inDto);
|
||||||
|
|
||||||
|
|
@ -3414,8 +3407,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_RequiredQuestion", string.Join(',', readingQuestionList.Select(x => x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)))]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_RequiredQuestion", string.Join(',', readingQuestionList.Select(x => x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)))]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 各个标准不同
|
// 各个标准不同
|
||||||
await _readingCalculateService.VerifyVisitTaskQuestions(inDto);
|
await _readingCalculateService.VerifyVisitTaskQuestions(inDto);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,375 +0,0 @@
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
|
||||||
// 生成时间 2026-03-10 06:17:28Z
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
using IRaCIS.Core.Infrastructure.Extention;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分割
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="_segmentationRepository"></param>
|
|
||||||
/// <param name="_mapper"></param>
|
|
||||||
/// <param name="_userInfo"></param>
|
|
||||||
/// <param name="_localizer"></param>
|
|
||||||
[ ApiExplorerSettings(GroupName = "Reading")]
|
|
||||||
public class SegmentationService(IRepository<Segmentation> _segmentationRepository,
|
|
||||||
IRepository<SegmentBinding> _segmentBindingRepository,
|
|
||||||
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
|
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
|
||||||
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
|
||||||
IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository,
|
|
||||||
IRepository<Segment> _segmentRepository,
|
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer): BaseService, ISegmentationService
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取分割组
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<PageOutput<SegmentationView>> GetSegmentationList(SegmentationQuery inQuery)
|
|
||||||
{
|
|
||||||
|
|
||||||
var segmentationQueryable =_segmentationRepository
|
|
||||||
.WhereIf(inQuery.SegmentationName.IsNotNullOrEmpty(),x=>x.SegmentationName.Contains(inQuery.SegmentationName))
|
|
||||||
.WhereIf(inQuery.Id != null, x => x.Id == inQuery.Id)
|
|
||||||
.WhereIf(inQuery.TrialId != null, x => x.TrialId == inQuery.TrialId)
|
|
||||||
.WhereIf(inQuery.SeriesId != null, x => x.SeriesId == inQuery.SeriesId)
|
|
||||||
.WhereIf(inQuery.StudyId != null, x => x.StudyId == inQuery.StudyId)
|
|
||||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
|
||||||
.WhereIf(inQuery.SubjectVisitId != null, x => x.SubjectVisitId == inQuery.SubjectVisitId)
|
|
||||||
.WhereIf(inQuery.VisitTaskId != null, x => x.VisitTaskId == inQuery.VisitTaskId)
|
|
||||||
.ProjectTo<SegmentationView>(_mapper.ConfigurationProvider);
|
|
||||||
|
|
||||||
var pageList= await segmentationQueryable.ToPagedListAsync(inQuery);
|
|
||||||
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 新增修改分割组
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="addOrEditSegmentation"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateSegmentation(SegmentationAddOrEdit addOrEditSegmentation)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var entity = await _segmentationRepository.InsertOrUpdateAsync(addOrEditSegmentation, true);
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 删除分割组
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="segmentationId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpDelete("{segmentationId:guid}")]
|
|
||||||
public async Task<IResponseOutput> DeleteSegmentation(Guid segmentationId)
|
|
||||||
{
|
|
||||||
await DeleteBindingsAndAnswersAsync(segmentationId, null);
|
|
||||||
var success = await _segmentationRepository.DeleteFromQueryAsync(t => t.Id == segmentationId,true);
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 修改分割组的保存状态
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<IResponseOutput> ChangeSegmentationSavedStatus(ChangeSegmentationSavedStatusInDto inDto)
|
|
||||||
{
|
|
||||||
await _segmentationRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, t => new Segmentation
|
|
||||||
{
|
|
||||||
IsSaved = inDto.IsSaved
|
|
||||||
});
|
|
||||||
await _segmentationRepository.SaveChangesAsync();
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取分割
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<PageOutput<SegmentView>> GetSegmentList(SegmentQuery inQuery)
|
|
||||||
{
|
|
||||||
|
|
||||||
var segmentQueryable = _segmentRepository
|
|
||||||
|
|
||||||
.WhereIf(inQuery.SegmentationId != null, x => x.SegmentationId == inQuery.SegmentationId)
|
|
||||||
.WhereIf(inQuery.SegmentName.IsNotNullOrEmpty(), x => x.SegmentName.Contains(inQuery.SegmentName))
|
|
||||||
.WhereIf(inQuery.VisitTaskId != null, x => x.VisitTaskId == inQuery.VisitTaskId)
|
|
||||||
.WhereIf(inQuery.Id != null, x => x.Id == inQuery.Id)
|
|
||||||
.ProjectTo<SegmentView>(_mapper.ConfigurationProvider);
|
|
||||||
|
|
||||||
var pageList = await segmentQueryable.ToPagedListAsync(inQuery,nameof(SegmentView.SegmentNumber));
|
|
||||||
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 新增修改分割
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="addOrEditSegment"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateSegment(SegmentAddOrEdit addOrEditSegment)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var entity = await _segmentRepository.InsertOrUpdateAsync(addOrEditSegment, true);
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 删除分割
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpDelete("{segmentId:guid}")]
|
|
||||||
public async Task<IResponseOutput> DeleteSegment(Guid segmentId)
|
|
||||||
{
|
|
||||||
await DeleteBindingsAndAnswersAsync(null, segmentId);
|
|
||||||
var success = await _segmentRepository.DeleteFromQueryAsync(t => t.Id == segmentId, true);
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取分割绑定
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<PageOutput<SegmentBindingView>> GetSegmentBindingList(SegmentBindingQuery inQuery)
|
|
||||||
{
|
|
||||||
|
|
||||||
var segmentBindingQueryable = _segmentBindingRepository
|
|
||||||
.WhereIf(inQuery.Id != null, x => x.Id == inQuery.Id)
|
|
||||||
.WhereIf(inQuery.QuestionId != null, x => x.QuestionId == inQuery.QuestionId)
|
|
||||||
.WhereIf(inQuery.RowId != null, x => x.RowId == inQuery.RowId)
|
|
||||||
.WhereIf(inQuery.SegmentId != null, x => x.SegmentId == inQuery.SegmentId)
|
|
||||||
.WhereIf(inQuery.SegmentationId != null, x => x.SegmentationId == inQuery.SegmentationId)
|
|
||||||
.WhereIf(inQuery.TableQuestionId != null, x => x.TableQuestionId == inQuery.TableQuestionId)
|
|
||||||
.WhereIf(inQuery.VisitTaskId != null, x => x.VisitTaskId == inQuery.VisitTaskId)
|
|
||||||
.ProjectTo<SegmentBindingView>(_mapper.ConfigurationProvider);
|
|
||||||
|
|
||||||
var pageList = await segmentBindingQueryable.ToPagedListAsync(inQuery);
|
|
||||||
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 新增修改分割绑定
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="addOrEditSegmentBinding"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateSegmentBinding(SegmentBindingAddOrEdit addOrEditSegmentBinding)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var entity = await _segmentBindingRepository.InsertOrUpdateAsync(addOrEditSegmentBinding, true);
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 删除分割
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="segmentBindingId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpDelete("{segmentBindingId:guid}")]
|
|
||||||
public async Task<IResponseOutput> DeleteSegmentBinding(Guid segmentBindingId)
|
|
||||||
{
|
|
||||||
var success = await _segmentBindingRepository.DeleteFromQueryAsync(t => t.Id == segmentBindingId, true);
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 保存分割绑定和答案
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<IResponseOutput> SaveSegmentBindingAndAnswer(SaveSegmentBindingAndAnswerInDto inDto)
|
|
||||||
{
|
|
||||||
|
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId)
|
|
||||||
.FirstNotNullAsync();
|
|
||||||
foreach (var item in inDto.BindingList)
|
|
||||||
{
|
|
||||||
// 处理绑定关系
|
|
||||||
var binding = await _segmentBindingRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == item.QuestionId && x.RowId == item.RowId && x.TableQuestionId == item.TableQuestionId)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
if (binding == null)
|
|
||||||
{
|
|
||||||
if (item.SegmentationId != null && item.SegmentId != null)
|
|
||||||
{
|
|
||||||
await _segmentBindingRepository.InsertFromDTOAsync(new SegmentBinding
|
|
||||||
{
|
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
|
||||||
QuestionId = item.QuestionId,
|
|
||||||
RowId = item.RowId,
|
|
||||||
TableQuestionId = item.TableQuestionId,
|
|
||||||
SegmentId = item.SegmentId.Value,
|
|
||||||
SegmentationId = item.SegmentationId.Value,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (item.SegmentationId != null && item.SegmentId != null)
|
|
||||||
{
|
|
||||||
await _segmentBindingRepository.UpdatePartialFromQueryAsync(x => x.Id == binding.Id, t => new SegmentBinding
|
|
||||||
{
|
|
||||||
SegmentId = item.SegmentId.Value,
|
|
||||||
SegmentationId = item.SegmentationId.Value,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await _segmentBindingRepository.DeleteFromQueryAsync(x => x.Id == binding.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 处理问题
|
|
||||||
if (item.RowId != null && item.TableQuestionId != null&&item.QuestionId!=null)
|
|
||||||
{
|
|
||||||
var answer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId&&x.QuestionId==item.QuestionId && x.RowId == item.RowId && x.TableQuestionId == item.TableQuestionId)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
var rowinfo= await _readingTableAnswerRowInfoRepository.Where(x => x.Id==item.RowId)
|
|
||||||
.Include(x=>x.VisitTask)
|
|
||||||
.FirstNotNullAsync();
|
|
||||||
if (answer != null)
|
|
||||||
{
|
|
||||||
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.Id == answer.Id, t => new ReadingTableQuestionAnswer
|
|
||||||
{
|
|
||||||
Answer = item.Answer
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await _readingTableQuestionAnswerRepository.InsertFromDTOAsync(new ReadingTableQuestionAnswer
|
|
||||||
{
|
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
|
||||||
RowId = item.RowId.Value,
|
|
||||||
QuestionId=item.QuestionId.Value,
|
|
||||||
TableQuestionId = item.TableQuestionId.Value,
|
|
||||||
Answer = item.Answer,
|
|
||||||
TrialId= rowinfo.VisitTask.TrialId,
|
|
||||||
RowIndex= rowinfo.RowIndex,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
var answer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId &&x.ReadingQuestionTrialId==item.QuestionId)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
if (answer != null)
|
|
||||||
{
|
|
||||||
await _readingTaskQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.Id == answer.Id, t => new ReadingTaskQuestionAnswer
|
|
||||||
{
|
|
||||||
Answer = item.Answer
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await _readingTaskQuestionAnswerRepository.InsertFromDTOAsync(new ReadingTaskQuestionAnswer
|
|
||||||
{
|
|
||||||
ReadingQuestionTrialId= item.QuestionId.Value,
|
|
||||||
ReadingQuestionCriterionTrialId=taskinfo.TrialReadingCriterionId,
|
|
||||||
TrialId= taskinfo.TrialId,
|
|
||||||
SubjectId= taskinfo.SubjectId,
|
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
|
||||||
Answer=item.Answer,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
await _segmentationRepository.SaveChangesAsync();
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 删除分割组和分割时的关联数据删除逻辑
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="segmentationId"></param>
|
|
||||||
/// <param name="segmentId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private async Task DeleteBindingsAndAnswersAsync(Guid? segmentationId, Guid? segmentId)
|
|
||||||
{
|
|
||||||
var bindingsQuery = _segmentBindingRepository
|
|
||||||
.WhereIf(segmentationId != null, x => x.SegmentationId == segmentationId)
|
|
||||||
.WhereIf(segmentId != null, x => x.SegmentId == segmentId);
|
|
||||||
|
|
||||||
var bindings = await bindingsQuery.ToListAsync();
|
|
||||||
|
|
||||||
foreach (var binding in bindings)
|
|
||||||
{
|
|
||||||
// 处理问题
|
|
||||||
if (binding.RowId != null && binding.TableQuestionId != null)
|
|
||||||
{
|
|
||||||
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.VisitTaskId == binding.VisitTaskId && x.RowId == binding.RowId && x.TableQuestionId == binding.TableQuestionId);
|
|
||||||
}
|
|
||||||
else if (binding.QuestionId != null)
|
|
||||||
{
|
|
||||||
await _readingTaskQuestionAnswerRepository.DeleteFromQueryAsync(x => x.VisitTaskId == binding.VisitTaskId && x.ReadingQuestionTrialId == binding.QuestionId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理绑定关系
|
|
||||||
if (segmentationId != null)
|
|
||||||
{
|
|
||||||
await _segmentBindingRepository.DeleteFromQueryAsync(x => x.SegmentationId == segmentationId);
|
|
||||||
}
|
|
||||||
else if (segmentId != null)
|
|
||||||
{
|
|
||||||
await _segmentBindingRepository.DeleteFromQueryAsync(x => x.SegmentId == segmentId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -15,23 +15,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//是否英文环境
|
//是否英文环境
|
||||||
var isEn_Us = false;
|
var isEn_Us = false;
|
||||||
|
|
||||||
// 在此处拷贝automapper 映射
|
|
||||||
|
|
||||||
CreateMap<Segment, SegmentView>();
|
|
||||||
CreateMap<Segment, SegmentAddOrEdit>().ReverseMap();
|
|
||||||
|
|
||||||
// 在此处拷贝automapper 映射
|
|
||||||
|
|
||||||
CreateMap<Segmentation, SegmentationView>();
|
|
||||||
CreateMap<Segmentation, SegmentationAddOrEdit>().ReverseMap();
|
|
||||||
|
|
||||||
// 在此处拷贝automapper 映射
|
|
||||||
|
|
||||||
CreateMap<SegmentBinding, SegmentBindingView>()
|
|
||||||
.ForMember(d => d.SegmentName, u => u.MapFrom(s => s.Segment.SegmentName))
|
|
||||||
.ForMember(d => d.SegmentationName, u => u.MapFrom(s => s.Segmentation.SegmentationName));
|
|
||||||
CreateMap<SegmentBinding, SegmentBindingAddOrEdit>().ReverseMap();
|
|
||||||
|
|
||||||
CreateMap<ReadingQuestionTrial, ReadingReportDto>()
|
CreateMap<ReadingQuestionTrial, ReadingReportDto>()
|
||||||
.ForMember(d => d.QuestionId, u => u.MapFrom(s => s.Id));
|
.ForMember(d => d.QuestionId, u => u.MapFrom(s => s.Id));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
|
|
@ -433,7 +432,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, $"{trialId}/InspectionUpload/" + pathCode, file.FileName, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = trialId, BatchDataType = BatchDataType.ReadingImportTemplete });
|
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/"+ pathCode, file.FileName);
|
||||||
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = file.FileName, RelativePath = ossRelativePath, TrialId = trialId });
|
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = file.FileName, RelativePath = ossRelativePath, TrialId = trialId });
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
await file.CopyToAsync(streamCopy);
|
await file.CopyToAsync(streamCopy);
|
||||||
// 重置流的位置,以便后续读取
|
// 重置流的位置,以便后续读取
|
||||||
streamCopy.Position = 0;
|
streamCopy.Position = 0;
|
||||||
var ossRelativePath = await oSSService.UploadToOSSAsync(streamCopy, $"{visitTaskInfo.TrialId.ToString()}/InspectionUpload/ReadingImport", file.FileName, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = visitTaskInfo.TrialId, BatchDataType = BatchDataType.ReadingImportTemplete });
|
var ossRelativePath = await oSSService.UploadToOSSAsync(streamCopy, $"{visitTaskInfo.TrialId.ToString()}/InspectionUpload/ReadingImport", file.FileName);
|
||||||
|
|
||||||
|
|
||||||
await _readingImportFileRepository.AddAsync(new ReadingImportFile()
|
await _readingImportFileRepository.AddAsync(new ReadingImportFile()
|
||||||
|
|
@ -351,8 +351,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private async Task<GetReportsChartDataOutDto> GetReportsChartTypeData(GetReportsChartTypeDataInDto inDto)
|
private async Task<GetReportsChartDataOutDto> GetReportsChartTypeData(GetReportsChartTypeDataInDto inDto)
|
||||||
{
|
{
|
||||||
var visitTaskNameList = inDto.Data.VisitTaskList.Select(x => x.BlindName).ToList();
|
var visitTaskNameList = inDto.Data.VisitTaskList.Select(x => x.BlindName).ToList();
|
||||||
GetReportsChartDataOutDto result = new GetReportsChartDataOutDto()
|
GetReportsChartDataOutDto result = new GetReportsChartDataOutDto() {
|
||||||
{
|
|
||||||
|
|
||||||
ChartDataList=new List<ReportChartData>() { },
|
ChartDataList=new List<ReportChartData>() { },
|
||||||
VisitTaskNameList= visitTaskNameList,
|
VisitTaskNameList= visitTaskNameList,
|
||||||
|
|
@ -519,8 +518,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
result.Evaluation.Add(visitTaskName.Select(x => new EvaluationValue()
|
result.Evaluation.Add(visitTaskName.Select(x=> new EvaluationValue() {
|
||||||
{
|
|
||||||
Value=x
|
Value=x
|
||||||
}).ToList());
|
}).ToList());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,11 @@ using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using MathNet.Numerics;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using MiniExcelLibs;
|
using MiniExcelLibs;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
|
@ -46,7 +44,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
switch (readingImportType)
|
switch (readingImportType)
|
||||||
{
|
{
|
||||||
case ReadingImportType.ROI:
|
case ReadingImportType.IVUS_MatchingSegment:
|
||||||
await UploadIVUSTemplate();
|
await UploadIVUSTemplate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -286,34 +284,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
ComputationTrigger.SaveEICRFQuestions,
|
ComputationTrigger.SaveEICRFQuestions,
|
||||||
|
|
||||||
};
|
};
|
||||||
//if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
||||||
//{
|
{
|
||||||
// // 计算斑块统计数据
|
// 计算斑块统计数据
|
||||||
// await this.CalculatePatchDataStatisticsAndPVA(inDto);
|
await this.CalculatePatchDataStatisticsAndPVA(inDto);
|
||||||
// inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
||||||
//}
|
}
|
||||||
|
|
||||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||||
{
|
{
|
||||||
//// 斑块1-PAV
|
// 斑块1-PAV
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque1PVA,GetDecimalNullFun=GetPlaque1PVA},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque1PVA,GetDecimalNullFun=GetPlaque1PVA},
|
||||||
|
|
||||||
// // 斑块2-PAV
|
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque2PVA,GetDecimalNullFun=GetPlaque2PVA},
|
|
||||||
|
|
||||||
// // 斑块3-PAV
|
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque3PVA,GetDecimalNullFun=GetPlaque3PVA},
|
|
||||||
|
|
||||||
|
|
||||||
// (EEM-Lumen)求和
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.EEMSum,GetDecimalNullFun=GetEmmSum},
|
|
||||||
|
|
||||||
// 斑块2-PAV
|
// 斑块2-PAV
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.EEMSubLumenSum,GetDecimalNullFun=GetEEMLumenSum},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque2PVA,GetDecimalNullFun=GetPlaque2PVA},
|
||||||
|
|
||||||
// PAV(冠状动脉粥样硬化体积百分比)
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.PAV,GetDecimalNullFun=GetPAV},
|
|
||||||
|
|
||||||
|
// 斑块3-PAV
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque3PVA,GetDecimalNullFun=GetPlaque3PVA},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -474,33 +461,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
decimal? getdecimalEmptyData(string value)
|
|
||||||
{
|
|
||||||
if (value == string.Empty)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
string getStringValue(decimal? value)
|
|
||||||
{
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
if (digitPlaces == -1)
|
|
||||||
{
|
|
||||||
return value.Value.ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return decimal.Round(value.Value, digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
||||||
var errorRow = new List<int> { };
|
var errorRow = new List<int> { };
|
||||||
|
|
||||||
|
|
@ -511,10 +471,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
iVUSMeasuredValue = new IVUSMeasuredValue()
|
iVUSMeasuredValue = new IVUSMeasuredValue()
|
||||||
{
|
{
|
||||||
//PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
FrameNumber = dataTable.Rows[i]["A"].ToString()??string.Empty,
|
Emm = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
Emm = getdecimalEmptyData(dataTable.Rows[i]["B"].ToString()),
|
Lumen = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
||||||
Lumen = getdecimalEmptyData(dataTable.Rows[i]["C"].ToString()),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
@ -535,15 +494,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var errorRows= string.Join(',', errorRow.Select(i => i.ToString()));
|
var errorRows= string.Join(',', errorRow.Select(i => i.ToString()));
|
||||||
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
}
|
}
|
||||||
//List<int> nums = new List<int>() { 1, 2, 3 };
|
List<int> nums = new List<int>() { 1, 2, 3 };
|
||||||
//if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
||||||
//}
|
}
|
||||||
//measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
|
|
||||||
|
|
||||||
var questionInfo = await _readingQuestionTrialRepository.Where(x =>x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId&& x.LesionType == LesionType.ROI).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x =>x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId&& x.LesionType == LesionType.MatchValues).FirstNotNullAsync();
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
||||||
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
@ -571,35 +530,33 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
});
|
});
|
||||||
|
|
||||||
// 编号
|
// 编号
|
||||||
//tableAnswers.Add(new ReadingTableQuestionAnswer()
|
|
||||||
//{
|
|
||||||
// Answer = item.PlaqueNum.ToString(),
|
|
||||||
// QuestionId = questionInfo.Id,
|
|
||||||
// TrialId = taskinfo.TrialId,
|
|
||||||
// VisitTaskId = taskinfo.Id,
|
|
||||||
// RowId = newRowId,
|
|
||||||
// RowIndex = maxnum,
|
|
||||||
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
|
||||||
//});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// EMM
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = item.FrameNumber,
|
Answer = item.PlaqueNum.ToString(),
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
RowId = newRowId,
|
RowId = newRowId,
|
||||||
RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.FrameNumber).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var emm = item.Emm.ToString();
|
||||||
|
var lumen=item.Lumen.ToString();
|
||||||
|
var emmSubtractionLumen = item.EmmSubtractionLumen.ToString();
|
||||||
|
|
||||||
|
if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
||||||
|
{
|
||||||
|
|
||||||
|
emm = decimal.Round(decimal.Parse(emm ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||||
|
lumen = decimal.Round(decimal.Parse(lumen ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||||
|
emmSubtractionLumen = decimal.Round(decimal.Parse(emmSubtractionLumen ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
// EMM
|
// EMM
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = getStringValue(item.Emm),
|
Answer = emm,
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
|
|
@ -610,7 +567,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = getStringValue(item.Lumen),
|
Answer = lumen,
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
|
|
@ -621,7 +578,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = getStringValue(item.EmmSubtractionLumen),
|
Answer = emmSubtractionLumen,
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
|
|
@ -676,7 +633,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
|
|
||||||
// 测量值集合
|
// 测量值集合
|
||||||
var matchValuesAnswerList = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).ToList();
|
var matchValuesAnswerList = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
|
|
||||||
// 获取编号
|
// 获取编号
|
||||||
var nums = matchValuesAnswerList.SelectMany(x => x.TableQuestionList).Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => int.Parse(x.Answer)).Distinct().OrderBy(x => x).ToList();
|
var nums = matchValuesAnswerList.SelectMany(x => x.TableQuestionList).Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => int.Parse(x.Answer)).Distinct().OrderBy(x => x).ToList();
|
||||||
|
|
@ -694,7 +651,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
var newRowId = NewId.NextGuid();
|
var newRowId = NewId.NextGuid();
|
||||||
|
|
||||||
var thisnumTableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.PlaqueNumber && y.Answer == item.ToString())).ToList();
|
var thisnumTableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.PlaqueNumber && y.Answer == item.ToString())).ToList();
|
||||||
|
|
||||||
// 斑块数据统计
|
// 斑块数据统计
|
||||||
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
||||||
|
|
@ -877,7 +834,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
|
|
||||||
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.ROI && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.PAV && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == question.Id)
|
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == question.Id)
|
||||||
|
|
@ -934,52 +891,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
.Where(x => x.QuestionMark == QuestionMark.PAV).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
.Where(x => x.QuestionMark == QuestionMark.PAV).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取EMM求和
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetEmmSum(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// (EEM-Lumen)求和
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetEEMLumenSum(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
var emm = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
|
||||||
|
|
||||||
var lumen = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.LumenArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
|
||||||
|
|
||||||
return emm - lumen;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// PAV(冠状动脉粥样硬化体积百分比)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetPAV(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
var eEMLumenSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMSubLumenSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
|
||||||
var eEMSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
|
||||||
|
|
||||||
decimal pav = 0;
|
|
||||||
if (eEMSum != 0)
|
|
||||||
{
|
|
||||||
pav = eEMLumenSum * 100 / eEMSum;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pav;
|
|
||||||
}
|
|
||||||
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
///// 计算NTAV的EEM
|
///// 计算NTAV的EEM
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
||||||
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
|
||||||
using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
|
|
||||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
@ -44,7 +40,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
switch (readingImportType)
|
switch (readingImportType)
|
||||||
{
|
{
|
||||||
case ReadingImportType.ROI:
|
case ReadingImportType.OCT_FCT:
|
||||||
await UploadOCTFCTTemplate();
|
await UploadOCTFCTTemplate();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -336,34 +332,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
||||||
var errorRow = new List<int> { };
|
var errorRow = new List<int> { };
|
||||||
|
|
||||||
string getNone(string value)
|
|
||||||
{
|
|
||||||
if (value == string.Empty || value == null)
|
|
||||||
{
|
|
||||||
return "无";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 3; i < dataTable.Rows.Count; i++)
|
for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
measuredValueList.Add(new OCTFCTUploadData()
|
measuredValueList.Add(new OCTFCTUploadData()
|
||||||
{
|
{
|
||||||
//PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
FrameNumber = dataTable.Rows[i]["A"].ToString() ?? string.Empty,
|
FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
FirstData = getdecimalEmptyData(dataTable.Rows[i]["B"].ToString()),
|
SecondData = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
||||||
SecondData = getdecimalEmptyData(dataTable.Rows[i]["C"].ToString()),
|
ThirdData = getdecimalData(dataTable.Rows[i]["D"].ToString()),
|
||||||
ThirdData = getdecimalEmptyData(dataTable.Rows[i]["D"].ToString()),
|
MacrophageInfiltrationMeasurement = dataTable.Rows[i]["E"].ToString() ?? string.Empty,
|
||||||
MacrophageInfiltrationMeasurement = getNone(dataTable.Rows[i]["E"].ToString()),
|
|
||||||
MacrophageInfiltrationAngle = getdecimalEmptyData(dataTable.Rows[i]["F"].ToString() ?? string.Empty),
|
MacrophageInfiltrationAngle = getdecimalEmptyData(dataTable.Rows[i]["F"].ToString() ?? string.Empty),
|
||||||
MicrochannelMeasurement = getNone(dataTable.Rows[i]["G"].ToString()),
|
MicrochannelMeasurement =dataTable.Rows[i]["G"].ToString() ?? string.Empty,
|
||||||
CholesterolCrystalMeasurement = getNone(dataTable.Rows[i]["H"].ToString()),
|
CholesterolCrystalMeasurement = dataTable.Rows[i]["H"].ToString() ?? string.Empty,
|
||||||
LumenAreaMeasurement = getdecimalEmptyData(dataTable.Rows[i]["I"].ToString()),
|
LumenAreaMeasurement = getdecimalEmptyData(dataTable.Rows[i]["I"].ToString() ?? string.Empty),
|
||||||
LipidAngle = getdecimalEmptyData(dataTable.Rows[i]["J"].ToString() ?? string.Empty),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
@ -373,7 +356,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -383,6 +366,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<int> nums = new List<int>() { 1, 2, 3 };
|
||||||
|
if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
||||||
|
}
|
||||||
|
|
||||||
Dictionary<string, string> isPresent = new Dictionary<string, string>()
|
Dictionary<string, string> isPresent = new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
{ "有","1"},
|
{ "有","1"},
|
||||||
|
|
@ -424,7 +413,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.ROI).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.FCT).FirstNotNullAsync();
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
||||||
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
@ -453,35 +442,30 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
});
|
});
|
||||||
|
|
||||||
// 编号
|
// 编号
|
||||||
//tableAnswers.Add(new ReadingTableQuestionAnswer()
|
|
||||||
//{
|
|
||||||
// Answer = item.PlaqueNum.ToString(),
|
|
||||||
// QuestionId = questionInfo.Id,
|
|
||||||
// TrialId = taskinfo.TrialId,
|
|
||||||
// VisitTaskId = taskinfo.Id,
|
|
||||||
// RowId = newRowId,
|
|
||||||
// RowIndex = maxnum,
|
|
||||||
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
|
||||||
//});
|
|
||||||
|
|
||||||
// 帧数
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = item.FrameNumber,
|
Answer = item.PlaqueNum.ToString(),
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
RowId = newRowId,
|
RowId = newRowId,
|
||||||
RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.FrameNumber).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var avg = item.Avg.ToString();
|
||||||
|
|
||||||
|
|
||||||
|
if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
||||||
|
{
|
||||||
|
avg = decimal.Round(decimal.Parse(avg ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 第一次
|
// 第一次
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = item.FirstData.DecimalNullToString(digitPlaces),
|
Answer = item.FirstData.ToString(),
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
|
|
@ -492,7 +476,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = item.SecondData.DecimalNullToString(digitPlaces),
|
Answer = item.SecondData.ToString(),
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
|
|
@ -503,7 +487,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = item.ThirdData.DecimalNullToString(digitPlaces),
|
Answer = item.ThirdData.ToString(),
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
|
|
@ -514,7 +498,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = item.Avg.DecimalNullToString(digitPlaces),
|
Answer = avg,
|
||||||
QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
|
|
@ -586,18 +570,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LumenAreaMeasurement).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LumenAreaMeasurement).Select(x => x.Id).FirstOrDefault(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 脂质角度
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
|
||||||
{
|
|
||||||
Answer = item.LipidAngle.ToString(),
|
|
||||||
QuestionId = questionInfo.Id,
|
|
||||||
TrialId = taskinfo.TrialId,
|
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
RowId = newRowId,
|
|
||||||
RowIndex = maxnum,
|
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
@ -664,176 +636,173 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task UploadOCTLipidAngleTemplate()
|
public async Task UploadOCTLipidAngleTemplate()
|
||||||
{
|
{
|
||||||
#region 这个导入没有了 代码全部注释
|
var request = httpContext.HttpContext!.Request;
|
||||||
//var request = httpContext.HttpContext!.Request;
|
var file = request.Form.Files[0];
|
||||||
//var file = request.Form.Files[0];
|
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||||
//Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
//var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
var uploadInfo = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
||||||
//var uploadInfo = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
List<string> sheetNames = new List<string>()
|
||||||
//List<string> sheetNames = new List<string>()
|
{
|
||||||
//{
|
"脂质角度","LipidAngle"
|
||||||
// "脂质角度","LipidAngle"
|
};
|
||||||
//};
|
|
||||||
|
|
||||||
//if (sheetNames.Intersect(uploadInfo.SheetNames).Count() == 0)
|
if (sheetNames.Intersect(uploadInfo.SheetNames).Count() == 0)
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
||||||
//}
|
}
|
||||||
//var dataTable = uploadInfo.DataTable;
|
var dataTable = uploadInfo.DataTable;
|
||||||
|
|
||||||
//var values = new TemplateData()
|
var values = new TemplateData()
|
||||||
//{
|
{
|
||||||
// SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
||||||
// TaskBlindName = taskinfo.TaskBlindName,
|
TaskBlindName = taskinfo.TaskBlindName,
|
||||||
//};
|
};
|
||||||
|
|
||||||
//if (values.SubjectID != dataTable.Rows[0]["B"].ToString() || values.TaskBlindName != dataTable.Rows[1]["B"].ToString())
|
if (values.SubjectID != dataTable.Rows[0]["B"].ToString() || values.TaskBlindName != dataTable.Rows[1]["B"].ToString())
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUS_UploadVisitTaskError"]);
|
throw new BusinessValidationFailedException(_localizer["IVUS_UploadVisitTaskError"]);
|
||||||
//}
|
}
|
||||||
|
|
||||||
//var digitPlaces = taskinfo.TrialReadingCriterion.DigitPlaces ?? 0;
|
var digitPlaces = taskinfo.TrialReadingCriterion.DigitPlaces ?? 0;
|
||||||
//decimal getdecimalData(string value)
|
decimal getdecimalData(string value)
|
||||||
//{
|
{
|
||||||
// return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
||||||
//}
|
}
|
||||||
//;
|
;
|
||||||
|
|
||||||
//List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
||||||
//var errorRow = new List<int> { };
|
var errorRow = new List<int> { };
|
||||||
|
|
||||||
//for (int i = 3; i < dataTable.Rows.Count; i++)
|
for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||||
//{
|
{
|
||||||
// try
|
try
|
||||||
// {
|
{
|
||||||
// measuredValueList.Add(new OCTFCTUploadData()
|
measuredValueList.Add(new OCTFCTUploadData()
|
||||||
// {
|
{
|
||||||
// PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
// FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
|
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// catch (Exception)
|
catch (Exception)
|
||||||
// {
|
{
|
||||||
|
|
||||||
// errorRow.Add(i + 1);
|
errorRow.Add(i+1);
|
||||||
// }
|
}
|
||||||
|
|
||||||
//}
|
}
|
||||||
|
|
||||||
//measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
|
|
||||||
//if (errorRow.Count() > 0)
|
if (errorRow.Count() > 0)
|
||||||
//{
|
{
|
||||||
// var errorRows = string.Join(',', errorRow.Select(i => i.ToString()));
|
var errorRows = string.Join(',', errorRow.Select(i => i.ToString()));
|
||||||
// throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
//List<int> nums = new List<int>() { 1, 2, 3 };
|
List<int> nums = new List<int>() { 1, 2, 3 };
|
||||||
//if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
//foreach (var item in measuredValueList)
|
foreach (var item in measuredValueList)
|
||||||
//{
|
{
|
||||||
// if (item.FirstData > 360)
|
if (item.FirstData > 360)
|
||||||
// {
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUS_LipidAngleLess360"]);
|
throw new BusinessValidationFailedException(_localizer["IVUS_LipidAngleLess360"]);
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
//var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.LipidAngle).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.LipidAngle).FirstNotNullAsync();
|
||||||
//var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
||||||
//List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
//List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
||||||
//var maxnum = 0;
|
var maxnum = 0;
|
||||||
|
|
||||||
|
|
||||||
//foreach (var item in measuredValueList)
|
foreach (var item in measuredValueList)
|
||||||
//{
|
{
|
||||||
// maxnum = maxnum + 1;
|
maxnum = maxnum + 1;
|
||||||
// var newRowId = NewId.NextGuid();
|
var newRowId = NewId.NextGuid();
|
||||||
// // 斑块数据统计
|
// 斑块数据统计
|
||||||
// tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
||||||
// {
|
{
|
||||||
// Id = newRowId,
|
Id = newRowId,
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// IsCurrentTaskAdd = true,
|
IsCurrentTaskAdd = true,
|
||||||
// BlindName = taskinfo.TaskBlindName,
|
BlindName = taskinfo.TaskBlindName,
|
||||||
// OrderMark = questionInfo.OrderMark,
|
OrderMark = questionInfo.OrderMark,
|
||||||
// FristAddTaskId = taskinfo.Id,
|
FristAddTaskId = taskinfo.Id,
|
||||||
// RowMark = questionInfo.OrderMark + decimal.Parse(maxnum.ToString()).GetLesionMark()
|
RowMark = questionInfo.OrderMark + decimal.Parse(maxnum.ToString()).GetLesionMark()
|
||||||
// });
|
});
|
||||||
|
|
||||||
// // 编号
|
// 编号
|
||||||
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
// {
|
{
|
||||||
// Answer = item.PlaqueNum.ToString(),
|
Answer = item.PlaqueNum.ToString(),
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// RowId = newRowId,
|
RowId = newRowId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
||||||
// });
|
});
|
||||||
|
|
||||||
// var avg = item.Avg.ToString();
|
var avg = item.Avg.ToString();
|
||||||
|
|
||||||
|
|
||||||
// if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
||||||
// {
|
{
|
||||||
// avg = decimal.Round(decimal.Parse(avg ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
avg = decimal.Round(decimal.Parse(avg ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // 脂质角度
|
// 脂质角度
|
||||||
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
// {
|
{
|
||||||
// Answer = item.FirstData.ToString(),
|
Answer = item.FirstData.ToString(),
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// RowId = newRowId,
|
RowId = newRowId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
||||||
// });
|
});
|
||||||
|
|
||||||
// // 添加其他问题答案
|
// 添加其他问题答案
|
||||||
// foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||||
// {
|
{
|
||||||
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
// {
|
{
|
||||||
// Answer = string.Empty,
|
Answer = string.Empty,
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// RowId = newRowId,
|
RowId = newRowId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// TableQuestionId = otherQuestion.Id,
|
TableQuestionId = otherQuestion.Id,
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
//await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||||
//await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||||
//await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
//await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
||||||
//await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||||
//await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
||||||
//await this.CalculateTask(new CalculateTaskInDto()
|
await this.CalculateTask(new CalculateTaskInDto()
|
||||||
//{
|
{
|
||||||
|
|
||||||
// VisitTaskId = taskinfo.Id,
|
|
||||||
//});
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
VisitTaskId = taskinfo.Id,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -855,48 +824,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
ComputationTrigger.SaveEICRFQuestions,
|
ComputationTrigger.SaveEICRFQuestions,
|
||||||
|
|
||||||
};
|
};
|
||||||
//if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
||||||
//{
|
{
|
||||||
// // 计算斑块统计数据
|
// 计算斑块统计数据
|
||||||
// await this.CalculatePatchDataStatistics(inDto);
|
await this.CalculatePatchDataStatistics(inDto);
|
||||||
// inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
||||||
//}
|
}
|
||||||
|
|
||||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||||
{
|
{
|
||||||
//// 斑块1-匹配动脉段最小FCT
|
// 斑块1-匹配动脉段最小FCT
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque1MinFCT,GetDecimalNullFun=GetPlaque1MinFCT},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque1MinFCT,GetDecimalNullFun=GetPlaque1MinFCT},
|
||||||
|
|
||||||
// // 斑块2-匹配动脉段最小FCT
|
// 斑块2-匹配动脉段最小FCT
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque2MinFCT,GetDecimalNullFun=GetPlaque2MinFCT},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque2MinFCT,GetDecimalNullFun=GetPlaque2MinFCT},
|
||||||
|
|
||||||
// // 斑块3-匹配动脉段最小FCT
|
// 斑块3-匹配动脉段最小FCT
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque3MinFCT,GetDecimalNullFun=GetPlaque3MinFCT},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque3MinFCT,GetDecimalNullFun=GetPlaque3MinFCT},
|
||||||
|
|
||||||
|
|
||||||
// 匹配动脉段最小FCT
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MatchingTheMinimumFCT,GetDecimalNullFun=GetMinFCT},
|
|
||||||
|
|
||||||
// 平均最小FCT
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.AvgMinFCT,GetDecimalNullFun=GetAvgFCT},
|
|
||||||
|
|
||||||
// 脂质角度平均值
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.AvgLipidAngle,GetDecimalNullFun=GetAvgLipidAngle},
|
|
||||||
|
|
||||||
// 脂质角度最大值
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MaxLipidAngle,GetDecimalNullFun=GetMaxLipidAngle},
|
|
||||||
|
|
||||||
//巨噬细胞浸润测量
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MacrophageInfiltrationMeasurement,GetStringFun=GetMacrophageInfiltration},
|
|
||||||
|
|
||||||
//巨噬细胞浸润角度测量
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MacrophageInfiltrationAngle,GetStringFun=GetMacrophageExtensionAngle},
|
|
||||||
|
|
||||||
//微通道测量
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MicrochannelMeasurement,GetStringFun=GetMicrochannels},
|
|
||||||
|
|
||||||
//胆固醇结晶测量
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.CholesterolCrystalMeasurement,GetStringFun=GetCholesterolCrystallization},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -998,7 +942,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
public async Task CalculatePatchDataStatistics(ReadingCalculateDto inDto)
|
public async Task CalculatePatchDataStatistics(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
// FCT 问题信息
|
// FCT 问题信息
|
||||||
var fCTQuestionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).FirstOrDefault();
|
var fCTQuestionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).FirstOrDefault();
|
||||||
|
|
||||||
List<OCTInfo> oCTFCTInfos=new List<OCTInfo> ();
|
List<OCTInfo> oCTFCTInfos=new List<OCTInfo> ();
|
||||||
|
|
||||||
|
|
@ -1276,123 +1220,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
.Where(x => x.QuestionMark == QuestionMark.MiniMumFCT).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
.Where(x => x.QuestionMark == QuestionMark.MiniMumFCT).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 匹配动脉段最小FCT (平均值的最小值)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetMinFCT(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).Where(x => x != 0).MinOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 平均最小FCT (平均值的平均值)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetAvgFCT(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).Where(x=>x!=0).DefaultIfEmpty(0).Average();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度平均值
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetAvgLipidAngle(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.LipidAngle&&x.Answer.IsNotNullOrEmpty()).Select(x => x.Answer.IsNullOrEmptyReturn0()).DefaultIfEmpty(0).Average();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度最大
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetMaxLipidAngle(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Answer.IsNullOrEmptyReturn0()).MaxOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<OCTInfo>> GetOCTInfo(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
var fCTQuestionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).FirstOrDefault();
|
|
||||||
List<OCTInfo> oCTFCTInfos = new List<OCTInfo>();
|
|
||||||
foreach (var item in fCTQuestionInfo!.TableRowInfoList)
|
|
||||||
{
|
|
||||||
oCTFCTInfos.Add(new OCTInfo()
|
|
||||||
{
|
|
||||||
|
|
||||||
// Data = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => decimal.Parse(x.Answer)).FirstOrDefault(),
|
|
||||||
MacrophageInfiltrationMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MacrophageInfiltrationMeasurement).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
|
||||||
MacrophageInfiltrationAngle = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MacrophageInfiltrationAngle).Select(x => x.Answer.IsNullOrEmptyReturnNull()).FirstOrDefault(),
|
|
||||||
MicrochannelMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MicrochannelMeasurement).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
|
||||||
CholesterolCrystalMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.CholesterolCrystalMeasurement).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return oCTFCTInfos;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取巨噬细胞浸润测量
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetMacrophageInfiltration(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
List<OCTInfo> oCTFCTInfos = await GetOCTInfo(inDto);
|
|
||||||
return oCTFCTInfos.Any(x => x.MacrophageInfiltrationMeasurement != string.Empty) ?
|
|
||||||
oCTFCTInfos.Any(x => x.MacrophageInfiltrationMeasurement.EqEnum(IsPresent.Existence)) ? IsPresent.Existence.GetEnumInt() : IsPresent.NonExistence.GetEnumInt()
|
|
||||||
: IsPresent.NonExistence.GetEnumInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 巨噬细胞浸润角度测量
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetMacrophageExtensionAngle(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
List<OCTInfo> oCTFCTInfos = await GetOCTInfo(inDto);
|
|
||||||
return oCTFCTInfos.Where(x =>x.MacrophageInfiltrationAngle != null).Count() == 0 ? string.Empty : oCTFCTInfos.Max(x => x.MacrophageInfiltrationAngle ?? 0).ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取微通道汇总
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetMicrochannels(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
List<OCTInfo> oCTFCTInfos = await GetOCTInfo(inDto);
|
|
||||||
return oCTFCTInfos.Any(x => x.MicrochannelMeasurement != string.Empty) ?
|
|
||||||
oCTFCTInfos.Any(x => x.MicrochannelMeasurement.EqEnum(IsPresent.Existence)) ? IsPresent.Existence.GetEnumInt() : IsPresent.NonExistence.GetEnumInt()
|
|
||||||
: IsPresent.NonExistence.GetEnumInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取胆固醇结晶汇总
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetCholesterolCrystallization(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
List<OCTInfo> oCTFCTInfos = await GetOCTInfo(inDto);
|
|
||||||
return oCTFCTInfos.Any(x => x.CholesterolCrystalMeasurement != string.Empty) ?
|
|
||||||
oCTFCTInfos.Any(x => x.CholesterolCrystalMeasurement.EqEnum(IsPresent.Existence)) ? IsPresent.Existence.GetEnumInt() : IsPresent.NonExistence.GetEnumInt()
|
|
||||||
: IsPresent.NonExistence.GetEnumInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 验证访视提交
|
/// 验证访视提交
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1402,7 +1229,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
|
|
||||||
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.ROI && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.PatchDataStatistics && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId== question.Id)
|
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId== question.Id)
|
||||||
|
|
@ -1434,7 +1261,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
public async Task<decimal?> GetAllMinFCT(ReadingCalculateDto inDto)
|
public async Task<decimal?> GetAllMinFCT(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||||
.Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).MinOrDefault();
|
.Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).MinOrDefault();
|
||||||
if (allMinFCT == 0)
|
if (allMinFCT == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -1450,7 +1277,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<decimal?> GetAvgMinFCT(ReadingCalculateDto inDto)
|
public async Task<decimal?> GetAvgMinFCT(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||||
.Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).ToList();
|
.Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).ToList();
|
||||||
if (allMinFCT.Count() == 0)
|
if (allMinFCT.Count() == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1191,7 +1191,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
var userEmail = item.Key;
|
var userEmail = item.Key;
|
||||||
|
|
||||||
var userTypeIdList = item.Select(t => t.UserTypeId).Distinct().ToList();
|
var userTypeIdList = item.Select(t => t.UserTypeId).ToList();
|
||||||
|
|
||||||
var existSysUser = await _identityUserRepository.Where(t => t.EMail == userEmail, true).Include(t => t.UserRoleList).FirstOrDefaultAsync();
|
var existSysUser = await _identityUserRepository.Where(t => t.EMail == userEmail, true).Include(t => t.UserRoleList).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public class TrialProcessConfig
|
public class TrialProcessConfig
|
||||||
{
|
{
|
||||||
public TrialDataStore TrialDataStoreType { get; set; }
|
|
||||||
|
|
||||||
public List<Guid> CriterionIds { get; set; } = new List<Guid>();
|
public List<Guid> CriterionIds { get; set; } = new List<Guid>();
|
||||||
|
|
||||||
|
|
@ -405,12 +404,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> ReadingToolList { get; set; }
|
public List<string> ReadingToolList { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分割工具
|
|
||||||
/// </summary>
|
|
||||||
public List<string> SegmentToolList { get; set; } = new List<string>();
|
|
||||||
|
|
||||||
|
|
||||||
public string TrialModalitys { get; set; }
|
public string TrialModalitys { get; set; }
|
||||||
|
|
||||||
public bool IsImageFilter { get; set; }
|
public bool IsImageFilter { get; set; }
|
||||||
|
|
@ -943,11 +936,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
public List<string> ReadingToolList { get; set; } = new List<string>() { };
|
public List<string> ReadingToolList { get; set; } = new List<string>() { };
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分割工具
|
|
||||||
/// </summary>
|
|
||||||
public List<string> SegmentToolList { get; set; } = new List<string>();
|
|
||||||
|
|
||||||
public List<KeyFile> KeyFileList { get; set; }=new List<KeyFile>() { };
|
public List<KeyFile> KeyFileList { get; set; }=new List<KeyFile>() { };
|
||||||
|
|
||||||
public bool IsImageFilter { get; set; }
|
public bool IsImageFilter { get; set; }
|
||||||
|
|
@ -1096,8 +1084,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public class TrialConfigDTO : BasicTrialConfig
|
public class TrialConfigDTO : BasicTrialConfig
|
||||||
{
|
{
|
||||||
public TrialDataStore TrialDataStoreType { get; set; }
|
|
||||||
|
|
||||||
[Comment("阅片任务产生之前 采集影像")]
|
[Comment("阅片任务产生之前 采集影像")]
|
||||||
public CollectImagesType CollectImagesEnum { get; set; }
|
public CollectImagesType CollectImagesEnum { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ namespace IRaCIS.Application.Contracts
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 打开失访可读
|
/// 打开失访可读
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsOpenLostVistRead { get; set; } = true;
|
public bool IsOpenLostVistRead { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@ namespace IRaCIS.Core.Application
|
||||||
foreach (var item in systemCriterionKeyFile)
|
foreach (var item in systemCriterionKeyFile)
|
||||||
{
|
{
|
||||||
|
|
||||||
var path = await _oSSService.UploadToOSSAsync(item.FilePath, $"{trialCriterion.TrialId}/ReadingModule/{trialCriterion.CriterionName}", true, true, uploadInfo: new FileUploadRecordAddOrEdit() { TrialId = trialCriterion.TrialId ,BatchDataType=BatchDataType.ReadingKeyFile });
|
var path = await _oSSService.UploadToOSSAsync(item.FilePath, $"{trialCriterion.TrialId}/ReadingModule/{trialCriterion.CriterionName}", true, true);
|
||||||
|
|
||||||
trialCriterionKeyFiles.Add(new TrialCriterionKeyFile
|
trialCriterionKeyFiles.Add(new TrialCriterionKeyFile
|
||||||
{
|
{
|
||||||
|
|
@ -610,11 +610,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
toolList = toolList.Distinct().ToList();
|
toolList = toolList.Distinct().ToList();
|
||||||
|
|
||||||
|
if (tabletoolList.Except(trialCriterion.ReadingToolList).Count() > 0)
|
||||||
var alltool= trialCriterion.ReadingToolList.Union(trialCriterion.SegmentToolList).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
if (tabletoolList.Except(alltool).Count() > 0)
|
|
||||||
{
|
{
|
||||||
//---问题的阅片工具不在标准配置的阅片工具列表中
|
//---问题的阅片工具不在标准配置的阅片工具列表中
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_TableToolNotInStdTool"]);
|
throw new BusinessValidationFailedException(_localizer["TrialConfig_TableToolNotInStdTool"]);
|
||||||
|
|
@ -633,7 +629,6 @@ namespace IRaCIS.Core.Application
|
||||||
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
|
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
|
||||||
{
|
{
|
||||||
ReadingToolList = inDto.ReadingToolList,
|
ReadingToolList = inDto.ReadingToolList,
|
||||||
SegmentToolList= inDto.SegmentToolList,
|
|
||||||
IsImageFilter = inDto.IsImageFilter,
|
IsImageFilter = inDto.IsImageFilter,
|
||||||
ImageDownloadEnum = inDto.ImageDownloadEnum,
|
ImageDownloadEnum = inDto.ImageDownloadEnum,
|
||||||
ImageUploadEnum = inDto.ImageUploadEnum,
|
ImageUploadEnum = inDto.ImageUploadEnum,
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ public class TrialStatService(
|
||||||
{
|
{
|
||||||
UploadedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
UploadedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
.Where(t => t.SubmitState == SubmitStateEnum.Submitted).Count(),
|
.Where(t => t.SubmitState == SubmitStateEnum.Submitted).Count(),
|
||||||
QCFinishedCount = t.QCProcessEnum == TrialQCProcess.NotAudit ? null : t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
QCFinishedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
.Where(t => t.AuditState == AuditStateEnum.QCPassed || t.AuditState == AuditStateEnum.QCFailed).Count(),
|
.Where(t => t.AuditState == AuditStateEnum.QCPassed || t.AuditState == AuditStateEnum.QCFailed).Count(),
|
||||||
CheckFinishedCount = t.IsImageConsistencyVerification == false ? null : t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
CheckFinishedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
.Where(t => t.CheckState == CheckStateEnum.CVPassed).Count(),
|
.Where(t => t.CheckState == CheckStateEnum.CVPassed).Count(),
|
||||||
|
|
||||||
CriterionList = t.TrialReadingCriterionList.Where(t => inQuery.TrialReadingCriterionId != null ? t.Id == inQuery.TrialReadingCriterionId : true)
|
CriterionList = t.TrialReadingCriterionList.Where(t => inQuery.TrialReadingCriterionId != null ? t.Id == inQuery.TrialReadingCriterionId : true)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Helper;
|
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
|
@ -270,7 +269,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)).IgnoreQueryFilters()
|
var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)).IgnoreQueryFilters()
|
||||||
.WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false)
|
.WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false)
|
||||||
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
||||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsReading, t.IsDeleted, t.FileSize, t.ImagePositionPatient, t.ImageOrientationPatient }).ToListAsync();
|
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsReading, t.IsDeleted, t.FileSize }).ToListAsync();
|
||||||
|
|
||||||
foreach (var t in studyList)
|
foreach (var t in studyList)
|
||||||
{
|
{
|
||||||
|
|
@ -284,17 +283,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
t.SeriesList.ForEach(series =>
|
t.SeriesList.ForEach(series =>
|
||||||
{
|
{
|
||||||
|
|
||||||
var instances = instanceList.Where(x => x.SeriesId == series.Id);
|
series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k =>
|
||||||
|
|
||||||
// ⭐ DICOM 空间排序(带兜底)
|
|
||||||
var sorted = DicomSortHelper.SortSlices(
|
|
||||||
instances,
|
|
||||||
x => x.ImagePositionPatient,
|
|
||||||
x => x.ImageOrientationPatient,
|
|
||||||
x => x.InstanceNumber
|
|
||||||
);
|
|
||||||
|
|
||||||
series.InstanceInfoList = sorted.Select(k =>
|
|
||||||
new InstanceBasicInfo()
|
new InstanceBasicInfo()
|
||||||
{
|
{
|
||||||
Id = k.Id,
|
Id = k.Id,
|
||||||
|
|
@ -599,7 +588,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
if (studyIds.Count > 0)
|
if (studyIds.Count > 0)
|
||||||
{
|
{
|
||||||
var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId) && t.IsReading)
|
var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId) && t.IsReading)
|
||||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.IsReading, t.FileSize, t.ImagePositionPatient, t.ImageOrientationPatient }).ToListAsync();
|
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.IsReading, t.FileSize }).ToListAsync();
|
||||||
|
|
||||||
List<DicomSeriesDTO> seriesLists = await _dicomSeriesRepository.Where(s => studyIds.Contains(s.StudyId))
|
List<DicomSeriesDTO> seriesLists = await _dicomSeriesRepository.Where(s => studyIds.Contains(s.StudyId))
|
||||||
.WhereIf(isManualGenerate == false, t => t.IsReading)
|
.WhereIf(isManualGenerate == false, t => t.IsReading)
|
||||||
|
|
@ -608,23 +597,11 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
foreach (var t in dicomStudyList)
|
foreach (var t in dicomStudyList)
|
||||||
{
|
{
|
||||||
|
|
||||||
t.SeriesList = seriesLists.Where(s => s.StudyId == t.StudyId).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ToList();
|
t.SeriesList = seriesLists.Where(s => s.StudyId == t.StudyId).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ToList();
|
||||||
|
|
||||||
t.SeriesList.ForEach(series =>
|
t.SeriesList.ForEach(series =>
|
||||||
{
|
{
|
||||||
|
series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k =>
|
||||||
var instances = instanceList.Where(x => x.SeriesId == series.Id);
|
|
||||||
|
|
||||||
// ⭐ DICOM 空间排序(带兜底)
|
|
||||||
var sorted = DicomSortHelper.SortSlices(
|
|
||||||
instances,
|
|
||||||
x => x.ImagePositionPatient,
|
|
||||||
x => x.ImageOrientationPatient,
|
|
||||||
x => x.InstanceNumber
|
|
||||||
);
|
|
||||||
|
|
||||||
series.InstanceInfoList = sorted.Select(k =>
|
|
||||||
new InstanceBasicInfo()
|
new InstanceBasicInfo()
|
||||||
{
|
{
|
||||||
Id = k.Id,
|
Id = k.Id,
|
||||||
|
|
@ -665,20 +642,6 @@ namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
study.SeriesList = study.SeriesList.OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ToList();
|
study.SeriesList = study.SeriesList.OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ToList();
|
||||||
|
|
||||||
study.SeriesList.ForEach(series =>
|
|
||||||
{
|
|
||||||
|
|
||||||
// ⭐ DICOM 空间排序(带兜底)
|
|
||||||
var sorted = DicomSortHelper.SortSlices(
|
|
||||||
series.InstanceInfoList,
|
|
||||||
x => x.ImagePositionPatient,
|
|
||||||
x => x.ImageOrientationPatient,
|
|
||||||
x => x.InstanceNumber
|
|
||||||
);
|
|
||||||
|
|
||||||
series.InstanceInfoList = sorted;
|
|
||||||
});
|
|
||||||
|
|
||||||
study.InstanceCount = study.SeriesList.SelectMany(t => t.InstanceInfoList).Count();
|
study.InstanceCount = study.SeriesList.SelectMany(t => t.InstanceInfoList).Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ namespace IRaCIS.Application.Contracts
|
||||||
public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; }
|
public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; }
|
||||||
|
|
||||||
//任务阅片状态
|
//任务阅片状态
|
||||||
public List<DoctorTaskStat> ReadingTaskStateList { get; set; } = new List<DoctorTaskStat>();
|
public List<DoctorUserTask> ReadingTaskStateList { get; set; } = new List<DoctorUserTask>();
|
||||||
|
|
||||||
public List<CriterionFile> CriterionFileList { get; set; } = new List<CriterionFile>();
|
public List<CriterionFile> CriterionFileList { get; set; } = new List<CriterionFile>();
|
||||||
|
|
||||||
|
|
@ -299,17 +299,11 @@ namespace IRaCIS.Application.Contracts
|
||||||
new CriterionReadingCategory()
|
new CriterionReadingCategory()
|
||||||
{
|
{
|
||||||
EnrollId = EnrollId,
|
EnrollId = EnrollId,
|
||||||
//PendingCount = ReadingTaskStateList.Where(x => x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(),
|
PendingCount = ReadingTaskStateList.Where(x => x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(),
|
||||||
|
|
||||||
//ComplectedCount = ReadingTaskStateList.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(),
|
ComplectedCount = ReadingTaskStateList.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(),
|
||||||
|
|
||||||
//TotalCount = ReadingTaskStateList.Where(x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(),
|
TotalCount = ReadingTaskStateList.Where(x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(),
|
||||||
|
|
||||||
PendingCount = ReadingTaskStateList.Where(x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).FirstOrDefault()?.PendingCount,
|
|
||||||
|
|
||||||
ComplectedCount = ReadingTaskStateList.Where(x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).FirstOrDefault()?.ComplectedCount,
|
|
||||||
|
|
||||||
TotalCount = ReadingTaskStateList.Where(x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).FirstOrDefault()?.TotalCount,
|
|
||||||
|
|
||||||
StatementCriterionFileList = CriterionFileList.Where(x => x.CriterionType == t.CriterionType && x.FileType == CriterionFileType.Statement)
|
StatementCriterionFileList = CriterionFileList.Where(x => x.CriterionType == t.CriterionType && x.FileType == CriterionFileType.Statement)
|
||||||
.WhereIf(t.CriterionType == CriterionType.SelfDefine, x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).ToList(),
|
.WhereIf(t.CriterionType == CriterionType.SelfDefine, x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).ToList(),
|
||||||
|
|
@ -354,19 +348,6 @@ namespace IRaCIS.Application.Contracts
|
||||||
public Guid TrialReadingCriterionId { get; set; }
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DoctorTaskStat
|
|
||||||
{
|
|
||||||
public CriterionType? CriterionType { get; set; }
|
|
||||||
|
|
||||||
public Guid TrialReadingCriterionId { get; set; }
|
|
||||||
|
|
||||||
public int PendingCount { get; set; }
|
|
||||||
|
|
||||||
public int ComplectedCount { get; set; }
|
|
||||||
|
|
||||||
public int TotalCount { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TrialReadingCriterionDto
|
public class TrialReadingCriterionDto
|
||||||
{
|
{
|
||||||
public ReadingOrder IsReadingTaskViewInOrder { get; set; }
|
public ReadingOrder IsReadingTaskViewInOrder { get; set; }
|
||||||
|
|
@ -454,11 +435,11 @@ namespace IRaCIS.Application.Contracts
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 待办数量
|
/// 待办数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? PendingCount { get; set; }
|
public int PendingCount { get; set; }
|
||||||
|
|
||||||
public int? ComplectedCount { get; set; }
|
public int ComplectedCount { get; set; }
|
||||||
|
|
||||||
public int? TotalCount { get; set; }
|
public int TotalCount { get; set; }
|
||||||
|
|
||||||
public List<CriterionFile> StatementCriterionFileList { get; set; }
|
public List<CriterionFile> StatementCriterionFileList { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,17 +242,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
Id = x.Id
|
Id = x.Id
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
|
||||||
//ReadingTaskStateList = intoGroup.DoctorUser.VisitTaskList.Where(t => t.TrialReadingCriterion.IsConfirm).Where(x => x.TaskState == TaskState.Effect && x.TrialId == trialId).GroupBy(x => new { x.TrialReadingCriterionId, x.TrialReadingCriterion.CriterionType }).Select(g => new DoctorTaskStat()
|
ReadingTaskStateList = intoGroup.DoctorUser.VisitTaskList.Where(t => t.TrialReadingCriterion.IsConfirm).Where(x => x.TaskState == TaskState.Effect && x.TrialId == trialId).Select(x => new DoctorUserTask()
|
||||||
//{
|
{
|
||||||
|
ReadingTaskState = x.ReadingTaskState,
|
||||||
|
TrialReadingCriterionId = x.TrialReadingCriterionId,
|
||||||
|
CriterionType = x.TrialReadingCriterion.CriterionType,
|
||||||
|
|
||||||
|
}).ToList(),
|
||||||
// PendingCount = g.Count(x => x.ReadingTaskState != ReadingTaskState.HaveSigned),
|
|
||||||
// TotalCount = g.Count(),
|
|
||||||
// ComplectedCount = g.Count(x => x.ReadingTaskState == ReadingTaskState.HaveSigned),
|
|
||||||
// TrialReadingCriterionId = g.Key.TrialReadingCriterionId,
|
|
||||||
// CriterionType = g.Key.CriterionType,
|
|
||||||
|
|
||||||
//}).ToList(),
|
|
||||||
|
|
||||||
DoctorId = doctor.Id,
|
DoctorId = doctor.Id,
|
||||||
Code = doctor.ReviewerCode,
|
Code = doctor.ReviewerCode,
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//await WeComNotifier.SendErrorAsync(webhook, "http://irc.test.extimaging.com/login", new Exception("测试异常"), new[] { "ZhouHang" });
|
//await WeComNotifier.SendErrorAsync(webhook, "http://irc.test.extimaging.com/login", new Exception("测试异常"), new[] { "ZhouHang" });
|
||||||
|
|
||||||
//throw new Exception("手动测试异常抛出");
|
//throw new Exception("手动测试异常抛出");
|
||||||
return ResponseOutput.Ok(_userInfo.Domain);
|
return ResponseOutput.Ok(modelVerify);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
github 项目地址:https://github.com/koenbeuk/EntityFrameworkCore.Triggered
|
github 项目地址:https://github.com/koenbeuk/EntityFrameworkCore.Triggered
|
||||||
|
|
||||||
Trigger 使用一般分为两种 IBeforeSaveTrigger IAfterSaveTrigger
|
Trigger 使用一般分为两种 IBeforeSaveTrigger IAfterSaveTrigger
|
||||||
|
|
||||||
IBeforeSaveTrigger 在事务保存之前 然后在里面不需要提交事务(避免稽查那里反复进)
|
IBeforeSaveTrigger 在事务保存之前 然后在里面不需要提交事务(避免稽查那里反复进)
|
||||||
|
|
||||||
IAfterSaveTrigger 在事务保存之后(比如要维护 访视拍片日期,首先数据要落库后,才能找到最大的和最小的日期赋值给访视)
|
IAfterSaveTrigger 在事务保存之后(比如要维护 访视拍片日期,首先数据要落库后,才能找到最大的和最小的日期赋值给访视)
|
||||||
|
|
@ -54,11 +54,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
OCT_LipidAngle = 2,
|
OCT_LipidAngle = 2,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI
|
|
||||||
/// </summary>
|
|
||||||
ROI = 3,
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -504,23 +499,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 影像标记类型
|
|
||||||
/// </summary>
|
|
||||||
public enum ImageMarkType
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 普通标记
|
|
||||||
/// </summary>
|
|
||||||
Normal = 0,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分割标记
|
|
||||||
/// </summary>
|
|
||||||
Segment = 1,
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导出结果
|
/// 导出结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -2060,11 +2038,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PAV = 103,
|
PAV = 103,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI测量值
|
|
||||||
/// </summary>
|
|
||||||
ROI = 104,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 脂质角度
|
/// 脂质角度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -2485,11 +2458,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PlaqueToOstiumDistance=1031,
|
PlaqueToOstiumDistance=1031,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 帧数
|
|
||||||
/// </summary>
|
|
||||||
FrameNumber =1032,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 第一次测量
|
/// 第一次测量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -3002,76 +2970,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TargetSegmentRemarks = 1012,
|
TargetSegmentRemarks = 1012,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI起始回撤距离
|
|
||||||
/// </summary>
|
|
||||||
ROIStart = 1013,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI终止回撤距离
|
|
||||||
/// </summary>
|
|
||||||
ROIEnd = 1014,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI段落总长度
|
|
||||||
/// </summary>
|
|
||||||
ROIAllLength = 1015,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// PAV(冠状动脉粥样硬化体积百分比)
|
|
||||||
/// </summary>
|
|
||||||
PAV =1019,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// EEM求和
|
|
||||||
/// </summary>
|
|
||||||
EEMSum = 1020,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// (EEM-Lumen)求和
|
|
||||||
/// </summary>
|
|
||||||
EEMSubLumenSum = 1021,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 匹配动脉段最小FCT
|
|
||||||
/// </summary>
|
|
||||||
MatchingTheMinimumFCT = 1022,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 平均最小FCT
|
|
||||||
/// </summary>
|
|
||||||
AvgMinFCT = 1023,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度平均值
|
|
||||||
/// </summary>
|
|
||||||
AvgLipidAngle = 1024,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度最大值
|
|
||||||
/// </summary>
|
|
||||||
MaxLipidAngle = 1025,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 巨噬细胞浸润测量
|
|
||||||
/// </summary>
|
|
||||||
MacrophageInfiltrationMeasurement = 1026,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 巨噬细胞浸润角度测量
|
|
||||||
/// </summary>
|
|
||||||
MacrophageInfiltrationAngle = 1027,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 微通道测量
|
|
||||||
/// </summary>
|
|
||||||
MicrochannelMeasurement = 1028,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 胆固醇结晶测量
|
|
||||||
/// </summary>
|
|
||||||
CholesterolCrystalMeasurement = 1029,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 脂肪分数总平均值
|
/// 脂肪分数总平均值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("后台 - 字典表(需要同步)")]
|
[Comment("后台 - 字典表(需要同步)")]
|
||||||
[Table("Dictionary")]
|
[Table("Dictionary")]
|
||||||
public partial class Dictionary : BaseFullAuditEntity
|
public partial class Dictionary : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<DoctorDictionary> DoctorDicRelationList { get; set; } = new List<DoctorDictionary>();
|
public List<DoctorDictionary> DoctorDicRelationList { get; set; } = new List<DoctorDictionary>();
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
@ -26,12 +26,12 @@ public partial class Dictionary : BaseFullAuditEntity
|
||||||
|
|
||||||
public Guid? ConfigTypeId { get; set; }
|
public Guid? ConfigTypeId { get; set; }
|
||||||
|
|
||||||
[Comment("字典类型- 枚举|bool|下拉框")]
|
[Comment("字典类型- 枚举|bool|下拉框")]
|
||||||
public DicDataTypeEnum DataTypeEnum { get; set; }
|
public DicDataTypeEnum DataTypeEnum { get; set; }
|
||||||
|
|
||||||
public string Description { get; set; } = null!;
|
public string Description { get; set; } = null!;
|
||||||
|
|
||||||
[Comment("是否字典类型配置")]
|
[Comment("是否字典类型配置")]
|
||||||
public bool IsConfig { get; set; }
|
public bool IsConfig { get; set; }
|
||||||
|
|
||||||
public bool IsEnable { get; set; }
|
public bool IsEnable { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
|
||||||
|
|
||||||
[Comment("整个系统,上传记录表")]
|
|
||||||
[Table("FileUploadRecord")]
|
|
||||||
public class FileUploadRecord : BaseFullAuditEntity
|
|
||||||
{
|
|
||||||
#region 导航属性
|
|
||||||
[JsonIgnore]
|
|
||||||
public Trial Trial { get; set; }
|
|
||||||
[JsonIgnore]
|
|
||||||
public Subject Subject { get; set; }
|
|
||||||
[JsonIgnore]
|
|
||||||
public SubjectVisit SubjectVisit { get; set; }
|
|
||||||
[JsonIgnore]
|
|
||||||
public DicomStudy DicomStudy { get; set; }
|
|
||||||
[JsonIgnore]
|
|
||||||
public NoneDicomStudy NoneDicomStudy { get; set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public Guid? TrialId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectId { get; set; }
|
|
||||||
|
|
||||||
public Guid? SubjectVisitId { get; set; }
|
|
||||||
|
|
||||||
public Guid? DicomStudyId { get; set; }
|
|
||||||
|
|
||||||
public Guid? NoneDicomStudyId { get; set; }
|
|
||||||
|
|
||||||
public string StudyCode { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
[Comment("文件标识ID")]
|
|
||||||
public string FileMarkId { get; set; }
|
|
||||||
|
|
||||||
[Comment("上传批次")]
|
|
||||||
public string UploadBatchId { get; set; }
|
|
||||||
|
|
||||||
[Comment("该批次数据类型")]
|
|
||||||
public BatchDataType BatchDataType { get; set; }
|
|
||||||
|
|
||||||
[Comment("上传区域")]
|
|
||||||
public string UploadRegion { get; set; }
|
|
||||||
|
|
||||||
[Comment("目标区域")]
|
|
||||||
public string TargetRegion { get; set; }
|
|
||||||
|
|
||||||
[Comment("文件类型")]
|
|
||||||
public string FileType { get; set; }
|
|
||||||
|
|
||||||
public string FileName { get; set; }
|
|
||||||
|
|
||||||
public long FileSize { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[StringLength(1000)]
|
|
||||||
public string Path { get; set; }
|
|
||||||
|
|
||||||
[Comment("是否需要同步")]
|
|
||||||
public bool? IsNeedSync { get; set; }
|
|
||||||
|
|
||||||
[Comment("同步优先级")]
|
|
||||||
public int? Priority { get; set; }
|
|
||||||
|
|
||||||
[Comment("是否已同步-最后一个任务的状态")]
|
|
||||||
public bool? IsSync { get; set; }
|
|
||||||
|
|
||||||
[Comment("同步结束时间-最后一个任务的时间")]
|
|
||||||
public DateTime? SyncFinishedTime { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public string IP { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[Comment("同步任务记录表")]
|
|
||||||
[Table("UploadFileSyncRecord")]
|
|
||||||
public class UploadFileSyncRecord : BaseFullAuditEntity
|
|
||||||
{
|
|
||||||
#region 导航属性
|
|
||||||
[JsonIgnore]
|
|
||||||
public FileUploadRecord FileUploadRecord { get; set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public Guid FileUploadRecordId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public DateTime? StartTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime? EndTime { get; set; }
|
|
||||||
|
|
||||||
public jobState JobState { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public string Msg { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum jobState
|
|
||||||
{
|
|
||||||
//待启动
|
|
||||||
PENDING = 0,
|
|
||||||
//上传中
|
|
||||||
RUNNING = 1,
|
|
||||||
|
|
||||||
SUCCESS = 2,
|
|
||||||
|
|
||||||
FAILED = 3,
|
|
||||||
|
|
||||||
CANCELLED = 4
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum BatchDataType
|
|
||||||
{
|
|
||||||
//前端自定义 1-99
|
|
||||||
//后端自定义100开始
|
|
||||||
|
|
||||||
|
|
||||||
DataReconciliation=100,
|
|
||||||
|
|
||||||
SiteUserSurvey=101,
|
|
||||||
|
|
||||||
DICOMDIR = 102,
|
|
||||||
|
|
||||||
EmailAttach=103,
|
|
||||||
|
|
||||||
ReadingImportTemplete=105,
|
|
||||||
|
|
||||||
ReadingKeyFile=106,
|
|
||||||
|
|
||||||
PACSReceive = 107
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -2,13 +2,13 @@ using IRaCIS.Core.Domain.Share;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生 - 基础信息表")]
|
[Comment("医生 - 基础信息表")]
|
||||||
[Table("Doctor")]
|
[Table("Doctor")]
|
||||||
public class Doctor : BaseFullAuditEntity
|
public class Doctor : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
[Comment("导航属性")]
|
[Comment("导航属性")]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<DoctorDictionary> DoctorDicRelationList { get; set; } = new List<DoctorDictionary>();
|
public List<DoctorDictionary> DoctorDicRelationList { get; set; } = new List<DoctorDictionary>();
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
@ -85,12 +85,12 @@ public class Doctor : BaseFullAuditEntity
|
||||||
public int GCP { get; set; }
|
public int GCP { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// GCP证书的时间
|
/// GCP证书的时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? GCPTime { get; set; }
|
public DateTime? GCPTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// GCP机构
|
/// GCP机构
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string GCPAgencies { get; set; }
|
public string GCPAgencies { get; set; }
|
||||||
|
|
@ -187,53 +187,53 @@ public class Doctor : BaseFullAuditEntity
|
||||||
public string WeChat { get; set; } = string.Empty;
|
public string WeChat { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工作兼职
|
/// 工作兼职
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string WorkPartTime { get; set; } = string.Empty;
|
public string WorkPartTime { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工作兼职En
|
/// 工作兼职En
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string WorkPartTimeEn { get; set; } = string.Empty;
|
public string WorkPartTimeEn { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 概述
|
/// 概述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string Summarize { get; set; } = string.Empty;
|
public string Summarize { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 概述
|
/// 概述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string SummarizeEn { get; set; } = string.Empty;
|
public string SummarizeEn { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 银行卡号
|
/// 银行卡号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BankNum { get; set; } = string.Empty;
|
public string BankNum { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 银行名称
|
/// 银行名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string BankName { get; set; } = string.Empty;
|
public string BankName { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开户行
|
/// 开户行
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OpeningBank { get; set; } = string.Empty;
|
public string OpeningBank { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份证号
|
/// 身份证号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string IdCard { get; set; } = string.Empty;
|
public string IdCard { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 银行手机号
|
/// 银行手机号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BankPhoneNum { get; set; } = string.Empty;
|
public string BankPhoneNum { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
@ -242,42 +242,42 @@ public class Doctor : BaseFullAuditEntity
|
||||||
public string FullName => LastName + " / " + FirstName;
|
public string FullName => LastName + " / " + FirstName;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 医生Id
|
/// 医生Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? DoctorId { get; set; }
|
public Guid? DoctorId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目Id
|
/// 项目Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 大学
|
/// 大学
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UniversityAffiliated { get; set; } = string.Empty;
|
public string UniversityAffiliated { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 大学
|
/// 大学
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UniversityAffiliatedCN { get; set; } = string.Empty;
|
public string UniversityAffiliatedCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 城市
|
/// 城市
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string City { get; set; } = string.Empty;
|
public string City { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 城市
|
/// 城市
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CityCN { get; set; } = string.Empty;
|
public string CityCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 医院
|
/// 医院
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HospitalName { get; set; } = string.Empty;
|
public string HospitalName { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 医院
|
/// 医院
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HospitalNameCN { get; set; } = string.Empty;
|
public string HospitalNameCN { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生 - 医生字典关联表")]
|
[Comment("医生 - 医生字典关联表")]
|
||||||
[Table("DoctorDictionary")]
|
[Table("DoctorDictionary")]
|
||||||
public class DoctorDictionary : Entity
|
public class DoctorDictionary : Entity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("DoctorId")]
|
[ForeignKey("DoctorId")]
|
||||||
public Doctor Doctor { get; set; }
|
public Doctor Doctor { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -2,44 +2,44 @@ using IRaCIS.Core.Domain.Share;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生 - 概述")]
|
[Comment("医生 - 概述")]
|
||||||
[Table("DoctorSummarize")]
|
[Table("DoctorSummarize")]
|
||||||
public class DoctorSummarize : BaseFullAuditEntity
|
public class DoctorSummarize : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 医生Id
|
/// 医生Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid DoctorId { get; set; }
|
public Guid DoctorId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 概述
|
/// 概述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string Summarize { get; set; } = string.Empty;
|
public string Summarize { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 概述
|
/// 概述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string SummarizeEn { get; set; } = string.Empty;
|
public string SummarizeEn { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否是主模板
|
/// 是否是主模板
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMain { get; set; }
|
public bool IsMain { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 适应症
|
/// 适应症
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Indication { get; set; }
|
public string Indication { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 适应症
|
/// 适应症
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string IndicationEn { get; set; }
|
public string IndicationEn { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目Id
|
/// 项目Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生计费 - 工作量记录表")]
|
[Comment("医生计费 - 工作量记录表")]
|
||||||
[Table("DoctorWorkload")]
|
[Table("DoctorWorkload")]
|
||||||
public class Workload : BaseFullAuditEntity
|
public class Workload : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生 - 教育信息")]
|
[Comment("医生 - 教育信息")]
|
||||||
[Table("Education")]
|
[Table("Education")]
|
||||||
public class Education : BaseFullAuditEntity
|
public class Education : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public DateOnly? BeginDate { get; set; }
|
public DateOnly? BeginDate { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生 - 继续教育经历")]
|
[Comment("医生 - 继续教育经历")]
|
||||||
[Table("Postgraduate")]
|
[Table("Postgraduate")]
|
||||||
public class Postgraduate : BaseFullAuditEntity
|
public class Postgraduate : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("HospitalId")]
|
[ForeignKey("HospitalId")]
|
||||||
public Hospital HospitalEnt { get; set; }
|
public Hospital HospitalEnt { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生 - 科研学术记录")]
|
[Comment("医生 - 科研学术记录")]
|
||||||
[Table("ResearchPublication")]
|
[Table("ResearchPublication")]
|
||||||
public partial class ResearchPublication : BaseFullAuditEntity
|
public partial class ResearchPublication : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public Guid DoctorId { get; set; }
|
public Guid DoctorId { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ using IRaCIS.Core.Domain.Share;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生 - 项目临床经历")]
|
[Comment("医生 - 项目临床经历")]
|
||||||
[Table("TrialExperience")]
|
[Table("TrialExperience")]
|
||||||
public partial class TrialExperience : BaseFullAuditEntity
|
public partial class TrialExperience : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
@ -10,7 +10,7 @@ public partial class TrialExperience : BaseFullAuditEntity
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("TrialId")]
|
[ForeignKey("TrialId")]
|
||||||
|
|
@ -33,37 +33,37 @@ public partial class TrialExperience : BaseFullAuditEntity
|
||||||
public DateTime? EndTime { get; set; }
|
public DateTime? EndTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 其他分期
|
/// 其他分期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OtherStages { get; set; } = string.Empty;
|
public string OtherStages { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 其他标准
|
/// 其他标准
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OtherCriterion { get; set; } = string.Empty;
|
public string OtherCriterion { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 适应症的枚举
|
/// 适应症的枚举
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int IndicationEnum { get; set; } = -1;
|
public int IndicationEnum { get; set; } = -1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据类型
|
/// 数据类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ExperienceDataType ExperienceDataType { get; set; }
|
public ExperienceDataType ExperienceDataType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 适应症类型ID
|
/// 适应症类型ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid IndicationTypeId { get; set; } = Guid.Empty;
|
public Guid IndicationTypeId { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目Id
|
/// 项目Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 阅片标准
|
/// 阅片标准
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CriterionType? CriterionType { get; set; }
|
public CriterionType? CriterionType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
@ -72,22 +72,22 @@ public partial class TrialExperience : BaseFullAuditEntity
|
||||||
public enum ExperienceDataType
|
public enum ExperienceDataType
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统手动添加
|
/// 系统手动添加
|
||||||
/// </summary>
|
/// </summary>
|
||||||
System = 0,
|
System = 0,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目手动添加或者同系统复制过来的
|
/// 项目手动添加或者同系统复制过来的
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Trial=1,
|
Trial=1,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目自动添加
|
/// 项目自动添加
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TrialAuto = 2,
|
TrialAuto = 2,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统自动添加
|
/// 系统自动添加
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SystemAuto = 3,
|
SystemAuto = 3,
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生计费 - 每月支付记录表")]
|
[Comment("医生计费 - 每月支付记录表")]
|
||||||
[Table("Payment")]
|
[Table("Payment")]
|
||||||
public partial class Payment : BaseFullAuditEntity
|
public partial class Payment : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生计费 - 每月支付记录表")]
|
[Comment("医生计费 - 每月支付记录表")]
|
||||||
[Table("PaymentAdjustment")]
|
[Table("PaymentAdjustment")]
|
||||||
public partial class PaymentAdjustment : BaseFullAuditEntity
|
public partial class PaymentAdjustment : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生计费 - 每月支付详情表")]
|
[Comment("医生计费 - 每月支付详情表")]
|
||||||
[Table("PaymentDetail")]
|
[Table("PaymentDetail")]
|
||||||
public partial class PaymentDetail : BaseFullAuditEntity
|
public partial class PaymentDetail : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生计费 - 不同时间点价格设置")]
|
[Comment("医生计费 - 不同时间点价格设置")]
|
||||||
[Table("RankPrice")]
|
[Table("RankPrice")]
|
||||||
public partial class RankPrice : BaseFullAuditEntity
|
public partial class RankPrice : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生计费 - 支付信息表")]
|
[Comment("医生计费 - 支付信息表")]
|
||||||
[Table("DoctorPayInformation")]
|
[Table("DoctorPayInformation")]
|
||||||
public partial class ReviewerPayInformation : BaseFullAuditEntity
|
public partial class ReviewerPayInformation : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生计费 - 项目支付配置")]
|
[Comment("医生计费 - 项目支付配置")]
|
||||||
[Table("TrialPaymentPrice")]
|
[Table("TrialPaymentPrice")]
|
||||||
public partial class TrialPaymentPrice : BaseFullAuditEntity
|
public partial class TrialPaymentPrice : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
@ -17,6 +17,6 @@ public partial class TrialPaymentPrice : BaseFullAuditEntity
|
||||||
[DecimalPrecision(18, 2)]
|
[DecimalPrecision(18, 2)]
|
||||||
public decimal AdjustmentMultiple { get; set; } = 1;
|
public decimal AdjustmentMultiple { get; set; } = 1;
|
||||||
|
|
||||||
[Comment("是否有 为新项目")]
|
[Comment("是否有 为新项目")]
|
||||||
public bool? IsNewTrial { get; set; } = false;
|
public bool? IsNewTrial { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("医生计费 - 奖励")]
|
[Comment("医生计费 - 奖励")]
|
||||||
[Table("VolumeReward")]
|
[Table("VolumeReward")]
|
||||||
public partial class VolumeReward : BaseFullAuditEntity
|
public partial class VolumeReward : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("机构 - CRO")]
|
[Comment("机构 - CRO")]
|
||||||
[Table("CROCompany")]
|
[Table("CROCompany")]
|
||||||
public class CRO : BaseFullAuditEntity
|
public class CRO : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
@ -14,7 +14,7 @@ public class CRO : BaseFullAuditEntity
|
||||||
|
|
||||||
public string CRONameCN { get; set; } = null!;
|
public string CRONameCN { get; set; } = null!;
|
||||||
|
|
||||||
[Comment("是否是项目级别")]
|
[Comment("是否是项目级别")]
|
||||||
public bool IsTrialLevel { get; set; }
|
public bool IsTrialLevel { get; set; }
|
||||||
|
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? TrialId { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("机构 - Site")]
|
[Comment("机构 - Site")]
|
||||||
[Table("Site")]
|
[Table("Site")]
|
||||||
public class Site : BaseFullAuditEntity
|
public class Site : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("HospitalId")]
|
[ForeignKey("HospitalId")]
|
||||||
public Hospital Hospital { get; set; }
|
public Hospital Hospital { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("机构 - Sponsor")]
|
[Comment("机构 - Sponsor")]
|
||||||
[Table("Sponsor")]
|
[Table("Sponsor")]
|
||||||
public partial class Sponsor : BaseFullAuditEntity
|
public partial class Sponsor : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public string SponsorName { get; set; } = String.Empty;
|
public string SponsorName { get; set; } = String.Empty;
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@ using IRaCIS.Core.Domain.Share;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("后台 - 系统账户角色关系表")]
|
[Comment("后台 - 系统账户角色关系表")]
|
||||||
[Table("User")]
|
[Table("User")]
|
||||||
public class UserRole : BaseFullAuditEntity
|
public class UserRole : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
[ForeignKey("IdentityUserId")]
|
[ForeignKey("IdentityUserId")]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
@ -37,24 +37,24 @@ public class UserRole : BaseFullAuditEntity
|
||||||
public string LastName { get; set; }
|
public string LastName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[Comment("自动切换下一个任务")]
|
[Comment("自动切换下一个任务")]
|
||||||
public bool AutoCutNextTask { get; set; }
|
public bool AutoCutNextTask { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否双屏
|
/// 是否双屏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsDoubleScreen { get; set; } = false;
|
public bool IsDoubleScreen { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Comment("医生生成账号后,会有值")]
|
[Comment("医生生成账号后,会有值")]
|
||||||
public Guid? DoctorId { get; set; }
|
public Guid? DoctorId { get; set; }
|
||||||
|
|
||||||
public UserTypeEnum UserTypeEnum { get; set; }
|
public UserTypeEnum UserTypeEnum { get; set; }
|
||||||
|
|
||||||
public Guid UserTypeId { get; set; }
|
public Guid UserTypeId { get; set; }
|
||||||
|
|
||||||
#region 新增字段
|
#region 新增字段
|
||||||
|
|
||||||
public Guid IdentityUserId { get; set; }
|
public Guid IdentityUserId { get; set; }
|
||||||
|
|
||||||
|
|
@ -63,7 +63,7 @@ public class UserRole : BaseFullAuditEntity
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
[Comment("后台 - 系统真实账户表")]
|
[Comment("后台 - 系统真实账户表")]
|
||||||
[Table("IdentityUser")]
|
[Table("IdentityUser")]
|
||||||
public class IdentityUser : BaseFullAuditEntity
|
public class IdentityUser : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
|
@ -87,7 +87,7 @@ public class IdentityUser : BaseFullAuditEntity
|
||||||
[Projectable]
|
[Projectable]
|
||||||
public string FullName => LastName + " / " + FirstName;
|
public string FullName => LastName + " / " + FirstName;
|
||||||
|
|
||||||
#region 用户信息
|
#region 用户信息
|
||||||
|
|
||||||
public int Code { get; set; }
|
public int Code { get; set; }
|
||||||
public string UserCode { get; set; }
|
public string UserCode { get; set; }
|
||||||
|
|
@ -117,20 +117,20 @@ public class IdentityUser : BaseFullAuditEntity
|
||||||
|
|
||||||
public string PositionName { get; set; }
|
public string PositionName { get; set; }
|
||||||
|
|
||||||
[Comment("这个字段废除,放在用户角色上面,后续删除")]
|
[Comment("这个字段废除,放在用户角色上面,后续删除")]
|
||||||
public bool AutoCutNextTask { get; set; }
|
public bool AutoCutNextTask { get; set; }
|
||||||
|
|
||||||
public string DepartmentName { get; set; }
|
public string DepartmentName { get; set; }
|
||||||
|
|
||||||
[Comment("首次登录需要修改密码")]
|
[Comment("首次登录需要修改密码")]
|
||||||
public bool IsFirstAdd { get; set; } = true;
|
public bool IsFirstAdd { get; set; } = true;
|
||||||
|
|
||||||
public bool IsTestUser { get; set; }
|
public bool IsTestUser { get; set; }
|
||||||
|
|
||||||
[Comment("内部用户 外部用户")]
|
[Comment("内部用户 外部用户")]
|
||||||
public bool IsZhiZhun { get; set; }
|
public bool IsZhiZhun { get; set; }
|
||||||
|
|
||||||
[Comment("上一次修改密码的时间")]
|
[Comment("上一次修改密码的时间")]
|
||||||
public DateTime? LastChangePassWordTime { get; set; }
|
public DateTime? LastChangePassWordTime { get; set; }
|
||||||
|
|
||||||
public string LastLoginIP { get; set; }
|
public string LastLoginIP { get; set; }
|
||||||
|
|
@ -140,7 +140,7 @@ public class IdentityUser : BaseFullAuditEntity
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 用户来源
|
#region 用户来源
|
||||||
|
|
||||||
public UserCeateSource UserCeateSource { get; set; }
|
public UserCeateSource UserCeateSource { get; set; }
|
||||||
|
|
||||||
|
|
@ -149,12 +149,12 @@ public class IdentityUser : BaseFullAuditEntity
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户协议Id
|
/// 用户协议Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? UserAgreementId { get; set; }
|
public Guid? UserAgreementId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 隐私政策Id
|
/// 隐私政策Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? PrivacyPolicyId { get; set; }
|
public Guid? PrivacyPolicyId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("后台 - 系统用户类型菜单中间关系表 (需要同步)")]
|
[Comment("后台 - 系统用户类型菜单中间关系表 (需要同步)")]
|
||||||
[Table("UserTypeMenu")]
|
[Table("UserTypeMenu")]
|
||||||
public partial class UserTypeMenu : Entity
|
public partial class UserTypeMenu : Entity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("UserTypeId")]
|
[ForeignKey("UserTypeId")]
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue