Compare commits
268 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6bd35ae04 | |||
| 102e193ae8 | |||
| 20d557e795 | |||
| 593ab42882 | |||
| b56d256e10 | |||
| 614a3bd70e | |||
| 2eb3b04365 | |||
| 1fa3a5a181 | |||
| cd2007c4fd | |||
| 67e710eac0 | |||
| ef451d82ec | |||
| 899ebf2a30 | |||
| f233d27f96 | |||
| 9e8ab8acca | |||
| 2265387f47 | |||
| baf8f39bc6 | |||
| 3fa14d92ae | |||
| e6c577e68b | |||
| bb111dbbeb | |||
| 0df0b10a72 | |||
| 0a7ba9f0f5 | |||
| cd88990c32 | |||
| d53a1300fc | |||
| 07332ff3e1 | |||
| 8195a1cf3e | |||
| f5e5a47624 | |||
| 28608f3ecb | |||
| bb2da7ca81 | |||
| 713518a68c | |||
| bc448da297 | |||
| 8447878cb2 | |||
| 1b5a9673f6 | |||
| 27711f4184 | |||
| bb9bac1edf | |||
| 41ae2febc7 | |||
| c072c526e2 | |||
| d6bb98b84f | |||
| 42587ee59f | |||
| 62a964a3ea | |||
| 72447eb82f | |||
| 2f83c27fde | |||
| b219593f61 | |||
| 8521b0c28c | |||
| 26a62426f0 | |||
| 1246413e30 | |||
| f50b5819c0 | |||
| 6db8d61b7c | |||
| 58250fe993 | |||
| 6cae7a1ae4 | |||
| 73541efbf4 | |||
| f4bd891deb | |||
| a9831657cc | |||
| 500a9fbaca | |||
| 5f11c3a602 | |||
| 7680e90d65 | |||
| 06a57cd056 | |||
| 7626d17540 | |||
| 344b92c427 | |||
| 4719177009 | |||
| c1461633ce | |||
| 6be7aa1ad9 | |||
| 4da7c2f960 | |||
| 47a45df610 | |||
| 1a44e48b2d | |||
| c566a703eb | |||
| 001c248cb8 | |||
| 654462fe6b | |||
| ab6642ce33 | |||
| 946386ad43 | |||
| cf9c79a928 | |||
| 493e4e8dca | |||
| ecbe8434f3 | |||
| 644fe1bd3c | |||
| 870fca2e93 | |||
| 6207fb5006 | |||
| ae913d8213 | |||
| ce969822a0 | |||
| 4fc311d4a5 | |||
| 2b424ff45c | |||
| e5d9cfc50e | |||
| ac3552818b | |||
| c004741f95 | |||
| 2bdc0c7704 | |||
| 35d90d56dd | |||
| f14525ea95 | |||
| c2350f1418 | |||
| 4b8b02fa55 | |||
| 62102b8b03 | |||
| 0655318d2d | |||
| 0bd2a10091 | |||
| ce11788878 | |||
| 0cb74296c3 | |||
| def08b72ca | |||
| 1ef8d2913b | |||
| 7e18b1287e | |||
| fdcb6ad12f | |||
| 988bf0e92c | |||
| f6612286d9 | |||
| c21845c60d | |||
| 867ef0ef97 | |||
| f27bee83b7 | |||
| e3b6feb4da | |||
| d727703075 | |||
| c49cf0ed12 | |||
| f324d207dd | |||
| c9bda275f5 | |||
| 62ed1a408d | |||
| 25efb34f1f | |||
| eb0f13c075 | |||
| 7ca92a7675 | |||
| e313f88bca | |||
| 4823eb29d5 | |||
| 43ec332f61 | |||
| cac0652120 | |||
| cc088900b6 | |||
| 824b165723 | |||
| 443b94b332 | |||
| dc116d3a6f | |||
| bbc8859a16 | |||
| 09e388b01a | |||
| e5fcb75b9f | |||
| 8e104e133f | |||
| e2a77537f0 | |||
| a73a79b627 | |||
| e79c3a8f37 | |||
| ca9a2dad18 | |||
| cd03f5f31d | |||
| 33e25de801 | |||
| 9cd60e9575 | |||
| 4da4a4de89 | |||
| ec0a88a5ec | |||
| a52a00e58c | |||
| 0a6ffbba07 | |||
| 8cb5423b0b | |||
| 5a6411c6c3 | |||
| b97a8b5a68 | |||
| 91794266e7 | |||
| 2f86e2dae1 | |||
| fb76c5af6c | |||
| 3f6ec5b7ea | |||
| c95ea8c547 | |||
| facd9e0e5f | |||
| 9d0c3d3fc5 | |||
| 907d0d39a1 | |||
| 4d689100ee | |||
| 818d9d6f62 | |||
| 9a2059726f | |||
| 8bcac405e5 | |||
| 19661c5e82 | |||
| 9875d9622d | |||
| 7573ffe941 | |||
| 47166ab2eb | |||
| 0295b7d919 | |||
| 3653072497 | |||
| 0e7f203a1b | |||
| ab99265c88 | |||
| f774d95f5c | |||
| 9e1e32f16d | |||
| 0accb453e5 | |||
| e2b285c792 | |||
| 935f95fa3b | |||
| a4d20d9f08 | |||
| 0e23719c7b | |||
| eb1f06658d | |||
| 1e177a2530 | |||
| 49031b0e48 | |||
| ca5bbb3064 | |||
| b338188c5f | |||
| 9cbe4cc36e | |||
| 6f5f521803 | |||
| a6db30280b | |||
| 4db3860ade | |||
| 57837cfe1d | |||
| b51fdc5769 | |||
| 5038d7ad53 | |||
| c1d618326b | |||
| db1a0195fe | |||
| 238def8089 | |||
| 59e969c2a8 | |||
| 029a288be2 | |||
| 11e5448acf | |||
| 71577d0346 | |||
| 681e559cb4 | |||
| 862390ae78 | |||
| f210799c4d | |||
| d7700c3c77 | |||
| 44fa4d3fc4 | |||
| f0c57c643b | |||
| 5e48ed1e23 | |||
| a3f12b2a53 | |||
| cc00cce704 | |||
| 9c244c6750 | |||
| ffb5d46ca3 | |||
| 7376732b1a | |||
| 1caf4ff8e6 | |||
| 22147483c1 | |||
| c7dbf7ba92 | |||
| fd3f76d35c | |||
| e10bca6892 | |||
| 4a01960426 | |||
| 318364e70b | |||
| 383064a7b7 | |||
| 78bbfb5f41 | |||
| 9aec1f5f50 | |||
| 66beb43daf | |||
| b02589a957 | |||
| d4a1d83851 | |||
| 53aee1020d | |||
| 010c106879 | |||
| fb43e38c7d | |||
| ca96c67e96 | |||
| 1fbf635582 | |||
| 44d62b187f | |||
| 57600cbad1 | |||
| 311d6507ce | |||
| 8e520ce579 | |||
| 5a97e15885 | |||
| bb36c67159 | |||
| 7a33edc7a6 | |||
| a7d6303da4 | |||
| 704c201c33 | |||
| c69d3eec36 | |||
| 6e5a3a0078 | |||
| ed62de9135 | |||
| a8b218ce95 | |||
| f6d2b1e7f1 | |||
| 85439213b2 | |||
| 2933d100f7 | |||
| ac799688d3 | |||
| a4b9c44cfa | |||
| af282d2bb8 | |||
| a93bbebb61 | |||
| 4552a24caa | |||
| fc22ec0672 | |||
| 963fbcb5e8 | |||
| 3da3b9de45 | |||
| a055d1c668 | |||
| 0b130bbc01 | |||
| 9f9bc9c747 | |||
| 75367ae727 | |||
| bd9d78622f | |||
| 6b807f419b | |||
| f58ee6f63a | |||
| 7510d86a52 | |||
| 65fba6ca41 | |||
| 3e2198b7ba | |||
| 535c0fc419 | |||
| 1c5d30b673 | |||
| 3bf26dbbef | |||
| 329437411d | |||
| 090cdaf2e4 | |||
| 7c257f261c | |||
| 477bc7baf7 | |||
| 32d6ebef9c | |||
| 51e0676ce5 | |||
| 53156e210f | |||
| 84f76c09f7 | |||
| 74e0765d7a | |||
| 51cfadbc77 | |||
| 01e047f639 | |||
| 4050d7e4a3 | |||
| adab66172d | |||
| 7c850c969e | |||
| f55fa98dec | |||
| 7f28c984e1 | |||
| 6220e53d8f | |||
| 5bb0231354 | |||
| 58eec48af7 |
@@ -30,6 +30,8 @@ using IRaCIS.Core.Application.Helper;
|
||||
using Microsoft.Extensions.Options;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
||||
using DocumentFormat.OpenXml.Spreadsheet;
|
||||
using AutoMapper.QueryableExtensions;
|
||||
|
||||
namespace IRaCIS.Api.Controllers
|
||||
{
|
||||
@@ -53,8 +55,8 @@ namespace IRaCIS.Api.Controllers
|
||||
/// <param name="doctorId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("doctor/getDetail/{doctorId:guid}")]
|
||||
|
||||
public async Task<IResponseOutput<DoctorDetailDTO>> GetDoctorDetail([FromServices] IAttachmentService attachmentService, [FromServices] IDoctorService _doctorService,
|
||||
|
||||
public async Task<IResponseOutput<DoctorDetailDTO>> GetDoctorDetail([FromServices] IAttachmentService attachmentService, [FromServices] IDoctorService _doctorService,
|
||||
[FromServices] IEducationService _educationService, [FromServices] ITrialExperienceService _trialExperienceService,
|
||||
|
||||
[FromServices] IResearchPublicationService _researchPublicationService, [FromServices] IVacationService _vacationService, Guid doctorId)
|
||||
@@ -66,7 +68,7 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
var doctorDetail = new DoctorDetailDTO
|
||||
{
|
||||
AuditView =await _doctorService.GetAuditState(doctorId),
|
||||
AuditView = await _doctorService.GetAuditState(doctorId),
|
||||
BasicInfoView = await _doctorService.GetBasicInfo(doctorId),
|
||||
EmploymentView = await _doctorService.GetEmploymentInfo(doctorId),
|
||||
AttachmentList = await attachmentService.GetAttachments(doctorId),
|
||||
@@ -77,7 +79,7 @@ namespace IRaCIS.Api.Controllers
|
||||
TrialExperienceView = await _trialExperienceService.GetTrialExperience(doctorId),
|
||||
ResearchPublicationView = await _researchPublicationService.GetResearchPublication(doctorId),
|
||||
|
||||
SpecialtyView =await _doctorService.GetSpecialtyInfo(doctorId),
|
||||
SpecialtyView = await _doctorService.GetSpecialtyInfo(doctorId),
|
||||
InHoliday = (await _vacationService.OnVacation(doctorId)).IsSuccess,
|
||||
IntoGroupInfo = _doctorService.GetDoctorIntoGroupInfo(doctorId),
|
||||
SowList = sowList,
|
||||
@@ -96,80 +98,31 @@ namespace IRaCIS.Api.Controllers
|
||||
/// <summary> 系统用户登录接口[New] </summary>
|
||||
[HttpPost, Route("user/login")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput<LoginReturnDTO>> Login(UserLoginDTO loginUser, [FromServices] IEasyCachingProvider provider, [FromServices] IUserService _userService,
|
||||
[FromServices] ITokenService _tokenService,
|
||||
|
||||
[FromServices] IReadingImageTaskService readingImageTaskService,
|
||||
[FromServices] IConfiguration configuration)
|
||||
public async Task<IResponseOutput> Login(UserLoginDTO loginUser,
|
||||
[FromServices] IEasyCachingProvider provider,
|
||||
[FromServices] IUserService _userService,
|
||||
[FromServices] ITokenService _tokenService,
|
||||
[FromServices] IReadingImageTaskService readingImageTaskService,
|
||||
IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
||||
IMailVerificationService _mailVerificationService)
|
||||
{
|
||||
|
||||
|
||||
var returnModel = await _userService.Login(loginUser.UserName, loginUser.Password);
|
||||
|
||||
if (returnModel.IsSuccess)
|
||||
//MFA 邮箱验证 前端传递用户Id 和MFACode
|
||||
if (loginUser.UserId != null && _verifyConfig.CurrentValue.OpenLoginMFA)
|
||||
{
|
||||
#region GRPC 调用鉴权中心,因为服务器IIS问题 http/2 故而没法使用
|
||||
Guid userId = (Guid)loginUser.UserId;
|
||||
|
||||
////重试策略
|
||||
//var defaultMethodConfig = new MethodConfig
|
||||
//{
|
||||
// Names = { MethodName.Default },
|
||||
// RetryPolicy = new RetryPolicy
|
||||
// {
|
||||
// MaxAttempts = 3,
|
||||
// InitialBackoff = TimeSpan.FromSeconds(1),
|
||||
// MaxBackoff = TimeSpan.FromSeconds(5),
|
||||
// BackoffMultiplier = 1.5,
|
||||
// RetryableStatusCodes = { Grpc.Core.StatusCode.Unavailable }
|
||||
// }
|
||||
//};
|
||||
//验证MFA 编码是否有问题 ,前端要拆开,自己调用验证的逻辑
|
||||
//await _userService.VerifyMFACodeAsync(userId, loginUser.MFACode);
|
||||
|
||||
//#region unable to trust the certificate then the gRPC client can be configured to ignore the invalid certificate
|
||||
//var loginUser = await _userRepository.Where(u => u.UserName.Equals(userName) && u.Password == password).ProjectTo<UserBasicInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
//var httpHandler = new HttpClientHandler();
|
||||
//// Return `true` to allow certificates that are untrusted/invalid
|
||||
//httpHandler.ServerCertificateCustomValidationCallback =
|
||||
// HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
|
||||
var basicInfo = await _userService.GetUserBasicInfo(userId, loginUser.Password);
|
||||
|
||||
var loginReturn = new LoginReturnDTO() { BasicInfo = basicInfo };
|
||||
|
||||
//////这一句是让grpc支持本地 http 如果本地访问部署在服务器上,那么是访问不成功的
|
||||
//AppContext.SetSwitch(
|
||||
// "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
|
||||
loginReturn.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(loginReturn.BasicInfo));
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
|
||||
//var grpcAdress = configuration.GetValue<string>("GrpcAddress");
|
||||
////var grpcAdress = "http://localhost:7200";
|
||||
|
||||
//var channel = GrpcChannel.ForAddress(grpcAdress, new GrpcChannelOptions
|
||||
//{
|
||||
// HttpHandler = httpHandler,
|
||||
// ServiceConfig = new ServiceConfig { MethodConfigs = { defaultMethodConfig } }
|
||||
|
||||
//});
|
||||
////var channel = GrpcChannel.ForAddress(grpcAdress);
|
||||
//var grpcClient = new TokenGrpcService.TokenGrpcServiceClient(channel);
|
||||
|
||||
//var userInfo = returnModel.Data.BasicInfo;
|
||||
|
||||
//var tokenResponse = grpcClient.GetUserToken(new GetTokenReuqest()
|
||||
//{
|
||||
// Id = userInfo.Id.ToString(),
|
||||
// ReviewerCode = userInfo.ReviewerCode,
|
||||
// IsAdmin = userInfo.IsAdmin,
|
||||
// RealName = userInfo.RealName,
|
||||
// UserTypeEnumInt = (int)userInfo.UserTypeEnum,
|
||||
// UserTypeShortName = userInfo.UserTypeShortName,
|
||||
// UserName = userInfo.UserName
|
||||
//});
|
||||
|
||||
//returnModel.Data.JWTStr = tokenResponse.Token;
|
||||
|
||||
#endregion
|
||||
|
||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
||||
|
||||
// 创建一个 CookieOptions 对象,用于设置 Cookie 的属性
|
||||
var option = new CookieOptions
|
||||
@@ -180,20 +133,161 @@ namespace IRaCIS.Api.Controllers
|
||||
Secure = false // 确保 cookie 只能通过 HTTPS 访问
|
||||
};
|
||||
|
||||
HttpContext.Response.Cookies.Append("access_token", returnModel.Data.JWTStr, option);
|
||||
HttpContext.Response.Cookies.Append("access_token", loginReturn.JWTStr, option);
|
||||
|
||||
// 验证阅片休息时间
|
||||
await readingImageTaskService.ResetReadingRestTime(userId);
|
||||
|
||||
await provider.SetAsync(userId.ToString(), loginReturn.JWTStr, TimeSpan.FromDays(7));
|
||||
|
||||
await provider.SetAsync($"{userId.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
|
||||
return ResponseOutput.Ok(loginReturn);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var returnModel = await _userService.Login(loginUser.UserName, loginUser.Password);
|
||||
|
||||
if (returnModel.IsSuccess)
|
||||
{
|
||||
#region GRPC 调用鉴权中心,因为服务器IIS问题 http/2 故而没法使用
|
||||
|
||||
////重试策略
|
||||
//var defaultMethodConfig = new MethodConfig
|
||||
//{
|
||||
// Names = { MethodName.Default },
|
||||
// RetryPolicy = new RetryPolicy
|
||||
// {
|
||||
// MaxAttempts = 3,
|
||||
// InitialBackoff = TimeSpan.FromSeconds(1),
|
||||
// MaxBackoff = TimeSpan.FromSeconds(5),
|
||||
// BackoffMultiplier = 1.5,
|
||||
// RetryableStatusCodes = { Grpc.Core.StatusCode.Unavailable }
|
||||
// }
|
||||
//};
|
||||
|
||||
//#region unable to trust the certificate then the gRPC client can be configured to ignore the invalid certificate
|
||||
|
||||
//var httpHandler = new HttpClientHandler();
|
||||
//// Return `true` to allow certificates that are untrusted/invalid
|
||||
//httpHandler.ServerCertificateCustomValidationCallback =
|
||||
// HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
|
||||
|
||||
|
||||
//////这一句是让grpc支持本地 http 如果本地访问部署在服务器上,那么是访问不成功的
|
||||
//AppContext.SetSwitch(
|
||||
// "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
|
||||
//var grpcAdress = configuration.GetValue<string>("GrpcAddress");
|
||||
////var grpcAdress = "http://localhost:7200";
|
||||
|
||||
//var channel = GrpcChannel.ForAddress(grpcAdress, new GrpcChannelOptions
|
||||
//{
|
||||
// HttpHandler = httpHandler,
|
||||
// ServiceConfig = new ServiceConfig { MethodConfigs = { defaultMethodConfig } }
|
||||
|
||||
//});
|
||||
////var channel = GrpcChannel.ForAddress(grpcAdress);
|
||||
//var grpcClient = new TokenGrpcService.TokenGrpcServiceClient(channel);
|
||||
|
||||
//var userInfo = returnModel.Data.BasicInfo;
|
||||
|
||||
//var tokenResponse = grpcClient.GetUserToken(new GetTokenReuqest()
|
||||
//{
|
||||
// Id = userInfo.Id.ToString(),
|
||||
// ReviewerCode = userInfo.ReviewerCode,
|
||||
// IsAdmin = userInfo.IsAdmin,
|
||||
// RealName = userInfo.RealName,
|
||||
// UserTypeEnumInt = (int)userInfo.UserTypeEnum,
|
||||
// UserTypeShortName = userInfo.UserTypeShortName,
|
||||
// UserName = userInfo.UserName
|
||||
//});
|
||||
|
||||
//returnModel.Data.JWTStr = tokenResponse.Token;
|
||||
|
||||
#endregion
|
||||
|
||||
var userId = returnModel.Data.BasicInfo.Id;
|
||||
|
||||
if (_verifyConfig.CurrentValue.OpenLoginMFA)
|
||||
{
|
||||
//发版屏蔽
|
||||
|
||||
//returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
||||
|
||||
//MFA 发送邮件
|
||||
|
||||
returnModel.Data.IsMFA = true;
|
||||
|
||||
var email = returnModel.Data.BasicInfo.EMail;
|
||||
|
||||
#region 隐藏Email
|
||||
// 找到 "@" 符号的位置
|
||||
int atIndex = email.IndexOf('@');
|
||||
|
||||
// 替换 "@" 符号前的中间两位为星号
|
||||
string visiblePart = email.Substring(0, atIndex);
|
||||
|
||||
int startIndex = (visiblePart.Length - 2) / 2;
|
||||
|
||||
// 替换中间两位字符为星号
|
||||
string hiddenPartBeforeAt = visiblePart.Substring(0, startIndex) + "**" + visiblePart.Substring(startIndex + 2);
|
||||
|
||||
string afterAt = email.Substring(atIndex + 1);
|
||||
|
||||
// 组合隐藏和可见部分
|
||||
string hiddenEmail = hiddenPartBeforeAt + "@" + afterAt;
|
||||
#endregion
|
||||
|
||||
returnModel.Data.BasicInfo.EMail = hiddenEmail;
|
||||
|
||||
await _userService.SendMFAEmail(userId);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
||||
|
||||
// 创建一个 CookieOptions 对象,用于设置 Cookie 的属性
|
||||
var option = new CookieOptions
|
||||
{
|
||||
Expires = DateTime.Now.AddMonths(1), // 设置过期时间为 30 分钟之后
|
||||
HttpOnly = false, // 确保 cookie 只能通过 HTTP 访问
|
||||
SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None, // 设置 SameSite 属性
|
||||
Secure = false // 确保 cookie 只能通过 HTTPS 访问
|
||||
};
|
||||
|
||||
HttpContext.Response.Cookies.Append("access_token", returnModel.Data.JWTStr, option);
|
||||
|
||||
|
||||
|
||||
// 验证阅片休息时间
|
||||
await readingImageTaskService.ResetReadingRestTime(returnModel.Data.BasicInfo.Id);
|
||||
|
||||
await provider.SetAsync(userId.ToString(), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
|
||||
|
||||
await provider.SetAsync($"{userId.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
}
|
||||
|
||||
}
|
||||
return returnModel;
|
||||
|
||||
}
|
||||
|
||||
var userId = returnModel.Data.BasicInfo.Id.ToString();
|
||||
//provider.Set(userId, userId, TimeSpan.FromMinutes(AppSettings.LoginExpiredTimeSpan));
|
||||
// 验证阅片休息时间
|
||||
await readingImageTaskService.ResetReadingRestTime(returnModel.Data.BasicInfo.Id);
|
||||
await provider.SetAsync(userId.ToString(), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
|
||||
return returnModel;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[HttpGet, Route("imageShare/ShareImage")]
|
||||
[AllowAnonymous]
|
||||
public IResponseOutput ShareImage([FromServices] ITokenService _tokenService)
|
||||
@@ -223,7 +317,7 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
var ossOptions = serviceOption.AliyunOSS;
|
||||
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO ,AliyunOSS= serviceOption.AliyunOSS,AWS=serviceOption.AWS });
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AliyunOSS = serviceOption.AliyunOSS, AWS = serviceOption.AWS });
|
||||
|
||||
#region 临时token 屏蔽
|
||||
//IClientProfile profile = DefaultProfile.GetProfile(ossOptions.RegionId, ossOptions.AccessKeyId, ossOptions.AccessKeySecret);
|
||||
@@ -264,19 +358,19 @@ namespace IRaCIS.Api.Controllers
|
||||
#endregion
|
||||
|
||||
}
|
||||
else if(Enum.TryParse<ObjectStoreUse>(serviceOption.ObjectStoreUse, out var parsedValue) && parsedValue == ObjectStoreUse.MinIO)
|
||||
else if (Enum.TryParse<ObjectStoreUse>(serviceOption.ObjectStoreUse, out var parsedValue) && parsedValue == ObjectStoreUse.MinIO)
|
||||
{
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse=serviceOption.ObjectStoreUse,MinIO=serviceOption.MinIO, AWS = serviceOption.AWS });
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AWS = serviceOption.AWS });
|
||||
}
|
||||
else
|
||||
{
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AWS = serviceOption.AWS });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[HttpGet("user/GenerateSTS")]
|
||||
public IResponseOutput GenerateSTS([FromServices]IOptionsMonitor<AliyunOSSOptions> options )
|
||||
[HttpGet("user/GenerateSTS")]
|
||||
public IResponseOutput GenerateSTS([FromServices] IOptionsMonitor<AliyunOSSOptions> options)
|
||||
{
|
||||
var ossOptions = options.CurrentValue;
|
||||
|
||||
@@ -304,9 +398,9 @@ namespace IRaCIS.Api.Controllers
|
||||
SecurityToken = response.Credentials.SecurityToken,
|
||||
Expiration = response.Credentials.Expiration,
|
||||
|
||||
Region = ossOptions.region ,
|
||||
BucketName = ossOptions.bucketName ,
|
||||
ViewEndpoint = ossOptions.viewEndpoint ,
|
||||
Region = ossOptions.region,
|
||||
BucketName = ossOptions.bucketName,
|
||||
ViewEndpoint = ossOptions.viewEndpoint,
|
||||
|
||||
};
|
||||
|
||||
@@ -318,12 +412,12 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
[HttpGet("User/UserRedirect")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> UserRedirect([FromServices] IRepository<User> _userRepository, string url ,[FromServices]ILogger<ExtraController> _logger)
|
||||
public async Task<IActionResult> UserRedirect([FromServices] IRepository<User> _userRepository, string url, [FromServices] ILogger<ExtraController> _logger)
|
||||
{
|
||||
|
||||
var decodeUrl = System.Web.HttpUtility.UrlDecode(url);
|
||||
|
||||
var userId = decodeUrl.Substring(decodeUrl.IndexOf("UserId=") + "UserId=".Length , 36) ;
|
||||
var userId = decodeUrl.Substring(decodeUrl.IndexOf("UserId=") + "UserId=".Length, 36);
|
||||
|
||||
var token = decodeUrl.Substring(decodeUrl.IndexOf("access_token=") + "access_token=".Length);
|
||||
|
||||
@@ -331,12 +425,12 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
var domainStrList = decodeUrl.Split("/").ToList().Take(3).ToList();
|
||||
|
||||
var errorUrl = domainStrList[0]+"//"+ domainStrList[2]+ "/error";
|
||||
var errorUrl = domainStrList[0] + "//" + domainStrList[2] + "/error";
|
||||
|
||||
|
||||
if (!await _userRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd))
|
||||
if (!await _userRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd))
|
||||
{
|
||||
decodeUrl = errorUrl+ $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(lang=="zh"? "您的初始化链接已过期": "Error!The initialization link has expired. Return")} ";
|
||||
decodeUrl = errorUrl + $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(lang == "zh" ? "您的初始化链接已过期" : "Error!The initialization link has expired. Return")} ";
|
||||
}
|
||||
|
||||
return Redirect(decodeUrl);
|
||||
|
||||
@@ -20,7 +20,6 @@ using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using Magicodes.ExporterAndImporter.Excel;
|
||||
using MassTransit;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -39,7 +38,6 @@ using Microsoft.Net.Http.Headers;
|
||||
using MiniExcelLibs;
|
||||
using Newtonsoft.Json;
|
||||
using SharpCompress.Archives;
|
||||
using SkiaSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -237,10 +235,10 @@ namespace IRaCIS.Core.API.Controllers
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
|
||||
private readonly IRepository _repository;
|
||||
|
||||
@@ -255,7 +253,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
_hostEnvironment = hostEnvironment;
|
||||
_mediator = mediator;
|
||||
_localizer = localizer;
|
||||
_mapper = mapper;
|
||||
_mapper = mapper;
|
||||
_userInfo = userInfo;
|
||||
_repository = repository;
|
||||
}
|
||||
@@ -278,7 +276,6 @@ namespace IRaCIS.Core.API.Controllers
|
||||
var studyMonitor = new StudyMonitor()
|
||||
{
|
||||
TrialId = savedInfo.TrialId,
|
||||
SiteId = savedInfo.SiteId,
|
||||
SubjectId = savedInfo.SubjectId,
|
||||
SubjectVisitId = savedInfo.SubjectVisitId,
|
||||
|
||||
@@ -407,7 +404,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
|
||||
}
|
||||
catch (Exception )
|
||||
catch (Exception)
|
||||
{
|
||||
_provider.Remove($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}");
|
||||
|
||||
@@ -482,6 +479,8 @@ namespace IRaCIS.Core.API.Controllers
|
||||
public string FilePath { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public int FileFize { get; set; }
|
||||
|
||||
public string FileType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,7 +505,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
|
||||
|
||||
var sv = (await _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException();
|
||||
var sv = (await _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.TrialSiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException();
|
||||
|
||||
var studyMonitor = await _studyMonitorRepository.FirstOrDefaultAsync(t => t.Id == studyMonitorId);
|
||||
|
||||
@@ -514,7 +513,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
foreach (var item in incommand.UploadedFileList)
|
||||
{
|
||||
await _repository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId });
|
||||
await _repository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType });
|
||||
|
||||
}
|
||||
var uploadFinishedTime = DateTime.Now;
|
||||
@@ -587,6 +586,20 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
#region MiniExcel 需要自己验证数据格式规范
|
||||
|
||||
|
||||
if (fileName.EndsWith(".xlsx"))
|
||||
{
|
||||
etcCheckList = MiniExcel.Query<CheckViewModel>(templateFileStream, excelType: ExcelType.XLSX).ToList();
|
||||
}
|
||||
else if (fileName.EndsWith(".csv"))
|
||||
{
|
||||
//因为csv 需要加配置文件 不然都是null
|
||||
etcCheckList = MiniExcel.Query<CheckViewModel>(templateFileStream, null, configuration: new MiniExcelLibs.Csv.CsvConfiguration()
|
||||
{
|
||||
StreamReaderFunc = (stream) => new StreamReader(stream, Encoding.GetEncoding("gb2312"))
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
//if (fileName.EndsWith(".csv"))
|
||||
//{
|
||||
// //因为csv 需要加配置文件 不然都是null
|
||||
@@ -602,67 +615,72 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
#region 升级net8 导入有问题
|
||||
|
||||
|
||||
//Magicodes 支持自定义特性验证
|
||||
if (fileName.EndsWith(".xlsx"))
|
||||
{
|
||||
var Importer = new ExcelImporter();
|
||||
// if (fileName.EndsWith(".xlsx"))
|
||||
//{
|
||||
// var Importer = new ExcelImporter();
|
||||
|
||||
var import = await Importer.Import<CheckViewModel>(templateFileStream);
|
||||
// var import = await Importer.Import<CheckViewModel>(templateFileStream);
|
||||
|
||||
if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
||||
// if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
||||
|
||||
//if (import.RowErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.RowErrors));
|
||||
// //if (import.RowErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.RowErrors));
|
||||
|
||||
if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(_localizer["UploadDownLoad_TemplateErrors"]);
|
||||
// if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(_localizer["UploadDownLoad_TemplateErrors"]);
|
||||
|
||||
etcCheckList = import.Data.ToList();
|
||||
}
|
||||
else if (fileName.EndsWith(".csv"))
|
||||
{
|
||||
#region 临时方案 MiniExcel读取 然后保存为xlsx 再用 Magicodes验证数据
|
||||
// etcCheckList = import.Data.ToList();
|
||||
//}
|
||||
//else if (fileName.EndsWith(".csv"))
|
||||
//{
|
||||
// #region 临时方案 MiniExcel读取 然后保存为xlsx 再用 Magicodes验证数据
|
||||
|
||||
//因为csv 需要加配置文件 不然都是null
|
||||
etcCheckList = MiniExcel.Query<CheckViewModel>(templateFileStream, null, configuration: new MiniExcelLibs.Csv.CsvConfiguration()
|
||||
{
|
||||
StreamReaderFunc = (stream) => new StreamReader(stream, Encoding.GetEncoding("gb2312"))
|
||||
}).ToList();
|
||||
// //因为csv 需要加配置文件 不然都是null
|
||||
// etcCheckList = MiniExcel.Query<CheckViewModel>(templateFileStream, null, configuration: new MiniExcelLibs.Csv.CsvConfiguration()
|
||||
// {
|
||||
// StreamReaderFunc = (stream) => new StreamReader(stream, Encoding.GetEncoding("gb2312"))
|
||||
// }).ToList();
|
||||
|
||||
var (csVToXlsxPath, csVToXlsxRelativePath) = FileStoreHelper.GetTrialCheckFilePath(_hostEnvironment, Path.GetFileNameWithoutExtension(fileName) + ".xlsx", trialId);
|
||||
// var (csVToXlsxPath, csVToXlsxRelativePath) = FileStoreHelper.GetTrialCheckFilePath(_hostEnvironment, Path.GetFileNameWithoutExtension(fileName) + ".xlsx", trialId);
|
||||
|
||||
|
||||
await MiniExcel.SaveAsAsync(csVToXlsxPath, etcCheckList, excelType: ExcelType.XLSX);
|
||||
// await MiniExcel.SaveAsAsync(csVToXlsxPath, etcCheckList, excelType: ExcelType.XLSX);
|
||||
|
||||
|
||||
var Importer = new ExcelImporter();
|
||||
// var Importer = new ExcelImporter();
|
||||
|
||||
var import = await Importer.Import<CheckViewModel>(System.IO.File.OpenRead(csVToXlsxPath));
|
||||
// var import = await Importer.Import<CheckViewModel>(System.IO.File.OpenRead(csVToXlsxPath));
|
||||
|
||||
if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
||||
// if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
||||
|
||||
//if (import.RowErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.RowErrors));
|
||||
// //if (import.RowErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.RowErrors));
|
||||
|
||||
if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.TemplateErrors));
|
||||
// if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.TemplateErrors));
|
||||
|
||||
etcCheckList = import.Data.ToList();
|
||||
// etcCheckList = import.Data.ToList();
|
||||
|
||||
#endregion
|
||||
// #endregion
|
||||
|
||||
|
||||
#region 导入组件有问题 excel编码格式
|
||||
//var Importer = new CsvImporter();
|
||||
// #region 导入组件有问题 excel编码格式
|
||||
// //var Importer = new CsvImporter();
|
||||
|
||||
//var import = await Importer.Import<CheckViewModel>(File.OpenRead(filePath));
|
||||
// //var import = await Importer.Import<CheckViewModel>(File.OpenRead(filePath));
|
||||
|
||||
//if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
||||
// //if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
||||
|
||||
//if (import.RowErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.RowErrors));
|
||||
// //if (import.RowErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.RowErrors));
|
||||
|
||||
//if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.TemplateErrors));
|
||||
// //if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.TemplateErrors));
|
||||
|
||||
//etcCheckList = import.Data.ToList();
|
||||
#endregion
|
||||
// //etcCheckList = import.Data.ToList();
|
||||
// #endregion
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
#endregion
|
||||
//ExcelReaderFactory 需要自己验证数据 并且从固定列取数据
|
||||
else
|
||||
{
|
||||
@@ -966,14 +984,14 @@ namespace IRaCIS.Core.API.Controllers
|
||||
public IMapper _mapper { get; set; }
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
private readonly IMediator _mediator;
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
|
||||
public UploadDownLoadController(IMapper mapper, IUserInfo userInfo, IStringLocalizer localizer, IMediator mediator, IWebHostEnvironment hostEnvironment)
|
||||
{
|
||||
_hostEnvironment = hostEnvironment;
|
||||
_localizer = localizer;
|
||||
_mediator = mediator;
|
||||
_mediator = mediator;
|
||||
_mapper = mapper;
|
||||
_userInfo = userInfo;
|
||||
}
|
||||
@@ -1056,7 +1074,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
}
|
||||
//处理好 用户类型 和用户类型枚举
|
||||
var sysUserTypeList = _usertypeRepository.Where(t => t.UserTypeEnum == UserTypeEnum.CRA || t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { UserTypeId = t.Id, t.UserTypeEnum }).ToList();
|
||||
var siteList = _trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode)).Select(t => new { t.TrialSiteCode, t.SiteId }).ToList();
|
||||
var siteList = _trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode)).Select(t => new { t.TrialSiteCode, TrialSiteId= t.Id }).ToList();
|
||||
|
||||
foreach (var item in excelList)
|
||||
{
|
||||
@@ -1077,7 +1095,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
}
|
||||
|
||||
item.SiteId = siteList.FirstOrDefault(t => t.TrialSiteCode.ToUpper() == item.TrialSiteCode.ToUpper()).SiteId;
|
||||
item.TrialSiteId = siteList.FirstOrDefault(t => t.TrialSiteCode.ToUpper() == item.TrialSiteCode.ToUpper()).TrialSiteId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,19 +69,18 @@
|
||||
<PackageReference Include="EasyCaching.Serialization.MessagePack" Version="1.9.2">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.11" />
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.12" />
|
||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||
<PackageReference Include="Hangfire.SqlServer" Version="1.8.11" />
|
||||
<PackageReference Include="Hangfire.SqlServer" Version="1.8.12" />
|
||||
<PackageReference Include="Invio.Extensions.Authentication.JwtBearer" Version="2.0.1" />
|
||||
<PackageReference Include="LogDashboard" Version="1.4.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.3" />
|
||||
<PackageReference Include="Serilog.Sinks.Email" Version="3.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<param name="doctorId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,EasyCaching.Core.IEasyCachingProvider,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Application.Contracts.IReadingImageTaskService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,EasyCaching.Core.IEasyCachingProvider,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Application.Contracts.IReadingImageTaskService,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Application.Services.IMailVerificationService)">
|
||||
<summary> 系统用户登录接口[New] </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.Special.FinancialChangeController.AddOrUpdateTrialInspection(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Application.Contracts.TrialCommand})">
|
||||
|
||||
@@ -24,9 +24,10 @@ using IRaCIS.Core.Application.Filter;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using IRaCIS.Application.Services.BackGroundJob;
|
||||
using LogDashboard;
|
||||
using OfficeOpenXml.Utils;
|
||||
using FellowOakDicom.Network;
|
||||
using IRaCIS.Core.Application.Service.ImageAndDoc;
|
||||
using IP2Region.Net.Abstractions;
|
||||
using IP2Region.Net.XDB;
|
||||
|
||||
|
||||
#region 获取环境变量
|
||||
@@ -160,7 +161,7 @@ builder.Services.AddSignalR();
|
||||
builder.Services.AddSingleton<IUserIdProvider, IRaCISUserIdProvider>();
|
||||
|
||||
|
||||
|
||||
builder.Services.AddSingleton<ISearcher>(new Searcher(CachePolicy.Content, Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "ip2region.xdb")));
|
||||
|
||||
|
||||
#region 历史废弃配置
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Event_IRC"
|
||||
},
|
||||
"applicationUrl": "http://localhost:6101"
|
||||
"applicationUrl": "http://localhost:6100"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
@@ -54,11 +54,11 @@
|
||||
},
|
||||
"applicationUrl": "http://localhost:6100"
|
||||
},
|
||||
"IRaCIS.US_IRC": {
|
||||
"IRaCIS.US_Uat_IRC": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "US_IRC"
|
||||
"ASPNETCORE_ENVIRONMENT": "US_Uat_IRC"
|
||||
},
|
||||
"applicationUrl": "http://localhost:6100"
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ namespace IRaCIS.Core.API
|
||||
//triggerOptions.AddTrigger<AddlTrialUserTrigger>();
|
||||
triggerOptions.AddTrigger<VisitTaskIsFrontTaskNeedSignButNotSignTrigger>();
|
||||
triggerOptions.AddTrigger<VisitTaskIbeforeTrigger>();
|
||||
|
||||
|
||||
triggerOptions.AddTrigger<UserLogTrigger>();
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
using Serilog.Sinks.Email;
|
||||
//using Serilog.Sinks.Email;
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30,
|
||||
"AutoLoginOutMinutes": 60
|
||||
"AutoLoginOutMinutes": 60,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10
|
||||
},
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
@@ -51,7 +54,11 @@
|
||||
"FromEmail": "uat@extimaging.com",
|
||||
"FromName": "UAT_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021",
|
||||
"SiteUrl": "http://irc.event.extimaging.com/login"
|
||||
"SiteUrl": "http://irc.event.extimaging.com/login",
|
||||
"CompanyName": "Extensive Imaging",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Extensive Imaging",
|
||||
"CompanyShortNameCN": "展影医疗"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
// "RemoteNew": "Server=47.117.165.18,1434;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||
// "Hangfire": "Server=47.117.165.18,1434;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
||||
//"RemoteNew": "Server=101.132.193.237,1434;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||
//"Hangfire": "Server=101.132.193.237,1434;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
||||
"RemoteNew": "Server=prod_mssql_standard,1433;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=prod_mssql_standard,1433;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
||||
},
|
||||
@@ -36,14 +36,20 @@
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": true,
|
||||
|
||||
"OpenSignDocumentBeforeWork": true,
|
||||
|
||||
"OpenLoginLimit": true,
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30,
|
||||
"AutoLoginOutMinutes": 60
|
||||
|
||||
"AutoLoginOutMinutes": 360,
|
||||
|
||||
"OpenLoginMFA": false,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10
|
||||
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
@@ -53,6 +59,8 @@
|
||||
"FromName": "IRC",
|
||||
"AuthorizationCode": "ExtImg@2022",
|
||||
"SiteUrl": "http://irc.extimaging.com/login",
|
||||
"OrganizationName": "Extlmaging",
|
||||
"OrganizationNameCN": "Extlmaging",
|
||||
"CompanyName": "Extensive Imaging",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Extensive Imaging",
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=123.56.94.154,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=123.56.94.154,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
|
||||
},
|
||||
|
||||
@@ -26,15 +26,14 @@
|
||||
"viewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
"endPoint": "192.168.3.68",
|
||||
"port": "8001",
|
||||
"useSSL": false,
|
||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||
"bucketName": "test",
|
||||
"viewEndpoint": "http://192.168.3.68:8001/test/"
|
||||
"endPoint": "hir-oss.test.extimaging.com",
|
||||
"port": "443",
|
||||
"useSSL": true,
|
||||
"accessKey": "fbStsVYCIPKHQneeqMwD",
|
||||
"secretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
||||
"bucketName": "irc-test",
|
||||
"viewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
@@ -60,7 +59,14 @@
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 1,
|
||||
"AutoLoginOutMinutes": 10
|
||||
|
||||
"AutoLoginOutMinutes": 1,
|
||||
|
||||
"OpenLoginMFA": false,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
@@ -72,6 +78,8 @@
|
||||
|
||||
"SiteUrl": "http://irc.test.extimaging.com/login",
|
||||
|
||||
"OrganizationName": "Extlmaging",
|
||||
"OrganizationNameCN": "Extlmaging",
|
||||
"CompanyName": "Extensive Imaging",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Extensive Imaging",
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=us-prod-mssql-service,1433;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=us-prod-mssql-service,1433;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
//"RemoteNew": "Server=44.210.231.169,1435;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
//"Hangfire": "Server=44.210.231.169,1435;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
},
|
||||
|
||||
"ObjectStoreService": {
|
||||
"ObjectStoreUse": "AWS",
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"endPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"accessKeyId": "",
|
||||
"accessKeySecret": "",
|
||||
"bucketName": "zy-irc-test-store",
|
||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||
"viewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
"endPoint": "44.210.231.169",
|
||||
"port": "9001",
|
||||
"useSSL": false,
|
||||
"accessKey": "e9bT1isTOqSAUxb6wd4n",
|
||||
"secretKey": "b5TaDzNdQCBtCvfm8eZ3dR6yY7tfZu2JYze2Po1i",
|
||||
"bucketName": "prod-irc-us",
|
||||
"viewEndpoint": "http://44.210.231.169:9001/prod-irc-us/"
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
"endPoint": "s3.us-east-1.amazonaws.com",
|
||||
"useSSL": true,
|
||||
"accessKey": "AKIAW3MEAFJX5P32P6NA",
|
||||
"secretKey": "soKfYlzZE11Zi4RyTjXp0myXN0U3U+ka8rT49+B/",
|
||||
"bucketName": "ei-med-s3-lili-store",
|
||||
"viewEndpoint": "https://ei-med-s3-lili-store.s3.amazonaws.com/"
|
||||
}
|
||||
},
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": false,
|
||||
|
||||
"OpenSignDocumentBeforeWork": false,
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
"OpenLoginLimit": false,
|
||||
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30,
|
||||
"AutoLoginOutMinutes": 60,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 587,
|
||||
"Host": "smtp-mail.outlook.com",
|
||||
"FromEmail": "donotreply@elevateimaging.ai",
|
||||
"FromName": "LiLi",
|
||||
"AuthorizationCode": "Q#669869497420ul",
|
||||
|
||||
"OrganizationName": "Elevate Imaging",
|
||||
"OrganizationNameCN": "Elevate Imaging",
|
||||
"CompanyName": "Elevate Imaging Inc.",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Elevate Imaging",
|
||||
"CompanyShortNameCN": "展影医疗",
|
||||
"SiteUrl": "https://lili.elevateimaging.ai/login"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
},
|
||||
|
||||
"ObjectStoreService": {
|
||||
|
||||
"ObjectStoreUse": "MinIO",
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"endPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||
"bucketName": "zy-irc-test-store",
|
||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||
"viewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
//"endPoint": "hir-oss.uat.extimaging.com",
|
||||
//"port": "443",
|
||||
//"useSSL": true,
|
||||
//"viewEndpoint": "https://hir-oss.uat.extimaging.com/hir-uat",
|
||||
|
||||
"endPoint": "47.117.164.182",
|
||||
"port": "9001",
|
||||
"useSSL": false,
|
||||
"viewEndpoint": "http://47.117.164.182:9001/test-irc-us",
|
||||
|
||||
"accessKey": "b9Ul0e98xPzt6PwRXA1Q",
|
||||
"secretKey": "DzMaU2L4OXl90uytwOmDXF2encN0Jf4Nxu2XkYqQ",
|
||||
"bucketName": "test-irc-us"
|
||||
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
"endPoint": "s3.us-east-1.amazonaws.com",
|
||||
"useSSL": true,
|
||||
"accessKey": "AKIAZQ3DRSOHFPJJ6FEU",
|
||||
"secretKey": "l+yjtvV7Z4jiwm/7xCYv30UeUj/SvuqqYzAwjJHf",
|
||||
"bucketName": "ei-irc-test-store",
|
||||
"viewEndpoint": "https://ei-irc-test-store.s3.amazonaws.com/"
|
||||
}
|
||||
},
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": false,
|
||||
|
||||
"OpenSignDocumentBeforeWork": false,
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
"OpenLoginLimit": false,
|
||||
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30,
|
||||
"AutoLoginOutMinutes": 60,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 587,
|
||||
"Host": "smtp-mail.outlook.com",
|
||||
"FromEmail": "donotreply@elevateimaging.ai",
|
||||
"FromName": "LiLi",
|
||||
"AuthorizationCode": "Q#669869497420ul",
|
||||
|
||||
"OrganizationName": "Elevate Imaging",
|
||||
"OrganizationNameCN": "Elevate Imaging",
|
||||
"CompanyName": "Elevate Imaging Inc.",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Elevate Imaging",
|
||||
"CompanyShortNameCN": "展影医疗",
|
||||
"SiteUrl": "https://lili.test.elevateimaging.ai/login"
|
||||
}
|
||||
|
||||
}
|
||||
+32
-17
@@ -7,8 +7,8 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=us-mssql-service,1433;Database=Prod_US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=us-mssql-service,1433;Database=Prod_US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
"RemoteNew": "Server=us-mssql-service,1433;Database=US_Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=us-mssql-service,1433;Database=US_Uat_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
|
||||
//"RemoteNew": "Server=44.218.11.19,1435;Database=Prod_US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
//"Hangfire": "Server=44.218.11.19,1435;Database=Prod_US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
"ObjectStoreService": {
|
||||
|
||||
"ObjectStoreUse": "AWS",
|
||||
"ObjectStoreUse": "MinIO",
|
||||
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
@@ -30,13 +30,20 @@
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
"endPoint": "192.168.3.68",
|
||||
"port": "8001",
|
||||
//"endPoint": "hir-oss.us.extimaging.com",
|
||||
//"port": "443",
|
||||
//"useSSL": true,
|
||||
//"viewEndpoint": "https://hir-oss.us.extimaging.com/hir-us",
|
||||
|
||||
"endPoint": "44.218.11.19",
|
||||
"port": "9001",
|
||||
"useSSL": false,
|
||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||
"bucketName": "test",
|
||||
"viewEndpoint": "http://192.168.3.68:8001/test/"
|
||||
"viewEndpoint": "http://44.218.11.19:9001/uat-irc-us",
|
||||
|
||||
"accessKey": "lH8DkKskLuDqPaiubuSQ",
|
||||
"secretKey": "pdPdicvvLeH7xAC5yFUrI7odMyBfOXxvVWMvKYV4",
|
||||
"bucketName": "uat-irc-us"
|
||||
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
@@ -61,19 +68,27 @@
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30,
|
||||
"AutoLoginOutMinutes": 60
|
||||
"AutoLoginOutMinutes": 60,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "test@extimaging.com",
|
||||
"FromName": "Test_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021",
|
||||
"CompanyName": "Elevate Imaging",
|
||||
"Port": 587,
|
||||
"Host": "smtp-mail.outlook.com",
|
||||
"FromEmail": "donotreply@elevateimaging.ai",
|
||||
"FromName": "LiLi",
|
||||
"AuthorizationCode": "Q#669869497420ul",
|
||||
|
||||
"OrganizationName": "Elevate Imaging",
|
||||
"OrganizationNameCN": "Elevate Imaging",
|
||||
"CompanyName": "Elevate Imaging Inc.",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Elevate Imaging",
|
||||
"CompanyShortNameCN": "展影医疗"
|
||||
"CompanyShortNameCN": "展影医疗",
|
||||
"SiteUrl": "https://lili.test.elevateimaging.ai/login"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,12 +26,17 @@
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
"endpoint": "http://192.168.3.68",
|
||||
"port": "8001",
|
||||
"useSSL": false,
|
||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||
"bucketName": "test"
|
||||
"endPoint": "hir-oss.uat.extimaging.com",
|
||||
//"port": "80",
|
||||
//"useSSL": false,
|
||||
//"viewEndpoint": "http://hir-oss.uat.extimaging.com/irc-uat",
|
||||
"port": "443",
|
||||
"useSSL": true,
|
||||
"viewEndpoint": "https://hir-oss.uat.extimaging.com/irc-uat",
|
||||
"accessKey": "b9Ul0e98xPzt6PwRXA1Q",
|
||||
"secretKey": "DzMaU2L4OXl90uytwOmDXF2encN0Jf4Nxu2XkYqQ",
|
||||
"bucketName": "irc-uat"
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -45,7 +50,12 @@
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30,
|
||||
"AutoLoginOutMinutes": 60
|
||||
"AutoLoginOutMinutes": 60,
|
||||
"OpenLoginMFA": false,
|
||||
|
||||
"ContinuousReadingTimeMin": 120,
|
||||
|
||||
"ReadingRestTimeMin": 10
|
||||
|
||||
},
|
||||
"SystemEmailSendConfig": {
|
||||
@@ -55,6 +65,8 @@
|
||||
"FromName": "UAT_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021",
|
||||
"SiteUrl": "http://irc.uat.extimaging.com/login",
|
||||
"OrganizationName": "Extlmaging",
|
||||
"OrganizationNameCN": "Extlmaging",
|
||||
"CompanyName": "Extensive Imaging",
|
||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||
"CompanyShortName": "Extensive Imaging",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"JwtSetting": {
|
||||
"SecurityKey": "SecurityKey_SHzyyl@2021",
|
||||
"SecurityKey": "ShangHaiZhanYing_SecurityKey_SHzyyl@2021",
|
||||
"Issuer": "Extimaging",
|
||||
"Audience": "EICS",
|
||||
"TokenExpireDays": "7"
|
||||
|
||||
@@ -90,8 +90,9 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
|
||||
{
|
||||
context.HttpContext.Response.ContentType = "application/json";
|
||||
context.HttpContext.Response.StatusCode = StatusCodes.Status403Forbidden;
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk("登录无操作超时自动退出", ApiResponseCodeEnum.AutoLoginOut));
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountAuto_LoginOut"], ApiResponseCodeEnum.AutoLoginOut));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Magicodes.ExporterAndImporter.Excel;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MiniExcelLibs;
|
||||
@@ -14,7 +13,6 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using SkiaSharp;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
|
||||
|
||||
@@ -515,18 +515,18 @@ public static class FileStoreHelper
|
||||
|
||||
// 获取 入组确认 PD 进展发送邮件Word|PDF 存放路径
|
||||
|
||||
public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId,bool isChangeToPdfFormat=false)
|
||||
public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid trialSiteId, Guid subjectId,bool isChangeToPdfFormat=false)
|
||||
{
|
||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
||||
string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), siteId.ToString(), subjectId.ToString());
|
||||
string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), trialSiteId.ToString(), subjectId.ToString());
|
||||
|
||||
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
|
||||
|
||||
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName, isChangeToPdfFormat);
|
||||
|
||||
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{siteId}/{subjectId}/{trustedFileNameForFileStorage}";
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{trialSiteId}/{subjectId}/{trustedFileNameForFileStorage}";
|
||||
|
||||
var serverFilePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage);
|
||||
|
||||
@@ -541,7 +541,7 @@ public static class FileStoreHelper
|
||||
return Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), siteId.ToString(), subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.DicomFolder);
|
||||
}
|
||||
|
||||
public static (string PhysicalPath, string RelativePath) GetDicomInstanceFilePath(IWebHostEnvironment _hostEnvironment, Guid trialId, Guid siteId, Guid subjectId, Guid subjectVisitId, Guid studyId, Guid instanceId)
|
||||
public static (string PhysicalPath, string RelativePath) GetDicomInstanceFilePath(IWebHostEnvironment _hostEnvironment, Guid trialId, Guid subjectId, Guid subjectVisitId, Guid studyId, Guid instanceId)
|
||||
{
|
||||
#region 切换存储前
|
||||
//var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
@@ -552,7 +552,7 @@ public static class FileStoreHelper
|
||||
|
||||
//加入访视层级 和Data
|
||||
var path = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(),
|
||||
siteId.ToString(), subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.DicomFolder, studyId.ToString());
|
||||
subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.DicomFolder, studyId.ToString());
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
@@ -561,7 +561,7 @@ public static class FileStoreHelper
|
||||
|
||||
var physicalPath = Path.Combine(path, instanceId.ToString() );
|
||||
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{siteId}/{subjectId}/{subjectVisitId}/{StaticData.Folder.DicomFolder}/{studyId}/{instanceId}";
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{subjectId}/{subjectVisitId}/{StaticData.Folder.DicomFolder}/{studyId}/{instanceId}";
|
||||
|
||||
//var physicalPath = Path.Combine(path, instanceId.ToString() + ".dcm");
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
@@ -96,8 +95,8 @@ namespace IRaCIS.Core.Application.Helper
|
||||
|
||||
public interface IOSSService
|
||||
{
|
||||
public Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName);
|
||||
public Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath);
|
||||
public Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true);
|
||||
public Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true);
|
||||
|
||||
public Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath);
|
||||
|
||||
@@ -124,12 +123,12 @@ namespace IRaCIS.Core.Application.Helper
|
||||
/// <param name="fileStream"></param>
|
||||
/// <param name="oosFolderPath"></param>
|
||||
/// <param name="fileRealName"></param>
|
||||
/// <param name="isFileNameAddGuid"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName)
|
||||
public async Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true)
|
||||
{
|
||||
|
||||
|
||||
var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{fileRealName}";
|
||||
var ossRelativePath = isFileNameAddGuid ? $"{oosFolderPath}/{Guid.NewGuid()}_{fileRealName}" : $"{oosFolderPath}/{fileRealName}";
|
||||
//var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{fileRealName}";
|
||||
//var ossRelativePath = oosFolderPath + "/" + fileRealName;
|
||||
|
||||
using (var memoryStream = new MemoryStream())
|
||||
@@ -207,11 +206,12 @@ namespace IRaCIS.Core.Application.Helper
|
||||
/// <param name="oosFolderPath"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
public async Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath)
|
||||
public async Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true)
|
||||
{
|
||||
var localFileName = Path.GetFileName(localFilePath);
|
||||
|
||||
var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}";
|
||||
var ossRelativePath = isFileNameAddGuid ? $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}" : $"{oosFolderPath}/{localFileName}";
|
||||
|
||||
|
||||
//var ossRelativePath = oosFolderPath + "/" + localFileName;
|
||||
|
||||
@@ -266,6 +266,7 @@ namespace IRaCIS.Core.Application.Helper
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath)
|
||||
{
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public static class SendEmailHelper
|
||||
|
||||
//await smtp.AuthenticateAsync("zhou941003@qq.com", "sqfhlpfdvnexbcab");
|
||||
|
||||
await smtp.ConnectAsync(_systemEmailConfig.Host, _systemEmailConfig.Port, SecureSocketOptions.SslOnConnect);
|
||||
await smtp.ConnectAsync(_systemEmailConfig.Host, _systemEmailConfig.Port, SecureSocketOptions.Auto);
|
||||
|
||||
await smtp.AuthenticateAsync(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
|
||||
|
||||
@@ -40,11 +40,11 @@ public static class SendEmailHelper
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception )
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
//---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员
|
||||
throw new Exception(StaticData.International("SendEmail_SendFail"));
|
||||
throw new Exception(StaticData.International("SendEmail_SendFail"),new Exception(ex.Message));
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public static class SendEmailHelper
|
||||
using (var client = new MailKit.Net.Smtp.SmtpClient())
|
||||
{
|
||||
|
||||
await client.ConnectAsync(_systemEmailConfig.Host, _systemEmailConfig.Port, SecureSocketOptions.SslOnConnect);
|
||||
await client.ConnectAsync(_systemEmailConfig.Host, _systemEmailConfig.Port, SecureSocketOptions.Auto);
|
||||
|
||||
await client.AuthenticateAsync(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
|
||||
|
||||
@@ -133,7 +133,7 @@ public static class SendEmailHelper
|
||||
|
||||
smtp.ServerCertificateValidationCallback = (s, c, h, e) => true;
|
||||
|
||||
await smtp.ConnectAsync(sMTPEmailConfig.Host, sMTPEmailConfig.Port, SecureSocketOptions.SslOnConnect);
|
||||
await smtp.ConnectAsync(sMTPEmailConfig.Host, sMTPEmailConfig.Port, SecureSocketOptions.Auto);
|
||||
|
||||
await smtp.AuthenticateAsync(sMTPEmailConfig.UserName, sMTPEmailConfig.AuthorizationCode);
|
||||
|
||||
|
||||
@@ -65,44 +65,43 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
||||
<PackageReference Include="FreeSpire.Doc" Version="12.2.0" />
|
||||
<PackageReference Include="Hangfire.Core" Version="1.8.11" />
|
||||
<PackageReference Include="Hangfire.Core" Version="1.8.12" />
|
||||
<PackageReference Include="BeetleX.BNR" Version="1.0.1" />
|
||||
<PackageReference Include="Castle.Core.AsyncInterceptor" Version="2.1.0" />
|
||||
<PackageReference Include="EasyCaching.Redis" Version="1.9.2" />
|
||||
<PackageReference Include="EasyCaching.InMemory" Version="1.9.2" />
|
||||
<PackageReference Include="ExcelDataReader" Version="3.6.0" />
|
||||
<PackageReference Include="ExcelDataReader.DataSet" Version="3.6.0" />
|
||||
<PackageReference Include="DistributedLock.Redis" Version="1.0.2" />
|
||||
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.3" />
|
||||
<PackageReference Include="DistributedLock.Redis" Version="1.0.3" />
|
||||
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.4" />
|
||||
<PackageReference Include="fo-dicom" Version="5.1.2" />
|
||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.2" />
|
||||
<PackageReference Include="fo-dicom.Codecs" Version="5.12.0" />
|
||||
<PackageReference Include="Magicodes.IE.Core" Version="2.7.5.1" />
|
||||
<PackageReference Include="Magicodes.IE.Csv" Version="2.7.5.1">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.5.1">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Magicodes.IE.Excel.AspNetCore" Version="2.7.5.1" />
|
||||
<PackageReference Include="MailKit" Version="4.4.0" />
|
||||
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
||||
<PackageReference Include="MailKit" Version="4.2.0" />
|
||||
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||
<PackageReference Include="MimeKit" Version="4.4.0" />
|
||||
<PackageReference Include="MiniExcel" Version="1.31.3" />
|
||||
<PackageReference Include="MimeKit" Version="4.2.0" />
|
||||
<PackageReference Include="MiniExcel" Version="1.32.0" />
|
||||
<PackageReference Include="Minio" Version="6.0.2" />
|
||||
<PackageReference Include="MiniWord" Version="0.8.0" />
|
||||
<PackageReference Include="My.Extensions.Localization.Json" Version="3.2.0">
|
||||
<PackageReference Include="My.Extensions.Localization.Json" Version="3.3.0">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NPOI" Version="2.6.2" />
|
||||
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.1" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.1" />
|
||||
<PackageReference Include="WinSCP" Version="6.3.2" />
|
||||
<PackageReference Include="NPOI" Version="2.7.0" />
|
||||
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.2" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
|
||||
<PackageReference Include="WinSCP" Version="6.3.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\IRaCIS.Core.Infra.EFCore\IRaCIS.Core.Infra.EFCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Resources\ip2region.xdb">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -84,16 +84,17 @@
|
||||
<param name="type"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.IO.Stream,System.String,System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.IO.Stream,System.String,System.String,System.Boolean)">
|
||||
<summary>
|
||||
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||
</summary>
|
||||
<param name="fileStream"></param>
|
||||
<param name="oosFolderPath"></param>
|
||||
<param name="fileRealName"></param>
|
||||
<param name="isFileNameAddGuid"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.String,System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.String,System.String,System.Boolean)">
|
||||
<summary>
|
||||
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||
</summary>
|
||||
@@ -423,11 +424,11 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetOrderReadingIQueryable(IRaCIS.Core.Application.ViewModel.GetOrderReadingIQueryableInDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetSubjectReadingIQueryable(IRaCIS.Core.Application.ViewModel.GetReadingIQueryableInDto)">
|
||||
<summary>
|
||||
获取有序阅片IQuery对象
|
||||
获取subject有序 或者无序阅片IQuery对象
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetIRHaveReadTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
|
||||
@@ -852,11 +853,40 @@
|
||||
后台托管服务的方式运行
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.StudyService.AddOrUpdateArchiveStudy(IRaCIS.Core.Application.Contracts.NewArchiveStudyCommand)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.SubejctRandomReadingTaskNameDeal(System.Guid,System.Guid)">
|
||||
<summary>
|
||||
上传临床数据
|
||||
受试者随机阅片,任务进行随机编号
|
||||
进入阅片任务前,随机挑选出该受试者的一个任务,然后给该任务一个编号,编号给的逻辑是:TimePoint Ran+ 已阅任务数量+1
|
||||
根据当前受试者该标准已阅任务数量(生效失效的任务都算,考虑重阅,最后编号不重复) 第一个就是TimePoint Ran1,后面依次随机挑选出来的阅片序号依次递增
|
||||
</summary>
|
||||
<param name="incommand"></param>
|
||||
<param name="subjectId"></param>
|
||||
<param name="trialReadingCriterionId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetSubjectImageUploadList(System.Guid,System.Guid)">
|
||||
<summary>
|
||||
获取该受试者任务上传列表(展示已上传情况)
|
||||
</summary>
|
||||
<param name="subjectId"></param>
|
||||
<param name="trialReadingCriterionId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.RequestPackageAndAnonymizImage(System.Guid,System.Guid,System.Boolean)">
|
||||
<summary>
|
||||
打包和匿名化影像 默认是匿名化打包,也可以不匿名化打包
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="subjectVisitId"></param>
|
||||
<param name="isAnonymize"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.PackageAndAnonymizImage(System.Guid,System.Guid,System.Boolean)">
|
||||
<summary>
|
||||
后台任务调用,前端忽略该接口
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="subjectVisitId"></param>
|
||||
<param name="isAnonymize"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.StudyService.Preview(System.Guid)">
|
||||
@@ -1017,7 +1047,7 @@
|
||||
项目iD
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.SiteId">
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.TrialSiteId">
|
||||
<summary>
|
||||
中心
|
||||
</summary>
|
||||
@@ -1151,7 +1181,7 @@
|
||||
<param name="currentInspectionId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetDataInspectionDateType(System.Collections.Generic.List{System.String},System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetDataInspectionDateType(System.Collections.Generic.List{System.String},System.String,System.String)">
|
||||
<summary>
|
||||
格式化日期和时间
|
||||
</summary>
|
||||
@@ -1159,7 +1189,7 @@
|
||||
<param name="jsonStr"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetInspectionEnumValue(System.Collections.Generic.List{System.String},System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetInspectionEnumValue(System.Collections.Generic.List{System.String},System.String,System.String)">
|
||||
<summary>
|
||||
获取外键表数据
|
||||
</summary>
|
||||
@@ -1167,7 +1197,7 @@
|
||||
<param name="jsonStr"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetEnum(System.Guid,System.Collections.Generic.List{System.String},System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetEnum(System.Guid,System.Collections.Generic.List{System.String},System.String,System.String)">
|
||||
<summary>
|
||||
获取枚举
|
||||
</summary>
|
||||
@@ -5612,6 +5642,16 @@
|
||||
是否是转变的任务(转为IRECIST)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GlobalQuestionInfo.JudgeDifferenceValue">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GlobalQuestionInfo.JudgeDifferenceType">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值匹配规则
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GlobalQuestionInfo.QuestionType">
|
||||
<summary>
|
||||
问题类型
|
||||
@@ -5717,6 +5757,31 @@
|
||||
标准
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.SetTrialCriterionJudgeQuestionAnswerGroupInDto.JudgeDifferenceValue">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.SetTrialCriterionJudgeQuestionAnswerGroupInDto.JudgeDifferenceType">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值匹配规则
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialCriterionJudgeQuestionListOutDto.JudgeDifferenceValue">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialCriterionJudgeQuestionListOutDto.Type">
|
||||
<summary>
|
||||
类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialCriterionJudgeQuestionListOutDto.JudgeDifferenceType">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值匹配规则
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialCriterionJudgeQuestionListOutDto.QuestionGenre">
|
||||
<summary>
|
||||
问题类型
|
||||
@@ -5827,6 +5892,26 @@
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GroupTaskAnswerDto.JudgeDifferenceValue">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GroupTaskAnswerDto.JudgeDifferenceType">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值匹配规则
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TaskAnswerDto.JudgeDifferenceValue">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TaskAnswerDto.JudgeDifferenceType">
|
||||
<summary>
|
||||
裁判百分比或绝对值的相差值匹配规则
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionDataInfo.Id">
|
||||
<summary>
|
||||
|
||||
@@ -6997,6 +7082,11 @@
|
||||
自定义计算标记
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionTrialAddOrEdit.TrialId">
|
||||
<summary>
|
||||
TrialId
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionTrialAddOrEdit.IsDepend">
|
||||
<summary>
|
||||
IsDepend
|
||||
@@ -10841,22 +10931,6 @@
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.LesionInformation.TUTESTCD">
|
||||
<summary>
|
||||
检查项目
|
||||
TUMIDENT (Tumor Identification )
|
||||
TUSPLIT (Tumor Split )
|
||||
TUMERGE (Tumor Merged)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.IReportService.AddLesion(System.Collections.Generic.List{IRaCIS.Core.Application.Contracts.LesionInformation},IRaCIS.Core.Application.Contracts.ReportDTO)">
|
||||
<summary> 添加基线期病灶标识及测量信息 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.IReportService.GetVisitLineLesion(System.String,System.String,System.Decimal,System.String)">
|
||||
<summary>
|
||||
获取访视病灶信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteEquipmentSurveyView">
|
||||
<summary> TrialSiteEquipmentSurveyView 列表视图模型 </summary>
|
||||
</member>
|
||||
@@ -12541,6 +12615,12 @@
|
||||
<param name="addOrEditBasic"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.DictionaryService.GetAllDictionaryKey">
|
||||
<summary>
|
||||
获取所有字典的Key
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.DictionaryService.AddBasicDicAndChild(IRaCIS.Application.Contracts.AddBasicDicAndChild)">
|
||||
<summary>
|
||||
添加字典 的同时 一起添加子项 --New
|
||||
@@ -13026,7 +13106,7 @@
|
||||
<member name="M:IRaCIS.Application.Services.CroService.GetCroList(IRaCIS.Application.Contracts.CROCompanyQueryDTO)">
|
||||
<summary> 分页获取CRO列表 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.CroService.GetAllCROList">
|
||||
<member name="M:IRaCIS.Application.Services.CroService.GetAllCROList(System.Nullable{System.Guid})">
|
||||
<summary> 根据CRO 名称查询所有CRO 列表 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.CroService.AddOrUpdateCro(IRaCIS.Application.Contracts.CROCompanyDTO)">
|
||||
@@ -13059,7 +13139,7 @@
|
||||
<member name="M:IRaCIS.Application.Services.SponsorService.GetSponsorList(IRaCIS.Application.Contracts.SponsorQueryDTO)">
|
||||
<summary> 分页获取申办方列表 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.SponsorService.GetAllSponsorList">
|
||||
<member name="M:IRaCIS.Application.Services.SponsorService.GetAllSponsorList(System.Nullable{System.Guid})">
|
||||
<summary> 分页获取申办方列表 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.SponsorService.AddOrUpdateSponsor(IRaCIS.Application.Contracts.SponsorCommand)">
|
||||
@@ -13185,6 +13265,23 @@
|
||||
<param name="state"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.UserService.SendMFAEmail(System.Guid,System.Int32)">
|
||||
<summary>
|
||||
发送MFA 验证邮件
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="mfaType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.UserService.VerifyMFACodeAsync(System.Guid,System.String)">
|
||||
<summary>
|
||||
验证MFA 邮件
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="Code"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.UserService.Login(System.String,System.String)">
|
||||
<summary>
|
||||
用户登陆
|
||||
@@ -13874,6 +13971,13 @@
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.ResetReadingTask(IRaCIS.Core.Application.Service.Reading.Dto.ResetReadingTaskInDto)">
|
||||
<summary>
|
||||
重置阅片任务
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.VerifyReadingRestTime">
|
||||
<summary>
|
||||
验证阅片休息时间
|
||||
@@ -14527,6 +14631,16 @@
|
||||
标准类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.UserBasicInfo.LastLoginIP">
|
||||
<summary>
|
||||
LastLoginIP
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.UserBasicInfo.LastChangePassWordTime">
|
||||
<summary>
|
||||
上一次修改密码的时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Application.Contracts.UserAddedReturnDTO">
|
||||
<summary>
|
||||
添加用户是的返回模型
|
||||
|
||||
Binary file not shown.
@@ -1,37 +0,0 @@
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ViewModel
|
||||
{
|
||||
public class AllocationVisitViewModel
|
||||
{
|
||||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public string BlindName { get; set; } = string.Empty;
|
||||
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
public DateTime? CheckPassedTime { get; set; }
|
||||
|
||||
public bool IsUrgent { get; set; }
|
||||
|
||||
|
||||
public ReadingCategory ReadingCategoryEnum { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public class ConsistentCommonView
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public String TrialSiteCode { get; set; }
|
||||
public string SubjectCode { get; set; }
|
||||
@@ -200,31 +200,12 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
}
|
||||
|
||||
|
||||
//public class DoctorConsistentRuleSubjectView
|
||||
//{
|
||||
// public Guid TrialId => VisitTaskList.Select(t => t.TrialId).First();
|
||||
// public Guid SiteId => VisitTaskList.Select(t => t.SiteId).First();
|
||||
|
||||
// public String TrialSiteCode => VisitTaskList.Select(t => t.TrialSiteCode).First();
|
||||
// public string SubjectCode => VisitTaskList.Select(t => t.SubjectCode).First();
|
||||
|
||||
// public Guid SubjectId { get; set; }
|
||||
|
||||
// public bool IsHaveGeneratedTask { get; set; }
|
||||
// public int? ValidTaskCount { get; set; }
|
||||
|
||||
// public int? ValidVisitCount => VisitTaskList.Select(t => t.TaskName).Distinct().Count();
|
||||
|
||||
// public List<VisitTaskSimpleView> VisitTaskList { get; set; }
|
||||
|
||||
// //public List<UserSimpleInfo> HistoryDoctorUserList => VisitTaskList.SelectMany(t => t.RelationDoctorUserList).DistinctBy(t=>t.UserId).ToList();
|
||||
//}
|
||||
|
||||
public class InfluenceTaskInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
@@ -267,7 +248,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
|
||||
public Guid VisitTaskId { get; set; }
|
||||
public string MedicalNo { get; set; } = string.Empty;
|
||||
|
||||
public int AuditState { get; set; }
|
||||
public DateTime? AuditSignTime { get; set; }
|
||||
@@ -54,7 +53,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
//开始读片时间
|
||||
public DateTime? FirstReadingTime { get; set; }
|
||||
|
||||
public string MedicalNo { get; set; } = string.Empty;
|
||||
|
||||
//读片时间差
|
||||
public TimeSpan? ReadingDurationTimeSpan { get; set; }
|
||||
@@ -95,7 +93,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public class TaskMedicalReviewQuery : PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 传了Id
|
||||
@@ -136,7 +134,19 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid? TrialReadingCriterionId { get; set; }
|
||||
|
||||
public MedicalReviewDoctorUserIdea? DoctorUserIdeaEnum { get; set; }
|
||||
}
|
||||
|
||||
public Arm? ArmEnum { get; set; }
|
||||
|
||||
public DateTime? BeginAuditSignTime { get; set; }
|
||||
public DateTime? EndAuditSignTime { get; set; }
|
||||
|
||||
public bool? IsEffect { get; set; }
|
||||
public bool? IsHaveQuestion { get; set; }
|
||||
|
||||
|
||||
public DateTime? BeginAllocateDate { get; set; }
|
||||
public DateTime? EndAllocateDate { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class SetMedicalReviewInvalidCommand
|
||||
|
||||
@@ -54,10 +54,16 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid UpdateUserId { get; set; }
|
||||
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public string BlindTrialSiteCode { get; set; }
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
public string MedicalNo { get; set; } = string.Empty;
|
||||
|
||||
public string BlindSubjectCode { get; set; } = string.Empty;
|
||||
|
||||
public bool IsPMSetBack { get; set; }
|
||||
|
||||
#region 标准配置
|
||||
@@ -86,7 +92,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
/// <summary>
|
||||
/// 任务展示访视 读片任务显示是否顺序
|
||||
/// </summary>
|
||||
public bool IsReadingTaskViewInOrder { get; set; } = true;
|
||||
public ReadingOrder IsReadingTaskViewInOrder { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -150,7 +156,18 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public bool IsCanEditUrgentState { get; set; }
|
||||
|
||||
public DateTime? FirstReadingTime { get;set; }
|
||||
|
||||
public string ReadingDuration
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!SignTime.HasValue)
|
||||
return "";
|
||||
else return string.Format("{0}h:{1}m:{2}s", (SignTime - FirstReadingTime)?.Hours, (SignTime - FirstReadingTime)?.Minutes, (SignTime - FirstReadingTime)?.Seconds)
|
||||
/*string.Format("{0}分钟", (ReadingDurationTimeSpan)?.TotalMinutes)*/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class UserSimpleInfo
|
||||
@@ -353,16 +370,16 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
}
|
||||
|
||||
|
||||
public class GetOrderReadingIQueryableInDto
|
||||
public class GetReadingIQueryableInDto:PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
public string? SubjectCode { get; set; } = null;
|
||||
|
||||
public PageInput? Page { get; set; } = null;
|
||||
|
||||
}
|
||||
|
||||
public class VisitTaskQuery : PageInput
|
||||
@@ -371,7 +388,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
@@ -393,11 +410,16 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public DateTime? EndAllocateDate { get; set; }
|
||||
|
||||
public DateTime? BeginSignTime { get; set; }
|
||||
|
||||
|
||||
public DateTime? BeginSignTime { get; set; }
|
||||
|
||||
public DateTime? EndSignTime { get; set; }
|
||||
|
||||
public Guid? RootReReadingTaskId { get; set; }
|
||||
public DateTime? BeginRequestReReadingTime { get; set; }
|
||||
public DateTime? EndRequestReReadingTime { get; set; }
|
||||
|
||||
public Guid? RootReReadingTaskId { get; set; }
|
||||
|
||||
public string? TaskCode { get; set; }
|
||||
|
||||
@@ -418,6 +440,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public RequestReReadingResult? RequestReReadingResultEnum { get; set; }
|
||||
|
||||
|
||||
public bool? IsEffect { get; set; }
|
||||
|
||||
public string? RequestReReadingReason { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +499,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
@@ -495,7 +521,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
@@ -538,7 +564,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public class SubjectAssignStat
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
@@ -618,7 +644,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public class SubjectAssignView
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
Task<IResponseOutput> ConfirmReReading(ConfirmReReadingCommand agreeReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService);
|
||||
|
||||
Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto);
|
||||
Task<PageOutput<IRUnReadSubjectView>> GetSubjectReadingIQueryable(GetReadingIQueryableInDto inDto);
|
||||
}
|
||||
}
|
||||
@@ -116,9 +116,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
// return ResponseOutput.Ok();
|
||||
//}
|
||||
|
||||
public async Task<List<SubjectCancelDoctorView>> GetSubjectCancelDoctorHistoryList(Guid subjectId)
|
||||
public async Task<List<SubjectCancelDoctorView>> GetSubjectCancelDoctorHistoryList(Guid subjectId,Guid trialReadingCriterionId)
|
||||
{
|
||||
var list = await _subjectCanceDoctorRepository.Where(t => t.SubjectId == subjectId).ProjectTo<SubjectCancelDoctorView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var list = await _subjectCanceDoctorRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId==trialReadingCriterionId).ProjectTo<SubjectCancelDoctorView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -87,14 +87,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="queryVisitTask"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<AnalysisTaskView>>> GetAnalysisTaskList(VisitTaskQuery queryVisitTask)
|
||||
public async Task<IResponseOutput<PageOutput<AnalysisTaskView>>> GetAnalysisTaskList(VisitTaskQuery queryVisitTask )
|
||||
{
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId)
|
||||
.Where(t => t.IsAnalysisCreate)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
@@ -104,18 +104,20 @@ namespace IRaCIS.Core.Application.Service
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
.WhereIf(queryVisitTask.ArmEnum != null, t => t.ArmEnum == queryVisitTask.ArmEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => /*(t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) ||*/ (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) /*&& t.IsAnalysisCreate == false*/))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => ((t.Subject.Code.Contains(queryVisitTask.SubjectCode)||t.Subject.MedicalNo.Contains(queryVisitTask.SubjectCode)) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime >= queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime <= queryVisitTask.EndAllocateDate)
|
||||
.WhereIf(queryVisitTask.BeginSignTime != null, t => t.SignTime >= queryVisitTask.BeginSignTime)
|
||||
.WhereIf(queryVisitTask.EndSignTime != null, t => t.SignTime <= queryVisitTask.EndSignTime)
|
||||
.ProjectTo<AnalysisTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||
|
||||
var trialTaskConfig = _repository.Where<Trial>(t => t.Id == queryVisitTask.TrialId).Select(t => new { IsHaveDoubleReadCriterion=t.ReadingQuestionCriterionTrialList.Any(t=>t.IsSigned && t.IsConfirm && t.ReadingType==ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault();
|
||||
var trialTaskConfig = _repository.Where<Trial>(t => t.Id == queryVisitTask.TrialId).Select(t => new { IsHaveDoubleReadCriterion=t.TrialReadingCriterionList.Any(t=>t.IsSigned && t.IsConfirm && t.ReadingType==ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault();
|
||||
|
||||
return ResponseOutput.Ok(pageList, trialTaskConfig);
|
||||
}
|
||||
@@ -558,7 +560,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var query = subjectQuery.Select(t => new DoctorSelfConsistentSubjectView()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.TrialSiteId,
|
||||
SubjectCode = t.Code,
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
SubjectId = t.Id,
|
||||
@@ -685,7 +687,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var query = subjectQuery.Select(t => new DoctorGroupConsistentSubjectView()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.TrialSiteId,
|
||||
SubjectCode = t.Code,
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
SubjectId = t.Id,
|
||||
|
||||
@@ -55,28 +55,39 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
||||
var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.SiteId != null, t => t.VisitTask.Subject.SiteId == inQuery.SiteId)
|
||||
|
||||
.WhereIf(inQuery.IsEffect == true, t => t.VisitTask.TaskState == TaskState.Effect || t.VisitTask.TaskState == TaskState.Freeze)
|
||||
.WhereIf(inQuery.IsEffect == false, t => t.VisitTask.TaskState == TaskState.Adbandon || t.VisitTask.TaskState == TaskState.HaveReturned)
|
||||
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode) || t.VisitTask.Subject.MedicalNo.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.VisitTask.TaskName.Contains(inQuery.TaskName) || t.VisitTask.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.VisitTask.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.VisitTask.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.VisitTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode) && t.VisitTask.IsAnalysisCreate) || (t.VisitTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode) && t.VisitTask.IsAnalysisCreate == false))
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.VisitTask.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.TaskState != null, t => t.VisitTask.TaskState == inQuery.TaskState)
|
||||
.WhereIf(inQuery.ArmEnum != null, t => t.VisitTask.ArmEnum == inQuery.ArmEnum)
|
||||
.WhereIf(inQuery.AuditState != null, t => t.AuditState == inQuery.AuditState)
|
||||
.WhereIf(inQuery.MedicalManagerUserId != null, t => t.MedicalManagerUserId == inQuery.MedicalManagerUserId)
|
||||
.WhereIf(inQuery.BeginSignTime != null, t => t.VisitTask.SignTime > inQuery.BeginSignTime)
|
||||
.WhereIf(inQuery.EndSignTime != null, t => t.VisitTask.SignTime < inQuery.EndSignTime!.Value.AddDays(1))
|
||||
.WhereIf(inQuery.AuditAdviceEnum != null, t => t.AuditAdviceEnum == inQuery.AuditAdviceEnum)
|
||||
.WhereIf(inQuery.MedicalManagerUserId != null, t => t.MedicalManagerUserId == inQuery.MedicalManagerUserId)
|
||||
.WhereIf(inQuery.BeginSignTime != null, t => t.VisitTask.SignTime > inQuery.BeginSignTime)
|
||||
.WhereIf(inQuery.EndSignTime != null, t => t.VisitTask.SignTime < inQuery.EndSignTime)
|
||||
.WhereIf(inQuery.AuditAdviceEnum != null, t => t.AuditAdviceEnum == inQuery.AuditAdviceEnum)
|
||||
|
||||
.WhereIf(inQuery.DoctorUserIdeaEnum != null, t => t.DoctorUserIdeaEnum == inQuery.DoctorUserIdeaEnum)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.OrderBy(x => x.AuditState).ThenBy(x => x.VisitTask.SubjectId).ThenBy(x => x.VisitTask.ArmEnum).ThenBy(x => x.VisitTask.VisitTaskNum)
|
||||
.WhereIf(inQuery.DoctorUserIdeaEnum != null, t => t.DoctorUserIdeaEnum == inQuery.DoctorUserIdeaEnum)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.WhereIf(inQuery.IsInvalid != null, t => t.IsInvalid == inQuery.IsInvalid)
|
||||
.WhereIf(inQuery.IsHaveQuestion != null, t => t.IsHaveQuestion == inQuery.IsHaveQuestion)
|
||||
|
||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime >= inQuery.BeginAllocateDate)
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime <= inQuery.EndAllocateDate)
|
||||
.WhereIf(inQuery.BeginAuditSignTime != null, t => t.AuditSignTime >= inQuery.BeginAuditSignTime)
|
||||
.WhereIf(inQuery.EndAuditSignTime != null, t => t.AuditSignTime <= inQuery.EndAuditSignTime)
|
||||
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, new string[] { });
|
||||
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum) , nameof(TaskMedicalReviewView.VisitTaskNum) };
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
@@ -93,22 +104,25 @@ namespace IRaCIS.Core.Application.Service
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.Where(t => t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect||t.TaskState==TaskState.Freeze) && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
|
||||
.WhereIf(inQuery.SiteId != null, t => t.Subject.SiteId == inQuery.SiteId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.IsGeneratedJudge != null, t => t.JudgeVisitTaskId != null)
|
||||
.WhereIf(inQuery.IsGlobalHaveUpdate != null, t => t.IsGlobalHaveUpdate == inQuery.IsGlobalHaveUpdate)
|
||||
.WhereIf(inQuery.IsGlobalHaveUpdate != null, t => t.IsGlobalHaveUpdate == inQuery.IsGlobalHaveUpdate)
|
||||
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
|
||||
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
||||
|
||||
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
||||
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
||||
.ProjectTo<GenerateMedicalReviewTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.IsUrgent) + " desc", nameof(TaskMedicalReviewView.SubjectId) };
|
||||
var defalutSortArray = new string[] { nameof(GenerateMedicalReviewTaskView.IsUrgent) + " desc", nameof(GenerateMedicalReviewTaskView.SubjectId) };
|
||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||
|
||||
|
||||
@@ -218,23 +232,35 @@ namespace IRaCIS.Core.Application.Service
|
||||
||x.Id == inQuery.Id // 这里必须找传入id 因为要找到这条的索引 获取下一条
|
||||
)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.SiteId != null, t => t.VisitTask.Subject.SiteId == inQuery.SiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.VisitTask.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.AuditState != null, t => t.AuditState == inQuery.AuditState)
|
||||
.WhereIf(inQuery.DoctorUserIdeaEnum != null, t => t.DoctorUserIdeaEnum == inQuery.DoctorUserIdeaEnum)
|
||||
.WhereIf(inQuery.TaskState != null, t => t.VisitTask.TaskState == inQuery.TaskState)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode) || t.VisitTask.Subject.MedicalNo.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.VisitTask.TaskName.Contains(inQuery.TaskName) || t.VisitTask.TaskBlindName.Contains(inQuery.TaskName))
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.VisitTask.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.VisitTask.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.VisitTask.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.IsInvalid != null, t => t.IsInvalid == inQuery.IsInvalid)
|
||||
.WhereIf(inQuery.IsGetBeRead,x=>!x.IsInvalid&&x.AuditState!= MedicalReviewAuditState.HaveSigned)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.OrderBy(x=>x.VisitTask.SubjectId).ThenBy(x=>x.VisitTask.ArmEnum).ThenBy(x=>x.VisitTask.VisitTaskNum)
|
||||
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
|
||||
|
||||
.WhereIf(inQuery.BeginAuditSignTime != null, t => t.AuditSignTime >= inQuery.BeginAuditSignTime)
|
||||
.WhereIf(inQuery.EndAuditSignTime != null, t => t.AuditSignTime <= inQuery.EndAuditSignTime)
|
||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime >= inQuery.BeginAllocateDate)
|
||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime <= inQuery.EndAllocateDate)
|
||||
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { } );
|
||||
.WhereIf(inQuery.ArmEnum != null, t => t.VisitTask.ArmEnum == inQuery.ArmEnum)
|
||||
.WhereIf(inQuery.MedicalManagerUserId != null, t => t.MedicalManagerUserId == inQuery.MedicalManagerUserId)
|
||||
.WhereIf(inQuery.BeginSignTime != null, t => t.VisitTask.SignTime > inQuery.BeginSignTime)
|
||||
.WhereIf(inQuery.EndSignTime != null, t => t.VisitTask.SignTime < inQuery.EndSignTime)
|
||||
.WhereIf(inQuery.AuditAdviceEnum != null, t => t.AuditAdviceEnum == inQuery.AuditAdviceEnum)
|
||||
.WhereIf(inQuery.IsHaveQuestion != null, t => t.IsHaveQuestion == inQuery.IsHaveQuestion)
|
||||
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||
|
||||
return ResponseOutput.Ok(pageList, new
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
||||
private readonly IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository;
|
||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||
private readonly IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository;
|
||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IUserInfo _userInfo;
|
||||
@@ -61,8 +61,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||
IRepository<ReadingOncologyTaskInfo> ReadingOncologyTaskInfoRepository,
|
||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingOncologyTaskInfo> ReadingOncologyTaskInfoRepository,
|
||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||
IRepository<ReadingJudgeInfo> readingJudgeInfoRepository,
|
||||
IRepository<TaskAllocationRule> taskAllocationRuleRepository, IMapper mapper, IUserInfo userInfo, IRepository<VisitTaskReReading> visitTaskReReadingRepository,
|
||||
@@ -78,8 +78,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||
this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
|
||||
_readingOncologyTaskInfoRepository = ReadingOncologyTaskInfoRepository;
|
||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||
_readingOncologyTaskInfoRepository = ReadingOncologyTaskInfoRepository;
|
||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||
_provider = provider;
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
@@ -155,6 +155,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//基于标准签名 产生任务 (或者手动选择某些访视生成该标准的任务)
|
||||
public async Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId, bool? isManualSelectVisit = null, List<Guid>? subjectVisitIdList = null)
|
||||
{
|
||||
@@ -197,26 +199,29 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
foreach (var subjectVisit in subjectGroup.SubjectVisitList)
|
||||
{
|
||||
var blindTaskName = string.Empty;
|
||||
|
||||
var isNeedClinicalDataSign = IsNeedClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList);
|
||||
var isClinicalDataSign = IsClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList, subjectVisit.Id, trialId);
|
||||
|
||||
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0)
|
||||
var blindTaskName = string.Empty;
|
||||
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
blindTaskName = visitBlindConfig.BlindBaseLineName;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder)
|
||||
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0 && subjectVisit.VisitNum==0)
|
||||
{
|
||||
blindTaskName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(subjectVisit.VisitNum);
|
||||
blindTaskName = visitBlindConfig.BlindBaseLineName;
|
||||
}
|
||||
else
|
||||
{
|
||||
blindTaskName = visitBlindConfig.BlindFollowUpPrefix;
|
||||
blindTaskName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(subjectVisit.VisitNum);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
blindTaskName ="Timepoint";
|
||||
}
|
||||
|
||||
|
||||
//每个访视 根据项目配置生成任务 双审生成两个
|
||||
|
||||
@@ -392,13 +397,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
}
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -463,11 +469,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
.Where(t => t.TrialId == trialId && t.IsSign && t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned && t.ReadingId == readingId && t.ClinicalDataTrialSet.UploadRole == UploadRole.PM).Count();
|
||||
|
||||
|
||||
var readModule = _readModuleRepository.Where(t => t.Id == readingId).FirstOrDefault();
|
||||
var readModule = _readModuleRepository.Where(t => t.Id == readingId).FirstOrDefault();
|
||||
//CRC 阅片期自定义结构化录入是否签名
|
||||
bool crcReadModuleSign = true;
|
||||
|
||||
|
||||
|
||||
|
||||
//访视
|
||||
if (readingCategory == ReadingCategory.Visit)
|
||||
@@ -508,7 +514,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
// 肿瘤学
|
||||
else if (readingCategory == ReadingCategory.Oncology)
|
||||
{
|
||||
needSignCount= trialClinicalDataSetList.Where(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCriterionId) && t.ClinicalDataLevel == ClinicalLevel.OncologyRead && t.UploadRole == UploadRole.PM).Count();
|
||||
needSignCount = trialClinicalDataSetList.Where(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCriterionId) && t.ClinicalDataLevel == ClinicalLevel.OncologyRead && t.UploadRole == UploadRole.PM).Count();
|
||||
if (readModule != null)
|
||||
{
|
||||
// 不存在需要CRC上传的临床数据 或者 PM已确认
|
||||
@@ -526,7 +532,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
|
||||
//可能仅仅CRC 基线 没有PM
|
||||
if (needSignCount == haveSignedCount && crcReadModuleSign )
|
||||
if (needSignCount == haveSignedCount && crcReadModuleSign)
|
||||
{
|
||||
isClinicalDataSign = true;
|
||||
|
||||
@@ -660,29 +666,29 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.OrignalSubjectUserId == null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
||||
|
||||
|
||||
var blindTaskName = string.Empty;
|
||||
|
||||
var isNeedClinicalDataSign = IsNeedClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList);
|
||||
var isClinicalDataSign = IsClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList, subjectVisit.Id, trialId);
|
||||
|
||||
var isFrontTaskNeedSignButNotSign = await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.VisitTaskNum < subjectVisit.VisitNum && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false);
|
||||
|
||||
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0)
|
||||
var blindTaskName = string.Empty;
|
||||
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
blindTaskName = visitBlindConfig.BlindBaseLineName;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder)
|
||||
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0 && subjectVisit.VisitNum == 0)
|
||||
{
|
||||
blindTaskName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(subjectVisit.VisitNum);
|
||||
blindTaskName = visitBlindConfig.BlindBaseLineName;
|
||||
}
|
||||
else
|
||||
{
|
||||
blindTaskName = visitBlindConfig.BlindFollowUpPrefix;
|
||||
blindTaskName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(subjectVisit.VisitNum);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
blindTaskName = "Timepoint";
|
||||
}
|
||||
|
||||
|
||||
//每个访视 根据项目配置生成任务 双审生成两个
|
||||
@@ -784,7 +790,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
#region 后续访视 未分配的进行再次分配,重置的或者失效的 需要重新生成新的任务 (PM 有序退回 或者PM 有序 申请重阅)
|
||||
|
||||
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder)
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
||||
|
||||
@@ -1075,7 +1081,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = isNeedClinicalDataSign,
|
||||
IsClinicalDataSign = isClinicalDataSign,
|
||||
IsFrontTaskNeedSignButNotSign= isFrontTaskNeedSignButNotSign
|
||||
IsFrontTaskNeedSignButNotSign = isFrontTaskNeedSignButNotSign
|
||||
});
|
||||
|
||||
|
||||
@@ -1114,7 +1120,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
#region 重阅/退回的时候,需要将取消分配的访视类型的 任务重新分配
|
||||
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder)
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
||||
var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
@@ -1609,12 +1615,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
var oncologySubjectUser = await _subjectUserRepository.Where(x => x.SubjectId == item.SubjectId && x.ArmEnum == Arm.TumorArm && x.IsConfirmed && x.TrialReadingCriterionId == originalTaskInfo.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||
|
||||
item.VisitNum = await _readModuleRepository.Where(x => x.Id == item.ReadModuleId).Select(x => x.SubjectVisit.VisitNum).FirstOrDefaultAsync();
|
||||
var id= NewId.NextGuid();
|
||||
var id = NewId.NextGuid();
|
||||
|
||||
var singleTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
var singleTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
{
|
||||
Id= id,
|
||||
TrialId = trialId,
|
||||
Id = id,
|
||||
TrialId = trialId,
|
||||
SubjectId = item.SubjectId,
|
||||
IsUrgent = originalTaskInfo.IsUrgent,
|
||||
TaskName = item.ReadingName,
|
||||
@@ -1648,20 +1654,20 @@ namespace IRaCIS.Core.Application.Service
|
||||
// 生成肿瘤学需要 肿瘤学阅片结果中基线,统一显示为NA
|
||||
// 找到基线任务ID
|
||||
var baseLineTaskId = await _visitTaskRepository.Where(x => x.TaskState == TaskState.Effect
|
||||
&& x.ArmEnum == originalTaskInfo.ArmEnum && x.VisitTaskNum == 0
|
||||
&& x.SubjectId== originalTaskInfo.SubjectId
|
||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == originalTaskInfo.TrialReadingCriterionId).Select(x => x.Id).FirstNotNullAsync();
|
||||
&& x.ArmEnum == originalTaskInfo.ArmEnum && x.VisitTaskNum == 0
|
||||
&& x.SubjectId == originalTaskInfo.SubjectId
|
||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == originalTaskInfo.TrialReadingCriterionId).Select(x => x.Id).FirstNotNullAsync();
|
||||
await _readingOncologyTaskInfoRepository.AddAsync(new ReadingOncologyTaskInfo()
|
||||
{
|
||||
EvaluationResult = "-1",
|
||||
EvaluationReason=string.Empty,
|
||||
EvaluationReason = string.Empty,
|
||||
OncologyTaskId = id,
|
||||
VisitTaskId = baseLineTaskId,
|
||||
SubjectId = originalTaskInfo.SubjectId,
|
||||
TrialId = originalTaskInfo.TrialId
|
||||
});
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ using DocumentFormat.OpenXml.Bibliography;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
using MassTransit;
|
||||
using System.Reactive.Subjects;
|
||||
using Subject = IRaCIS.Core.Domain.Models.Subject;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
@@ -105,7 +107,23 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
var list = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.IsConfirm)
|
||||
|
||||
.OrderBy(t => t.ShowOrder)
|
||||
.Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, IsAutoCreate = t.IsAutoCreate, IsAdditionalAssessment = t.IsAdditionalAssessment, TrialReadingCriterionName = t.CriterionName, CriterionType = t.CriterionType, ReadingType = t.ReadingType, ReadingInfoSignTime = t.ReadingInfoSignTime , IsReadingPeriod= t.IsReadingPeriod })
|
||||
.Select(t => new TrialReadingCriterionDto()
|
||||
{
|
||||
TrialReadingCriterionId = t.Id,
|
||||
IsAutoCreate = t.IsAutoCreate,
|
||||
IsAdditionalAssessment = t.IsAdditionalAssessment,
|
||||
TrialReadingCriterionName = t.CriterionName,
|
||||
CriterionType = t.CriterionType,
|
||||
ReadingType = t.ReadingType,
|
||||
ReadingInfoSignTime = t.ReadingInfoSignTime,
|
||||
IsReadingPeriod = t.IsReadingPeriod,
|
||||
IsArbitrationReading = t.IsArbitrationReading,
|
||||
IsGlobalReading = t.IsGlobalReading,
|
||||
IsOncologyReading = t.IsOncologyReading,
|
||||
ImageDownloadEnum = t.ImageDownloadEnum,
|
||||
ImageUploadEnum = t.ImageUploadEnum,
|
||||
IsReadingTaskViewInOrder = t.IsReadingTaskViewInOrder
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
//if (list.Count == 0)
|
||||
@@ -134,17 +152,17 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
var isAddtinoarlCriterion = await _trialReadingCriterionRepository.AnyAsync(t => t.Id == querySubjectAssign.TrialReadingCriterionId && t.IsAutoCreate == false);
|
||||
|
||||
var subjectQuery = _subjectRepository.Where(t => t.TrialId == querySubjectAssign.TrialId && t.SubjectVisitTaskList.Any())
|
||||
.WhereIf(querySubjectAssign.SiteId != null, t => t.SiteId == querySubjectAssign.SiteId)
|
||||
.WhereIf(querySubjectAssign.TrialSiteId != null, t => t.TrialSiteId == querySubjectAssign.TrialSiteId)
|
||||
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
|
||||
.WhereIf(querySubjectAssign.DoctorUserId != null, t => t.SubjectDoctorList.Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
|
||||
.WhereIf(!string.IsNullOrEmpty(querySubjectAssign.SubjectCode), t => t.Code.Contains(querySubjectAssign.SubjectCode))
|
||||
//未分配
|
||||
.WhereIf(querySubjectAssign.SubjectAllocateState == 0, t => !t.SubjectDoctorList.Any(t => t.AssignTime!=null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
|
||||
//已分配
|
||||
.WhereIf(querySubjectAssign.SubjectAllocateState == 0, t => !t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
|
||||
//已分配
|
||||
.WhereIf(querySubjectAssign.SubjectAllocateState == 1, t => t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
|
||||
|
||||
.WhereIf(querySubjectAssign.ArmList.Count >0 , t => !querySubjectAssign.ArmList.Except(t.SubjectDoctorList.Where(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId).Select(c => c.ArmEnum)).Any() )
|
||||
|
||||
.WhereIf(querySubjectAssign.ArmList.Count > 0, t => !querySubjectAssign.ArmList.Except(t.SubjectDoctorList.Where(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId).Select(c => c.ArmEnum)).Any())
|
||||
|
||||
|
||||
.WhereIf(isAddtinoarlCriterion, t => t.SubjectCriteriaEvaluationList.Where(t => t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId).Any(t => t.IsJoinEvaluation))
|
||||
|
||||
@@ -158,7 +176,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == querySubjectAssign.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder, x.ReadingType, x.IsArbitrationReading, x.IsOncologyReading, x.IsGlobalReading }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
return ResponseOutput.Ok (pageList, criterionConfig);
|
||||
return ResponseOutput.Ok(pageList, criterionConfig);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -292,7 +310,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
var subjectId = cancelCommand.CancelList.First().SubjectId;
|
||||
|
||||
await _repository.AddAsync(new SubjectCanceDoctor() { SubjectId = subjectId, Note = cancelCommand.Note });
|
||||
await _repository.AddAsync(new SubjectCanceDoctor() { SubjectId = subjectId, Note = cancelCommand.Note, TrialReadingCriterionId = cancelCommand.TrialReadingCriterionId });
|
||||
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
|
||||
@@ -407,7 +425,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
.WhereIf(querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(querySubjectAssign.IsJudgeDoctor, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
|
||||
.WhereIf(querySubjectAssign.SiteId != null, t => t.SiteId == querySubjectAssign.SiteId)
|
||||
.WhereIf(querySubjectAssign.TrialSiteId != null, t => t.TrialSiteId == querySubjectAssign.TrialSiteId)
|
||||
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
|
||||
|
||||
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == true && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
@@ -670,7 +688,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
.WhereIf(queryVisitTask.ReadingCategory == null, t => t.ReadingCategory != ReadingCategory.Judge)
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -710,7 +728,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -742,13 +760,16 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <param name="queryVisitTask"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<(PageOutput<ReadingTaskView>, object?)> GetReadingTaskList(VisitTaskQuery queryVisitTask)
|
||||
public async Task<IResponseOutput<PageOutput<ReadingTaskView>>> GetReadingTaskList(VisitTaskQuery queryVisitTask)
|
||||
{
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
|
||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||
|
||||
.WhereIf(queryVisitTask.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||
.WhereIf(queryVisitTask.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -765,10 +786,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||
.WhereIf(queryVisitTask.BeginSignTime != null, t => t.SignTime > queryVisitTask.BeginSignTime)
|
||||
.WhereIf(queryVisitTask.EndSignTime != null, t => t.SignTime < queryVisitTask.EndSignTime!.Value.AddDays(1))
|
||||
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate)
|
||||
.WhereIf(queryVisitTask.BeginSignTime != null, t => t.SignTime > queryVisitTask.BeginSignTime)
|
||||
.WhereIf(queryVisitTask.EndSignTime != null, t => t.SignTime < queryVisitTask.EndSignTime)
|
||||
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||
|
||||
@@ -776,7 +797,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialUrgentConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
|
||||
return (pageList, trialTaskConfig);
|
||||
return ResponseOutput.Ok(pageList, trialTaskConfig);
|
||||
}
|
||||
|
||||
|
||||
@@ -794,26 +815,33 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
.Where(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId /*&& t.OriginalReReadingTask.IsAnalysisCreate == false*/)
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.OriginalReReadingTask.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.WhereIf(queryVisitTask.RequestReReadingType != null, t => t.RequestReReadingType == queryVisitTask.RequestReReadingType)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
.WhereIf(queryVisitTask.ArmEnum != null, t => t.OriginalReReadingTask.ArmEnum == queryVisitTask.ArmEnum)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.RequestReReadingReason), t => t.RequestReReadingReason.Contains(queryVisitTask.RequestReReadingReason))
|
||||
|
||||
.WhereIf(queryVisitTask.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == queryVisitTask.RequestReReadingResultEnum)
|
||||
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(queryVisitTask.TaskName) || t.OriginalReReadingTask.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => ((t.OriginalReReadingTask.Subject.Code.Contains(queryVisitTask.SubjectCode) || t.OriginalReReadingTask.Subject.MedicalNo.Contains(queryVisitTask.SubjectCode)) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
|
||||
|
||||
.WhereIf(queryVisitTask.BeginRequestReReadingTime != null, t => t.RequestReReadingTime >= queryVisitTask.BeginRequestReReadingTime)
|
||||
.WhereIf(queryVisitTask.EndRequestReReadingTime != null, t => t.RequestReReadingTime <= queryVisitTask.EndRequestReReadingTime!.Value.AddDays(1))
|
||||
|
||||
.ProjectTo<ReReadingTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
//var defalutSortArray = new string[] { nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.IsUrgent) + " desc", nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.SubjectId), nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.VisitTaskNum) };
|
||||
@@ -845,13 +873,13 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
.Where(t => t.RequestReReadingType == RequestReReadingType.DocotorApply)
|
||||
.Where(t => t.OriginalReReadingTask.DoctorUserId == _userInfo.Id)
|
||||
.Where(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId)
|
||||
.WhereIf(queryVisitTask.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == queryVisitTask.RequestReReadingResultEnum)
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(queryVisitTask.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == queryVisitTask.RequestReReadingResultEnum)
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.OriginalReReadingTask.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -886,7 +914,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.OriginalReReadingTask.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -918,74 +946,54 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<(PageOutput<IRUnReadSubjectView>, object)> GetIRUnReadSubjectTaskList(IRUnReadSubjectQuery iRUnReadSubjectQuery)
|
||||
public async Task<IResponseOutput<PageOutput<IRUnReadSubjectView>>> GetIRUnReadSubjectTaskList(IRUnReadSubjectQuery inQuery)
|
||||
{
|
||||
|
||||
var trialId = iRUnReadSubjectQuery.TrialId;
|
||||
var trialId = inQuery.TrialId;
|
||||
var subjectCode = inQuery.SubjectCode;
|
||||
|
||||
var trialReadingCriterionId = iRUnReadSubjectQuery.TrialReadingCriterionId;
|
||||
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
|
||||
|
||||
var criterionConfig = await _trialReadingCriterionRepository.Where(x => x.Id == iRUnReadSubjectQuery.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
var criterionConfig = await _trialReadingCriterionRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
|
||||
var readingTool = criterionConfig.ReadingTool;
|
||||
var isReadingTaskViewInOrder = criterionConfig.IsReadingTaskViewInOrder;
|
||||
|
||||
#region 按照Subject 维度
|
||||
if (isReadingTaskViewInOrder)
|
||||
|
||||
var result = new PageOutput<IRUnReadSubjectView>()
|
||||
{
|
||||
PageSize = inQuery.PageSize,
|
||||
PageIndex = inQuery.PageIndex,
|
||||
TotalCount = 0,
|
||||
CurrentPageData = null,
|
||||
};
|
||||
|
||||
IRUnReadOutDto iRUnReadOut = new IRUnReadOutDto();
|
||||
|
||||
var visitTaskListInfo = await GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
|
||||
//subject 级别 有序 无序查询
|
||||
if (isReadingTaskViewInOrder == ReadingOrder.InOrder || isReadingTaskViewInOrder == ReadingOrder.SubjectRandom)
|
||||
{
|
||||
result = await GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
||||
{
|
||||
TrialId = trialId,
|
||||
TrialReadingCriterionId = trialReadingCriterionId,
|
||||
SubjectCode = iRUnReadSubjectQuery.SubjectCode,
|
||||
Page = new PageInput()
|
||||
{
|
||||
PageIndex = iRUnReadSubjectQuery.PageIndex,
|
||||
PageSize = iRUnReadSubjectQuery.PageSize,
|
||||
Asc = iRUnReadSubjectQuery.Asc,
|
||||
SortField = iRUnReadSubjectQuery.SortField,
|
||||
|
||||
}
|
||||
SubjectCode = inQuery.SubjectCode,
|
||||
|
||||
PageIndex = inQuery.PageIndex,
|
||||
PageSize = inQuery.PageSize,
|
||||
Asc = inQuery.Asc,
|
||||
SortField = inQuery.SortField,
|
||||
});
|
||||
|
||||
|
||||
var totalCount = visitTaskListInfo.Item1;
|
||||
var currentPageData = visitTaskListInfo.Item2;
|
||||
|
||||
|
||||
|
||||
var result = new PageOutput<IRUnReadSubjectView>()
|
||||
{
|
||||
PageSize = iRUnReadSubjectQuery.PageSize,
|
||||
PageIndex = iRUnReadSubjectQuery.PageIndex,
|
||||
TotalCount = totalCount,
|
||||
CurrentPageData = currentPageData,
|
||||
};
|
||||
|
||||
// 封装的方法有问题
|
||||
//var result = await visitQuery.ToPagedListAsync(iRUnReadSubjectQuery.PageIndex, iRUnReadSubjectQuery.PageSize, String.IsNullOrEmpty(iRUnReadSubjectQuery.SortField) ? nameof(IRUnReadSubjectView.SubjectId) : iRUnReadSubjectQuery.SortField, iRUnReadSubjectQuery.Asc);
|
||||
return (result, new
|
||||
{
|
||||
RandomReadInfo = new IRUnReadOutDto(),
|
||||
IsReadingTaskViewInOrder = isReadingTaskViewInOrder,
|
||||
ReadingTool = readingTool,
|
||||
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
||||
IsReadingShowSubjectInfo = criterionConfig.IsReadingShowSubjectInfo,
|
||||
IsReadingShowPreviousResults = criterionConfig.IsReadingShowPreviousResults,
|
||||
DigitPlaces = criterionConfig.DigitPlaces,
|
||||
CriterionType = criterionConfig.CriterionType,
|
||||
});
|
||||
}
|
||||
//随机阅片
|
||||
else
|
||||
{
|
||||
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == iRUnReadSubjectQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
||||
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
||||
// .Where(x=>x.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == x.SouceReadModuleId || c.ReadingId == x.SourceSubjectVisitId)))
|
||||
.Where(x => !x.Subject.IsDeleted).Where(x => (x.IsNeedClinicalDataSign && x.IsClinicalDataSign) || !x.IsNeedClinicalDataSign);
|
||||
|
||||
IRUnReadOutDto iRUnReadOut = new IRUnReadOutDto()
|
||||
iRUnReadOut = new IRUnReadOutDto()
|
||||
{
|
||||
FinishJudgeTaskCount = await taskQuery.Where(x => x.ReadingCategory == ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).CountAsync(),
|
||||
FinishTaskCount = await taskQuery.Where(x => x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).CountAsync(),
|
||||
@@ -993,12 +1001,57 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
UnReadJudgeTaskCount = await taskQuery.Where(x => x.ReadingCategory == ReadingCategory.Judge && x.ReadingTaskState != ReadingTaskState.HaveSigned).CountAsync(),
|
||||
UnReadTaskCount = await taskQuery.Where(x => x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState != ReadingTaskState.HaveSigned).CountAsync(),
|
||||
};
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(result, new
|
||||
{
|
||||
IsReadingTaskViewInOrder = isReadingTaskViewInOrder,
|
||||
RandomReadInfo = iRUnReadOut,
|
||||
ReadingTool = readingTool,
|
||||
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
||||
IsReadingShowSubjectInfo = criterionConfig.IsReadingShowSubjectInfo,
|
||||
IsReadingShowPreviousResults = criterionConfig.IsReadingShowPreviousResults,
|
||||
DigitPlaces = criterionConfig.DigitPlaces,
|
||||
CriterionType = criterionConfig.CriterionType,
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
var visitGroupQuery = taskQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||
/// <summary>
|
||||
/// 获取subject有序 或者无序阅片IQuery对象
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PageOutput<IRUnReadSubjectView>> GetSubjectReadingIQueryable(GetReadingIQueryableInDto inQuery)
|
||||
{
|
||||
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
|
||||
var subjectCode = inQuery.SubjectCode;
|
||||
var trialId = inQuery.TrialId;
|
||||
var subjectId = inQuery.SubjectId;
|
||||
|
||||
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
||||
|
||||
if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||
|
||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||
//前序 不存在 未生成任务的访视
|
||||
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
||||
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
||||
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
||||
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
||||
//满足前序访视不存在 需要签署但是未签署 sql 相当复杂 同时想查询所有未读的统计数字 就无法统计 byzhouhang
|
||||
//但是加字段 IsFrontTaskNeedSignButNotSign 那么签名临床数据的时候,要对该subject 该标准的有效的任务 这个字段需要在签名的时候维护 采取这种方式 统计数字灵活
|
||||
//.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode!) && t.IsAnalysisCreate));
|
||||
|
||||
|
||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||
|
||||
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
|
||||
{
|
||||
@@ -1017,6 +1070,32 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
).Count(),
|
||||
|
||||
|
||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||
.OrderBy(x => x.VisitTaskNum)
|
||||
.Select(u => new IRUnreadTaskView()
|
||||
{
|
||||
Id = u.Id,
|
||||
IsUrgent = u.IsUrgent,
|
||||
VisitNum = u.VisitTaskNum,
|
||||
TaskBlindName = u.TaskBlindName,
|
||||
VisistId = u.SourceSubjectVisitId,
|
||||
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
||||
ReadingCategory = u.ReadingCategory,
|
||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||
ArmEnum = u.ArmEnum,
|
||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||
})
|
||||
.ToList(),
|
||||
|
||||
|
||||
UrgentCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||
.Where(x => x.IsUrgent).Count(),
|
||||
|
||||
//已读任务量
|
||||
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
@@ -1041,166 +1120,122 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||
})
|
||||
.ToList(),
|
||||
}).Where(x => x.UnReadCanReadTaskCount > 0);
|
||||
}).Where(x => x.UnReadCanReadTaskCount > 0)/*.OrderBy(x => x.UnReadCanReadTaskCount)*/;
|
||||
// 有序阅片需要找到最小需要
|
||||
|
||||
|
||||
var totalCount = await visitGroupQuery.CountAsync();
|
||||
var currentPageData = await visitTaskQuery.ToListAsync();
|
||||
// 不这样写会有问题
|
||||
var count = visitQuery.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||
.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode }).Count();
|
||||
|
||||
var result = new PageOutput<IRUnReadSubjectView>()
|
||||
{
|
||||
PageSize = iRUnReadSubjectQuery.PageSize,
|
||||
PageIndex = iRUnReadSubjectQuery.PageIndex,
|
||||
TotalCount = totalCount,
|
||||
CurrentPageData = currentPageData,
|
||||
};
|
||||
var result = new List<IRUnReadSubjectView>();
|
||||
|
||||
return (result, new
|
||||
{
|
||||
IsReadingTaskViewInOrder = isReadingTaskViewInOrder,
|
||||
RandomReadInfo = iRUnReadOut,
|
||||
ReadingTool = readingTool,
|
||||
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
||||
IsReadingShowSubjectInfo = criterionConfig.IsReadingShowSubjectInfo,
|
||||
IsReadingShowPreviousResults = criterionConfig.IsReadingShowPreviousResults,
|
||||
DigitPlaces = criterionConfig.DigitPlaces,
|
||||
CriterionType = criterionConfig.CriterionType,
|
||||
});
|
||||
var propName = string.IsNullOrWhiteSpace(inQuery!.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField;
|
||||
|
||||
}
|
||||
var visitTaskOrderQuery = inQuery.Asc ? visitTaskQuery.OrderBy(propName) : visitTaskQuery.OrderBy(propName + " desc");
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取有序阅片IQuery对象
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto)
|
||||
{
|
||||
var trialReadingCriterionId = inDto.TrialReadingCriterionId;
|
||||
|
||||
|
||||
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
||||
|
||||
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.DoctorUserId == _userInfo.Id
|
||||
&& x.TaskState == TaskState.Effect /*&& x.TrialReadingCriterionId== inDto.TrialReadingCriterionId*/)
|
||||
|
||||
//前序 不存在 未生成任务的访视
|
||||
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
||||
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
||||
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
||||
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
||||
//满足前序访视不存在 需要签署但是未签署 sql 相当复杂 同时想查询所有未读的统计数字 就无法统计 byzhouhang
|
||||
//但是加字段 IsFrontTaskNeedSignButNotSign 那么签名临床数据的时候,要对该subject 该标准的有效的任务 这个字段需要在签名的时候维护 采取这种方式 统计数字灵活
|
||||
//.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum))
|
||||
.WhereIf(!string.IsNullOrEmpty(inDto.SubjectCode), t => (t.Subject.Code.Contains(inDto.SubjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inDto.SubjectCode!) && t.IsAnalysisCreate));
|
||||
|
||||
|
||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||
|
||||
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
|
||||
{
|
||||
SubjectId = x.Key.SubjectId,
|
||||
SubjectCode = x.Key.BlindSubjectCode == string.Empty ? x.Key.Code : x.Key.BlindSubjectCode,
|
||||
|
||||
SuggesteFinishedTime = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Min(x => x.SuggesteFinishedTime),
|
||||
|
||||
//未读任务量
|
||||
UnReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
//未读 里可读任务量
|
||||
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
||||
//不能对包含聚合或子查询的表达式执行聚合函数
|
||||
//&& !x.Any(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false && t.VisitTaskNum<y.VisitTaskNum )
|
||||
).Count(),
|
||||
|
||||
|
||||
UnReadCanReadTaskList= x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||
.OrderBy(x => x.VisitTaskNum)
|
||||
.Select(u => new IRUnreadTaskView()
|
||||
{
|
||||
Id = u.Id,
|
||||
IsUrgent = u.IsUrgent,
|
||||
VisitNum = u.VisitTaskNum,
|
||||
TaskBlindName = u.TaskBlindName,
|
||||
VisistId = u.SourceSubjectVisitId,
|
||||
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
||||
ReadingCategory = u.ReadingCategory,
|
||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||
ArmEnum = u.ArmEnum,
|
||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||
})
|
||||
.ToList(),
|
||||
|
||||
|
||||
UrgentCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||
.Where(x=>x.IsUrgent).Count(),
|
||||
|
||||
//已读任务量
|
||||
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed),
|
||||
|
||||
//查出所有未读的 未读的可读的 在这个列表基础上 过滤下 y.IsFrontTaskNeedSignButNotSign==false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true) 这样容易排错 确认这三个字段是否维护有误
|
||||
UnReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).OrderBy(x => x.VisitTaskNum)
|
||||
.Select(u => new IRUnreadTaskView()
|
||||
{
|
||||
Id = u.Id,
|
||||
IsUrgent = u.IsUrgent,
|
||||
VisitNum = u.VisitTaskNum,
|
||||
TaskBlindName = u.TaskBlindName,
|
||||
VisistId = u.SourceSubjectVisitId,
|
||||
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
||||
ReadingCategory = u.ReadingCategory,
|
||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||
ArmEnum = u.ArmEnum,
|
||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||
})
|
||||
.ToList(),
|
||||
}).Where(x => x.UnReadCanReadTaskCount > 0)/*.OrderBy(x => x.UnReadCanReadTaskCount)*/;
|
||||
// 有序阅片需要找到最小需要
|
||||
|
||||
|
||||
// 不这样写会有问题
|
||||
var count = visitQuery.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||
.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode }).Count();
|
||||
|
||||
var result = new List<IRUnReadSubjectView>();
|
||||
|
||||
var propName = string.IsNullOrWhiteSpace(inDto.Page!.SortField) ? "UnReadCanReadTaskCount" : inDto.Page.SortField;
|
||||
|
||||
var visitTaskOrderQuery = inDto.Page.Asc ? visitTaskQuery.OrderBy(propName) : visitTaskQuery.OrderBy(propName + " desc");
|
||||
if (inDto.Page != null)
|
||||
{
|
||||
result = await visitTaskOrderQuery
|
||||
.Skip((inDto.Page.PageIndex - 1) * inDto.Page.PageSize)
|
||||
.Take(inDto.Page.PageSize).ToListAsync();
|
||||
.Skip((inQuery.PageIndex - 1) * inQuery.PageSize)
|
||||
.Take(inQuery.PageSize).ToListAsync();
|
||||
|
||||
|
||||
return new PageOutput<IRUnReadSubjectView>()
|
||||
{
|
||||
PageSize = inQuery.PageSize,
|
||||
PageIndex = inQuery.PageIndex,
|
||||
TotalCount = count,
|
||||
CurrentPageData = result,
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await visitTaskOrderQuery.ToListAsync();
|
||||
|
||||
if (subjectId != null)
|
||||
{
|
||||
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskBlindName == "Timepoint" && t.ReadingCategory == ReadingCategory.Visit
|
||||
&& (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze), true).ToListAsync();
|
||||
|
||||
if (needDealTaskList.Count > 0)
|
||||
{
|
||||
//已完成的访视任务数量(包含重阅的)
|
||||
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit);
|
||||
|
||||
//已经处理过的任务名称的数量
|
||||
|
||||
var haveDealedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit && t.TaskBlindName != "Timepoint");
|
||||
|
||||
|
||||
|
||||
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
||||
List<int> availableNumbers = Enumerable.Range(haveDealedTaskCount + haveFinishedTaskCount + 1, needDealTaskList.Count).ToList();
|
||||
Random rng = new Random();
|
||||
foreach (var visitTask in needDealTaskList)
|
||||
{
|
||||
int randomIndex = rng.Next(availableNumbers.Count);
|
||||
|
||||
visitTask.TaskBlindName = $"Timepoint Ran {availableNumbers[randomIndex]}";
|
||||
|
||||
availableNumbers.RemoveAt(randomIndex);
|
||||
}
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(subjectCode), t => (t.Subject.Code.Contains(subjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(subjectCode!) && t.IsAnalysisCreate));
|
||||
|
||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||
|
||||
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
|
||||
{
|
||||
SubjectId = x.Key.SubjectId,
|
||||
SubjectCode = x.Key.BlindSubjectCode == string.Empty ? x.Key.Code : x.Key.BlindSubjectCode,
|
||||
|
||||
SuggesteFinishedTime = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Min(x => x.SuggesteFinishedTime),
|
||||
|
||||
//未读任务量
|
||||
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
UrgentCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Where(x => x.IsUrgent).Count(),
|
||||
|
||||
//已读任务量
|
||||
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed),
|
||||
|
||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
.OrderBy(x => x.VisitTaskNum)
|
||||
.Select(u => new IRUnreadTaskView()
|
||||
{
|
||||
Id = u.Id,
|
||||
IsUrgent = u.IsUrgent,
|
||||
VisitNum = u.VisitTaskNum,
|
||||
TaskBlindName = u.TaskBlindName,
|
||||
VisistId = u.SourceSubjectVisitId,
|
||||
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
||||
ReadingCategory = u.ReadingCategory,
|
||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||
ArmEnum = u.ArmEnum,
|
||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||
})
|
||||
.ToList()
|
||||
}).Where(x => x.UnReadCanReadTaskCount > 0);
|
||||
|
||||
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField, inQuery.Asc);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
return (count, result);
|
||||
}
|
||||
|
||||
|
||||
@@ -1218,7 +1253,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState == ReadingTaskState.HaveSigned)//该医生 已经签名的数据
|
||||
|
||||
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
@@ -1250,14 +1285,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
var baseLineTaskList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SourceSubjectVisit.IsBaseLine == true).ToListAsync();
|
||||
|
||||
var judegeList= await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||
var judegeList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Judge && t.ReadingTaskState == ReadingTaskState.HaveSigned).ToListAsync();
|
||||
|
||||
foreach (var item in judegeList)
|
||||
{
|
||||
if (!baseLineTaskList.Any(t => t.SubjectId == item.SubjectId))
|
||||
{
|
||||
baseLineTaskList.Add(item);
|
||||
baseLineTaskList.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1361,7 +1396,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
|
||||
// 有序 一个受试者访视重阅未处理完,不能申请其他的
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
if (await _visitTaskReReadingRepository.AnyAsync(t => t.OriginalReReadingTask.TrialId == task.TrialId && t.OriginalReReadingTask.SubjectId == task.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect
|
||||
&& t.OriginalReReadingTask.TrialReadingCriterionId == task.TrialReadingCriterionId
|
||||
@@ -1382,7 +1417,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
task.ReReadingApplyState = ReReadingApplyState.DocotorHaveApplyed;
|
||||
|
||||
// 有序
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
// 针对同一个subject 不同阅片人 针对同一个访视申请重阅,是允许的,所以同一阅片人,针对同一suject 有访视申请重阅还未处理,不允许申请重阅
|
||||
if (await _visitTaskReReadingRepository.AnyAsync(t => t.OriginalReReadingTask.TrialId == task.TrialId && t.OriginalReReadingTask.SubjectId == task.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect
|
||||
@@ -1648,7 +1683,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
}
|
||||
|
||||
//有序阅片
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
|
||||
|
||||
@@ -1757,7 +1792,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
|
||||
//有序阅片
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
#region 有序 IR 申请 重阅 影响的其他访视查询
|
||||
|
||||
@@ -2165,8 +2200,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
foreach (var item in readingTableAnswerRowInfoList)
|
||||
{
|
||||
|
||||
var originalVisitTaskId= item.VisitTaskId;
|
||||
var originalFristAddTaskId= item.FristAddTaskId;
|
||||
var originalVisitTaskId = item.VisitTaskId;
|
||||
var originalFristAddTaskId = item.FristAddTaskId;
|
||||
|
||||
item.Id = NewId.NextSequentialGuid();
|
||||
item.VisitTaskId = newTask.Id;
|
||||
@@ -2270,7 +2305,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
|
||||
//有序
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
|
||||
//Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.TaskAllocationState == TaskAllocationState.Allocated;
|
||||
@@ -2602,7 +2637,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
//当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务
|
||||
|
||||
//有序
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
|
||||
switch (filterObj.ReadingCategory)
|
||||
@@ -2721,7 +2756,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
|
||||
//有序
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
switch (filterObj.ReadingCategory)
|
||||
{
|
||||
@@ -2780,7 +2815,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
if (filterObj.ReadingCategory == ReadingCategory.Visit && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
|
||||
{
|
||||
//有序
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
// 当前任务及其之后的所有访视任务 两个阅片人的
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<TaskAllocationRule, TaskAllocationRuleDTO>()
|
||||
.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.Enroll.DoctorUser))
|
||||
.ForMember(o => o.CriterionReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId })))
|
||||
.ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.ReadingQuestionCriterionTrialList.Where(t => t.IsConfirm)))
|
||||
.ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.TrialReadingCriterionList.Where(t => t.IsConfirm)))
|
||||
.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Where(t=>t.TrialReadingCriterionId== trialReadingCriterionId).OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList()))
|
||||
;
|
||||
|
||||
@@ -124,9 +124,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<VisitTask, VisitTaskView>().IncludeBase<VisitTask, VisitTaskViewBasic>()
|
||||
|
||||
|
||||
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code))
|
||||
.ForMember(o => o.TrialSiteId, t => t.MapFrom(u => u.Subject.TrialSiteId))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
||||
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
||||
|
||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
||||
@@ -167,7 +169,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
CreateMap<VisitTask, IRHaveReadView>().IncludeBase<VisitTask, VisitTaskViewBasic>()
|
||||
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
||||
.ForMember(o => o.TrialSiteId, t => t.MapFrom(u => u.Subject.TrialSiteId))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code));
|
||||
|
||||
@@ -223,17 +225,19 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(o => o.Id, t => t.MapFrom(u => u.Id))
|
||||
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.VisitTask.Subject.MedicalNo))
|
||||
.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.VisitTask.DoctorUser))
|
||||
.ForMember(o => o.MedicalManagerUser, t => t.MapFrom(u => u.MedicalManagerUser));
|
||||
.ForMember(o => o.MedicalManagerUser, t => t.MapFrom(u => u.MedicalManagerUser))
|
||||
.ForMember(o => o.AllocateTime, t => t.MapFrom(u => u.AllocateTime))
|
||||
;
|
||||
|
||||
CreateMap<VisitTask, TaskMedicalReviewView>()
|
||||
.ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code));
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u =>/* u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code));
|
||||
|
||||
CreateMap<VisitTask, GenerateMedicalReviewTaskView>()
|
||||
.ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
||||
.ForMember(o => o.GeneratedMedicalReviewCount, t => t.MapFrom(u => u.TaskMedicalReviewList.Count()))
|
||||
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
||||
.ForMember(o => o.IsGeneratedJudge, t => t.MapFrom(u => u.JudgeVisitTaskId != null))
|
||||
|
||||
@@ -87,6 +87,18 @@ namespace IRaCIS.Application.Services
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有字典的Key
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<string>> GetAllDictionaryKey()
|
||||
{
|
||||
var result =await _dicRepository.Where(t => t.ParentId == null).OrderBy(x=>x.Code).Select(x => x.Code).ToListAsync();
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加字典 的同时 一起添加子项 --New
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var list = await _trialSiteUserRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.TrialSite.TrialSiteName.Contains(param.SiteName) || t.TrialSite.TrialSiteAliasName.Contains(param.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName),
|
||||
t => t.TrialSite.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode),
|
||||
@@ -153,9 +153,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var groupSelectIdQuery =
|
||||
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||
.WhereIf(queryParam.SiteId != null, t => t.SiteId == queryParam.SiteId)
|
||||
.WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||
.GroupBy(t => t.SiteId)
|
||||
.GroupBy(t => t.TrialSiteId)
|
||||
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var list = await _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
||||
.WhereIf(visitSearchDTO.SiteId != null, t => t.SiteId == visitSearchDTO.SiteId)
|
||||
.WhereIf(visitSearchDTO.TrialSiteId != null, t => t.TrialSiteId == visitSearchDTO.TrialSiteId)
|
||||
.WhereIf(visitSearchDTO.SubjectId != null, t => t.Subject.Id == visitSearchDTO.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(visitSearchDTO.SubjectInfo), t => t.Subject.Code.Contains(visitSearchDTO.SubjectInfo))
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
|
||||
.WhereIf(challengeQuery.ReuploadEnum != null, t => t.ReuploadEnum == challengeQuery.ReuploadEnum)
|
||||
.WhereIf(challengeQuery.IsClosed != null, t => t.IsClosed == challengeQuery.IsClosed)
|
||||
.WhereIf(challengeQuery.SiteId != null, t => t.SubjectVisit.SiteId == challengeQuery.SiteId)
|
||||
.WhereIf(challengeQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == challengeQuery.TrialSiteId)
|
||||
.WhereIf(challengeQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == challengeQuery.SubjectId)
|
||||
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
|
||||
.WhereIf(!string.IsNullOrEmpty(challengeQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode))
|
||||
@@ -318,7 +318,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.Name), t => t.ShortName.Contains(param.Name))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.Sex), t => t.Sex.Contains(param.Sex))
|
||||
.WhereIf(param.Status != null, t => t.Status == param.Status)
|
||||
.WhereIf(param.SiteId != null, t => t.SiteId == param.SiteId)
|
||||
.WhereIf(param.TrialSiteId != null, t => t.TrialSiteId == param.TrialSiteId)
|
||||
// CRC 只负责他管理site的受试者
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.ProjectTo<SubjectExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
@@ -532,16 +532,16 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
var svExpression = QCCommon.GetStudyMonitorSubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
var StudyMonitorQuery = _repository.Where<StudyMonitor>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
|
||||
.WhereIf(studyQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == studyQuery.TrialSiteId)
|
||||
.Select(t => new UnionStudyMonitorExportDto()
|
||||
{
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
SubjectCode = t.Subject.Code,
|
||||
|
||||
@@ -642,7 +642,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
|
||||
var dicomStudyQuery = _repository.Where<DicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.Where(x => x.SubjectVisit.AuditState == AuditStateEnum.QCPassed)
|
||||
@@ -656,9 +656,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
StudyCode = t.StudyCode,
|
||||
StudyTime = t.StudyTime,
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
CheckState = t.SubjectVisit.CheckState,
|
||||
//Uploader = t.Uploader.UserName,
|
||||
@@ -670,7 +670,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
|
||||
|
||||
var nodeDicomStudyQuery = _repository.Where<NoneDicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.Where(x => x.SubjectVisit.AuditState == AuditStateEnum.QCPassed)
|
||||
@@ -685,9 +685,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
StudyCode = t.StudyCode,
|
||||
StudyTime = t.ImageDate,
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
CheckState = t.SubjectVisit.CheckState,
|
||||
|
||||
@@ -735,7 +735,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
var list = await _subjectVisitRepository.Where(x => x.TrialId == checkQuery.TrialId)
|
||||
.Where(x => x.AuditState == AuditStateEnum.QCPassed) //一致性核查中的,或者还没一致性核查的
|
||||
.WhereIf(checkQuery.CheckState != null, t => t.CheckState == checkQuery.CheckState)
|
||||
.WhereIf(checkQuery.SiteId != null, t => t.SiteId == checkQuery.SiteId)
|
||||
.WhereIf(checkQuery.TrialSiteId != null, t => t.TrialSiteId == checkQuery.TrialSiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(checkQuery.SubjectInfo), t => t.Subject.Code.Contains(checkQuery.SubjectInfo))
|
||||
.WhereIf(checkQuery.VisitPlanArray != null && checkQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site
|
||||
@@ -773,7 +773,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.ArmEnum != null, t => t.ArmEnum == queryVisitTask.ArmEnum)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -826,7 +827,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
var list = await _repository.Where<VisitTaskReReading>(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId /*&& t.OriginalReReadingTask.IsAnalysisCreate == false*/)
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.OriginalReReadingTask.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
@@ -874,7 +875,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
{
|
||||
|
||||
var list = await _repository.Where<TaskMedicalReview>(t => t.VisitTask.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.SiteId != null, t => t.VisitTask.Subject.SiteId == inQuery.SiteId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.VisitTask.TaskName.Contains(inQuery.TaskName) || t.VisitTask.TaskBlindName.Contains(inQuery.TaskName))
|
||||
@@ -935,7 +936,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -1019,7 +1020,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -1223,7 +1224,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -1280,7 +1281,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
@@ -1349,7 +1350,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
||||
@@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using OfficeOpenXml.FormulaParsing.Utilities;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -41,11 +40,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
var cacheList= _provider.Get<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front).Value;
|
||||
|
||||
if(cacheList != null && cacheList.Count!=0)
|
||||
{
|
||||
return cacheList;
|
||||
}
|
||||
else
|
||||
//if(cacheList != null && cacheList.Count!=0)
|
||||
//{
|
||||
// return cacheList;
|
||||
//}
|
||||
//else
|
||||
{
|
||||
var list = await _internationalizationRepository.Where(t => t.InternationalizationType == 0).Select(t => new InternationalizationSimpleDto()
|
||||
{
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
Task SiteSurveyRejectEmail(MimeMessage messageToSend);
|
||||
|
||||
Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode, UserMFAType mfaType = UserMFAType.Login);
|
||||
|
||||
Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
||||
|
||||
Task AnolymousSendEmailForResetAccount(string emailAddress, int verificationCode);
|
||||
@@ -91,6 +93,66 @@ namespace IRaCIS.Application.Services
|
||||
return str;
|
||||
}
|
||||
|
||||
//MFA
|
||||
public async Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode, UserMFAType mfaType = UserMFAType.Login)
|
||||
{
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
//收件地址
|
||||
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
||||
//主题
|
||||
//---[来自{0}] 关于MFA邮箱验证的提醒
|
||||
messageToSend.Subject = _localizer[mfaType == UserMFAType.Login? "Mail_EmailMFALoginTopic":"Mail_EmailMFAUnlockTopic", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN];
|
||||
|
||||
var builder = new BodyBuilder();
|
||||
|
||||
|
||||
var pathToFile = _hostEnvironment.WebRootPath
|
||||
+ Path.DirectorySeparatorChar.ToString()
|
||||
+ "EmailTemplate"
|
||||
+ Path.DirectorySeparatorChar.ToString()
|
||||
//+ "UserOptCommon.html";
|
||||
+ (_userInfo.IsEn_Us ? "UserOptCommon_US.html" : "UserOptCommon.html");
|
||||
|
||||
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
||||
{
|
||||
var templateInfo = SourceReader.ReadToEnd();
|
||||
|
||||
|
||||
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
||||
|
||||
userName,
|
||||
_localizer[mfaType == UserMFAType.Login ? "Mail_EmailMFALoginEmail": "Mail_EmailMFAUnlockEmail"],
|
||||
verificationCode
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
messageToSend.Body = builder.ToMessageBody();
|
||||
|
||||
|
||||
|
||||
EventHandler<MessageSentEventArgs> sucessHandle = (sender, args) =>
|
||||
{
|
||||
// args.Response
|
||||
var code = verificationCode.ToString();
|
||||
_ = _verificationCodeRepository.AddAsync(new VerificationCode()
|
||||
{
|
||||
CodeType = 0,
|
||||
HasSend = true,
|
||||
Code = code,
|
||||
UserId = userId,
|
||||
ExpirationTime = DateTime.Now.AddMinutes(3)
|
||||
}).Result;
|
||||
_ = _verificationCodeRepository.SaveChangesAsync().Result;
|
||||
|
||||
};
|
||||
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle);
|
||||
}
|
||||
|
||||
//重置邮箱
|
||||
public async Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode)
|
||||
{
|
||||
|
||||
@@ -182,6 +182,9 @@ namespace IRaCIS.Application.Contracts
|
||||
public string OptUserName { get; set; } = string.Empty;
|
||||
public DateTime? OptTime { get; set; }
|
||||
public string? OptTimeStr => OptTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
||||
public string DoctorUserName { get; set; }
|
||||
}
|
||||
|
||||
public class DoctorOptDTO
|
||||
|
||||
@@ -60,7 +60,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<AddOrUpdateDicDTO, Dictionary>().ReverseMap();
|
||||
|
||||
//医生列表、项目显示列表模型转换
|
||||
CreateMap<DoctorDTO, SelectionReviewerDTO>();
|
||||
CreateMap<DoctorDTO, SelectionReviewerDTO>()
|
||||
;
|
||||
|
||||
CreateMap<User, UserBasicInfo>()
|
||||
.ForMember(d => d.UserTypeShortName, u => u.MapFrom(t => t.UserTypeRole.UserTypeShortName))
|
||||
@@ -80,7 +81,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(d => d.UserName, u => u.MapFrom(doctor => doctor.LastName + " / " + doctor.FirstName));
|
||||
|
||||
#region 医生基本信息
|
||||
CreateMap<Doctor, SelectionReviewerDTO>();
|
||||
CreateMap<Doctor, SelectionReviewerDTO>()
|
||||
.ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.User.UserName));
|
||||
CreateMap<Doctor, DoctorDTO>().IncludeMembers(t => t.Hospital).Include<Doctor, SelectionReviewerDTO>()
|
||||
.ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t=>t.DoctorUserId!=null).Select(c=>c.DoctorUser.UserName).FirstOrDefault()))
|
||||
.ForMember(d => d.Department, u => u.MapFrom(s => s.Department.Value))
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public bool? IsDeleted { get; set; }
|
||||
public Guid? FileTypeId { get; set; }
|
||||
|
||||
public Guid? UserTypeId { get; set; }
|
||||
|
||||
public string Name { get; set; } = String.Empty;
|
||||
|
||||
[NotDefault]
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var taskInfo = await _repository.Where<VisitTask>(t => t.Id == visitTaskId).Select(t => new
|
||||
{
|
||||
t.Subject.SiteId,
|
||||
t.Subject.TrialSiteId,
|
||||
t.Trial.ResearchProgramNo,
|
||||
t.Subject.TrialSite.TrialSiteCode,
|
||||
SubjectCode = t.Subject.Code,
|
||||
@@ -102,7 +102,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
return (topicStr, htmlBodyStr, isEn_us, null);
|
||||
};
|
||||
|
||||
await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.SiteId);
|
||||
await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.TrialSiteId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
return (topicStr, htmlBodyStr, isEn_us, null);
|
||||
};
|
||||
|
||||
await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.SiteId);
|
||||
await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.TrialSiteId);
|
||||
}
|
||||
|
||||
|
||||
@@ -283,9 +283,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
|
||||
public async Task SendTrialEmailAsync(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null, Func<TrialEmailNoticeConfig, SMTPEmailConfig, SMTPEmailConfig> emailAttachFunc=null)
|
||||
public async Task SendTrialEmailAsync(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? trialSiteId = null, Guid? trialReadingCriterionId = null, Func<TrialEmailNoticeConfig, SMTPEmailConfig, SMTPEmailConfig> emailAttachFunc=null)
|
||||
{
|
||||
var (trialEmailConfig, sendEmailConfig) = await BuildEmailConfig(trialId, businessScenario, topicAndHtmlFunc, siteId, trialReadingCriterionId);
|
||||
var (trialEmailConfig, sendEmailConfig) = await BuildEmailConfig(trialId, businessScenario, topicAndHtmlFunc, trialSiteId, trialReadingCriterionId);
|
||||
|
||||
if (sendEmailConfig != null)
|
||||
{
|
||||
@@ -295,7 +295,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
|
||||
|
||||
public async Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null)
|
||||
public async Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? trialSiteId = null, Guid? trialReadingCriterionId = null)
|
||||
{
|
||||
//找到配置
|
||||
var trialEmailConfig = await _trialEmailNoticeConfigRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionId && t.BusinessScenarioEnum == businessScenario, ignoreQueryFilters: true)
|
||||
@@ -333,13 +333,13 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ToList();
|
||||
|
||||
//收件人 有CRC CRA , CRC CRA的账户要按照中心发送
|
||||
if (siteId == null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA) && onlyToUserId == null)
|
||||
if (trialSiteId == null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA) && onlyToUserId == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前场景收件人包含CRC CRA,但是没有siteId,请联系后端开发");
|
||||
}
|
||||
if (siteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
if (trialSiteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
{
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId).Select(t => t.UserId).ToList();
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
|
||||
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||
}
|
||||
@@ -351,9 +351,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
var copyUserList = allUserList.Where(t => copyUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||
.Where(t => !blackUserIdList.Contains(t.UserId)).ToList();
|
||||
|
||||
if (siteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
if (trialSiteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
{
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId).Select(t => t.UserId).ToList();
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
|
||||
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using System.Linq;
|
||||
|
||||
namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
@@ -63,6 +64,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
var trialDocumentQueryable = _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == queryTrialDocument.TrialId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryTrialDocument.Name), t => t.Name.Contains(queryTrialDocument.Name))
|
||||
.WhereIf(queryTrialDocument.FileTypeId != null, t => t.FileTypeId == queryTrialDocument.FileTypeId)
|
||||
.WhereIf(queryTrialDocument.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t=>t.NeedConfirmUserTypeId== queryTrialDocument.UserTypeId) )
|
||||
.WhereIf(queryTrialDocument.IsDeleted != null, t => t.IsDeleted == queryTrialDocument.IsDeleted)
|
||||
.ProjectTo<TrialDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using SharpCompress.Common;
|
||||
using SkiaSharp;
|
||||
using DocumentFormat.OpenXml.Bibliography;
|
||||
using System.Linq.Dynamic.Core;
|
||||
|
||||
@@ -237,7 +236,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
t.SourceSubjectVisitId,
|
||||
t.SouceReadModuleId,
|
||||
t.SubjectId,
|
||||
t.Subject.SiteId,
|
||||
t.Subject.TrialSiteId,
|
||||
|
||||
t.DoctorUserId,
|
||||
t.ReadingTaskState,
|
||||
@@ -318,7 +317,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
};
|
||||
|
||||
|
||||
var (trialEmailConfig, sendEmailConfig) = await _emailSendService.BuildEmailConfig(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.SiteId, taskInfo.TrialReadingCriterionId);
|
||||
var (trialEmailConfig, sendEmailConfig) = await _emailSendService.BuildEmailConfig(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.TrialSiteId, taskInfo.TrialReadingCriterionId);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -382,7 +381,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
//有序
|
||||
|
||||
if (taskInfo.IsReadingTaskViewInOrder)
|
||||
if (taskInfo.IsReadingTaskViewInOrder==ReadingOrder.InOrder)
|
||||
{
|
||||
|
||||
|
||||
@@ -660,7 +659,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var path = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, _userInfo.IsEn_Us ? trialEmailConfig.AttachPath : trialEmailConfig.AttachCNPath);
|
||||
|
||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetSubjectEnrollConfirmOrPDEmailPath(_hostEnvironment, Path.GetFileName(path), taskInfo.TrialId, taskInfo.SiteId, taskInfo.SubjectId, true);
|
||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetSubjectEnrollConfirmOrPDEmailPath(_hostEnvironment, Path.GetFileName(path), taskInfo.TrialId, taskInfo.TrialSiteId, taskInfo.SubjectId, true);
|
||||
|
||||
if (emailStoreMode == EmailStoreSendMode.StoreLocalSend || emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail)
|
||||
{
|
||||
@@ -889,7 +888,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{ TrialReadingCriterionId = t.Id, t.ReadingType, t.IsReadingTaskViewInOrder, t.CriterionType, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
// 项目双重
|
||||
if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Double && trialReadingCriterionConfig.IsReadingTaskViewInOrder)
|
||||
if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Double && trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
//仲裁在访视上面
|
||||
if (trialReadingCriterionConfig.ArbitrationRule == ArbitrationRule.Visit)
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public int SliceLocation { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
@@ -30,6 +29,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public bool IsDeleted { get; set; }
|
||||
public bool IsReading { get; set; } = true;
|
||||
|
||||
public string SliceThickness { get; set; } = String.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +52,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
public string Sponsor { get; set; } = string.Empty;
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
||||
{
|
||||
public class DicomSeriesDTO
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
public bool IsDicom { get; set; } = true;
|
||||
|
||||
public bool IsBeMark { get; set; } = false;
|
||||
@@ -21,7 +27,7 @@
|
||||
public string SliceThickness { get; set; } = String.Empty;
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
@@ -33,19 +39,54 @@
|
||||
public bool IsDeleted { get; set; }
|
||||
public bool IsReading { get; set; } = true;
|
||||
|
||||
public List<Guid> InstanceList { get; set; } = new List<Guid>();
|
||||
|
||||
public List<string> InstancePathList { get; set; } = new List<string>();
|
||||
public List<InstanceBasicInfo> InstanceInfoList { get; set; }=new List<InstanceBasicInfo>();
|
||||
|
||||
public bool IsExistMutiFrames => InstanceInfoList.Any(t => t.NumberOfFrames > 1);
|
||||
|
||||
public List<string> InstanceHtmlPathList { get; set; }
|
||||
|
||||
//存放在instance 上面
|
||||
public string WindowCenter { get; set; } = string.Empty;
|
||||
public string WindowWidth { get; set; } = string.Empty;
|
||||
public string? WindowCenter => InstanceInfoList.FirstOrDefault()?.WindowCenter;
|
||||
public string? WindowWidth => InstanceInfoList.FirstOrDefault()?.WindowWidth;
|
||||
|
||||
public string ImageResizePath { get; set; }
|
||||
}
|
||||
|
||||
public class StudyInstanceInfo
|
||||
{
|
||||
|
||||
public int ShowOrder { get; set; }
|
||||
|
||||
|
||||
public decimal RowIndex { get; set; }
|
||||
|
||||
public Guid? SeriesId { get; set; }
|
||||
|
||||
public Guid? StudyId { get; set; }
|
||||
public Guid? InstanceId { get; set; }
|
||||
}
|
||||
public class InstanceBasicInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
|
||||
public string HtmlPath { get; set; }
|
||||
|
||||
public int NumberOfFrames { get; set; }
|
||||
|
||||
public int InstanceNumber { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public int ShowOrder { get; set; }
|
||||
[JsonIgnore]
|
||||
public decimal RowIndex { get; set; }
|
||||
[JsonIgnore]
|
||||
public string WindowCenter { get; set; }
|
||||
[JsonIgnore]
|
||||
public string WindowWidth { get; set; }
|
||||
}
|
||||
|
||||
public class DicomSeriesWithLabelDTO : DicomSeriesDTO
|
||||
{
|
||||
public bool HasLabel { get; set; } = false;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
@@ -18,7 +18,7 @@
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
@@ -74,7 +74,7 @@
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
//public string SubjectName { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
||||
{
|
||||
public class SubjectImageUploadDTO
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubejctId { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
|
||||
public string TaskBlindName { get; set; }
|
||||
|
||||
public string TaskName { get; set; }
|
||||
|
||||
public bool IsImageFilter { get; set; }
|
||||
public string CriterionModalitys { get; set; }
|
||||
|
||||
public Guid? SourceSubjectVisitId { get; set; }
|
||||
public PackState PackState { get; set; }
|
||||
|
||||
public List<StudyBasicInfo> OrginalStudyList { get; set; }
|
||||
|
||||
public List<StudyBasicInfo> UploadStudyList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class StudyBasicInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string StudyInstanceUid { get; set; }
|
||||
|
||||
public string StudyCode { get; set; }
|
||||
|
||||
public string ModalityForEdit { get; set; }
|
||||
|
||||
public string BodyPartExamined { get; set; }
|
||||
|
||||
|
||||
public string BodyPartForEdit { get; set; }
|
||||
|
||||
public DateTime? StudyTime { get; set; }
|
||||
|
||||
public string Modalities { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
public int SeriesCount { get; set; }
|
||||
public int InstanceCount { get; set; }
|
||||
|
||||
public List<string> SopInstanceUidList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
||||
public class ImageShareCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid? StudyId { get; set; }
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public Guid? SubjectVisitId { get; set; }
|
||||
|
||||
public string SubjectInfo { get; set; } = String.Empty;
|
||||
@@ -157,30 +157,28 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public Guid? VisitTaskId { get; set; }
|
||||
|
||||
public bool? IsDicom { get; set; }
|
||||
public bool? IsDicom { get; set; }
|
||||
|
||||
public string? Uploader { get; set; }
|
||||
public string? Uploader { get; set; }
|
||||
|
||||
public bool? IsSuccess { get; set; }
|
||||
public bool? IsSuccess { get; set; }
|
||||
|
||||
public string? StudyCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class PreArchiveDicomStudyCommand
|
||||
public class PriArchiveTaskStudyCommand
|
||||
{
|
||||
//public string StudyInstanceUid { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
||||
public decimal FileSize { get; set; }
|
||||
|
||||
public bool IsDicomReUpload { get; set; }
|
||||
@@ -189,34 +187,73 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public int FileCount { get; set; }
|
||||
}
|
||||
|
||||
public class NewArchiveStudyCommand
|
||||
public class PreArchiveDicomStudyCommand
|
||||
{
|
||||
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
||||
public decimal FileSize { get; set; }
|
||||
|
||||
public bool IsDicomReUpload { get; set; }
|
||||
|
||||
|
||||
public int FileCount { get; set; }
|
||||
}
|
||||
|
||||
public class TaskArchiveStudyCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid StudyMonitorId { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid StudyMonitorId { get; set; }
|
||||
|
||||
public int FailedFileCount { get; set; }
|
||||
|
||||
public string RecordPath { get; set; } = string.Empty;
|
||||
|
||||
public AddOrUpdateStudyDto Study { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public class NewArchiveStudyCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid TrialSiteId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid StudyMonitorId { get; set; }
|
||||
|
||||
public int FailedFileCount { get; set; }
|
||||
|
||||
public string RecordPath { get; set; } = string.Empty;
|
||||
|
||||
public AddOrUpdateStudyDto Study { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class AddOrUpdateStudyDto
|
||||
{
|
||||
|
||||
|
||||
public string StudyId { get; set; } = string.Empty;
|
||||
|
||||
|
||||
//public int Code { get; set; } = 0;
|
||||
|
||||
//public string StudyCode { get; set; } = string.Empty;
|
||||
@@ -271,7 +308,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public string AcquisitionNumber { get; set; } = string.Empty;
|
||||
public string TriggerTime { get; set; } = string.Empty;
|
||||
|
||||
public string ImageResizePath { get; set; }=string.Empty;
|
||||
public string ImageResizePath { get; set; } = string.Empty;
|
||||
public List<AddInstanceDto> InstanceList { get; set; }
|
||||
|
||||
public Guid? VisitTaskId { get; set; }
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
}
|
||||
|
||||
|
||||
var (physicalPath, relativePath) = FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
var (physicalPath, relativePath) = FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
|
||||
dicomInstance.Path = relativePath;
|
||||
|
||||
@@ -270,7 +270,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty),
|
||||
|
||||
|
||||
SiteId = addtionalInfo.SiteId,
|
||||
TrialId = addtionalInfo.TrialId,
|
||||
SubjectId = addtionalInfo.SubjectId,
|
||||
SubjectVisitId = addtionalInfo.SubjectVisitId,
|
||||
@@ -400,7 +399,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
AcquisitionNumber = dataset.GetSingleValueOrDefault(DicomTag.AcquisitionNumber, string.Empty),
|
||||
TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty),
|
||||
|
||||
SiteId = dicomStudy.SiteId,
|
||||
TrialId = dicomStudy.TrialId,
|
||||
SubjectId = dicomStudy.SubjectId,
|
||||
SubjectVisitId = dicomStudy.SubjectVisitId,
|
||||
@@ -433,7 +431,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
StudyId = dicomStudy.Id,
|
||||
SeriesId = dicomSeries.Id,
|
||||
|
||||
SiteId = dicomStudy.SiteId,
|
||||
TrialId = dicomStudy.TrialId,
|
||||
SubjectId = dicomStudy.SubjectId,
|
||||
SubjectVisitId = dicomStudy.SubjectVisitId,
|
||||
@@ -536,7 +533,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty),
|
||||
|
||||
|
||||
SiteId = Guid.Empty,
|
||||
TrialId = Guid.Empty,
|
||||
SubjectId = Guid.Empty,
|
||||
SubjectVisitId = Guid.Empty,
|
||||
@@ -607,7 +603,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
AcquisitionNumber = dataset.GetSingleValueOrDefault(DicomTag.AcquisitionNumber, string.Empty),
|
||||
TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty),
|
||||
|
||||
SiteId = Guid.Empty,
|
||||
TrialId = Guid.Empty,
|
||||
SubjectId = Guid.Empty,
|
||||
SubjectVisitId = Guid.Empty,
|
||||
@@ -630,7 +625,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
StudyInstanceUid = findStudy.StudyInstanceUid,
|
||||
SeriesInstanceUid = findSerice.SeriesInstanceUid,
|
||||
|
||||
SiteId = Guid.Empty,
|
||||
TrialId = Guid.Empty,
|
||||
SubjectId = Guid.Empty,
|
||||
SubjectVisitId = Guid.Empty,
|
||||
|
||||
@@ -0,0 +1,771 @@
|
||||
using EasyCaching.Core;
|
||||
using FellowOakDicom;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using MassTransit;
|
||||
using MathNet.Numerics;
|
||||
using Medallion.Threading;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
public interface IDownloadAndUploadService
|
||||
{
|
||||
Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true);
|
||||
}
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class DownloadAndUploadService : BaseService, IDownloadAndUploadService
|
||||
{
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly IRepository<SystemAnonymization> _systemAnonymizationRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
private readonly IOSSService _oSSService;
|
||||
private readonly IRepository<StudyMonitor> _studyMonitorRepository;
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
public DownloadAndUploadService(IEasyCachingProvider provider, IRepository<SystemAnonymization> systemAnonymizationRepository, IRepository<SubjectVisit> subjectVisitRepository, IOSSService oSSService,
|
||||
IRepository<StudyMonitor> studyMonitorRepository, IDistributedLockProvider distributedLockProvider, IRepository<VisitTask> visitTaskRepository)
|
||||
{
|
||||
_systemAnonymizationRepository = systemAnonymizationRepository;
|
||||
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
|
||||
_oSSService = oSSService;
|
||||
_studyMonitorRepository = studyMonitorRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
_provider = provider;
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 受试者随机阅片,任务进行随机编号
|
||||
/// 进入阅片任务前,随机挑选出该受试者的一个任务,然后给该任务一个编号,编号给的逻辑是:TimePoint Ran+ 已阅任务数量+1
|
||||
/// 根据当前受试者该标准已阅任务数量(生效失效的任务都算,考虑重阅,最后编号不重复) 第一个就是TimePoint Ran1,后面依次随机挑选出来的阅片序号依次递增
|
||||
/// </summary>
|
||||
/// <param name="subjectId"></param>
|
||||
/// <param name="trialReadingCriterionId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> SubejctRandomReadingTaskNameDeal(Guid subjectId, Guid trialReadingCriterionId)
|
||||
{
|
||||
//subject 随机阅片 才处理任务编号
|
||||
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom))
|
||||
{
|
||||
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskBlindName == "Timepoint" && t.ReadingCategory == ReadingCategory.Visit
|
||||
&& (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze), true).ToListAsync();
|
||||
|
||||
if (needDealTaskList.Count > 0)
|
||||
{
|
||||
//已完成的访视任务数量(包含重阅的)
|
||||
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit);
|
||||
|
||||
//已经处理过的任务名称的数量
|
||||
|
||||
var haveDealedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit && t.TaskBlindName != "Timepoint");
|
||||
|
||||
|
||||
|
||||
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
||||
List<int> availableNumbers = Enumerable.Range(haveDealedTaskCount + haveFinishedTaskCount + 1, needDealTaskList.Count).ToList();
|
||||
Random rng = new Random();
|
||||
foreach (var visitTask in needDealTaskList)
|
||||
{
|
||||
int randomIndex = rng.Next(availableNumbers.Count);
|
||||
|
||||
visitTask.TaskBlindName = $"Timepoint Ran {availableNumbers[randomIndex]}";
|
||||
|
||||
availableNumbers.RemoveAt(randomIndex);
|
||||
}
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取该受试者任务上传列表(展示已上传情况)
|
||||
/// </summary>
|
||||
/// <param name="subjectId"></param>
|
||||
/// <param name="trialReadingCriterionId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput<List<SubjectImageUploadDTO>>> GetSubjectImageUploadList(Guid subjectId, Guid trialReadingCriterionId)
|
||||
{
|
||||
await SubejctRandomReadingTaskNameDeal(subjectId, trialReadingCriterionId);
|
||||
|
||||
var query = _repository.Where<VisitTask>(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.SourceSubjectVisitId != null
|
||||
&& t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||
.Select(u => new SubjectImageUploadDTO()
|
||||
{
|
||||
VisitTaskId = u.Id,
|
||||
|
||||
SubejctId = u.SubjectId,
|
||||
|
||||
TrialSiteId = u.Subject.TrialSiteId,
|
||||
|
||||
IsImageFilter = u.TrialReadingCriterion.IsImageFilter,
|
||||
|
||||
CriterionModalitys = u.TrialReadingCriterion.CriterionModalitys,
|
||||
|
||||
SubjectCode = u.IsSelfAnalysis == true ? u.BlindSubjectCode : u.Subject.Code,
|
||||
TaskBlindName = u.TaskBlindName,
|
||||
TaskName = u.TaskName,
|
||||
|
||||
SourceSubjectVisitId = u.SourceSubjectVisitId,
|
||||
PackState = u.SourceSubjectVisit.PackState,
|
||||
|
||||
OrginalStudyList = u.SourceSubjectVisit.StudyList
|
||||
.Where(t => u.TrialReadingCriterion.IsImageFilter ? ("|" + u.TrialReadingCriterion.CriterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|") : true)
|
||||
.Select(t => new StudyBasicInfo()
|
||||
{
|
||||
Id = t.Id,
|
||||
StudyInstanceUid = t.StudyInstanceUid,
|
||||
ModalityForEdit = t.ModalityForEdit,
|
||||
BodyPartExamined = t.BodyPartExamined,
|
||||
BodyPartForEdit = t.BodyPartForEdit,
|
||||
|
||||
StudyCode = t.StudyCode,
|
||||
StudyTime = t.StudyTime,
|
||||
Description = t.Description,
|
||||
InstanceCount = t.InstanceCount,
|
||||
Modalities = t.Modalities,
|
||||
SeriesCount = t.SeriesCount,
|
||||
}).ToList(),
|
||||
|
||||
UploadStudyList = u.TaskStudyList.Select(t => new StudyBasicInfo()
|
||||
{
|
||||
Id = t.Id,
|
||||
StudyInstanceUid = t.StudyInstanceUid,
|
||||
ModalityForEdit = t.ModalityForEdit,
|
||||
BodyPartExamined = t.BodyPartExamined,
|
||||
BodyPartForEdit = t.BodyPartForEdit,
|
||||
|
||||
StudyCode = t.StudyCode,
|
||||
StudyTime = t.StudyTime,
|
||||
Description = t.Description,
|
||||
InstanceCount = t.InstanceCount,
|
||||
Modalities = t.Modalities,
|
||||
SeriesCount = t.SeriesCount,
|
||||
|
||||
SopInstanceUidList = t.InstanceList.Select(t => t.SopInstanceUid).ToList(),
|
||||
|
||||
}).ToList()
|
||||
})
|
||||
;
|
||||
|
||||
var list = await query.ToListAsync();
|
||||
|
||||
return ResponseOutput.Ok(list);
|
||||
}
|
||||
|
||||
private void SpecialArchiveStudyDeal(TaskStudy study)
|
||||
{
|
||||
#region 特殊逻辑
|
||||
|
||||
|
||||
if (study.PatientBirthDate.Length == 8)
|
||||
{
|
||||
study.PatientBirthDate = $"{study.PatientBirthDate[0]}{study.PatientBirthDate[1]}{study.PatientBirthDate[2]}{study.PatientBirthDate[3]}-{study.PatientBirthDate[4]}{study.PatientBirthDate[5]}-{study.PatientBirthDate[6]}{study.PatientBirthDate[7]}";
|
||||
}
|
||||
|
||||
var dicModalityList = _repository.Where<Dictionary>(t => t.Code == "Modality").SelectMany(t => t.ChildList.Select(c => c.Value)).ToList();
|
||||
|
||||
|
||||
var modality = study.Modalities;
|
||||
|
||||
var modalityForEdit = dicModalityList.Contains(modality) ? modality : String.Empty;
|
||||
|
||||
if (modality == "MR")
|
||||
{
|
||||
modalityForEdit = "MRI";
|
||||
}
|
||||
|
||||
if (modality == "PT")
|
||||
{
|
||||
modalityForEdit = "PET";
|
||||
}
|
||||
if (modality == "PT、CT")
|
||||
{
|
||||
modalityForEdit = "PET-CT";
|
||||
}
|
||||
|
||||
study.ModalityForEdit = modalityForEdit;
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
public async Task<IResponseOutput> PreArchiveDicomStudy(PriArchiveTaskStudyCommand preArchiveStudyCommand)
|
||||
{
|
||||
|
||||
var studyMonitor = new StudyMonitor()
|
||||
{
|
||||
TrialId = preArchiveStudyCommand.TrialId,
|
||||
SubjectId = preArchiveStudyCommand.SubjectId,
|
||||
SubjectVisitId = preArchiveStudyCommand.SubjectVisitId,
|
||||
|
||||
IsSuccess = false,
|
||||
UploadStartTime = DateTime.Now,
|
||||
IsDicom = true,
|
||||
IP = _userInfo.IP,
|
||||
|
||||
IsDicomReUpload = preArchiveStudyCommand.IsDicomReUpload,
|
||||
FileSize = preArchiveStudyCommand.FileSize,
|
||||
FileCount = preArchiveStudyCommand.FileCount,
|
||||
|
||||
};
|
||||
|
||||
|
||||
var addEntity = await _studyMonitorRepository.AddAsync(studyMonitor, true);
|
||||
|
||||
return ResponseOutput.Ok(addEntity.Id);
|
||||
|
||||
}
|
||||
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
public async Task<IResponseOutput> AddOrUpdateArchiveTaskStudy(TaskArchiveStudyCommand incommand)
|
||||
{
|
||||
#region 获取该subject 已生成任务的访视的检查
|
||||
|
||||
var queryStudy = _repository.Where<VisitTask>(t => t.SubjectId == incommand.SubjectId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id).Select(u => new
|
||||
{
|
||||
VisitTaskId = u.Id,
|
||||
SourceSubjectVisitId = u.SourceSubjectVisitId,
|
||||
OrginalStudyList = u.SourceSubjectVisit.StudyList.Select(t => new StudyBasicInfo()
|
||||
{
|
||||
Id = t.Id,
|
||||
StudyInstanceUid = t.StudyInstanceUid
|
||||
}).ToList(),
|
||||
});
|
||||
|
||||
var studyList = await queryStudy.ToListAsync();
|
||||
|
||||
|
||||
var findOriginStudy = studyList.FirstOrDefault(c => c.OrginalStudyList.Any(t => t.StudyInstanceUid == incommand.Study.StudyInstanceUid));
|
||||
|
||||
if (findOriginStudy == null)
|
||||
{
|
||||
return ResponseOutput.NotOk("该检查不属于该受试者,请核查");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
var modalitys = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
var trialId = incommand.TrialId;
|
||||
|
||||
|
||||
var studyMonitor = await _studyMonitorRepository.FirstOrDefaultAsync(t => t.Id == incommand.StudyMonitorId);
|
||||
studyMonitor.UploadFinishedTime = DateTime.Now;
|
||||
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||
studyMonitor.FailedFileCount = incommand.FailedFileCount;
|
||||
studyMonitor.IsSuccess = incommand.FailedFileCount == 0;
|
||||
studyMonitor.RecordPath = incommand.RecordPath;
|
||||
|
||||
//上传
|
||||
if (studyMonitor.IsDicomReUpload == false)
|
||||
{
|
||||
var study = _mapper.Map<TaskStudy>(incommand.Study);
|
||||
|
||||
var @lock = _distributedLockProvider.CreateLock($"StudyCode");
|
||||
|
||||
using (await @lock.AcquireAsync())
|
||||
{
|
||||
//查询数据库获取最大的Code 没有记录则为0
|
||||
var dbStudyCodeIntMax = _repository.Where<TaskStudy>(s => s.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||
|
||||
//获取缓存中的值 并发的时候,需要记录,已被占用的值 这样其他线程在此占用的最大的值上递增
|
||||
var cacheMaxCodeInt = _provider.Get<int>($"{trialId}_{StaticData.CacheKey.StudyMaxCode}").Value;
|
||||
|
||||
int currentNextCodeInt = cacheMaxCodeInt > dbStudyCodeIntMax ? cacheMaxCodeInt + 1 : dbStudyCodeIntMax + 1;
|
||||
study.Code = currentNextCodeInt;
|
||||
|
||||
study.StudyCode = AppSettings.GetCodeStr(currentNextCodeInt, nameof(DicomStudy));
|
||||
|
||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.StudyMaxCode}", study.Code, TimeSpan.FromMinutes(30));
|
||||
|
||||
}
|
||||
|
||||
|
||||
study.Id = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
study.TrialId = incommand.TrialId;
|
||||
study.SubjectId = incommand.SubjectId;
|
||||
study.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
//study.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
||||
//特殊处理逻辑
|
||||
study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Distinct());
|
||||
SpecialArchiveStudyDeal(study);
|
||||
modalitys = study.Modalities;
|
||||
|
||||
await _repository.AddAsync(study);
|
||||
|
||||
|
||||
studyMonitor.StudyId = study.Id;
|
||||
studyMonitor.StudyCode = study.StudyCode;
|
||||
|
||||
|
||||
foreach (var seriesItem in incommand.Study.SeriesList)
|
||||
{
|
||||
var series = _mapper.Map<TaskSeries>(seriesItem);
|
||||
|
||||
series.Id = IdentifierHelper.CreateGuid(seriesItem.StudyInstanceUid, seriesItem.SeriesInstanceUid, incommand.TrialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
//series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
series.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
|
||||
//前端传递的数量不准,上传的时候,把失败的也加进来了,以实际数组的数字为准
|
||||
series.InstanceCount = seriesItem.InstanceList.Count;
|
||||
|
||||
await _repository.AddAsync(series);
|
||||
|
||||
foreach (var instanceItem in seriesItem.InstanceList)
|
||||
{
|
||||
var isntance = _mapper.Map<TaskInstance>(instanceItem);
|
||||
|
||||
Guid instanceId = IdentifierHelper.CreateGuid(study.StudyInstanceUid, series.SeriesInstanceUid, isntance.SopInstanceUid, study.TrialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
|
||||
isntance.Id = instanceId;
|
||||
isntance.StudyId = study.Id;
|
||||
isntance.SeriesId = series.Id;
|
||||
|
||||
isntance.TrialId = incommand.TrialId;
|
||||
isntance.SubjectId = incommand.SubjectId;
|
||||
//isntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
isntance.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
|
||||
await _repository.AddAsync(isntance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var studyId = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
|
||||
var study = await _repository.FirstOrDefaultAsync<TaskStudy>(t => t.Id == studyId);
|
||||
|
||||
//重传的时候也要赋值检查Id
|
||||
studyMonitor.StudyId = study.Id;
|
||||
studyMonitor.StudyCode = study.StudyCode;
|
||||
|
||||
//特殊处理逻辑
|
||||
study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Union(study.Modalities.Split("、", StringSplitOptions.RemoveEmptyEntries)).Distinct());
|
||||
SpecialArchiveStudyDeal(study);
|
||||
modalitys = study.Modalities;
|
||||
|
||||
|
||||
// 少了整个序列
|
||||
|
||||
//某个序列下少了instance
|
||||
foreach (var seriesItem in incommand.Study.SeriesList)
|
||||
{
|
||||
var seriesId = IdentifierHelper.CreateGuid(seriesItem.StudyInstanceUid, seriesItem.SeriesInstanceUid, trialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
|
||||
TaskSeries dicomSeries = await _repository.FirstOrDefaultAsync<TaskSeries>(t => t.Id == seriesId);
|
||||
|
||||
//判断重复
|
||||
if (dicomSeries == null)
|
||||
{
|
||||
var series = _mapper.Map<TaskSeries>(seriesItem);
|
||||
|
||||
series.Id = seriesId;
|
||||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
series.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
//series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
||||
dicomSeries = await _repository.AddAsync(series);
|
||||
|
||||
//新的序列 那么 检查的序列数量+1
|
||||
study.SeriesCount += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//该序列掉了instance
|
||||
dicomSeries.InstanceCount += seriesItem.InstanceList.Count;
|
||||
}
|
||||
|
||||
foreach (var instanceItem in seriesItem.InstanceList)
|
||||
{
|
||||
var insntance = _mapper.Map<TaskInstance>(instanceItem);
|
||||
insntance.Id = IdentifierHelper.CreateGuid(insntance.StudyInstanceUid, insntance.SeriesInstanceUid, insntance.SopInstanceUid, trialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
insntance.StudyId = study.Id;
|
||||
insntance.SeriesId = dicomSeries.Id;
|
||||
|
||||
insntance.TrialId = incommand.TrialId;
|
||||
insntance.SubjectId = incommand.SubjectId;
|
||||
insntance.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
|
||||
await _repository.AddAsync(insntance);
|
||||
}
|
||||
|
||||
|
||||
// 不管是新的序列 还是 该序列 掉了Instance 重传的时候 检查的instance 数量都会增加
|
||||
study.InstanceCount += seriesItem.InstanceList.Count;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
var @lock2 = _distributedLockProvider.CreateLock($"StudyCommit");
|
||||
|
||||
using (await @lock2.AcquireAsync())
|
||||
{
|
||||
await _repository.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
return ResponseOutput.NotOk(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_provider.Remove($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok(modalitys);
|
||||
}
|
||||
|
||||
|
||||
[HttpDelete]
|
||||
public async Task<IResponseOutput> DeleteTaskStudy(Guid visitTaskId)
|
||||
{
|
||||
|
||||
await _repository.BatchDeleteAsync<TaskStudy>(t => t.VisitTaskId == visitTaskId);
|
||||
await _repository.BatchDeleteAsync<TaskSeries>(t => t.VisitTaskId == visitTaskId);
|
||||
await _repository.BatchDeleteAsync<TaskInstance>(t => t.VisitTaskId == visitTaskId);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
/// <summary>
|
||||
/// 打包和匿名化影像 默认是匿名化打包,也可以不匿名化打包
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="subjectVisitId"></param>
|
||||
/// <param name="isDicom"></param>
|
||||
/// <param name="isAnonymize"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<IResponseOutput> RequestPackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true)
|
||||
{
|
||||
|
||||
|
||||
var extralConfig = _repository.Where<Trial>(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
|
||||
|
||||
var config = JsonConvert.DeserializeObject<TrialExtraConfig>(extralConfig) ?? new TrialExtraConfig();
|
||||
|
||||
if (config.IsSupportQCDownloadImage == false)
|
||||
{
|
||||
throw new BusinessValidationFailedException("该项目不支持QC下载影像");
|
||||
}
|
||||
|
||||
var subjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
||||
|
||||
var sujectCode = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => t.Subject.Code).FirstOrDefaultAsync();
|
||||
|
||||
var packState = isDicom ? subjectVisit.PackState : subjectVisit.NoDicomPackState;
|
||||
|
||||
if (packState == PackState.WaitPack)
|
||||
{
|
||||
|
||||
if (isDicom)
|
||||
{
|
||||
subjectVisit.PackState = PackState.Packing;
|
||||
HangfireJobHelper.NotImmediatelyOnceOnlyJob<IDownloadAndUploadService>(t => t.PackageAndAnonymizImage(trialId, subjectVisitId, true, isAnonymize), TimeSpan.FromSeconds(1));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
subjectVisit.NoDicomPackState = PackState.Packing;
|
||||
|
||||
HangfireJobHelper.NotImmediatelyOnceOnlyJob<IDownloadAndUploadService>(t => t.PackageAndAnonymizImage(trialId, subjectVisitId, false, isAnonymize), TimeSpan.FromSeconds(1));
|
||||
}
|
||||
|
||||
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(isDicom ? subjectVisit.VisitImageZipPath : subjectVisit.VisitNoDicomImageZipPath,
|
||||
new { FileName = $"{sujectCode}_{subjectVisit.VisitName}_ImageStudy_{(isDicom ? "Dicom" : "NoneDicom")}.zip" });
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 后台任务调用,前端忽略该接口
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="subjectVisitId"></param>
|
||||
/// <param name="isDicom"></param>
|
||||
/// <param name="isAnonymize"></param>
|
||||
/// <returns></returns>
|
||||
public async Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true)
|
||||
{
|
||||
|
||||
var subjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
||||
|
||||
try
|
||||
{
|
||||
var addOrUpdateFixedFieldList = new List<SystemAnonymization>();
|
||||
|
||||
var ircFieldList = new List<SystemAnonymization>();
|
||||
|
||||
if (isAnonymize)
|
||||
{
|
||||
var systemAnonymizationList = _systemAnonymizationRepository.Where(t => t.IsEnable).ToList();
|
||||
|
||||
addOrUpdateFixedFieldList = systemAnonymizationList.Where(t => t.IsFixed).ToList();
|
||||
|
||||
ircFieldList = systemAnonymizationList.Where(t => t.IsFixed == false).ToList();
|
||||
}
|
||||
|
||||
var subjectAndVisitInfo = _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => new { SubjectCode = t.Subject.Code, t.Trial.TrialCode, t.VisitNum }).FirstOrDefault();
|
||||
|
||||
var query = from sv in _subjectVisitRepository.Where(t => t.Id == subjectVisitId)
|
||||
|
||||
select new
|
||||
{
|
||||
SubjectCode = sv.Subject.Code,
|
||||
VisitName = sv.VisitName,
|
||||
StudyList = sv.StudyList.Select(u => new
|
||||
{
|
||||
u.PatientId,
|
||||
u.StudyTime,
|
||||
u.StudyCode,
|
||||
|
||||
SeriesList = u.SeriesList.Select(z => new
|
||||
{
|
||||
z.Modality,
|
||||
|
||||
InstancePathList = z.DicomInstanceList.Select(k => new
|
||||
{
|
||||
k.Path
|
||||
})
|
||||
})
|
||||
|
||||
}),
|
||||
|
||||
NoneDicomStudyList = sv.NoneDicomStudyList.Select(nd => new
|
||||
{
|
||||
nd.Modality,
|
||||
nd.StudyCode,
|
||||
nd.ImageDate,
|
||||
|
||||
FileList = nd.NoneDicomFileList.Select(file => new
|
||||
{
|
||||
file.FileName,
|
||||
file.Path,
|
||||
file.FileType
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
var info = query.FirstOrDefault();
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
// 创建一个临时文件夹来存放文件
|
||||
string tempFolderPath = Path.Combine(Directory.GetCurrentDirectory(), $"DownloadTemp_{NewId.NextGuid()}");
|
||||
Directory.CreateDirectory(tempFolderPath);
|
||||
|
||||
//dicom 处理
|
||||
|
||||
if (isDicom)
|
||||
{
|
||||
// 遍历查询结果
|
||||
foreach (var studyInfo in info.StudyList)
|
||||
{
|
||||
// 遍历 Series
|
||||
foreach (var seriesInfo in studyInfo.SeriesList)
|
||||
{
|
||||
string studyDicomFolderPath = Path.Combine(tempFolderPath, "Dicom",/* $"{info.SubjectCode}_{info.VisitName}",*/ $"{studyInfo.StudyCode}_{studyInfo.StudyTime?.ToString("yyyy-MM-dd")}_{seriesInfo.Modality}");
|
||||
|
||||
// 创建 影像 文件夹
|
||||
Directory.CreateDirectory(studyDicomFolderPath);
|
||||
|
||||
// 遍历 InstancePathList
|
||||
foreach (var instanceInfo in seriesInfo.InstancePathList)
|
||||
{
|
||||
// 复制文件到相应的文件夹
|
||||
string destinationPath = Path.Combine(studyDicomFolderPath, Path.GetFileName(instanceInfo.Path));
|
||||
|
||||
//下载到当前目录
|
||||
await _oSSService.DownLoadFromOSSAsync(instanceInfo.Path, destinationPath);
|
||||
|
||||
#region 匿名化逻辑
|
||||
|
||||
|
||||
if (isAnonymize)
|
||||
{
|
||||
//受试者随机阅片,需要匿名化检查时间
|
||||
DicomFile dicomFile = await DicomFile.OpenAsync(destinationPath, Encoding.Default);
|
||||
DicomDataset dataset = dicomFile.Dataset;
|
||||
dataset.AddOrUpdate(DicomTag.StudyDate, string.Empty);
|
||||
dataset.AddOrUpdate(DicomTag.StudyTime, string.Empty);
|
||||
|
||||
#region 前端已经匿名化,不需要做相关tag匿名化
|
||||
//DicomFile dicomFile = await DicomFile.OpenAsync(destinationPath, Encoding.Default);
|
||||
|
||||
//DicomDataset dataset = dicomFile.Dataset;
|
||||
|
||||
//foreach (var item in addOrUpdateFixedFieldList)
|
||||
//{
|
||||
|
||||
// var dicomTag = new DicomTag(Convert.ToUInt16(item.Group, 16), Convert.ToUInt16(item.Element, 16));
|
||||
|
||||
// dataset.AddOrUpdate(dicomTag, item.ReplaceValue);
|
||||
//}
|
||||
|
||||
//foreach (var item in ircFieldList)
|
||||
//{
|
||||
|
||||
// var dicomTag = new DicomTag(Convert.ToUInt16(item.Group, 16), Convert.ToUInt16(item.Element, 16));
|
||||
|
||||
// if (dicomTag == DicomTag.ClinicalTrialProtocolID)
|
||||
// {
|
||||
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialCode);
|
||||
|
||||
// }
|
||||
// if (dicomTag == DicomTag.ClinicalTrialSiteID)
|
||||
// {
|
||||
// //dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialSiteCode);
|
||||
|
||||
// }
|
||||
// if (dicomTag == DicomTag.ClinicalTrialSubjectID)
|
||||
// {
|
||||
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.SubjectCode);
|
||||
|
||||
// }
|
||||
// if (dicomTag == DicomTag.ClinicalTrialTimePointID)
|
||||
// {
|
||||
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.VisitNum.ToString());
|
||||
|
||||
// }
|
||||
// if (dicomTag == DicomTag.PatientID)
|
||||
// {
|
||||
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialCode + "_" + subjectAndVisitInfo.SubjectCode);
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var zipDicomPath = Path.Combine(Directory.GetCurrentDirectory(), $"{info.SubjectCode}_{info.VisitName}_ImageStudy_Dicom.zip");
|
||||
ZipFile.CreateFromDirectory(Path.Combine(tempFolderPath, "Dicom"), zipDicomPath);
|
||||
//上传到Oss
|
||||
var relativeDicomPath = await _oSSService.UploadToOSSAsync(zipDicomPath, $"download_zip", false);
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { PackState = PackState.Packed, VisitImageZipPath = relativeDicomPath });
|
||||
|
||||
|
||||
File.Delete(zipDicomPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
var relativeNoneDicomPath = string.Empty;
|
||||
|
||||
if (info.NoneDicomStudyList.Count() == 1 && info.NoneDicomStudyList.SelectMany(t => t.FileList).Count() == 1)
|
||||
{
|
||||
relativeNoneDicomPath = info.NoneDicomStudyList.First().FileList.First().Path;
|
||||
}
|
||||
else
|
||||
{
|
||||
//非dicom 处理
|
||||
|
||||
foreach (var noneDicomStudy in info.NoneDicomStudyList)
|
||||
{
|
||||
string studyNoneDicomFolderPath = Path.Combine(tempFolderPath, "NoneDicom", /*$"{info.SubjectCode}_{info.VisitName}",*/ $"{noneDicomStudy.StudyCode}_{noneDicomStudy.ImageDate.ToString("yyyy-MM-dd")}_{noneDicomStudy.Modality}");
|
||||
|
||||
Directory.CreateDirectory(studyNoneDicomFolderPath);
|
||||
|
||||
foreach (var file in noneDicomStudy.FileList)
|
||||
{
|
||||
string destinationPath = Path.Combine(studyNoneDicomFolderPath, Path.GetFileName(file.FileName));
|
||||
|
||||
//下载到当前目录
|
||||
await _oSSService.DownLoadFromOSSAsync(HttpUtility.UrlDecode(file.Path) , destinationPath);
|
||||
}
|
||||
}
|
||||
|
||||
var zipNoneDicomPath = Path.Combine(Directory.GetCurrentDirectory(), $"{info.SubjectCode}_{info.VisitName}_ImageStudy_NoneDicom.zip");
|
||||
ZipFile.CreateFromDirectory(Path.Combine(tempFolderPath, "NoneDicom"), zipNoneDicomPath);
|
||||
relativeNoneDicomPath = await _oSSService.UploadToOSSAsync(zipNoneDicomPath, $"download_zip", false);
|
||||
|
||||
File.Delete(zipNoneDicomPath);
|
||||
}
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { PackState = PackState.Packed, VisitNoDicomImageZipPath = relativeNoneDicomPath });
|
||||
|
||||
|
||||
}
|
||||
|
||||
//清理文件夹
|
||||
Directory.Delete(tempFolderPath, true);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { PackState = PackState.WaitPack });
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -49,8 +49,8 @@ namespace IRaCIS.Core.Application.Services
|
||||
#endregion
|
||||
|
||||
var studyIds = await _studyRepository.AsQueryable()
|
||||
.Where(t => t.TrialId == imageShareCommand.TrialId && t.SubjectId == imageShareCommand.SubjectId &&
|
||||
t.SiteId == imageShareCommand.SiteId)
|
||||
.Where(t => t.TrialId == imageShareCommand.TrialId && t.SubjectId == imageShareCommand.SubjectId
|
||||
)
|
||||
.Select(u => u.Id).ToListAsync();
|
||||
|
||||
if (!studyIds.Any())
|
||||
|
||||
@@ -60,12 +60,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
path = (await _instanceRepository.Where(s => s.Id == instanceId).Select(t => t.Path).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
//DicomInstance dicomInstance = await _instanceRepository.FirstOrDefaultAsync(s => s.Id == instanceId).IfNullThrowException();
|
||||
|
||||
//DicomStudy dicomStudy = await _studyRepository.FirstOrDefaultAsync(s => s.Id == dicomInstance.StudyId).IfNullThrowException();
|
||||
|
||||
//var (physicalPath, relativePath) = FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
|
||||
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
||||
|
||||
using (var sw = ImageHelper.RenderPreviewJpeg(physicalPath))
|
||||
@@ -86,16 +80,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
var filePath = string.Empty;
|
||||
var path = (await _instanceRepository.Where(s => s.Id == instanceId).Select(t=>t.Path).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
//DicomStudy dicomStudy = await _studyRepository.FirstOrDefaultAsync(s => s.Id == dicomInstance.StudyId).IfNullThrowException();
|
||||
|
||||
////if (dicomInstance.Anonymize) //被匿名化
|
||||
////{
|
||||
//// filePath = _dicomFileStoreHelper.GetInstanceFilePath(dicomStudy, dicomInstance.SeriesId, dicomInstance.Id + ".Anonymize");
|
||||
////}
|
||||
|
||||
////else
|
||||
//var (physicalPath, relativePath) = FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
|
||||
|
||||
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
||||
|
||||
|
||||
@@ -39,36 +39,23 @@ namespace IRaCIS.Core.Application.Services
|
||||
ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime)
|
||||
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var idList = await _instanceRepository.Where(s => s.StudyId == studyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
||||
var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
||||
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
||||
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames,t.InstanceNumber }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames,t.InstanceNumber,t.HtmlPath }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||
|
||||
foreach (var item in seriesList)
|
||||
foreach (var series in seriesList)
|
||||
{
|
||||
item.InstanceList = idList.Where(s => s.SeriesId == item.Id).Select(u => u.Id).ToList();
|
||||
|
||||
//处理多帧
|
||||
item.InstancePathList = idList.Where(s => s.SeriesId == item.Id).OrderBy(t => t.InstanceNumber)
|
||||
.SelectMany(u =>
|
||||
{
|
||||
series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k =>
|
||||
new InstanceBasicInfo()
|
||||
{
|
||||
Id = k.Id,
|
||||
NumberOfFrames = k.NumberOfFrames,
|
||||
HtmlPath = k.HtmlPath,
|
||||
Path = k.Path,
|
||||
InstanceNumber = k.InstanceNumber,
|
||||
|
||||
if (u.NumberOfFrames > 1)
|
||||
{
|
||||
var pathList = new List<string>();
|
||||
|
||||
for (int i = 1; i <= u.NumberOfFrames; i++)
|
||||
{
|
||||
pathList.Add(u.Path + "?frame=" + (i - 1));
|
||||
}
|
||||
return pathList;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<string> { u.Path };
|
||||
|
||||
}
|
||||
})
|
||||
.ToList();
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
#region 暂时废弃
|
||||
|
||||
@@ -15,6 +15,9 @@ using Microsoft.AspNetCore.Http;
|
||||
using Newtonsoft.Json;
|
||||
using System.Threading;
|
||||
using Medallion.Threading;
|
||||
using System.Reactive.Subjects;
|
||||
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
||||
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
@@ -107,7 +110,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
var studyMonitor = new StudyMonitor()
|
||||
{
|
||||
TrialId = preArchiveStudyCommand.TrialId,
|
||||
SiteId = preArchiveStudyCommand.SiteId,
|
||||
SubjectId = preArchiveStudyCommand.SubjectId,
|
||||
SubjectVisitId = preArchiveStudyCommand.SubjectVisitId,
|
||||
|
||||
@@ -139,11 +141,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 上传临床数据
|
||||
/// </summary>
|
||||
/// <param name="incommand"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
public async Task<IResponseOutput> AddOrUpdateArchiveStudy(NewArchiveStudyCommand incommand)
|
||||
{
|
||||
@@ -158,8 +156,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
studyMonitor.UploadFinishedTime = DateTime.Now;
|
||||
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||
studyMonitor.FailedFileCount = incommand.FailedFileCount;
|
||||
studyMonitor.IsSuccess = incommand.FailedFileCount==0;
|
||||
studyMonitor.RecordPath=incommand.RecordPath;
|
||||
studyMonitor.IsSuccess = incommand.FailedFileCount == 0;
|
||||
studyMonitor.RecordPath = incommand.RecordPath;
|
||||
|
||||
//上传
|
||||
if (studyMonitor.IsDicomReUpload == false)
|
||||
@@ -189,10 +187,19 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
study.Id = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString());
|
||||
study.TrialId = incommand.TrialId;
|
||||
study.SiteId = incommand.SiteId;
|
||||
study.SubjectId = incommand.SubjectId;
|
||||
study.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
//如果因为意外情况,连续点击两次,导致第一次插入了,第二次进来也会插入,在此判断一下
|
||||
var findStudy = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == study.Id);
|
||||
|
||||
if (findStudy != null)
|
||||
{
|
||||
//直接返回
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//特殊处理逻辑
|
||||
study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Distinct());
|
||||
@@ -214,7 +221,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SiteId = incommand.SiteId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
@@ -234,7 +240,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
isntance.SeriesId = series.Id;
|
||||
|
||||
isntance.TrialId = incommand.TrialId;
|
||||
isntance.SiteId = incommand.SiteId;
|
||||
isntance.SubjectId = incommand.SubjectId;
|
||||
isntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
@@ -281,7 +286,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SiteId = incommand.SiteId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
@@ -305,7 +309,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
insntance.SeriesId = dicomSeries.Id;
|
||||
|
||||
insntance.TrialId = incommand.TrialId;
|
||||
insntance.SiteId = incommand.SiteId;
|
||||
insntance.SubjectId = incommand.SubjectId;
|
||||
insntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
@@ -355,14 +358,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
|
||||
var dicomStudyQuery = _repository.Where<DicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.Select(t => new UnionStudyViewModel()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.Subject.TrialSiteId,
|
||||
SubjectId = t.SubjectId,
|
||||
SubjectVisitId = t.SubjectVisitId,
|
||||
VisitName = t.SubjectVisit.VisitName,
|
||||
@@ -387,9 +390,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
StudyTime = t.StudyTime,
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = t.Uploader.UserName,
|
||||
|
||||
@@ -403,7 +406,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
|
||||
var nodeDicomStudyQuery = _repository.Where<NoneDicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
@@ -411,7 +414,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
.Select(t => new UnionStudyViewModel()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.Subject.TrialSiteId,
|
||||
SubjectId = t.SubjectId,
|
||||
SubjectVisitId = t.SubjectVisitId,
|
||||
VisitName = t.SubjectVisit.VisitName,
|
||||
@@ -436,9 +439,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
StudyTime = t.ImageDate,
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = t.CreateUser.UserName,
|
||||
|
||||
@@ -452,7 +455,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
var unionQuery = dicomStudyQuery.Union(nodeDicomStudyQuery)
|
||||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId);
|
||||
.WhereIf(studyQuery.TrialSiteId != null, t => t.TrialSiteId == studyQuery.TrialSiteId);
|
||||
|
||||
return await unionQuery.ToPagedListAsync(studyQuery.PageIndex, studyQuery.PageSize, studyQuery.SortField, studyQuery.Asc);
|
||||
}
|
||||
@@ -463,21 +466,21 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
var svExpression = QCCommon.GetStudyMonitorSubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
var StudyMonitorQuery = _repository.Where<StudyMonitor>(t => t.TrialId == studyQuery.TrialId, ignoreQueryFilters: true)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
|
||||
.WhereIf(studyQuery.IsDicom != null, t => t.IsDicom == studyQuery.IsDicom )
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.Uploader), t => t.Uploader.UserName.Contains(studyQuery.Uploader))
|
||||
.WhereIf(studyQuery.IsSuccess != null, t => t.IsSuccess == studyQuery.IsSuccess)
|
||||
.WhereIf(studyQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == studyQuery.TrialSiteId)
|
||||
.WhereIf(studyQuery.IsDicom != null, t => t.IsDicom == studyQuery.IsDicom)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.Uploader), t => t.Uploader.UserName.Contains(studyQuery.Uploader))
|
||||
.WhereIf(studyQuery.IsSuccess != null, t => t.IsSuccess == studyQuery.IsSuccess)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.StudyCode), t => t.StudyCode.Contains(studyQuery.StudyCode))
|
||||
.Select(t => new UnionStudyMonitorModel()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.Subject.TrialSiteId,
|
||||
SubjectId = t.SubjectId,
|
||||
SubjectVisitId = t.SubjectVisitId,
|
||||
VisitName = t.SubjectVisit.VisitName,
|
||||
@@ -488,9 +491,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
SubjectCode = t.Subject.Code,
|
||||
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = t.Uploader.UserName,
|
||||
|
||||
@@ -506,7 +509,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
ArchiveFinishedTime = t.ArchiveFinishedTime,
|
||||
|
||||
|
||||
RecordPath=t.RecordPath,
|
||||
RecordPath = t.RecordPath,
|
||||
|
||||
IsDicomReUpload = t.IsDicomReUpload,
|
||||
StudyId = t.Id,
|
||||
@@ -521,108 +524,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
|
||||
|
||||
#region 冗余查询
|
||||
//var dicomStudyQuery = _repository.Where<StudyMonitor>(t => t.TrialId == studyQuery.TrialId && t.IsDicom)
|
||||
// .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
// .WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
// .Select(t => new UnionStudyMonitorModel()
|
||||
// {
|
||||
// TrialId = t.TrialId,
|
||||
// SiteId = t.SiteId,
|
||||
// SubjectId = t.SubjectId,
|
||||
// SubjectVisitId = t.SubjectVisitId,
|
||||
// VisitName = t.SubjectVisit.VisitName,
|
||||
// VisitNum = t.SubjectVisit.VisitNum,
|
||||
|
||||
|
||||
|
||||
// SubjectCode = t.Subject.Code,
|
||||
|
||||
|
||||
// TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
|
||||
// TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
|
||||
// Uploader = t.Uploader.FullName,
|
||||
|
||||
// UploadTime = t.CreateTime,
|
||||
|
||||
|
||||
// IP = t.IP,
|
||||
// FileCount = t.FileCount,
|
||||
// FileSize = t.FileSize,
|
||||
// UploadFinishedTime = t.UploadFinishedTime,
|
||||
// UploadStartTime = t.UploadStartTime,
|
||||
|
||||
// TotalMillisecondsInterval = t.TotalMillisecondsInterval,
|
||||
|
||||
// IsDicomReUpload = t.IsDicomReUpload,
|
||||
// StudyId = t.Id,
|
||||
// IsDicom = t.IsDicom,
|
||||
|
||||
// StudyCode = t.DicomStudy.StudyCode
|
||||
// //DicomStudyCode = t.DicomStudy.StudyCode,
|
||||
// //NoneDicomCode = 0,
|
||||
|
||||
// });
|
||||
|
||||
////.ProjectTo<UnionStudyViewDodel>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
|
||||
//var nodeDicomStudyQuery = _repository.Where<StudyMonitor>(t => t.TrialId == studyQuery.TrialId && t.IsDicom == false)
|
||||
// .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
// .WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
|
||||
// .Select(t => new UnionStudyMonitorModel()
|
||||
// {
|
||||
|
||||
// TrialId = t.TrialId,
|
||||
// SiteId = t.SiteId,
|
||||
// SubjectId = t.SubjectId,
|
||||
// SubjectVisitId = t.SubjectVisitId,
|
||||
// VisitName = t.SubjectVisit.VisitName,
|
||||
// VisitNum = t.SubjectVisit.VisitNum,
|
||||
// SubjectCode = t.Subject.Code,
|
||||
// TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
// TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
// Uploader = t.Uploader.FullName,
|
||||
// UploadTime = t.CreateTime,
|
||||
|
||||
// IP = t.IP,
|
||||
// FileCount = t.FileCount,
|
||||
// FileSize = t.FileSize,
|
||||
// UploadFinishedTime = t.UploadFinishedTime,
|
||||
// UploadStartTime = t.UploadStartTime,
|
||||
|
||||
// TotalMillisecondsInterval = t.TotalMillisecondsInterval,
|
||||
|
||||
// IsDicomReUpload = t.IsDicomReUpload,
|
||||
// StudyId = t.Id,
|
||||
// IsDicom = t.IsDicom,
|
||||
|
||||
// StudyCode = t.NoneDicomStudy.StudyCode
|
||||
|
||||
// //DicomStudyCode = string.Empty,
|
||||
// //NoneDicomCode = t.NoneDicomStudy.Code,
|
||||
|
||||
// });
|
||||
|
||||
////.ProjectTo<UnionStudyViewDodel>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
//var unionQuery = dicomStudyQuery.Union(nodeDicomStudyQuery)
|
||||
// .WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
// .WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
// .WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId);
|
||||
|
||||
//return await unionQuery.ToPagedListAsync(studyQuery.PageIndex, studyQuery.PageSize, string.IsNullOrEmpty(studyQuery.SortField) ? "UploadTime" : studyQuery.SortField, studyQuery.Asc);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -636,18 +540,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
path = (await _dicomInstanceRepository.Where(s => s.StudyId == studyId).Select(t => t.Path).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
//DicomInstance dicomInstance = await _repository.FirstOrDefaultAsync<DicomInstance>(s => s.StudyId == studyId);
|
||||
|
||||
//if (dicomInstance != null)
|
||||
//{
|
||||
// DicomStudy dicomStudy = await _repository.FirstOrDefaultAsync<DicomStudy>(s => s.Id == dicomInstance.StudyId);
|
||||
// if (dicomStudy != null)
|
||||
// {
|
||||
// var( physicalPath ,relativePath )= FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
|
||||
// path = physicalPath;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
using (var sw = ImageHelper.RenderPreviewJpeg(path))
|
||||
{
|
||||
@@ -714,6 +607,124 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<List<VerifyStudyUploadResult>>> VerifyTaskStudyAllowUploadAsync(VerifyTaskUploadOrReupload verifyInfo)
|
||||
{
|
||||
|
||||
var queryStudy = _repository.Where<VisitTask>(t => t.SubjectId == verifyInfo.SubjectId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id).Select(u => new
|
||||
{
|
||||
VisitTaskId = u.Id,
|
||||
SourceSubjectVisitId = u.SourceSubjectVisitId,
|
||||
OrginalStudyList = u.SourceSubjectVisit.StudyList.Select(t => new StudyBasicInfo()
|
||||
{
|
||||
Id = t.Id,
|
||||
StudyInstanceUid = t.StudyInstanceUid
|
||||
}).ToList(),
|
||||
|
||||
UploadStudyList = u.TaskStudyList.Select(t => new
|
||||
{
|
||||
Id = t.Id,
|
||||
StudyInstanceUid = t.StudyInstanceUid,
|
||||
|
||||
SeriesList = t.SeriesList.Select(t => new UploadedSeries()
|
||||
{ SeriesId = t.Id, SeriesInstanceUid = t.SeriesInstanceUid, SOPInstanceUIDList = t.InstanceList.Select(c => c.SopInstanceUid).ToList() }).ToList()
|
||||
|
||||
|
||||
}).ToList()
|
||||
});
|
||||
|
||||
var studyList = await queryStudy.ToListAsync();
|
||||
|
||||
var resultList = new List<VerifyStudyUploadResult>();
|
||||
|
||||
var trialId = verifyInfo.TrialId;
|
||||
|
||||
var subjectId = verifyInfo.SubjectId;
|
||||
|
||||
var visitList = _repository.Where<SubjectVisit>(t => t.SubjectId == verifyInfo.SubjectId).Select(t => new { t.VisitNum, t.EarliestScanDate, t.LatestScanDate, t.Id }).ToList();
|
||||
|
||||
foreach (var waitUploadItem in verifyInfo.StudyInstanceUidList)
|
||||
{
|
||||
|
||||
var studyInstanceUid = waitUploadItem.StudyInstanceUid;
|
||||
|
||||
var result = new VerifyStudyUploadResult();
|
||||
|
||||
if (_provider.Exists($"StudyUid_{trialId}_{studyInstanceUid}") && _provider.Get<Guid>($"StudyUid_{trialId}_{studyInstanceUid}").Value != _userInfo.Id)
|
||||
{
|
||||
|
||||
result.AllowUpload = false;
|
||||
|
||||
result.AllowReUpload = false;
|
||||
result.StudyInstanceUid = studyInstanceUid;
|
||||
//---当前有人正在上传归档该检查!
|
||||
result.ErrorMesseage = _localizer["Study_UploadArchiving"];
|
||||
|
||||
resultList.Add(result);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var findOriginStudy = studyList.FirstOrDefault(c => c.OrginalStudyList.Any(t => t.StudyInstanceUid == studyInstanceUid));
|
||||
|
||||
|
||||
if (findOriginStudy == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException("该检查不属于该受试者,请核查");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (findOriginStudy.UploadStudyList.Any(t => t.StudyInstanceUid == studyInstanceUid))
|
||||
{
|
||||
result.AllowReUpload = true;
|
||||
result.AllowUpload = false;
|
||||
|
||||
result.UploadedSeriesList = findOriginStudy.UploadStudyList.Where(t => t.StudyInstanceUid == studyInstanceUid).SelectMany(t => t.SeriesList).ToList();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
result.AllowUpload = true;
|
||||
|
||||
result.AllowReUpload = false;
|
||||
}
|
||||
}
|
||||
|
||||
result.StudyInstanceUid = studyInstanceUid;
|
||||
|
||||
var @lock = _distributedLockProvider.CreateLock($"StudyUpload");
|
||||
|
||||
using (@lock.Acquire())
|
||||
{
|
||||
if (result.AllowReUpload || result.AllowUpload)
|
||||
{
|
||||
_provider.Set($"StudyUid_{trialId}_{studyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30));
|
||||
}
|
||||
else
|
||||
{
|
||||
_provider.Remove($"StudyUid_{trialId}_{studyInstanceUid}");
|
||||
}
|
||||
}
|
||||
resultList.Add(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var systemAnonymizationList = _repository.Where<SystemAnonymization>(t => t.IsEnable).ToList();
|
||||
|
||||
return ResponseOutput.Ok<List<VerifyStudyUploadResult>>(resultList, new
|
||||
{
|
||||
AnonymizeFixedList = systemAnonymizationList.Where(t => t.IsFixed).ToList(),
|
||||
AnonymizeNotFixedList = systemAnonymizationList.Where(t => t.IsFixed == false).ToList()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量验证 检查是否可以上传 并告知原因
|
||||
/// </summary>
|
||||
@@ -780,7 +791,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
|
||||
var result = new VerifyStudyUploadResult();
|
||||
|
||||
if (_provider.Exists($"StudyUid_{trialId}_{studyInstanceUid}") && _provider.Get<Guid>($"StudyUid_{trialId}_{studyInstanceUid}").Value!=_userInfo.Id)
|
||||
if (_provider.Exists($"StudyUid_{trialId}_{studyInstanceUid}") && _provider.Get<Guid>($"StudyUid_{trialId}_{studyInstanceUid}").Value != _userInfo.Id)
|
||||
{
|
||||
|
||||
result.AllowUpload = false;
|
||||
@@ -793,7 +804,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
return result;
|
||||
}
|
||||
|
||||
if (_repository.Where<Subject>(t => t.Id == SubjectId).Select(t => t.Status).FirstOrDefault() == SubjectStatus.EndOfVisit)
|
||||
if (_repository.Where<Domain.Models.Subject>(t => t.Id == SubjectId).Select(t => t.Status).FirstOrDefault() == SubjectStatus.EndOfVisit)
|
||||
{
|
||||
result.AllowUpload = false;
|
||||
|
||||
|
||||
@@ -17,8 +17,15 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<AddOrUpdateSeriesDto, DicomSeries>()
|
||||
.ForMember(d => d.DicomInstanceList, u => u.Ignore());
|
||||
|
||||
CreateMap<AddOrUpdateStudyDto, TaskStudy>()
|
||||
.ForMember(d => d.SeriesList, u => u.Ignore());
|
||||
CreateMap<AddOrUpdateSeriesDto, TaskSeries>()
|
||||
.ForMember(d => d.InstanceList, u => u.Ignore());
|
||||
|
||||
CreateMap<AddInstanceDto, DicomInstance>();
|
||||
|
||||
CreateMap<AddInstanceDto, TaskInstance>();
|
||||
|
||||
|
||||
CreateMap<DicomSeries, DicomSeriesWithLabelDTO>();
|
||||
|
||||
@@ -33,8 +40,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
CreateMap<DicomStudy, StudyDTO>().IncludeMembers(t => t.Subject, u => u.SubjectVisit)
|
||||
.ForMember(d => d.UploaderFirstName, u => u.MapFrom(s => s.Site.SiteName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Site.SiteName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteName))
|
||||
.ForMember(d => d.UploaderFirstName, u => u.MapFrom(s => s.Uploader.FirstName))
|
||||
.ForMember(d => d.UploaderLastName, u => u.MapFrom(s => s.Uploader.LastName))
|
||||
.ForMember(d => d.UploadedTime, u => u.MapFrom(s => s.CreateTime));
|
||||
@@ -80,6 +86,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<DicomInstance, DicomInstanceDTO>()
|
||||
.ForMember(o => o.IsDeleted, t => t.MapFrom(u => u.DicomSerie.IsDeleted))
|
||||
.ForMember(o => o.SliceThickness, t => t.MapFrom(u => u.DicomSerie.SliceThickness))
|
||||
.ForMember(o => o.IsReading, t => t.MapFrom(u => u.DicomSerie.IsReading));
|
||||
CreateMap<DicomStudy, DicomStudyDTO>();
|
||||
CreateMap<DicomSeries, DicomSeriesDTO>();
|
||||
@@ -97,8 +104,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
//.ForMember(d => d.Modality, u => u.MapFrom(s => s.Modalities))
|
||||
.ForMember(d => d.Bodypart, u => u.MapFrom(s => s.BodyPartExamined))
|
||||
.ForMember(d => d.StudyTime, u => u.MapFrom(s => s.StudyTime))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.IsDicom, u => u.MapFrom(s => true))
|
||||
.ForMember(d => d.Count, u => u.MapFrom(s => s.SeriesCount))
|
||||
.ForMember(d => d.VisitNum, u => u.MapFrom(s => s.SubjectVisit.VisitNum))
|
||||
@@ -109,8 +116,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
//.ForMember(d => d.Modality, u => u.MapFrom(s => s.Modalities))
|
||||
.ForMember(d => d.Bodypart, u => u.MapFrom(s => s.BodyPart))
|
||||
.ForMember(d => d.StudyTime, u => u.MapFrom(s => s.ImageDate))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.IsDicom, u => u.MapFrom(s => false))
|
||||
.ForMember(d => d.Count, u => u.MapFrom(s => s.NoneDicomFileList.Count()))
|
||||
.ForMember(d => d.VisitNum, u => u.MapFrom(s => s.SubjectVisit.VisitNum))
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
||||
{
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
public Guid? SubjectVisitId { get; set; }
|
||||
|
||||
@@ -336,7 +336,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public string Code { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -441,7 +441,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
||||
/// <summary>
|
||||
/// 中心
|
||||
/// </summary>
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 受试者
|
||||
@@ -480,6 +480,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
||||
/// </summary>
|
||||
public string OpByUserName { get; set; } = string.Empty;
|
||||
|
||||
public string? CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阅读片人
|
||||
/// </summary>
|
||||
@@ -509,6 +511,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
||||
public Guid? TrialReadingCriterionId { get; set; }
|
||||
|
||||
|
||||
public string? TaskName { get; set; }
|
||||
}
|
||||
|
||||
public class InspectionBase
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,10 +41,9 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
|
||||
join trial in _repository.GetQueryable<Trial>().IgnoreQueryFilters() on data.TrialId equals trial.Id into trialtemp
|
||||
from leftrial in trialtemp.DefaultIfEmpty()
|
||||
join site in _repository.GetQueryable<Site>().IgnoreQueryFilters() on data.SiteId equals site.Id into sitetemp
|
||||
from leftsite in sitetemp.DefaultIfEmpty()
|
||||
|
||||
join trialSite in _repository.GetQueryable<TrialSite>().IgnoreQueryFilters() on new { SiteId = leftsite.Id, Trialid = leftrial.Id } equals new { SiteId = trialSite.SiteId, Trialid = trialSite.TrialId } into trialSitetemp
|
||||
|
||||
join trialSite in _repository.GetQueryable<TrialSite>().IgnoreQueryFilters() on data.TrialSiteId equals trialSite.Id into trialSitetemp
|
||||
from lefttrialSite in trialSitetemp.DefaultIfEmpty()
|
||||
|
||||
|
||||
@@ -97,7 +96,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
BlindName = data.VisitTask.TaskBlindName,
|
||||
TaskName = data.VisitTask.TaskName,
|
||||
TrialId = data.TrialId,
|
||||
SiteId = data.SiteId,
|
||||
TrialSiteId = data.TrialSiteId,
|
||||
SubjectId = data.SubjectId,
|
||||
SubjectVisitId = data.SubjectVisitId,
|
||||
//OptType = data.OptType,
|
||||
@@ -161,7 +160,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
TrialReadingCriterionName = data.TrialReadingCriterion.CriterionName
|
||||
};
|
||||
|
||||
query = query.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId)
|
||||
query = query.WhereIf(dto.TrialSiteId != null, x => x.TrialSiteId == dto.TrialSiteId)
|
||||
//.Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime))
|
||||
.Where(x => x.TrialId == dto.TrialId )
|
||||
|
||||
@@ -183,8 +182,9 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
.WhereIf(dto.BatchId != null, x => x.BatchId == dto.BatchId)
|
||||
.WhereIf(dto.BatchId == null && dto.GeneralId != null, x => x.GeneralId == dto.GeneralId)
|
||||
.WhereIf(dto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == dto.TrialReadingCriterionId)
|
||||
|
||||
|
||||
|
||||
.WhereIf(!dto.TaskName.IsNullOrEmpty(), x => x.TaskName.Contains(dto.TaskName) || x.BlindName.Contains(dto.TaskName))
|
||||
.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
|
||||
.WhereIf(!dto.RoleName.IsNullOrEmpty(), x => x.RoleName.Contains(dto.RoleName))
|
||||
//.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo)
|
||||
@@ -194,6 +194,8 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
.WhereIf(dto.ModuleType != null, x => x.ModuleTypeId == dto.ModuleType)
|
||||
.WhereIf(!dto.Description.IsNullOrEmpty(), x => x.Description.Contains(dto.Description)|| x.DescriptionCN.Contains(dto.Description))
|
||||
.WhereIf(!dto.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.OpByUserName))
|
||||
.WhereIf(!dto.CreateUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.CreateUserName) || x.CreateUserRealName.Contains(dto.CreateUserName))
|
||||
|
||||
//.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
|
||||
.WhereIf(dto.IsSign != null, x => x.IsSign == dto.IsSign);
|
||||
#endregion
|
||||
|
||||
@@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Institution")]
|
||||
[ApiExplorerSettings(GroupName = "Institution")]
|
||||
public class CroService : BaseService, ICroService
|
||||
{
|
||||
private readonly IRepository<CRO> _croRepository;
|
||||
@@ -20,50 +20,53 @@ namespace IRaCIS.Application.Services
|
||||
/// <summary> 分页获取CRO列表 </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<CROCompanyDTO>> GetCroList(CROCompanyQueryDTO croCompanySearchModel)
|
||||
{
|
||||
{
|
||||
var croQueryable = _croRepository
|
||||
.WhereIf(!string.IsNullOrEmpty(croCompanySearchModel.CROName), t => t.CROName.Contains(croCompanySearchModel.CROName) || t.CRONameCN.Contains(croCompanySearchModel.CROName))
|
||||
.WhereIf(!string.IsNullOrEmpty(croCompanySearchModel.CROCode), t => t.CROCode.Contains(croCompanySearchModel.CROCode) )
|
||||
.WhereIf(!string.IsNullOrEmpty(croCompanySearchModel.CROCode), t => t.CROCode.Contains(croCompanySearchModel.CROCode))
|
||||
.ProjectTo<CROCompanyDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await croQueryable.ToPagedListAsync(croCompanySearchModel.PageIndex, croCompanySearchModel.PageSize,
|
||||
string.IsNullOrWhiteSpace(croCompanySearchModel.SortField) ? "CROName": croCompanySearchModel.SortField, croCompanySearchModel.Asc);
|
||||
return await croQueryable.ToPagedListAsync(croCompanySearchModel.PageIndex, croCompanySearchModel.PageSize,
|
||||
string.IsNullOrWhiteSpace(croCompanySearchModel.SortField) ? "CROName" : croCompanySearchModel.SortField, croCompanySearchModel.Asc);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary> 根据CRO 名称查询所有CRO 列表 </summary>
|
||||
public async Task<IEnumerable<CroSelectDTO>> GetAllCROList()
|
||||
public async Task<IEnumerable<CroSelectDTO>> GetAllCROList(Guid? trialId)
|
||||
{
|
||||
return await _croRepository.ProjectTo<CroSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
||||
return await _croRepository
|
||||
.WhereIf(trialId == null, t => t.IsTrialLevel == false)
|
||||
.WhereIf(trialId != null, t => t.IsTrialLevel == false || t.TrialId == trialId)
|
||||
.ProjectTo<CroSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary> 添加CRO信息 </summary>
|
||||
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateCro(CROCompanyDTO addCroCompanyCommand)
|
||||
{
|
||||
|
||||
var exp = new EntityVerifyExp<CRO>()
|
||||
{
|
||||
VerifyExp = cro => cro.CROName.Equals(addCroCompanyCommand.CROName) ,
|
||||
VerifyExp = cro => (cro.CROName.Equals(addCroCompanyCommand.CROName) || cro.CRONameCN.Equals(addCroCompanyCommand.CRONameCN)) && cro.IsTrialLevel == false,
|
||||
//---已经存在同名的CRO,请确认。
|
||||
VerifyMsg = _localizer["CRO_DupName"]
|
||||
};
|
||||
|
||||
var cro = await _croRepository.InsertOrUpdateAsync(addCroCompanyCommand, true, exp);
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok( cro.Id.ToString());
|
||||
|
||||
|
||||
return ResponseOutput.Ok(cro.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
/// <summary> 删除CRO信息 </summary>
|
||||
|
||||
|
||||
[HttpDelete("{croCompanyId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteCro(Guid cROCompanyId)
|
||||
public async Task<IResponseOutput> DeleteCro(Guid cROCompanyId)
|
||||
{
|
||||
if (await _trialRepository.AnyAsync(t => t.CROId == cROCompanyId))
|
||||
{
|
||||
@@ -74,7 +77,7 @@ namespace IRaCIS.Application.Services
|
||||
//{
|
||||
// return ResponseOutput.NotOk("该CRO下存在用户,暂时无法删除。");
|
||||
//}
|
||||
var success = await _croRepository.BatchDeleteNoTrackingAsync(x=>x.Id== cROCompanyId);
|
||||
var success = await _croRepository.BatchDeleteNoTrackingAsync(x => x.Id == cROCompanyId);
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
public string CRONameCN { get; set; } = string.Empty;
|
||||
|
||||
public bool IsTrialLevel { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class CroSelectDTO
|
||||
@@ -18,8 +22,6 @@ namespace IRaCIS.Application.Contracts
|
||||
public Guid Id { get; set; }
|
||||
public string CROName { get; set; } = string.Empty;
|
||||
public string CROCode { get; set; } = string.Empty;
|
||||
|
||||
public string CRONameCN { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class CROCompanyQueryDTO : PageInput
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
public class SiteDTO: SiteCommand
|
||||
{
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
|
||||
public class SiteCommand
|
||||
@@ -29,6 +29,8 @@ namespace IRaCIS.Application.Contracts
|
||||
public string DirectorPhone { get; set; } = string.Empty;
|
||||
public string ContactName { get; set; } = string.Empty;
|
||||
public string ContactPhone { get; set; } = string.Empty;
|
||||
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
}
|
||||
|
||||
public class SiteSelectionDTO
|
||||
@@ -44,6 +46,24 @@ namespace IRaCIS.Application.Contracts
|
||||
public string Country { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
|
||||
public class TrialSiteInQuery:PageInput
|
||||
{
|
||||
public string? TrialSiteName { get; set; }
|
||||
|
||||
public string? TrialCode { get; set; }
|
||||
}
|
||||
|
||||
public class TrialSiteAddView
|
||||
{
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string TrialCode { get; set; }
|
||||
|
||||
public string TrialSiteName { get; set; }
|
||||
|
||||
public string TrialSiteAliasName { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
public class SiteSelectDTO : SiteDTO
|
||||
{
|
||||
public string HospitalName { get; set; } = String.Empty;
|
||||
|
||||
@@ -17,6 +17,10 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
public string SponsorCode { get; set; } = String.Empty;
|
||||
|
||||
public bool IsTrialLevel { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SponsorQueryDTO : PageInput
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace IRaCIS.Application.Interfaces
|
||||
public interface ICroService
|
||||
{
|
||||
Task<PageOutput<CROCompanyDTO>> GetCroList(CROCompanyQueryDTO queryModel);
|
||||
Task<IEnumerable<CroSelectDTO>> GetAllCROList();
|
||||
Task<IEnumerable<CroSelectDTO>> GetAllCROList(Guid? croId);
|
||||
Task<IResponseOutput> AddOrUpdateCro(CROCompanyDTO addCroCompanyViewModel);
|
||||
Task<IResponseOutput> DeleteCro(Guid croCompanyId);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace IRaCIS.Application.Interfaces
|
||||
public interface ISponsorService
|
||||
{
|
||||
Task<PageOutput<SponsorDTO>> GetSponsorList(SponsorQueryDTO queryParam);
|
||||
Task<IEnumerable<SponsorSelectDTO>> GetAllSponsorList();
|
||||
Task<IEnumerable<SponsorSelectDTO>> GetAllSponsorList(Guid? sponsorId);
|
||||
Task<IResponseOutput> AddOrUpdateSponsor(SponsorCommand model);
|
||||
Task<IResponseOutput> DeleteSponsor(Guid sponsorId);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Medallion.Threading;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using System.Security.Policy;
|
||||
using Site = IRaCIS.Core.Domain.Models.Site;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -21,7 +23,7 @@ namespace IRaCIS.Application.Services
|
||||
_siteRepository = siteRepository;
|
||||
_trialSiteUserRepository = trialSiteUserRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
_hospitalRepository= hospitalRepository;
|
||||
_hospitalRepository = hospitalRepository;
|
||||
}
|
||||
|
||||
/// <summary> 分页获取研究中心列表 </summary>
|
||||
@@ -35,7 +37,7 @@ namespace IRaCIS.Application.Services
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Province.Contains(searchModel.Province))
|
||||
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
|
||||
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
|
||||
@@ -48,6 +50,22 @@ namespace IRaCIS.Application.Services
|
||||
return await _siteRepository.ProjectTo<SiteSelectionDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialSiteAddView>> GetTrialSiteList(TrialSiteInQuery inQuery)
|
||||
{
|
||||
var query = _repository.Where<TrialSite>(t => t.SiteId == null)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteName), t => t.TrialSiteName.Contains(inQuery.TrialSiteName) || t.TrialSiteAliasName.Contains(inQuery.TrialSiteName))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialCode), t => t.Trial.TrialCode.Contains(inQuery.TrialCode))
|
||||
.Select(t => new TrialSiteAddView()
|
||||
{
|
||||
TrialCode = t.Trial.TrialCode,
|
||||
TrialSiteAliasName = t.TrialSiteAliasName,
|
||||
TrialSiteId = t.Id,
|
||||
TrialSiteName = t.TrialSiteName
|
||||
});
|
||||
|
||||
return await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TrialSiteAddView.TrialCode) : inQuery.SortField, inQuery.Asc);
|
||||
}
|
||||
|
||||
/// <summary> 添加研究中心 </summary>
|
||||
|
||||
@@ -56,7 +74,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
var exp = new EntityVerifyExp<Site>()
|
||||
{
|
||||
VerifyExp = h => h.SiteName.Equals(siteCommand.SiteName) || h.SiteCode.Equals(siteCommand.SiteCode),
|
||||
VerifyExp = h => h.SiteName.Equals(siteCommand.SiteName) || h.SiteNameCN.Equals(siteCommand.SiteNameCN),
|
||||
//---已经存在同名的中心,请确认。
|
||||
VerifyMsg = _localizer["Site_DupName"]
|
||||
};
|
||||
@@ -82,15 +100,22 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
//手动绑
|
||||
if(siteCommand.HospitalId != null)
|
||||
if (siteCommand.HospitalId != null)
|
||||
{
|
||||
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == siteCommand.HospitalId, u => new Hospital() { SiteId = site.Id });
|
||||
}
|
||||
|
||||
if (siteCommand.TrialSiteId != null)
|
||||
{
|
||||
await _repository.BatchUpdateAsync<TrialSite>(t => t.Id == siteCommand.TrialSiteId, u => new TrialSite() { SiteId = site.Id });
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(site.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary> 删除研究中心 </summary>
|
||||
@@ -99,7 +124,7 @@ namespace IRaCIS.Application.Services
|
||||
public async Task<IResponseOutput> DeleteSite(Guid siteId)
|
||||
{
|
||||
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.SiteId == siteId))
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.TrialSite.SiteId == siteId))
|
||||
{
|
||||
//---该中心已经加入项目,不可以被删除。
|
||||
return ResponseOutput.NotOk(_localizer["Site_InProject"]);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -33,14 +34,13 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
/// <summary> 分页获取申办方列表 </summary>
|
||||
public async Task<IEnumerable<SponsorSelectDTO>> GetAllSponsorList()
|
||||
public async Task<IEnumerable<SponsorSelectDTO>> GetAllSponsorList(Guid? trialId)
|
||||
{
|
||||
//Expression<Func<Sponsor, bool>> sponsorLambda = x => true;
|
||||
//if (!string.IsNullOrWhiteSpace(sponsorSearchModel.SponsorName))
|
||||
//{
|
||||
// sponsorLambda = sponsorLambda.And(t => t.SponsorName.Contains(sponsorSearchModel.SponsorName.Trim()));
|
||||
//}
|
||||
var sponsorQueryable = _sponsorRepository.ProjectTo<SponsorSelectDTO>(_mapper.ConfigurationProvider,new { isEn_Us= _userInfo.IsEn_Us});
|
||||
|
||||
var sponsorQueryable = _sponsorRepository
|
||||
.WhereIf(trialId == null, t => t.IsTrialLevel == false)
|
||||
.WhereIf(trialId != null, t => t.IsTrialLevel == false || t.TrialId == trialId)
|
||||
.ProjectTo<SponsorSelectDTO>(_mapper.ConfigurationProvider,new { isEn_Us= _userInfo.IsEn_Us});
|
||||
return await sponsorQueryable.ToListAsync();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
var exp = new EntityVerifyExp<Sponsor>()
|
||||
{
|
||||
VerifyExp = h => h.SponsorName.Equals(sponsorCommand.SponsorName),
|
||||
VerifyExp = h => (h.SponsorName.Equals(sponsorCommand.SponsorName)|| h.SponsorNameCN.Equals(sponsorCommand.SponsorNameCN)) && h.IsTrialLevel == false,
|
||||
//---已经存在同名的申办方,请确认。
|
||||
VerifyMsg = _localizer["Sponsor_DupName"]
|
||||
};
|
||||
@@ -67,16 +67,11 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
public async Task<IResponseOutput> DeleteSponsor(Guid sponsorId)
|
||||
{
|
||||
if (await _trialRepository.AnyAsync(t => t.CROId == sponsorId))
|
||||
if (await _trialRepository.AnyAsync(t => t.SponsorId == sponsorId))
|
||||
{
|
||||
//---该申办方已经加入项目,不允许删除。
|
||||
return ResponseOutput.NotOk(_localizer["Sponsor_InProject"]);
|
||||
}
|
||||
//if (_userRepository.Find().Any(t => t.OrganizationId == sponsorId))
|
||||
//{
|
||||
// return ResponseOutput.NotOk("该申办方下存在用户,暂时无法删除。");
|
||||
//}
|
||||
|
||||
|
||||
var success = await _sponsorRepository.BatchDeleteNoTrackingAsync(x => x.Id == sponsorId);
|
||||
return ResponseOutput.Result(success);
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid? LoginUserId { get; set; }
|
||||
|
||||
public Guid? OptUserId { get; set; }
|
||||
|
||||
public string IPRegion { get; set; }
|
||||
}
|
||||
|
||||
///<summary>UserLogQuery 列表查询参数模型</summary>
|
||||
@@ -47,14 +49,17 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public string? LoginFaildName { get; set; }
|
||||
|
||||
public string? LoginUserName { get; set; }
|
||||
|
||||
public DateTime? BeginDate { get; set; }
|
||||
|
||||
public DateTime? EndDate { get; set; }
|
||||
|
||||
public string? LoginUserName { get; set; }
|
||||
|
||||
public UserTypeEnum? LoginUserTypeEnum { get; set; }
|
||||
|
||||
public Guid? UserTypeId { get; set; }
|
||||
|
||||
public Guid? UserId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
public Guid? UserId { get; set; }
|
||||
}
|
||||
|
||||
public class LoginReturnDTO
|
||||
@@ -28,6 +30,8 @@ namespace IRaCIS.Application.Contracts
|
||||
public UserBasicInfo BasicInfo { get; set; } = new UserBasicInfo();
|
||||
public string JWTStr { get; set; }=string.Empty;
|
||||
|
||||
public bool IsMFA { get; set; } = false;
|
||||
|
||||
}
|
||||
|
||||
public class UserBasicInfo
|
||||
@@ -37,10 +41,18 @@ namespace IRaCIS.Application.Contracts
|
||||
public string RealName { get; set; } = string.Empty;
|
||||
public int Sex { get; set; } // 1-男 2-女
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
/// <summary>
|
||||
/// LastLoginIP
|
||||
/// </summary>
|
||||
public string LastLoginIP { get; set; } = string.Empty;
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
public bool IsTestUser { get; set; }
|
||||
/// <summary>
|
||||
/// 上一次修改密码的时间
|
||||
/// </summary>
|
||||
public DateTime? LastChangePassWordTime { get; set; }
|
||||
public bool IsTestUser { get; set; }
|
||||
public bool IsAdmin { get; set; } = false;
|
||||
public string UserTypeShortName { get; set; } = string.Empty;
|
||||
public bool PasswordChanged { get; set; }
|
||||
@@ -51,11 +63,13 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
public string PermissionStr { get; set; } = String.Empty;
|
||||
|
||||
|
||||
public string EMail { get; set; } = string.Empty;
|
||||
public bool IsFirstAdd { get; set; }
|
||||
public bool IsReviewer { get; set; } = false;
|
||||
|
||||
}
|
||||
public int LoginState { get; set; } = 0;
|
||||
|
||||
}
|
||||
|
||||
public class MenuFuncTreeNodeView
|
||||
{
|
||||
@@ -203,6 +217,12 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
public bool ? IsZhiZhun { get; set; }
|
||||
public UserStateEnum? UserState { get; set; }
|
||||
|
||||
public DateTime? BeginCreateTime { get; set; }
|
||||
|
||||
public DateTime? EndCreateTime { get; set; }
|
||||
|
||||
public string? EMail { get; set; }
|
||||
}
|
||||
|
||||
public class UserRoleInfoDTO
|
||||
@@ -217,6 +237,8 @@ namespace IRaCIS.Application.Contracts
|
||||
public Guid testGuid { get; set; }
|
||||
public bool CanEditUserType { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public List<string> RoleNameArray { get; set; } = new List<string>();
|
||||
public IEnumerable<RoleDTO> RoleNameList { get; set; } = new List<RoleDTO>();
|
||||
}
|
||||
|
||||
@@ -10,12 +10,16 @@ namespace IRaCIS.Application.Services
|
||||
Task<UserDetailDTO> GetUser(Guid id);
|
||||
Task<PageOutput<UserListDTO>> GetUserList(UserListQueryDTO param);
|
||||
Task<IResponseOutput<LoginReturnDTO>> Login(string userName, string password);
|
||||
Task<IResponseOutput> VerifyMFACodeAsync(Guid userId, string Code);
|
||||
|
||||
Task<IResponseOutput> SendMFAEmail(Guid userId, int mfaType=0);
|
||||
Task<UserBasicInfo> GetUserBasicInfo(Guid userId,string pwd);
|
||||
Task<IResponseOutput> ModifyPassword(EditPasswordCommand editPwModel);
|
||||
Task<IResponseOutput> ResetPassword(Guid userId);
|
||||
|
||||
Task<IResponseOutput> UpdateUser(UserCommand model);
|
||||
Task<IResponseOutput> UpdateUserState(Guid userId, UserStateEnum state);
|
||||
|
||||
|
||||
//Task<IResponseOutput> SendVerificationCode(string emailOrPhone, VerifyType verificationType, bool isReviewer = false);
|
||||
//Task<IResponseOutput> SetNewPassword(ResetPasswordCommand resetPwdModel);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ using Medallion.Threading;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
||||
using OfficeOpenXml.FormulaParsing.Utilities;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using BeetleX.Redis.Commands;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -23,17 +25,18 @@ namespace IRaCIS.Application.Services
|
||||
public class UserService : BaseService, IUserService
|
||||
{
|
||||
private readonly IRepository<User> _userRepository;
|
||||
|
||||
private readonly IMailVerificationService _mailVerificationService;
|
||||
private readonly IRepository<VerificationCode> _verificationCodeRepository;
|
||||
private readonly IRepository<Doctor> _doctorRepository;
|
||||
private readonly IRepository<TrialUser> _userTrialRepository;
|
||||
private readonly IRepository<UserLog> _userLogRepository;
|
||||
|
||||
private readonly IRepository<UserPassWordLog> _userPassWordLogRepository;
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
private readonly IEasyCachingProvider _cache;
|
||||
private readonly IReadingImageTaskService _readingImageTaskService;
|
||||
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
|
||||
|
||||
private readonly IReadingImageTaskService _readingImageTaskService;
|
||||
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
|
||||
private readonly SystemEmailSendConfig _systemEmailConfig;
|
||||
|
||||
public UserService(IRepository<User> userRepository,
|
||||
|
||||
@@ -41,25 +44,29 @@ namespace IRaCIS.Application.Services
|
||||
IRepository<VerificationCode> verificationCodeRepository,
|
||||
IRepository<Doctor> doctorRepository,
|
||||
IEasyCachingProvider cache,
|
||||
IReadingImageTaskService readingImageTaskService,
|
||||
IRepository<TrialUser> userTrialRepository,
|
||||
IReadingImageTaskService readingImageTaskService,
|
||||
IRepository<TrialUser> userTrialRepository,
|
||||
IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig,
|
||||
IRepository<UserLog> userLogRepository
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig,
|
||||
IRepository<UserLog> userLogRepository,
|
||||
IRepository<UserPassWordLog> userPassWordLogRepository
|
||||
,
|
||||
IDistributedLockProvider distributedLockProvider)
|
||||
{
|
||||
_userLogRepository = userLogRepository;
|
||||
|
||||
this._userPassWordLogRepository = userPassWordLogRepository;
|
||||
_verifyConfig = verifyConfig;
|
||||
_cache = cache;
|
||||
this._readingImageTaskService = readingImageTaskService;
|
||||
_userRepository = userRepository;
|
||||
this._readingImageTaskService = readingImageTaskService;
|
||||
_userRepository = userRepository;
|
||||
_mailVerificationService = mailVerificationService;
|
||||
_verificationCodeRepository = verificationCodeRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
_userTrialRepository = userTrialRepository;
|
||||
_userLogRepository = userLogRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
|
||||
_systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,33 +103,51 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
//var dbUser = (await _userRepository.FirstOrDefaultAsync(t => t.Id == userId)).IfNullThrowException();
|
||||
|
||||
if (_verifyConfig.CurrentValue.OpenUserComplexPassword)
|
||||
if (oldPwd != null && oldPwd == newPwd)
|
||||
{
|
||||
|
||||
if (oldPwd != null && oldPwd == newPwd)
|
||||
{
|
||||
//---新密码与旧密码相同。
|
||||
throw new BusinessValidationFailedException(_localizer["User_NewOldPwdSame"]);
|
||||
}
|
||||
|
||||
|
||||
var dbUser = (await _userRepository.Where(t => t.Id == userId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
if (oldPwd != null && dbUser.Password != oldPwd)
|
||||
{
|
||||
//---旧密码验证失败。
|
||||
throw new BusinessValidationFailedException(_localizer["User_OldPwdInvalid"]);
|
||||
}
|
||||
|
||||
if (dbUser.Password == newPwd)
|
||||
{
|
||||
//---新密码与旧密码相同。
|
||||
throw new BusinessValidationFailedException(_localizer["User_NewOldPwdSame"]);
|
||||
}
|
||||
|
||||
|
||||
//---新密码与旧密码相同。
|
||||
throw new BusinessValidationFailedException(_localizer["User_NewOldPwdSame"]);
|
||||
}
|
||||
|
||||
|
||||
var dbUser = (await _userRepository.Where(t => t.Id == userId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
if (oldPwd != null && dbUser.Password != oldPwd)
|
||||
{
|
||||
//---旧密码验证失败。
|
||||
throw new BusinessValidationFailedException(_localizer["User_OldPwdInvalid"]);
|
||||
}
|
||||
|
||||
if (dbUser.Password == newPwd)
|
||||
{
|
||||
//---新密码与旧密码相同。
|
||||
throw new BusinessValidationFailedException(_localizer["User_NewOldPwdSame"]);
|
||||
}
|
||||
|
||||
var passWordList = await _userPassWordLogRepository.Where(x => x.UserId == userId).OrderByDescending(x => x.CreateTime).Take(2).ToListAsync();
|
||||
if (passWordList.Any(x => x.PassWord == newPwd))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["User_PassWordRepeat"]);
|
||||
}
|
||||
if (oldPwd != null)
|
||||
{
|
||||
await _userPassWordLogRepository.AddAsync(new UserPassWordLog()
|
||||
{
|
||||
|
||||
CreateTime = DateTime.Now,
|
||||
PassWord = oldPwd,
|
||||
UserId = userId,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == userId, x => new User()
|
||||
{
|
||||
LastChangePassWordTime = DateTime.Now,
|
||||
});
|
||||
await _userPassWordLogRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
await Task.CompletedTask;
|
||||
|
||||
|
||||
@@ -136,7 +161,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
||||
//检查手机或者邮箱是否有效
|
||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"))
|
||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||
{
|
||||
//---Please input a legal email
|
||||
return ResponseOutput.NotOk(_localizer["User_LegalEmail"]);
|
||||
@@ -287,7 +312,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
await _mailVerificationService.AdminResetPwdSendEmailAsync(userId, pwd);
|
||||
}
|
||||
catch (Exception )
|
||||
catch (Exception)
|
||||
{
|
||||
//---请检查邮箱地址或者联系维护人员, 邮件发送失败, 未能创建账户成功
|
||||
throw new BusinessValidationFailedException(_localizer["User_CreateFailed"]);
|
||||
@@ -300,7 +325,7 @@ namespace IRaCIS.Application.Services
|
||||
IsFirstAdd = true
|
||||
});
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId=userId, OptType = UserOptType.ResetPassword }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = userId, OptType = UserOptType.ResetPassword }, true);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
@@ -318,7 +343,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
||||
//检查手机或者邮箱是否有效
|
||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"))
|
||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||
{
|
||||
|
||||
//---请输入一个正确的邮箱。
|
||||
@@ -384,7 +409,7 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
}
|
||||
|
||||
var list = await _userRepository.Where(t => t.EMail == email && t.Status== UserStateEnum.Enable).Select(t => new UserAccountDto() { UserId = t.Id, UserName = t.UserName, UserRealName = t.FullName, UserType = t.UserTypeRole.UserTypeShortName }).ToListAsync();
|
||||
var list = await _userRepository.Where(t => t.EMail == email && t.Status == UserStateEnum.Enable).Select(t => new UserAccountDto() { UserId = t.Id, UserName = t.UserName, UserRealName = t.FullName, UserType = t.UserTypeRole.UserTypeShortName }).ToListAsync();
|
||||
|
||||
|
||||
|
||||
@@ -412,7 +437,7 @@ namespace IRaCIS.Application.Services
|
||||
IsFirstAdd = false
|
||||
});
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId,LoginPassword=newPwd, OptType = UserOptType.UnloginModifyPasswoed }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId, LoginPassword = newPwd, OptType = UserOptType.UnloginModifyPasswoed }, true);
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
|
||||
@@ -448,7 +473,7 @@ namespace IRaCIS.Application.Services
|
||||
IsFirstAdd = false
|
||||
});
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId= _userInfo.Id, OptType = UserOptType.LoginModifyPassword }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = _userInfo.Id, OptType = UserOptType.LoginModifyPassword }, true);
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
|
||||
@@ -471,6 +496,9 @@ namespace IRaCIS.Application.Services
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.RealName), t => t.FullName.Contains(param.RealName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.Phone), t => t.Phone.Contains(param.Phone))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName), t => t.OrganizationName.Contains(param.OrganizationName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.EMail), t => t.EMail.Contains(param.EMail))
|
||||
.WhereIf(param.BeginCreateTime != null, t => t.CreateTime >= param.BeginCreateTime)
|
||||
.WhereIf(param.EndCreateTime != null, t => t.CreateTime <= param.EndCreateTime)
|
||||
.WhereIf(param.UserType != null, t => t.UserTypeId == param.UserType)
|
||||
.WhereIf(param.UserState != null, t => t.Status == param.UserState)
|
||||
.WhereIf(param.IsTestUser != null, t => t.IsTestUser == param.IsTestUser)
|
||||
@@ -533,11 +561,11 @@ namespace IRaCIS.Application.Services
|
||||
var success = await _userRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
await _mailVerificationService.AddUserSendEmailAsync(saveItem.Id, userAddModel.BaseUrl, userAddModel.RouteUrl);
|
||||
|
||||
|
||||
return ResponseOutput.Ok( new UserAddedReturnDTO { Id = saveItem.Id, UserCode = saveItem.UserCode });
|
||||
return ResponseOutput.Ok(new UserAddedReturnDTO { Id = saveItem.Id, UserCode = saveItem.UserCode });
|
||||
|
||||
}
|
||||
|
||||
@@ -564,10 +592,10 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
if (user.IsZhiZhun)
|
||||
{
|
||||
user.OrganizationName = AppSettings.DefaultInternalOrganizationName;
|
||||
user.OrganizationName = _userInfo.IsEn_Us? _systemEmailConfig.OrganizationName: _systemEmailConfig.OrganizationNameCN ;
|
||||
}
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId= model.Id , OptType = UserOptType.UpdateUser }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = model.Id, OptType = UserOptType.UpdateUser }, true);
|
||||
|
||||
var success = await _userRepository.SaveChangesAsync();
|
||||
|
||||
@@ -589,7 +617,7 @@ namespace IRaCIS.Application.Services
|
||||
return ResponseOutput.NotOk(_localizer["User_InProject"]);
|
||||
}
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId= userId, OptType = UserOptType.DeleteUser }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = userId, OptType = UserOptType.DeleteUser }, true);
|
||||
|
||||
var success = await _userRepository.BatchDeleteNoTrackingAsync(t => t.Id == userId);
|
||||
|
||||
@@ -607,7 +635,7 @@ namespace IRaCIS.Application.Services
|
||||
public async Task<IResponseOutput> UpdateUserState(Guid userId, UserStateEnum state)
|
||||
{
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = userId, OptType = state==UserStateEnum.Enable? UserOptType.AccountEnable: UserOptType.AccountLocked }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = userId, OptType = state == UserStateEnum.Enable ? UserOptType.AccountEnable : UserOptType.AccountLocked }, true);
|
||||
|
||||
var success = await _userRepository.BatchUpdateNoTrackingAsync(u => u.Id == userId, t => new User
|
||||
{
|
||||
@@ -617,7 +645,71 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
|
||||
public async Task<UserBasicInfo> GetUserBasicInfo(Guid userId, string pwd)
|
||||
{
|
||||
var info = await _userRepository.Where(u => u.Id == userId && u.Password==pwd).ProjectTo<UserBasicInfo>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送MFA 验证邮件
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="mfaType"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> SendMFAEmail(Guid userId, int mfaType )
|
||||
{
|
||||
var userInfo = await _userRepository.Where(u => u.Id == userId).Select(t => new { t.FullName, t.EMail }).FirstOrDefaultAsync();
|
||||
|
||||
int verificationCode = new Random().Next(100000, 1000000);
|
||||
|
||||
await _mailVerificationService.SenMFAVerifyEmail(userId, userInfo.FullName, userInfo.EMail, verificationCode, (UserMFAType)mfaType );
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证MFA 邮件
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="Code"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> VerifyMFACodeAsync(Guid userId, string Code)
|
||||
{
|
||||
var verificationRecord = await _repository.GetQueryable<VerificationCode>().OrderByDescending(x => x.ExpirationTime).Where(t => t.UserId == userId && t.Code == Code && t.CodeType == VerifyType.Email).FirstOrDefaultAsync();
|
||||
VerifyEmialGetDoctorInfoOutDto result = new VerifyEmialGetDoctorInfoOutDto();
|
||||
|
||||
//检查数据库是否存在该验证码
|
||||
if (verificationRecord == null)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId, OptType = UserOptType.MFALoginFail }, true);
|
||||
//---验证码错误。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_WrongVerificationCode"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
//检查验证码是否失效
|
||||
if (verificationRecord.ExpirationTime < DateTime.Now)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId, OptType = UserOptType.MFALoginFail }, true);
|
||||
//---验证码已经过期。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
|
||||
|
||||
|
||||
}
|
||||
else //验证码正确 并且 没有超时
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId, OptType = UserOptType.MFALogin }, true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户登陆
|
||||
@@ -650,7 +742,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
if (failCount >= maxFailures)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = Guid.Empty, OptUserId = Guid.Empty, LoginFaildName = userName,LoginPassword=password, OptType = UserOptType.AccountLocked }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = Guid.Empty, OptUserId = Guid.Empty, LoginFaildName = userName, LoginPassword = password, OptType = UserOptType.AccountLocked }, true);
|
||||
|
||||
//$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。"
|
||||
throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]);
|
||||
@@ -668,12 +760,12 @@ namespace IRaCIS.Application.Services
|
||||
failCount++;
|
||||
_cache.Set(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = Guid.Empty, OptUserId=Guid.Empty, LoginFaildName = userName, LoginPassword = password, OptType = UserOptType.AccountOrPasswordError }, true);
|
||||
var errorPwdUserId = await _userRepository.Where(u => u.UserName == userName).Select(t => t.Id).FirstOrDefaultAsync();
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = errorPwdUserId, OptUserId = errorPwdUserId, LoginFaildName = userName, LoginPassword = password, OptType = UserOptType.AccountOrPasswordError }, true);
|
||||
|
||||
return ResponseOutput.NotOk(_localizer["User_CheckNameOrPw"], new LoginReturnDTO());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (loginUser.Status == 0)
|
||||
@@ -684,21 +776,49 @@ namespace IRaCIS.Application.Services
|
||||
return ResponseOutput.NotOk(_localizer["User_Disabled"], new LoginReturnDTO());
|
||||
}
|
||||
|
||||
//超过90天没修改密码
|
||||
if (loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-90) > loginUser.LastChangePassWordTime.Value)
|
||||
{
|
||||
loginUser.LoginState = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//登录成功 清除缓存
|
||||
_cache.Set(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = loginUser.Id, OptUserId = loginUser.Id, OptType = UserOptType.Login }, true);
|
||||
|
||||
if (loginUser.LastLoginIP != string.Empty)
|
||||
{
|
||||
// 与上一次IP不一致
|
||||
if (loginUser.LastLoginIP != _userInfo.IP)
|
||||
{
|
||||
loginUser.LoginState = 2;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = loginUser.Id, OptUserId = loginUser.Id, OptType = UserOptType.Login }, true);
|
||||
|
||||
userLoginReturnModel.BasicInfo = loginUser;
|
||||
|
||||
if (loginUser.LastChangePassWordTime == null)
|
||||
{
|
||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
||||
{
|
||||
LastChangePassWordTime = DateTime.Now
|
||||
|
||||
// 登录 清除缓存
|
||||
//_cache.Remove(userLoginReturnModel.BasicInfo.Id.ToString());
|
||||
});
|
||||
|
||||
var userId = loginUser.Id;
|
||||
await _cache.SetAsync($"{userId.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
}
|
||||
|
||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
||||
{
|
||||
LastLoginIP = _userInfo.IP,
|
||||
LastLoginTime= DateTime.Now
|
||||
|
||||
});
|
||||
|
||||
return ResponseOutput.Ok(userLoginReturnModel);
|
||||
|
||||
@@ -707,17 +827,22 @@ namespace IRaCIS.Application.Services
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<UserLogView>> GetUserLogList(UserLogQuery inQuery)
|
||||
{
|
||||
DateTime? trialCreateTime = inQuery.TrialId != null ? _repository.Where<Trial>(t => t.Id == inQuery.TrialId).Select(t => t.CreateTime).FirstOrDefault() : null;
|
||||
|
||||
var userLogQueryable =
|
||||
_userLogRepository
|
||||
.WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && c.UserId == t.LoginUserId))
|
||||
.WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && (c.UserId == t.LoginUserId || c.UserId == t.OptUserId)))
|
||||
.WhereIf(trialCreateTime != null, t => t.CreateTime >= trialCreateTime)
|
||||
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
|
||||
.WhereIf(inQuery.UserId != null, t => t.LoginUserId == inQuery.UserId)
|
||||
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
||||
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
||||
.WhereIf(inQuery.LoginUserTypeEnum != null, t => t.LoginUser.UserTypeEnum== inQuery.LoginUserTypeEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.LoginUser.UserName.Contains(inQuery.LoginUserName!))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.LoginFaildName.Contains(inQuery.LoginFaildName!))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!))
|
||||
.WhereIf(inQuery.LoginUserTypeEnum != null, t => t.LoginUser.UserTypeEnum == inQuery.LoginUserTypeEnum)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.LoginUser.UserTypeId == inQuery.UserTypeId)
|
||||
|
||||
.ProjectTo<UserLogView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await userLogQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "Id" : inQuery.SortField, inQuery.Asc);
|
||||
@@ -725,10 +850,11 @@ namespace IRaCIS.Application.Services
|
||||
return pageList;
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public async Task<IResponseOutput> LoginOut()
|
||||
public async Task<IResponseOutput> LoginOut(Guid userId)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = _userInfo.Id, OptType = UserOptType.LoginOut },true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = _userInfo.Id, OptType = UserOptType.LoginOut }, true);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
/// <returns></returns>
|
||||
public async Task<List<TrialUserType>> GetTrialUserTypeList()
|
||||
{
|
||||
//排除其他组的用户
|
||||
var query = _userTypeRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin)
|
||||
.Where(t => !t.UserTypeGroupList.Any(t=> t.Group.Code=="3"))
|
||||
.OrderBy(t => t.UserTypeShortName).ProjectTo<TrialUserType>(_mapper.ConfigurationProvider);
|
||||
|
||||
@@ -56,33 +56,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
return clinicalObj;
|
||||
|
||||
#region 老方式 linq join 而且需要映射
|
||||
|
||||
|
||||
//var query = from sv in _subjectVisitRepository.GetAll()
|
||||
// join subject in _subjectRepository.GetAll() on sv.SubjectId equals subject.Id
|
||||
// join trialSite in _trialSiteRepository.Find(t => t.TrialId == subjectClinicalDataQuery.TrialId) on sv.SiteId equals trialSite.SiteId
|
||||
// select new SubjectClinicalDataDto()
|
||||
// {
|
||||
// SubjectId = sv.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// SubjectVisitId = sv.Id,
|
||||
// VisitName = sv.VisitName,
|
||||
// VisitNum = sv.VisitNum,
|
||||
// TrialSiteCode = trialSite.TrialSiteCode
|
||||
// };
|
||||
|
||||
//var clinicalObj = query.FirstOrDefault(t => t.SubjectVisitId == subjectClinicalDataQuery.SubjectVisitId);
|
||||
|
||||
//clinicalObj.PreviousHistoryList = _previousHistoryRepository.Find(t => t.SubjectVisitId == subjectClinicalDataQuery.SubjectVisitId)
|
||||
// .ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToList();
|
||||
//clinicalObj.PreviousOtherList = _previousOtherRepository.Find(t => t.SubjectVisitId == subjectClinicalDataQuery.SubjectVisitId)
|
||||
// .ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToList();
|
||||
//clinicalObj.PreviousSurgeryList = _previousSurgeryRepository.Find(t => t.SubjectVisitId == subjectClinicalDataQuery.SubjectVisitId)
|
||||
// .ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public string FullFilePath => Path;
|
||||
|
||||
public string PreviewPath => "/Common/LocalFilePreview?relativePath=" + Path;
|
||||
public string FileType { get; set; }
|
||||
|
||||
//public string PreviewPath => "/Common/LocalFilePreview?relativePath=" + Path;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public List<NoneDicomStudyFileView> NoneDicomStudyFileList { get; set; } = new List<NoneDicomStudyFileView>();
|
||||
|
||||
public List<string> NoneDicomStudyFilePreviewList => NoneDicomStudyFileList.Select(t=> t.PreviewPath).ToList();
|
||||
//public List<string> NoneDicomStudyFilePreviewList => NoneDicomStudyFileList.Select(t=> t.PreviewPath).ToList();
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
public string BodyPart { get; set; } = string.Empty;
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
||||
//public string LastName { get; set; }
|
||||
//public string Modalities { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string SiteName { get; set; } = String.Empty;
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public bool? IsUrgent { get; set; }
|
||||
@@ -51,7 +51,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public bool? IsUrgent { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? VisitId { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
@@ -263,7 +263,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
//public int? Age { get; set; }
|
||||
//public string Sex { get; set; } = string.Empty;
|
||||
//public Guid SiteId { get; set; }
|
||||
//public Guid TrialSiteId { get; set; }
|
||||
//public Guid TrialId { get; set; }
|
||||
//public string MedicalNo { get; set; } = string.Empty;
|
||||
//public string ShortName { get; set; } = string.Empty;
|
||||
@@ -353,10 +353,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public ReadingMethod ReadingType { get; set; }
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 任务展示访视 读片任务显示是否顺序
|
||||
///// </summary>
|
||||
//public bool IsReadingTaskViewInOrder { get; set; } = true;
|
||||
}
|
||||
|
||||
public class ReadingPeriodOrVisitInfo
|
||||
@@ -614,7 +610,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
[DictionaryTranslateAttribute("RequestBackState")]
|
||||
public RequestBackStateEnum RequestBackState { get; set; }
|
||||
@@ -1125,7 +1121,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public bool? IsUrgent { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public bool? IsClosed { get; set; }
|
||||
public bool? IsOverTime { get; set; }
|
||||
public Guid? CreateUserId { get; set; }
|
||||
@@ -1188,7 +1184,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public QCChanllengeReuploadEnum ReuploadEnum { get; set; }
|
||||
public DateTime? DeadlineTime { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public AuditStateEnum AuditState { get; set; }
|
||||
public CurrentQC CurrentQCEnum { get; set; }
|
||||
public TrialQCProcess QCProcessEnum { get; set; }
|
||||
@@ -1238,7 +1234,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public string SubjectInfo { get; set; } = String.Empty;
|
||||
|
||||
|
||||
@@ -1281,7 +1277,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public string SubjectInfo { get; set; } = String.Empty;
|
||||
|
||||
public string[]? VisitPlanArray { get; set; }
|
||||
@@ -1354,7 +1350,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
//public string Modality { get; set; }
|
||||
|
||||
@@ -1442,7 +1438,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public Guid? Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public bool InPlan { get; set; } = true;
|
||||
public int VisitExecuted { get; set; }
|
||||
public decimal VisitNum { get; set; }
|
||||
@@ -1474,6 +1470,10 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public bool IsLostVisit { get; set; }
|
||||
|
||||
public string VisitImageZipPath { get; set; }
|
||||
|
||||
public PackState PackState { get; set; }
|
||||
|
||||
//public Guid? ClinicalDataSignUserId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
Task<IResponseOutput> DeleteNoneDicomStudy(Guid noneDicomStudyId, Guid subjectVisitId);
|
||||
Task<IResponseOutput> DeleteNoneDicomStudyFile(Guid noneDicomStudyFileId, Guid subjectVisitId);
|
||||
Task<List<NoneDicomStudyFileView>> GetNoneDicomStudyFileList(Guid noneDicomStudyId);
|
||||
Task<List<NoneDicomStudyView>> GetNoneDicomStudyList(Guid subjectVisitId, Guid? sujectVisitId = null);
|
||||
Task<List<NoneDicomStudyView>> GetNoneDicomStudyList(Guid subjectVisitId, Guid? sujectVisitId = null, bool isFilterZip=false);
|
||||
Task<List<NoneDicomStudyFileView>> GetVisitNoneDicomStudyFileList(Guid subjectVisitId);
|
||||
//Task<IResponseOutput> UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId);
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public async Task<List<NoneDicomStudyView>> GetNoneDicomStudyList([FromQuery, NotDefault] Guid subjectVisitId, Guid? nonedicomStudyId)
|
||||
public async Task<List<NoneDicomStudyView>> GetNoneDicomStudyList([FromQuery, NotDefault] Guid subjectVisitId, [FromQuery] Guid? nonedicomStudyId, [FromQuery] bool isFilterZip)
|
||||
{
|
||||
|
||||
var noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
|
||||
|
||||
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken });
|
||||
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip });
|
||||
|
||||
return await noneDicomStudyQueryable.ToListAsync();
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <param name="visitSearchDTO"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<(PageOutput<QCCRCVisitViewModel>, TrialSubjectAndSVConfig)> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO)
|
||||
public async Task<IResponseOutput< PageOutput<QCCRCVisitViewModel>>> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO)
|
||||
{
|
||||
var svExpression = QCCommon.GetSubjectVisitFilter(visitSearchDTO.VisitPlanArray);
|
||||
|
||||
var query = _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
||||
.WhereIf(visitSearchDTO.SiteId != null, t => t.SiteId == visitSearchDTO.SiteId)
|
||||
.WhereIf(visitSearchDTO.TrialSiteId != null, t => t.TrialSiteId == visitSearchDTO.TrialSiteId)
|
||||
.WhereIf(visitSearchDTO.SubjectId != null, t => t.Subject.Id == visitSearchDTO.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(visitSearchDTO.SubjectInfo), t => t.Subject.Code.Contains(visitSearchDTO.SubjectInfo))
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
var config = await _repository.Where<Trial>(t => t.Id == visitSearchDTO.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
config.IsHaveSubjectClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == visitSearchDTO.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.Subject ) && x.UploadRole == UploadRole.CRC);
|
||||
config.IsHaveVisitClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == visitSearchDTO.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.SubjectVisit) && x.UploadRole == UploadRole.CRC);
|
||||
return (pageList, config);
|
||||
return ResponseOutput.Ok (pageList, config);
|
||||
|
||||
}
|
||||
|
||||
@@ -98,39 +98,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
public async Task<(PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig)> GetCRCChallengeList(ChallengeQuery challengeQuery)
|
||||
{
|
||||
|
||||
#region CRC 质疑列表 join连表方式
|
||||
//var query = from qcChanllenge in _qcChallengeRepository.Find(qcChallengeLambda)
|
||||
// join subjectVisit in _subjectVisitRepository.Find() on qcChanllenge.SubjectVisitId equals subjectVisit.Id
|
||||
// join trialSite in _trialSiteRepository.Find(t => t.TrialId == challengeQuery.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join subject in _subjectRepository.Find() on subjectVisit.SubjectId equals subject.Id
|
||||
// select new QCCRCChallengeViewModel()
|
||||
// {
|
||||
// Id = qcChanllenge.Id,
|
||||
// SubjectVisitId = qcChanllenge.SubjectVisitId,
|
||||
// ChallengeCode = qcChanllenge.ChallengeCode,
|
||||
// ChallengeType = qcChanllenge.ChallengeType,
|
||||
// Note = qcChanllenge.Note,
|
||||
// Content = qcChanllenge.Content,
|
||||
// UserTypeEnum = qcChanllenge.UserTypeEnum,
|
||||
// CreateTime = qcChanllenge.CreateTime,
|
||||
// CreateUser = qcChanllenge.CreateUser,
|
||||
// CreateUserId = qcChanllenge.CreateUserId,
|
||||
|
||||
// DeadlineTime = qcChanllenge.DeadlineTime,
|
||||
// IsClosed = qcChanllenge.IsClosed,
|
||||
// ClosedTime = qcChanllenge.ClosedTime,
|
||||
// ClosedUser = qcChanllenge.ClosedUser,
|
||||
// NeedReUpload = qcChanllenge.NeedReUpload,
|
||||
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// SubjectCode = subject.Code,
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
|
||||
// LatestMsgTime = qcChanllenge.LatestMsgTime,
|
||||
// LatestReplyUser = qcChanllenge.LatestReplyUser,
|
||||
// };
|
||||
#endregion
|
||||
|
||||
var svExpression = QCCommon.GetQCChallengeFilter(challengeQuery.VisitPlanArray);
|
||||
|
||||
@@ -138,7 +105,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
|
||||
.WhereIf(challengeQuery.ReuploadEnum != null, t => t.ReuploadEnum == challengeQuery.ReuploadEnum)
|
||||
.WhereIf(challengeQuery.IsClosed != null, t => t.IsClosed == challengeQuery.IsClosed)
|
||||
.WhereIf(challengeQuery.SiteId != null, t => t.SubjectVisit.SiteId == challengeQuery.SiteId)
|
||||
.WhereIf(challengeQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == challengeQuery.TrialSiteId)
|
||||
.WhereIf(challengeQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == challengeQuery.SubjectId)
|
||||
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
|
||||
.WhereIf(challengeQuery.SubjectCode != null, t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode!))
|
||||
@@ -170,57 +137,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
[HttpPost]
|
||||
public async Task<(PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig)> GetQCChallengeList(ChallengeQuery challengeQuery)
|
||||
{
|
||||
#region linq方式 + Expression 拼接
|
||||
|
||||
//Expression<Func<QCChallenge, bool>> qcChallengeLambda = x => x.TrialId == challengeQuery.TrialId;
|
||||
|
||||
//if (challengeQuery.ReuploadEnum != null)
|
||||
//{
|
||||
// qcChallengeLambda = qcChallengeLambda.And(t => t.ReuploadEnum == challengeQuery.ReuploadEnum);
|
||||
//}
|
||||
//if (challengeQuery.IsClosed != null)
|
||||
//{
|
||||
// qcChallengeLambda = qcChallengeLambda.And(t => t.IsClosed == challengeQuery.IsClosed);
|
||||
//}
|
||||
//if (challengeQuery.SiteId != null)
|
||||
//{
|
||||
// qcChallengeLambda = qcChallengeLambda.And(t => t.SubjectVisit.SiteId == challengeQuery.SiteId.Value);
|
||||
//}
|
||||
//if (challengeQuery.SubjectId != null)
|
||||
//{
|
||||
// qcChallengeLambda = qcChallengeLambda.And(t => t.SubjectVisit.Subject.Id == challengeQuery.SubjectId.Value);
|
||||
//}
|
||||
|
||||
//var query = from qcChanllenge in _qcChallengeRepository.Find(qcChallengeLambda)
|
||||
// join subjectVisit in _subjectVisitRepository.Find(subjectVisitLambda) on qcChanllenge.SubjectVisitId equals subjectVisit.Id
|
||||
// join trialSite in _trialSiteRepository.Find(t => t.TrialId == challengeQuery.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join subject in _subjectRepository.Find() on subjectVisit.SubjectId equals subject.Id
|
||||
// select new QCChallengeViewModel()
|
||||
// {
|
||||
// Id = qcChanllenge.Id,
|
||||
// SubjectVisitId = qcChanllenge.SubjectVisitId,
|
||||
// ChallengeCode = qcChanllenge.ChallengeCode.ToString(),
|
||||
// ChallengeType = qcChanllenge.ChallengeType,
|
||||
// Note = qcChanllenge.Note,
|
||||
// UserTypeEnum = qcChanllenge.UserTypeEnum,
|
||||
// Content = qcChanllenge.Content,
|
||||
// CreateTime = qcChanllenge.CreateTime,
|
||||
// CreateUserId = qcChanllenge.CreateUserId,
|
||||
// CreateUser = qcChanllenge.CreateUser,
|
||||
// SubjectCode = subject.Code,
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
// DeadlineTime = qcChanllenge.DeadlineTime,
|
||||
// IsClosed = qcChanllenge.IsClosed,
|
||||
// ClosedTime = qcChanllenge.ClosedTime,
|
||||
// ClosedUser = qcChanllenge.ClosedUser,
|
||||
// NeedReUpload = qcChanllenge.NeedReUpload,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// LatestMsgTime = qcChanllenge.LatestMsgTime,
|
||||
// LatestReplyUser = qcChanllenge.LatestReplyUser,
|
||||
|
||||
// };
|
||||
#endregion
|
||||
|
||||
var svExpression = QCCommon.GetQCChallengeFilter(challengeQuery.VisitPlanArray);
|
||||
|
||||
@@ -228,7 +144,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
|
||||
.WhereIf(challengeQuery.ReuploadEnum != null, t => t.ReuploadEnum == challengeQuery.ReuploadEnum)
|
||||
.WhereIf(challengeQuery.IsClosed != null, t => t.IsClosed == challengeQuery.IsClosed)
|
||||
.WhereIf(challengeQuery.SiteId != null, t => t.SubjectVisit.SiteId == challengeQuery.SiteId)
|
||||
.WhereIf(challengeQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == challengeQuery.TrialSiteId)
|
||||
.WhereIf(challengeQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == challengeQuery.SubjectId)
|
||||
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
|
||||
.WhereIf(!string.IsNullOrEmpty(challengeQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode))
|
||||
@@ -275,170 +191,12 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
public async Task<(PageOutput<QCVisitViewModel>, TrialSubjectAndSVConfig)> GetQCVisitList(QCVisitSearchDTO visitSearchDTO)
|
||||
{
|
||||
|
||||
#region 经典 linq
|
||||
//Expression<Func<Subject, bool>> subjectLambda = x => true;
|
||||
|
||||
//Expression<Func<SubjectVisit, bool>> subjectVisitLambda = x => x.TrialId == visitSearchDTO.TrialId;
|
||||
//Expression<Func<DicomStudy, bool>> studyLambda = x => x.TrialId == visitSearchDTO.TrialId;
|
||||
////Expression<Func<VisitStage, bool>> visitPlanLambda = x => x.TrialId == subjectVisitSearch.TrialId;
|
||||
|
||||
//if (visitSearchDTO.SiteId != null && visitSearchDTO.SiteId != Guid.Empty)shiwu
|
||||
//{
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => t.SiteId == visitSearchDTO.SiteId.Value);
|
||||
// studyLambda = studyLambda.And(t => t.SiteId == visitSearchDTO.SiteId.Value);
|
||||
//}
|
||||
|
||||
//if (visitSearchDTO.SubjectId != null && visitSearchDTO.SubjectId != Guid.Empty)
|
||||
//{
|
||||
// subjectLambda = subjectLambda.And(t => t.Id == visitSearchDTO.SubjectId.Value);
|
||||
|
||||
// studyLambda = studyLambda.And(t => t.SubjectId == visitSearchDTO.SubjectId.Value);
|
||||
//}
|
||||
|
||||
//if (!string.IsNullOrEmpty(visitSearchDTO.SubjectInfo))
|
||||
//{
|
||||
// var search = visitSearchDTO.SubjectInfo.Trim();
|
||||
// subjectLambda = subjectLambda.And(t => t.FirstName.Contains(search) || t.LastName.Contains(search) || t.Code.Contains(search));
|
||||
//}
|
||||
|
||||
//if (!string.IsNullOrWhiteSpace(visitSearchDTO.VisitPlanInfo))
|
||||
//{
|
||||
// var visitInfo = visitSearchDTO.VisitPlanInfo.Trim();
|
||||
|
||||
// if (visitInfo.Contains('.')) // 包含小数点的是计划外访视
|
||||
// {
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => t.VisitNum.ToString().Contains("."));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (int.TryParse(visitInfo, out var visitNum))
|
||||
// {
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => t.VisitNum == visitNum);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//var query = from subjectVisit in _subjectVisitRepository.Where(subjectVisitLambda)
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on subjectVisit.SubjectId equals subject.Id
|
||||
// join trialSite in _trialSiteRepository.Where(t => t.TrialId == visitSearchDTO.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join study in _studyRepository.Where(studyLambda).GroupBy(t => t.SubjectVisitId).Select(g => new { SubjectVisitId = g.Key, StudyCount = g.Count() }) on subjectVisit.Id equals study.SubjectVisitId into d
|
||||
// from study in d.DefaultIfEmpty()
|
||||
// join trial in _trialRepository.AsQueryable() on subjectVisit.TrialId equals trial.Id
|
||||
|
||||
// select new QCVisitViewModel()
|
||||
// {
|
||||
// Id = subjectVisit.Id,
|
||||
// //VisitPlanId = visitStage.Id,
|
||||
// SubjectId = subjectVisit.SubjectId,
|
||||
// TrialId = subjectVisit.TrialId,
|
||||
// SiteId = subjectVisit.SiteId,
|
||||
|
||||
// VisitDay = subjectVisit.VisitDay,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// SVENDTC = subjectVisit.SVENDTC,
|
||||
// SVSTDTC = subjectVisit.SVSTDTC,
|
||||
// SVUPDES = subjectVisit.SVUPDES,
|
||||
// InPlan = subjectVisit.InPlan,
|
||||
// VisitExecuted = subjectVisit.VisitExecuted,
|
||||
|
||||
|
||||
// StudyCount = study.StudyCount,
|
||||
// SubjectStatus = subject.Status,
|
||||
|
||||
// SubjectCode = subject.Code,
|
||||
|
||||
// IsUrgent = subjectVisit.IsUrgent,
|
||||
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
|
||||
// EarliestScanDate = subjectVisit.EarliestScanDate,
|
||||
// LatestScanDate = subjectVisit.LatestScanDate,
|
||||
|
||||
// QCProcessEnum = trial.QCProcessEnum,
|
||||
// CurrentActionUserId = subjectVisit.CurrentActionUserId,
|
||||
// CurrentActionUser = subjectVisit.CurrentActionUser,
|
||||
// CurrentActionUserExpireTime = subjectVisit.CurrentActionUserExpireTime,
|
||||
// PreliminaryAuditTime = subjectVisit.PreliminaryAuditTime,
|
||||
// PreliminaryAuitUser = subjectVisit.PreliminaryAuitUser,
|
||||
// ReviewAuitTime = subjectVisit.ReviewAuitTime,
|
||||
// ReviewAuitUser = subjectVisit.ReviewAuitUser,
|
||||
|
||||
// AuditState = subjectVisit.AuditState,
|
||||
// SubmitTime = subjectVisit.SubmitTime,
|
||||
// IsTake = subjectVisit.IsTake,
|
||||
|
||||
// };
|
||||
#endregion
|
||||
|
||||
#region WhereIf + ling 统计
|
||||
//var query = from subjectVisit in _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
// .WhereIf(visitSearchDTO.SiteId != null, t => t.SiteId == visitSearchDTO.SiteId)
|
||||
// .WhereIf(visitSearchDTO.SubjectId != null, t => t.Subject.Id == visitSearchDTO.SubjectId)
|
||||
// .WhereIf(!string.IsNullOrEmpty(subjectInfo), t => /*t.Subject.FirstName.Contains(subjectInfo) || t.Subject.LastName.Contains(subjectInfo) ||*/ t.Subject.Code.Contains(subjectInfo))
|
||||
// .WhereIf(!string.IsNullOrEmpty(visitInfo), visitInfo.Contains('.') ? t => t.VisitNum.ToString().Contains(".") : t => t.VisitNum.ToString() == visitInfo)
|
||||
// .WhereIf(visitSearchDTO.AuditState != null, t => t.AuditState == visitSearchDTO.AuditState)
|
||||
// .WhereIf(visitSearchDTO.HandleUser != null, t => t.PreliminaryAuitUser.Contains(visitSearchDTO.HandleUser) || t.ReviewAuitUser.Contains(visitSearchDTO.HandleUser))
|
||||
// .WhereIf(visitSearchDTO.IsUrgent != null, t => t.IsUrgent == visitSearchDTO.IsUrgent)
|
||||
// //.WhereIf(visitSearchDTO.SubmitState != null, t => t.SubmitState == visitSearchDTO.SubmitState)
|
||||
// //.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState)
|
||||
// join subject in _subjectRepository.AsQueryable() on subjectVisit.SubjectId equals subject.Id
|
||||
// join trialSite in _trialSiteRepository.Where(t => t.TrialId == visitSearchDTO.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join study in _studyRepository.AsQueryable().GroupBy(t => t.SubjectVisitId).Select(g => new { SubjectVisitId = g.Key, StudyCount = g.Count() }) on subjectVisit.Id equals study.SubjectVisitId into d
|
||||
// from study in d.DefaultIfEmpty()
|
||||
// join trial in _trialRepository.AsQueryable() on subjectVisit.TrialId equals trial.Id
|
||||
|
||||
// select new QCVisitViewModel()
|
||||
// {
|
||||
// Id = subjectVisit.Id,
|
||||
// //VisitPlanId = visitStage.Id,
|
||||
// SubjectId = subjectVisit.SubjectId,
|
||||
// TrialId = subjectVisit.TrialId,
|
||||
// SiteId = subjectVisit.SiteId,
|
||||
|
||||
// VisitDay = subjectVisit.VisitDay,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// SVENDTC = subjectVisit.SVENDTC,
|
||||
// SVSTDTC = subjectVisit.SVSTDTC,
|
||||
// SVUPDES = subjectVisit.SVUPDES,
|
||||
// InPlan = subjectVisit.InPlan,
|
||||
// VisitExecuted = subjectVisit.VisitExecuted,
|
||||
// IsUrgent = subjectVisit.IsUrgent,
|
||||
// EarliestScanDate = subjectVisit.EarliestScanDate,
|
||||
// LatestScanDate = subjectVisit.LatestScanDate,
|
||||
|
||||
// CurrentActionUserId = subjectVisit.CurrentActionUserId,
|
||||
// CurrentActionUser = subjectVisit.CurrentActionUser,
|
||||
// CurrentActionUserExpireTime = subjectVisit.CurrentActionUserExpireTime,
|
||||
// PreliminaryAuditTime = subjectVisit.PreliminaryAuditTime,
|
||||
// PreliminaryAuitUser = subjectVisit.PreliminaryAuitUser,
|
||||
// ReviewAuitTime = subjectVisit.ReviewAuitTime,
|
||||
// ReviewAuitUser = subjectVisit.ReviewAuitUser,
|
||||
|
||||
// AuditState = subjectVisit.AuditState,
|
||||
// SubmitTime = subjectVisit.SubmitTime,
|
||||
// IsTake = subjectVisit.IsTake,
|
||||
|
||||
// QCProcessEnum = trial.QCProcessEnum,
|
||||
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
|
||||
// SubjectStatus = subject.Status,
|
||||
// SubjectCode = subject.Code,
|
||||
|
||||
// StudyCount = study.StudyCount,
|
||||
|
||||
// };
|
||||
|
||||
#endregion
|
||||
|
||||
var svExpression = QCCommon.GetSubjectVisitFilter(visitSearchDTO.VisitPlanArray);
|
||||
var query = _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
.WhereIf(visitSearchDTO.VisitId != null, t => t.Id == visitSearchDTO.VisitId)
|
||||
.WhereIf(visitSearchDTO.CurrentActionUserId != null, t => t.CurrentActionUserId == visitSearchDTO.CurrentActionUserId)
|
||||
.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState)
|
||||
.WhereIf(visitSearchDTO.SiteId != null, t => t.SiteId == visitSearchDTO.SiteId)
|
||||
.WhereIf(visitSearchDTO.TrialSiteId != null, t => t.TrialSiteId == visitSearchDTO.TrialSiteId)
|
||||
.WhereIf(visitSearchDTO.SubjectId != null, t => t.Subject.Id == visitSearchDTO.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(visitSearchDTO.SubjectInfo), t => /*t.Subject.FirstName.Contains(subjectInfo) || t.Subject.LastName.Contains(subjectInfo) ||*/ t.Subject.Code.Contains(visitSearchDTO.SubjectInfo))
|
||||
.WhereIf(visitSearchDTO.VisitPlanArray != null && visitSearchDTO.VisitPlanArray?.Length > 0, svExpression)
|
||||
@@ -481,60 +239,13 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
[HttpPost]
|
||||
public async Task<(PageOutput<QCCheckWithModalityView>, TrialSubjectAndSVConfig)> GetConsistencyVerificationList(CheckQuery checkQuery)
|
||||
{
|
||||
#region linq 废弃 byzhouhang 2021 11 30
|
||||
//Expression<Func<Subject, bool>> subjectLambda = x => true;
|
||||
//Expression<Func<SubjectVisit, bool>> subjectVisitLambda = x => x.TrialId == checkQuery.TrialId && x.AuditState == AuditStateEnum.QCPassed;
|
||||
//Expression<Func<DicomStudy, bool>> studyLambda = x => x.TrialId == checkQuery.TrialId;
|
||||
//if (checkQuery.SiteId != null && checkQuery.SiteId != Guid.Empty)
|
||||
//{
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => t.SiteId == checkQuery.SiteId.Value);
|
||||
//}
|
||||
//if (checkQuery.SubjectId != null && checkQuery.SubjectId != Guid.Empty)
|
||||
//{
|
||||
// subjectLambda = subjectLambda.And(t => t.Id == checkQuery.SubjectId.Value);
|
||||
//}
|
||||
|
||||
//if (_userInfo.UserTypeEnumInt == (int)UserType.ClinicalResearchCoordinator)
|
||||
//{
|
||||
// var siteQuery = _userTrialSiteRepository.Where(t => t.UserId == _userInfo.Id && t.TrialId == checkQuery.TrialId).Select(t => t.SiteId);
|
||||
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => siteQuery.Contains(t.SiteId));
|
||||
//}
|
||||
|
||||
//var query =
|
||||
// from subjectVisit in _subjectVisitRepository.Where(subjectVisitLambda)
|
||||
// join trialSite in _trialSiteRepository.Where(t => t.TrialId == checkQuery.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join subject in _subjectRepository.Where() on subjectVisit.SubjectId equals subject.Id
|
||||
|
||||
// select new QCCheckViewModel()
|
||||
// {
|
||||
// Id = subjectVisit.Id,
|
||||
// AuditState = subjectVisit.AuditState,
|
||||
|
||||
// CheckTime = subjectVisit.CheckTime,
|
||||
// CheckState = subjectVisit.CheckState,
|
||||
|
||||
// CheckChallengeState = subjectVisit.CheckChallengeState,
|
||||
|
||||
// CheckResult = subjectVisit.CheckResult,
|
||||
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
|
||||
// SubjectCode = subject.Code,
|
||||
|
||||
// //Modality=study.Modalities,
|
||||
// //StudyTime = subjectVisit.sv,
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
// };
|
||||
#endregion
|
||||
|
||||
var svExpression = QCCommon.GetSubjectVisitFilter(checkQuery.VisitPlanArray);
|
||||
|
||||
var query = _subjectVisitRepository.Where(x => x.TrialId == checkQuery.TrialId)
|
||||
.Where(x => x.AuditState == AuditStateEnum.QCPassed) //一致性核查中的,或者还没一致性核查的
|
||||
.WhereIf(checkQuery.CheckState != null, t => t.CheckState == checkQuery.CheckState)
|
||||
.WhereIf(checkQuery.SiteId != null, t => t.SiteId == checkQuery.SiteId)
|
||||
.WhereIf(checkQuery.TrialSiteId != null, t => t.TrialSiteId == checkQuery.TrialSiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(checkQuery.SubjectInfo), t => t.Subject.Code.Contains(checkQuery.SubjectInfo))
|
||||
.WhereIf(checkQuery.VisitPlanArray != null && checkQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
//.WhereIf(!string.IsNullOrEmpty(checkQuery.VisitPlanInfo), checkQuery.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(checkQuery.VisitPlanInfo))
|
||||
@@ -580,7 +291,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
var query = _subjectVisitRepository.Where(x => x.TrialId == forwardQuery.TrialId)
|
||||
.Where(t => t.CheckState == CheckStateEnum.CVPassed)
|
||||
.WhereIf(forwardQuery.ForwardState != null, t => t.ForwardState == forwardQuery.ForwardState)
|
||||
.WhereIf(forwardQuery.SiteId != null, t => t.SiteId == forwardQuery.SiteId)
|
||||
.WhereIf(forwardQuery.TrialSiteId != null, t => t.TrialSiteId == forwardQuery.TrialSiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(forwardQuery.SubjectInfo), t => t.Subject.Code.Contains(forwardQuery.SubjectInfo))
|
||||
.WhereIf(forwardQuery.VisitPlanArray != null && forwardQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
//.WhereIf(!string.IsNullOrEmpty(forwardQuery.VisitPlanInfo), forwardQuery.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(forwardQuery.VisitPlanInfo))
|
||||
|
||||
@@ -28,11 +28,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
private readonly IRepository<QCChallenge> _qcChallengeRepository;
|
||||
private readonly IRepository<DicomStudy> _dicomStudyRepository;
|
||||
private readonly IRepository<DicomSeries> _dicomSeriesrepository;
|
||||
private readonly IReadingClinicalDataService _readingClinicalDataService;
|
||||
private readonly IRepository<Subject> _subjectRepository;
|
||||
private readonly IReadingClinicalDataService _readingClinicalDataService;
|
||||
private readonly IRepository<Subject> _subjectRepository;
|
||||
private readonly IRepository<ReadingClinicalData> _readingClinicalDataRepository;
|
||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IRepository<QCChallengeDialog> _qCChallengeDialogrepository;
|
||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IRepository<QCChallengeDialog> _qCChallengeDialogrepository;
|
||||
private readonly IRepository<CheckChallengeDialog> _checkChallengeDialogrepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
@@ -45,11 +45,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<DicomStudy> dicomStudyRepository,
|
||||
IRepository<DicomSeries> dicomSeriesrepository,
|
||||
IReadingClinicalDataService readingClinicalDataService,
|
||||
IRepository<Subject> subjectRepository,
|
||||
IReadingClinicalDataService readingClinicalDataService,
|
||||
IRepository<Subject> subjectRepository,
|
||||
IRepository<ReadingClinicalData> readingClinicalDataRepository,
|
||||
IRepository<ClinicalDataTrialSet> clinicalDataTrialSetRepository,
|
||||
IRepository<QCChallengeDialog> qCChallengeDialogrepository,
|
||||
IRepository<ClinicalDataTrialSet> clinicalDataTrialSetRepository,
|
||||
IRepository<QCChallengeDialog> qCChallengeDialogrepository,
|
||||
IRepository<CheckChallengeDialog> checkChallengeDialogrepository,
|
||||
IVisitTaskHelpeService visitTaskHelpeService,
|
||||
IDistributedLockProvider distributedLockProvider
|
||||
@@ -59,11 +59,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
_qcChallengeRepository = qcChallengeRepository;
|
||||
_dicomStudyRepository = dicomStudyRepository;
|
||||
this._dicomSeriesrepository = dicomSeriesrepository;
|
||||
this._readingClinicalDataService = readingClinicalDataService;
|
||||
this._subjectRepository = subjectRepository;
|
||||
this._readingClinicalDataService = readingClinicalDataService;
|
||||
this._subjectRepository = subjectRepository;
|
||||
this._readingClinicalDataRepository = readingClinicalDataRepository;
|
||||
this._clinicalDataTrialSetRepository = clinicalDataTrialSetRepository;
|
||||
this._qCChallengeDialogrepository = qCChallengeDialogrepository;
|
||||
this._clinicalDataTrialSetRepository = clinicalDataTrialSetRepository;
|
||||
this._qCChallengeDialogrepository = qCChallengeDialogrepository;
|
||||
this._checkChallengeDialogrepository = checkChallengeDialogrepository;
|
||||
_trialRepository = trialRepository;
|
||||
this._visitTaskRepository = visitTaskRepository;
|
||||
@@ -894,7 +894,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
public async Task<GetNextIQCQualityOutDto> CollectNextIQCQuality(GetNextIQCQualityInDto inDto)
|
||||
{
|
||||
var nextIQCQuality = await this.GetNextIQCQuality(inDto);
|
||||
|
||||
|
||||
if (nextIQCQuality.VisitId != null)
|
||||
{
|
||||
var visit = await _subjectVisitRepository.Where(x => x.Id == nextIQCQuality.VisitId).FirstNotNullAsync();
|
||||
@@ -902,7 +902,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
await ObtainOrCancelQCTask(inDto.TrialId, nextIQCQuality.VisitId.Value, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return nextIQCQuality;
|
||||
@@ -932,23 +932,24 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
break;
|
||||
case TrialQCProcess.SingleAudit:
|
||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted
|
||||
&& x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId!= _userInfo.Id&&(x.CurrentActionUserId == _userInfo.Id || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake)))
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y=>!y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.Id)
|
||||
.Include(x => x.Subject).ToListAsync();
|
||||
&& x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId != _userInfo.Id && (x.CurrentActionUserId == _userInfo.Id || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake)))
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.Id)
|
||||
.Include(x => x.Subject).ToListAsync();
|
||||
|
||||
subjectVisit = visitList.Where(x => x.SubjectId == inDto.SubjectId)
|
||||
|
||||
subjectVisit = visitList.Where(x => x.SubjectId == inDto.SubjectId)
|
||||
|
||||
.OrderBy(x=>x.VisitNum).FirstOrDefault();
|
||||
if(subjectVisit!=null)
|
||||
|
||||
.OrderBy(x => x.VisitNum).FirstOrDefault();
|
||||
if (subjectVisit != null)
|
||||
{
|
||||
return new GetNextIQCQualityOutDto() {
|
||||
SubjectId= subjectVisit.SubjectId,
|
||||
VisitId= subjectVisit.Id
|
||||
return new GetNextIQCQualityOutDto()
|
||||
{
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
VisitId = subjectVisit.Id
|
||||
};
|
||||
}
|
||||
|
||||
subjectVisit= visitList.OrderBy(x => x.Subject.Code).ThenBy(x=>x.VisitNum).FirstOrDefault();
|
||||
subjectVisit = visitList.OrderBy(x => x.Subject.Code).ThenBy(x => x.VisitNum).FirstOrDefault();
|
||||
if (subjectVisit != null)
|
||||
{
|
||||
return new GetNextIQCQualityOutDto()
|
||||
@@ -965,10 +966,10 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
case TrialQCProcess.DoubleAudit:
|
||||
|
||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId &&
|
||||
((x.CurrentActionUserId == _userInfo.Id)||(!x.IsTake&& x.AuditState != AuditStateEnum.QCPassed&& (x.PreliminaryAuditUserId != _userInfo.Id)))
|
||||
((x.CurrentActionUserId == _userInfo.Id) || (!x.IsTake && x.AuditState != AuditStateEnum.QCPassed && (x.PreliminaryAuditUserId != _userInfo.Id)))
|
||||
)
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId !=_userInfo.Id)
|
||||
.Include(x => x.Subject).ToListAsync();
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.Id)
|
||||
.Include(x => x.Subject).ToListAsync();
|
||||
if (subjectVisit != null)
|
||||
{
|
||||
return new GetNextIQCQualityOutDto()
|
||||
@@ -1027,14 +1028,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
//throw new BusinessValidationFailedException("当前访视已被领取,不允许领取");
|
||||
|
||||
//---当前访视的影像质控任务已被其他QC领取,不允许领取
|
||||
//---当前访视的影像质控任务已被其他QC领取,不允许领取
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCTaskNoAccess"], ApiResponseCodeEnum.NeedTips);
|
||||
|
||||
}
|
||||
|
||||
if (await _subjectVisitRepository.AnyAsync(t => t.Trial.QCQuestionConfirmedUserId == null && t.Id == subjectVisitId))
|
||||
{
|
||||
//---请先配置影像质控审核问题,再领取影像质控任务
|
||||
//---请先配置影像质控审核问题,再领取影像质控任务
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCConfigFirst"], ApiResponseCodeEnum.NeedTips);
|
||||
}
|
||||
|
||||
@@ -1053,14 +1054,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||
{
|
||||
//---项目配置为不审,没有领取QC Task
|
||||
//---项目配置为不审,没有领取QC Task
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoQC"]);
|
||||
}
|
||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
||||
{
|
||||
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id)
|
||||
{
|
||||
//---初审已通过,不能继续领取
|
||||
//---初审已通过,不能继续领取
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_InitialAuditPassed"]);
|
||||
}
|
||||
|
||||
@@ -1074,15 +1075,15 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
else
|
||||
{
|
||||
// ---项目配置为单审,不满足Submmit State:已提交 或者 Audit State:待审核/审核中, 不允许领取,请刷新界面
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSingleAudit"]);
|
||||
// ---项目配置为单审,不满足Submmit State:已提交 或者 Audit State:待审核/审核中, 不允许领取,请刷新界面
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSingleAudit"]);
|
||||
}
|
||||
}
|
||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit)
|
||||
{
|
||||
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id)
|
||||
{
|
||||
//---复审不能和初审是同一个人
|
||||
//---复审不能和初审是同一个人
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSameReviewer"]);
|
||||
}
|
||||
|
||||
@@ -1102,7 +1103,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
else
|
||||
{
|
||||
//---项目配置为复审,不满足提交状态:已提交 或者 审核状态:待审核/QC中, 不允许领取,请刷新界面
|
||||
//---项目配置为复审,不满足提交状态:已提交 或者 审核状态:待审核/QC中, 不允许领取,请刷新界面
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSecondaryAudit"]);
|
||||
}
|
||||
}
|
||||
@@ -1123,14 +1124,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
if (dbSubjectVisit!.CurrentActionUserId != _userInfo.Id)
|
||||
{
|
||||
//---您不是该质控任务当前领取人,没有操作权限!
|
||||
//---您不是该质控任务当前领取人,没有操作权限!
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoRecipient"], ApiResponseCodeEnum.NeedTips);
|
||||
}
|
||||
|
||||
|
||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||
{
|
||||
//---项目配置影像质控为不审,不需要取消任务功能
|
||||
//---项目配置影像质控为不审,不需要取消任务功能
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCFunction"]);
|
||||
}
|
||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
||||
@@ -1143,7 +1144,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
else
|
||||
{
|
||||
//---当前访视影像质控任务没有当前领取人,不能释放。
|
||||
//---当前访视影像质控任务没有当前领取人,不能释放。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoTaskOwner"]);
|
||||
}
|
||||
}
|
||||
@@ -1163,7 +1164,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
else
|
||||
{
|
||||
//---当前访视影像质控任务没有当前领取人,不能释放。
|
||||
//---当前访视影像质控任务没有当前领取人,不能释放。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoTaskOwner"]);
|
||||
}
|
||||
}
|
||||
@@ -1214,7 +1215,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
|
||||
//同时要根据项目有没有配置Subject 级别临床数据
|
||||
if (dbSubjectVisitList.Any(t => t.IsBaseLine && !t.IsHaveClinicalData)&&trialinfo.ClinicalInformationTransmissionEnum!=0)
|
||||
if (dbSubjectVisitList.Any(t => t.IsBaseLine && !t.IsHaveClinicalData) && trialinfo.ClinicalInformationTransmissionEnum != 0)
|
||||
{
|
||||
|
||||
//---基线没有临床数据,确认提交?
|
||||
@@ -1235,36 +1236,36 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
//[Authorize(Policy = IRaCISPolicy.CRC)]
|
||||
public async Task<IResponseOutput> CRCRequestToQC(CRCRequestToQCCommand cRCRequestToQCCommand)
|
||||
{
|
||||
List<string> modalitieTypess = new List<string>() { "PT、CT", "CT、PT", "PET-CT" };
|
||||
List<string> modalitieTypess = new List<string>() { "PT、CT", "CT、PT", "PET-CT" };
|
||||
// 验证临床数据 是否有Pet类型
|
||||
#region 验证临床数据 是否有Pet类型
|
||||
if (await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == cRCRequestToQCCommand.TrialId && x.IsConfirm && x.ClinicalDataLevel == ClinicalLevel.Study))
|
||||
{
|
||||
foreach (var item in cRCRequestToQCCommand.SubjectVisitIds)
|
||||
{
|
||||
foreach (var item in cRCRequestToQCCommand.SubjectVisitIds)
|
||||
{
|
||||
|
||||
if (await _dicomStudyRepository.AnyAsync(x => x.SubjectVisitId == item && modalitieTypess.Contains(x.Modalities)))
|
||||
{
|
||||
var visit = await _subjectVisitRepository.Where(x => x.Id == item).FirstNotNullAsync();
|
||||
var clinicalData = await this._readingClinicalDataService.GetStudyClinicalData(new Service.Reading.Dto.GetStudyClinicalDataInDto()
|
||||
{
|
||||
SubjectVisitId = item,
|
||||
});
|
||||
if (await _dicomStudyRepository.AnyAsync(x => x.SubjectVisitId == item && modalitieTypess.Contains(x.Modalities)))
|
||||
{
|
||||
var visit = await _subjectVisitRepository.Where(x => x.Id == item).FirstNotNullAsync();
|
||||
var clinicalData = await this._readingClinicalDataService.GetStudyClinicalData(new Service.Reading.Dto.GetStudyClinicalDataInDto()
|
||||
{
|
||||
SubjectVisitId = item,
|
||||
});
|
||||
|
||||
if (!clinicalData.Any(x => x.ClinicalDataLevel == ClinicalLevel.Study && x.ClinicalUploadType == ClinicalUploadType.PDF && x.PDFFileList.Count() > 0))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["QCOperation_NeedStudyClinical"]);
|
||||
}
|
||||
}
|
||||
if (!clinicalData.Any(x => x.ClinicalDataLevel == ClinicalLevel.Study && x.ClinicalUploadType == ClinicalUploadType.PDF && x.PDFFileList.Count() > 0))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["QCOperation_NeedStudyClinical"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
var trialId = cRCRequestToQCCommand.TrialId;
|
||||
var trialId = cRCRequestToQCCommand.TrialId;
|
||||
|
||||
var trialConfig = (await _trialRepository
|
||||
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification, t.IsUrgent, t.IsHaveFirstGiveMedicineDate, t.ClinicalInformationTransmissionEnum })
|
||||
@@ -1273,11 +1274,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
//找到符合配置的标准 确认的并且签名的、双重,有序,阅片期仲裁
|
||||
var trialReadingCriterionIdList = _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == cRCRequestToQCCommand.TrialId && t.IsConfirm && t.ReadingInfoSignTime != null
|
||||
//&& t.ReadingType == ReadingMethod.Double && t.ArbitrationRule == ArbitrationRule.Reading
|
||||
&& t.IsReadingTaskViewInOrder && t.IsReadingPeriod).Select(t => t.Id).ToList();
|
||||
&& t.IsReadingTaskViewInOrder == ReadingOrder.InOrder && t.IsReadingPeriod).Select(t => t.Id).ToList();
|
||||
|
||||
var trialInOrderCriterionIdList = _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == cRCRequestToQCCommand.TrialId && t.IsConfirm && t.ReadingInfoSignTime != null
|
||||
//&& t.ReadingType == ReadingMethod.Double && t.ArbitrationRule == ArbitrationRule.Reading
|
||||
&& t.IsReadingTaskViewInOrder).Select(t => t.Id).ToList();
|
||||
&& t.IsReadingTaskViewInOrder == ReadingOrder.InOrder).Select(t => t.Id).ToList();
|
||||
|
||||
|
||||
var dbSubjectVisitList = await _subjectVisitRepository.Where(t => cRCRequestToQCCommand.SubjectVisitIds.Contains(t.Id), true).Include(t => t.Subject).ToListAsync();
|
||||
@@ -1311,82 +1312,36 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
//基线不验证
|
||||
if (trialConfig.IsHaveFirstGiveMedicineDate && !dbSubjectVisit.IsBaseLine && dbSubjectVisit.Subject.FirstGiveMedicineTime == null)
|
||||
{
|
||||
//---项目配置了需要填写访视基准日期。但是受试者没有填写访视基准日期,不允许提交
|
||||
//---项目配置了需要填写访视基准日期。但是受试者没有填写访视基准日期,不允许提交
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_MissingBaselineDate"]);
|
||||
}
|
||||
|
||||
//基线 且配置了临床数据
|
||||
//if (trialConfig.ClinicalInformationTransmissionEnum != 0 /*&& dbSubjectVisit.IsBaseLine*//*&&dbSubjectVisit.ClinicalDataSignUserId==null*/)
|
||||
//{
|
||||
if (_subjectVisitRepository.Where(t => t.Id == dbSubjectVisit.Id).Any(t => (t.StudyList.Count(t => t.ModalityForEdit == "") > 0 ||t.NoneDicomStudyList.Count(t => t.Modality == "")>0) && t.Trial.TrialReadingCriterionList.Count(t => t.IsImageFilter == true) > 0))
|
||||
{
|
||||
//有标准配置了影像筛选,该受试者有检查未设置检查类型,不允许提交
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_MissingModality"]);
|
||||
}
|
||||
|
||||
|
||||
////找到需要确认的PDF 临床数据 如果没有CRC 没有上传 那么就添加一条没有文件的记录
|
||||
|
||||
//var crcNeedConfirmClinicalDataSetList = clinicalDataConfirmList.Where(t => t.UploadRole == UploadRole.CRC && t.ClinicalUploadType == ClinicalUploadType.PDF).ToList();
|
||||
|
||||
//// 找到CRC 已经自己添加的临床PDF数据文件
|
||||
|
||||
//var crcAddClinicalDataIdList = _readingClinicalDataRepository.Where(t => t.ReadingId == dbSubjectVisit.Id && t.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && t.ClinicalDataTrialSet.ClinicalUploadType == ClinicalUploadType.PDF)
|
||||
// .Select(t => new { t.ClinicalDataTrialSetId }).ToList();
|
||||
|
||||
//foreach (var crcNeedConfirmClinicalDataSet in crcNeedConfirmClinicalDataSetList)
|
||||
//{
|
||||
// if (!crcAddClinicalDataIdList.Any(t => t.ClinicalDataTrialSetId == crcNeedConfirmClinicalDataSet.Id))
|
||||
// {
|
||||
// await _repository.AddAsync(new ReadingClinicalData()
|
||||
// {
|
||||
// TrialId = dbSubjectVisit.TrialId,
|
||||
// SubjectId = dbSubjectVisit.SubjectId,
|
||||
// ReadingId = dbSubjectVisit.Id,
|
||||
// ClinicalDataTrialSetId = crcNeedConfirmClinicalDataSet.Id,
|
||||
// IsVisit = true,
|
||||
// IsSign = true,
|
||||
// ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned
|
||||
|
||||
// });
|
||||
// }
|
||||
//}
|
||||
|
||||
//已确认临床数据完整性
|
||||
dbSubjectVisit.IsConfirmedClinicalData = true;
|
||||
//已确认临床数据完整性
|
||||
dbSubjectVisit.IsConfirmedClinicalData = true;
|
||||
|
||||
|
||||
// CRC 上传的基线数据签名
|
||||
|
||||
List<ClinicalLevel> clinicalneedSign = new List<ClinicalLevel>() {
|
||||
ClinicalLevel.Subject,
|
||||
ClinicalLevel.SubjectVisit,
|
||||
ClinicalLevel.Study,
|
||||
};
|
||||
|
||||
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x =>
|
||||
clinicalneedSign.Contains(x.ClinicalDataTrialSet.ClinicalDataLevel)&&
|
||||
x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == dbSubjectVisit.Id && x.IsSign==false, x => new ReadingClinicalData()
|
||||
{
|
||||
IsSign = true,
|
||||
ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned
|
||||
});
|
||||
|
||||
|
||||
|
||||
//var signSuccess = await _repository.UpdateFromQueryAsync<TrialSign>(t => t.Id == cRCRequestToQCCommand.SignId, u => new TrialSign() { IsCompleted = true });
|
||||
|
||||
|
||||
////现在修改为 提交时 设置签名信息
|
||||
//dbSubjectVisit.ClinicalDataSignUserId = _userInfo.Id;
|
||||
//dbSubjectVisit.ClinicalDataSignTime = DateTime.Now;
|
||||
|
||||
//那么没有录入 不允许提交
|
||||
//if (!await _repository.AnyAsync<SubjectVisit>(t => t.PreviousHistoryList.Any() || t.PreviousOtherList.Any() || t.PreviousSurgeryList.Any()))
|
||||
//{
|
||||
// return ResponseOutput.NotOk("没有临床数据,不允许提交");
|
||||
//}
|
||||
|
||||
//return ResponseOutput.NotOk("没有签名临床数据,不允许提交");
|
||||
//}
|
||||
|
||||
|
||||
ClinicalLevel.Subject,
|
||||
ClinicalLevel.SubjectVisit,
|
||||
ClinicalLevel.Study,
|
||||
};
|
||||
|
||||
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x =>
|
||||
clinicalneedSign.Contains(x.ClinicalDataTrialSet.ClinicalDataLevel) &&
|
||||
x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == dbSubjectVisit.Id && x.IsSign == false, x => new ReadingClinicalData()
|
||||
{
|
||||
IsSign = true,
|
||||
ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned
|
||||
});
|
||||
|
||||
|
||||
var maxVisit = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.SubmitState == SubmitStateEnum.Submitted)
|
||||
@@ -1411,16 +1366,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId)&& x.SubjectId == dbSubjectVisit.SubjectId&&
|
||||
dbSubjectVisit.VisitNum<= x.VisitTaskNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum+0.01m) // 当前的访视 全局 裁判 及之前 全都加急
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId &&
|
||||
dbSubjectVisit.VisitNum <= x.VisitTaskNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum + 0.01m) // 当前的访视 全局 裁判 及之前 全都加急
|
||||
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||
{
|
||||
|
||||
IsUrgent = true,
|
||||
TaskUrgentType = TaskUrgentType.PDProgress,
|
||||
IsCanEditUrgentState=false,
|
||||
IsCanEditUrgentState = false,
|
||||
});
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId
|
||||
@@ -1430,7 +1383,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
IsUrgent = true,
|
||||
TaskUrgentType = TaskUrgentType.Other,
|
||||
TaskUrgentRemake= "后续访视设为pd",
|
||||
TaskUrgentRemake = "后续访视设为pd",
|
||||
IsCanEditUrgentState = false,
|
||||
});
|
||||
}
|
||||
@@ -1442,7 +1395,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
});
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) &&
|
||||
x.VisitTaskNum>= dbSubjectVisit.VisitNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum + 0.01m) // 当前的访视 全局 裁判 全都加急
|
||||
x.VisitTaskNum >= dbSubjectVisit.VisitNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum + 0.01m) // 当前的访视 全局 裁判 全都加急
|
||||
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||
{
|
||||
|
||||
@@ -1466,14 +1419,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
dbSubjectVisit.IsUrgent = true;
|
||||
|
||||
|
||||
//PD确认的紧急会把前面所有未QC完成的访视均标记为紧急
|
||||
|
||||
var previosSVlist = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.VisitNum < dbSubjectVisit.VisitNum && t.IsUrgent == false && t.SubmitState == SubmitStateEnum.Submitted, true).ToListAsync();
|
||||
|
||||
previosSVlist.ForEach(t =>
|
||||
{
|
||||
t.IsUrgent = true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1524,7 +1470,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
|
||||
//非基线设置为PD的话 或者设置为末次访视 根据配置自动生成阅片期
|
||||
if (!dbSubjectVisit.IsBaseLine && (dbSubjectVisit.PDState == PDStateEnum.PDProgress || dbSubjectVisit.IsFinalVisit) )
|
||||
if (!dbSubjectVisit.IsBaseLine && (dbSubjectVisit.PDState == PDStateEnum.PDProgress || dbSubjectVisit.IsFinalVisit))
|
||||
{
|
||||
|
||||
//该标准需要添加阅片期
|
||||
@@ -1592,7 +1538,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
//判断质疑是否都关闭了
|
||||
if (await _repository.AnyAsync<QCChallenge>(t => t.SubjectVisitId == subjectVisitId && t.IsClosed == false))
|
||||
{
|
||||
//---当前访视有影像质控质疑未关闭,不能进行此操作。
|
||||
//---当前访视有影像质控质疑未关闭,不能进行此操作。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotClosed"]);
|
||||
}
|
||||
}
|
||||
@@ -1623,7 +1569,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||
{
|
||||
//---项目配置影像质控为不审,不需要设置为影像质控通过。
|
||||
//---项目配置影像质控为不审,不需要设置为影像质控通过。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCNeeded"]);
|
||||
|
||||
}
|
||||
@@ -1633,7 +1579,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.First))
|
||||
{
|
||||
//---影像质控审核问题没有保存,不能进行此操作。
|
||||
//---影像质控审核问题没有保存,不能进行此操作。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
||||
}
|
||||
|
||||
@@ -1654,11 +1600,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
||||
|
||||
//var dicomStudy = new DicomStudy() { Id = t.StudyId, SubjectId = t.SubjectId, TrialId = trialId, SiteId = t.SiteId, SubjectVisitId = subjectVisitId };
|
||||
//var (physicalPath, relativePath) =
|
||||
|
||||
// FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, t.InstanceId);
|
||||
|
||||
if (System.IO.File.Exists(physicalPath))
|
||||
{
|
||||
File.Delete(physicalPath);
|
||||
@@ -1669,7 +1610,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
else
|
||||
{
|
||||
//---项目配置影像质控为单审,当前访视影像质控任务不能从当前审核状态变更到 审核通过。
|
||||
//---项目配置影像质控为单审,当前访视影像质控任务不能从当前审核状态变更到 审核通过。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NotChangePass"]);
|
||||
}
|
||||
|
||||
@@ -1685,7 +1626,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.First))
|
||||
{
|
||||
//---影像质控审核问题没有保存,不能进行此操作。
|
||||
//---影像质控审核问题没有保存,不能进行此操作。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
||||
}
|
||||
|
||||
@@ -1700,7 +1641,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.Second))
|
||||
{
|
||||
//---影像质控审核问题没有保存,不能进行此操作。
|
||||
//---影像质控审核问题没有保存,不能进行此操作。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
||||
}
|
||||
|
||||
@@ -1745,7 +1686,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||
{
|
||||
//---项目配置影像质控为不审,不允许设置影像质控终止。
|
||||
//---项目配置影像质控为不审,不允许设置影像质控终止。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCNeededNotEnd"]);
|
||||
}
|
||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
||||
@@ -1785,7 +1726,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
}
|
||||
|
||||
await _qcChallengeRepository.UpdatePartialFromQueryAsync(t => t.IsClosed == false&& t.SubjectVisitId==dbSubjectVisit.Id, u => new QCChallenge() { IsClosed = true, ClosedTime=DateTime.Now, CloseResonEnum = QCChallengeCloseEnum.Unresolvable });
|
||||
await _qcChallengeRepository.UpdatePartialFromQueryAsync(t => t.IsClosed == false && t.SubjectVisitId == dbSubjectVisit.Id, u => new QCChallenge() { IsClosed = true, ClosedTime = DateTime.Now, CloseResonEnum = QCChallengeCloseEnum.Unresolvable });
|
||||
|
||||
|
||||
}
|
||||
@@ -1965,31 +1906,31 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
throw new BusinessValidationFailedException(_localizer["QCOperation_InvalidCompleteResend"]);
|
||||
}
|
||||
|
||||
List<string> modalitieTypess = new List<string>() { "PT、CT", "CT、PT", "PET-CT" };
|
||||
// 验证临床数据 是否有Pet类型
|
||||
#region 验证临床数据 是否有Pet类型
|
||||
if (await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == cRCReuploadFinishedCommand.TrialId && x.IsConfirm && x.ClinicalDataLevel == ClinicalLevel.Study))
|
||||
{
|
||||
List<string> modalitieTypess = new List<string>() { "PT、CT", "CT、PT", "PET-CT" };
|
||||
// 验证临床数据 是否有Pet类型
|
||||
#region 验证临床数据 是否有Pet类型
|
||||
if (await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == cRCReuploadFinishedCommand.TrialId && x.IsConfirm && x.ClinicalDataLevel == ClinicalLevel.Study))
|
||||
{
|
||||
var item = qcChallenge.SubjectVisitId;
|
||||
if (await _dicomStudyRepository.AnyAsync(x => x.SubjectVisitId == item && modalitieTypess.Contains(x.Modalities)))
|
||||
{
|
||||
var visit = await _subjectVisitRepository.Where(x => x.Id == item).FirstNotNullAsync();
|
||||
var clinicalData = await this._readingClinicalDataService.GetStudyClinicalData(new Service.Reading.Dto.GetStudyClinicalDataInDto()
|
||||
{
|
||||
SubjectVisitId = item,
|
||||
});
|
||||
if (await _dicomStudyRepository.AnyAsync(x => x.SubjectVisitId == item && modalitieTypess.Contains(x.Modalities)))
|
||||
{
|
||||
var visit = await _subjectVisitRepository.Where(x => x.Id == item).FirstNotNullAsync();
|
||||
var clinicalData = await this._readingClinicalDataService.GetStudyClinicalData(new Service.Reading.Dto.GetStudyClinicalDataInDto()
|
||||
{
|
||||
SubjectVisitId = item,
|
||||
});
|
||||
|
||||
if (!clinicalData.Any(x => x.ClinicalDataLevel == ClinicalLevel.Study && x.ClinicalUploadType == ClinicalUploadType.PDF && x.PDFFileList.Count() > 0))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["QCOperation_NeedStudyClinical"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!clinicalData.Any(x => x.ClinicalDataLevel == ClinicalLevel.Study && x.ClinicalUploadType == ClinicalUploadType.PDF && x.PDFFileList.Count() > 0))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["QCOperation_NeedStudyClinical"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
var subjectVisitId = qcChallenge.SubjectVisitId;
|
||||
var subjectVisitId = qcChallenge.SubjectVisitId;
|
||||
|
||||
if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.StudyList).CountAsync() == 0 &&
|
||||
await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.NoneDicomStudyList).SelectMany(u => u.NoneDicomFileList).CountAsync() == 0)
|
||||
@@ -2124,14 +2065,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId)
|
||||
.AnyAsync(t => t.SubmitState == SubmitStateEnum.Submitted && t.IsEnrollmentConfirm != command.IsEnrollmentConfirm))
|
||||
{
|
||||
//---该访视已提交,不能修改入组确认状态
|
||||
//---该访视已提交,不能修改入组确认状态
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyConfirmation"]);
|
||||
}
|
||||
|
||||
if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId)
|
||||
.AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack))
|
||||
{
|
||||
//---该访视为回退访视,不允许修改PD确认状态
|
||||
//---该访视为回退访视,不允许修改PD确认状态
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]);
|
||||
}
|
||||
|
||||
@@ -2168,7 +2109,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
var targetPath = "/IMPORT-IMAGES/" + info.TrialCode + "_" + info.SubjectCode + "_" + info.VisitName;
|
||||
|
||||
var path = FileStoreHelper.GetSubjectVisitDicomFolderPhysicalPath(_hostEnvironment, info.TrialId, info.SiteId, info.SubjectId, info.SubjectVisitId);
|
||||
var path = FileStoreHelper.GetSubjectVisitDicomFolderPhysicalPath(_hostEnvironment, info.TrialId, info.TrialSiteId, info.SubjectId, info.SubjectVisitId);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -2218,7 +2159,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
|
||||
//---转发影像失败。
|
||||
//---转发影像失败。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + result.Failures.ToString() + result.ToJson());
|
||||
}
|
||||
}
|
||||
@@ -2238,8 +2179,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
|
||||
// --转发影像失败
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + e.Message);
|
||||
// --转发影像失败
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + e.Message);
|
||||
}
|
||||
|
||||
|
||||
@@ -2249,7 +2190,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
||||
//---转发影像失败。
|
||||
//---转发影像失败。
|
||||
return isSuccess ? ResponseOutput.Ok() : ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
CreateMap<Subject, SubjectExportDTO>()
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.Site.SiteName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.LatestBlindName, u => u.MapFrom(s => s.LatestSubjectVisit.BlindName))
|
||||
.ForMember(d => d.LatestVisitName, u => u.MapFrom(s => s.LatestSubjectVisit.VisitName))
|
||||
@@ -104,7 +104,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
|
||||
.ForMember(d => d.CheckDialogStr, u => u.MapFrom(t => string.Join(" | ", t.CheckChallengeDialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " " + c.CreateTime.ToString("yyyy-MM-dd hh:mm:ss") + " :" + c.TalkContent))))
|
||||
.ForMember(d => d.CheckDialogStr, u => u.MapFrom(t => string.Join(" | ", t.CheckChallengeDialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " " + c.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") + " :" + c.TalkContent))))
|
||||
.ForMember(d => d.ModalityList, c => c.MapFrom(s =>
|
||||
(s.NoneDicomStudyList.Select(t => t.Modality)
|
||||
.Union(s.StudyList.Select(k => k.ModalityForEdit))).Distinct()))
|
||||
@@ -253,9 +253,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
string token = string.Empty;
|
||||
bool isFilterZip = false;
|
||||
|
||||
string token = string.Empty;
|
||||
//一致性核查
|
||||
CreateMap<CheckDBModel, CheckViewModel>();
|
||||
|
||||
@@ -439,7 +440,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(d => d.IsHaveFirstGiveMedicineDate, u => u.MapFrom(s => s.Trial.IsHaveFirstGiveMedicineDate))
|
||||
//.ForMember(d => d.ChangeDefalutDays, u => u.MapFrom(s => s.Trial.ChangeDefalutDays))
|
||||
.ForMember(d => d.SubjectFirstGiveMedicineTime, u => u.MapFrom(s => s.Subject.FirstGiveMedicineTime))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Site.SiteName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName))
|
||||
.ForMember(d => d.TotalChallengeCount, u => u.MapFrom(s => s.QCChallengeList.Count()))
|
||||
.ForMember(d => d.NotClosedChallengeCount, u => u.MapFrom(s => s.QCChallengeList.Count(c => c.IsClosed == false)));
|
||||
|
||||
@@ -513,7 +514,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(d => d.SubmitState, u => u.MapFrom(s => s.SubjectVisit.SubmitState))
|
||||
|
||||
|
||||
.ForMember(d => d.SiteId, u => u.MapFrom(s => s.SubjectVisit.SiteId))
|
||||
.ForMember(d => d.TrialSiteId, u => u.MapFrom(s => s.SubjectVisit.TrialSiteId))
|
||||
.ForMember(d => d.AuditState, u => u.MapFrom(s => s.SubjectVisit.AuditState))
|
||||
.ForMember(d => d.IsUrgent, u => u.MapFrom(s => s.SubjectVisit.IsUrgent))
|
||||
.ForMember(d => d.IsBaseLine, u => u.MapFrom(s => s.SubjectVisit.IsBaseLine))
|
||||
@@ -560,7 +561,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<NoneDicomStudy, NoneDicomStudyView>()
|
||||
//.ForMember(d => d.FileCount, u => u.MapFrom(s => s.NoneDicomFileList.Count))
|
||||
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => s.NoneDicomFileList))
|
||||
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip? s.NoneDicomFileList.Where(t=>!t.FileType.Contains(StaticData.FileType.Zip)): s.NoneDicomFileList))
|
||||
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
+2
-2
@@ -457,7 +457,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
TrialId = subjectVisit.TrialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
SubjectCode = subjectVisit.Subject.Code,
|
||||
SiteId = subjectVisit.SiteId,
|
||||
TrialSiteId = subjectVisit.TrialSiteId,
|
||||
TrialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
||||
LatestScanDate = subjectVisit.LatestScanDate,
|
||||
EarliestScanDate = subjectVisit.LatestScanDate,
|
||||
@@ -691,7 +691,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
&& t.TrialReadingCriterionId == command.TrialReadingCriterionId;
|
||||
|
||||
//有序
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
filterExpression = filterExpression.And(t => t.VisitTaskNum >= subjectVisit.VisitNum);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using IRaCIS.Core.Application.Service.Reading.Interface;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using OfficeOpenXml.FormulaParsing.Excel.Functions.Information;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace IRaCIS.Application.Services
|
||||
public IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
|
||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IRepository<TrialClinicalDataSetCriterion> _trialClinicalDataSetCriterionRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _iReadingQuestionCriterionTrialRepository;
|
||||
private readonly IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository;
|
||||
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||
@@ -34,6 +35,7 @@ namespace IRaCIS.Application.Services
|
||||
public ClinicalDataSetService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IClinicalQuestionService iClinicalQuestionService,
|
||||
IRepository<ClinicalDataTrialSet> ClinicalDataTrialSetRepository,
|
||||
IRepository<TrialClinicalDataSetCriterion> trialClinicalDataSetCriterionRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> iReadingQuestionCriterionTrialRepository,
|
||||
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
||||
IRepository<PreviousPDF> previousPDFRepository,
|
||||
@@ -51,6 +53,7 @@ namespace IRaCIS.Application.Services
|
||||
_trialClinicalQuestionRepository = trialClinicalQuestionRepository;
|
||||
_systemClinicalQuestionRepository = systemClinicalQuestionRepository;
|
||||
_clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
|
||||
this._trialClinicalDataSetCriterionRepository = trialClinicalDataSetCriterionRepository;
|
||||
this._iReadingQuestionCriterionTrialRepository = iReadingQuestionCriterionTrialRepository;
|
||||
_clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
|
||||
this._previousPDFRepository = previousPDFRepository;
|
||||
@@ -243,7 +246,10 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
//indto.CriterionEnumListStr = $"|{String.Join('|', indto.CriterionEnumList)}|";
|
||||
|
||||
var entity = await _clinicalDataTrialSetRepository.InsertOrUpdateAsync(indto, true);
|
||||
//var entity = _mapper.Map<TEntity>(from);
|
||||
|
||||
indto.CreateTime = DateTime.Now;
|
||||
var entity = await _clinicalDataTrialSetRepository.InsertOrUpdateAsync(indto);
|
||||
|
||||
entity.TrialClinicalDataSetCriteriaList = indto.TrialCriterionIdList.Select(t => new TrialClinicalDataSetCriterion()
|
||||
{
|
||||
@@ -253,7 +259,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
if (indto.Id != null)
|
||||
{
|
||||
await _repository.BatchDeleteAsync<TrialClinicalDataSetCriterion>(t => t.TrialClinicalDataSetId == entity.Id);
|
||||
await _trialClinicalDataSetCriterionRepository.DeleteFromQueryAsync(t => t.TrialClinicalDataSetId == entity.Id);
|
||||
|
||||
await _repository.AddRangeAsync<TrialClinicalDataSetCriterion>(entity.TrialClinicalDataSetCriteriaList);
|
||||
}
|
||||
|
||||
@@ -299,6 +299,13 @@ namespace IRaCIS.Application.Services
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
if (inDto.FilterNoneForm)
|
||||
{
|
||||
cRCClinicalDataList = cRCClinicalDataList.Where(x => !(x.ClinicalFromList.Count() == 0 && x.ClinicalUploadType == ClinicalUploadType.Structuring)).ToList();
|
||||
|
||||
}
|
||||
|
||||
return cRCClinicalDataList;
|
||||
}
|
||||
|
||||
@@ -371,7 +378,26 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
//await this.iServiceProvider.GetService<IReadingImageTaskService>().AddOncologyTask(readingId);
|
||||
|
||||
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, inDto.TrialReadingCriterionId);
|
||||
//如果先生成了任务,再签名subject级别 PM 临床数据,那么会导致其他标准的任务签名状态无法得到维护
|
||||
|
||||
if (await _repository.AnyAsync<ClinicalDataTrialSet>(t=>t.Id == data.ClinicalDataTrialSetId && t.UploadRole == UploadRole.PM && t.ClinicalDataLevel == ClinicalLevel.Subject))
|
||||
{
|
||||
var needDealTrialReadingCriterionIdList = _repository.Where<ClinicalDataTrialSet>(t => t.Id == data.ClinicalDataTrialSetId)
|
||||
.SelectMany(t => t.TrialClinicalDataSetCriteriaList)
|
||||
.Select(u => u.TrialReadingCriterionId).Distinct().ToList();
|
||||
|
||||
foreach (var trialReadingCriterionId in needDealTrialReadingCriterionIdList)
|
||||
{
|
||||
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, trialReadingCriterionId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, inDto.TrialReadingCriterionId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Result(result);
|
||||
}
|
||||
@@ -481,12 +507,22 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
//有序阅片才维护 IsFrontTaskNeedSignButNotSign 这个状态
|
||||
if (_readingQuestionCriterionTrialRepository.Any(t=>t.Id==trialReadingCritrialId && t.IsReadingTaskViewInOrder == true))
|
||||
if (_readingQuestionCriterionTrialRepository.Any(t=>t.Id==trialReadingCritrialId && t.IsReadingTaskViewInOrder == ReadingOrder.InOrder))
|
||||
{
|
||||
|
||||
|
||||
Expression<Func<VisitTask, bool>> visitTaskLambda = x => x.TrialId == trialId && x.SubjectId == subjectId && x.TrialReadingCriterionId == trialReadingCritrialId;
|
||||
|
||||
if (isVisit)
|
||||
{
|
||||
//访视类型的任务 不影响肿瘤学任务的临床数据状态
|
||||
visitTaskLambda = visitTaskLambda.And(x => x.ArmEnum != Arm.TumorArm);
|
||||
}
|
||||
else
|
||||
{
|
||||
visitTaskLambda = visitTaskLambda.And(x => x.ArmEnum == Arm.TumorArm);
|
||||
}
|
||||
|
||||
|
||||
//维护 IsFrontTaskNeedSignButNotSign 在添加任务哪里用触发器也维护了
|
||||
var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
|
||||
|
||||
@@ -44,10 +44,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// </summary>
|
||||
public UploadRole UploadRole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public string? SiteCode { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public string SiteCode { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public string OutPlanPreviousVisitName { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public bool IsVisit { get; set; } = true;
|
||||
|
||||
|
||||
@@ -158,6 +158,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public Guid? StudyId { get; set; }
|
||||
|
||||
public bool FilterNoneForm { get; set; } = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1573,7 +1573,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public Guid? QuestionId { get; set; }
|
||||
|
||||
public bool IsHaveChange { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值
|
||||
/// </summary>
|
||||
public decimal? JudgeDifferenceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值匹配规则
|
||||
/// </summary>
|
||||
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
||||
|
||||
public bool IsHaveChange { get; set; } = false;
|
||||
|
||||
public string VisitAnswer { get; set; } = string.Empty;
|
||||
|
||||
@@ -1686,6 +1696,20 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
}
|
||||
|
||||
|
||||
public class ResetReadingTaskOutDto
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class ResetReadingTaskInDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
}
|
||||
|
||||
public class SetSkipReadingCacheInDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
}
|
||||
public class GetNextTaskInDto
|
||||
{
|
||||
|
||||
@@ -1750,7 +1774,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// <summary>
|
||||
/// 任务展示访视 读片任务显示是否顺序
|
||||
/// </summary>
|
||||
public bool IsReadingTaskViewInOrder { get; set; } = true;
|
||||
public ReadingOrder IsReadingTaskViewInOrder { get; set; }
|
||||
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
@@ -1810,8 +1834,18 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public List<string> AnswerGroup { get; set; }
|
||||
|
||||
|
||||
public List<AnswerCombinationDto> AnswerCombination { get; set; }
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值
|
||||
/// </summary>
|
||||
public decimal? JudgeDifferenceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值匹配规则
|
||||
/// </summary>
|
||||
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
||||
|
||||
|
||||
public List<AnswerCombinationDto> AnswerCombination { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -1821,8 +1855,23 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public class GetTrialCriterionJudgeQuestionListOutDto
|
||||
{
|
||||
public Guid ReadingQuestionTrialId { get; set; }
|
||||
|
||||
public string QuestionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值
|
||||
/// </summary>
|
||||
public decimal? JudgeDifferenceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值匹配规则
|
||||
/// </summary>
|
||||
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
||||
|
||||
public string QuestionName { get; set; }
|
||||
|
||||
|
||||
public string PageName { get; set; }
|
||||
@@ -2257,7 +2306,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public Guid QuestionId { get; set; }
|
||||
|
||||
public string AnswerGroup { get; set; }
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值
|
||||
/// </summary>
|
||||
public decimal? JudgeDifferenceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值匹配规则
|
||||
/// </summary>
|
||||
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
||||
public string AnswerGroup { get; set; }
|
||||
|
||||
|
||||
public string AnswerCombination { get; set; }
|
||||
@@ -2301,7 +2359,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public string AnswerCombination { get; set; }
|
||||
|
||||
public JudgeTypeEnum JudgeType { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值
|
||||
/// </summary>
|
||||
public decimal? JudgeDifferenceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 裁判百分比或绝对值的相差值匹配规则
|
||||
/// </summary>
|
||||
public JudgeDifferenceType JudgeDifferenceType { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class GetSystemReadingQuestionPageDto
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// <summary>
|
||||
/// 任务展示访视 读片任务显示是否顺序
|
||||
/// </summary>
|
||||
public bool IsReadingTaskViewInOrder { get; set; } = true;
|
||||
public ReadingOrder IsReadingTaskViewInOrder { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -385,7 +385,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public string ReadingUser { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public bool IsReadingTaskViewInOrder { get; set; }
|
||||
public ReadingOrder IsReadingTaskViewInOrder { get; set; }
|
||||
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
|
||||
@@ -328,6 +328,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// </summary>
|
||||
public CustomCalculateMark? CustomCalculateMark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TrialId
|
||||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IsDepend
|
||||
@@ -586,7 +590,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public bool IsReadingTaskViewInOrder { get; set; }
|
||||
public ReadingOrder IsReadingTaskViewInOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仲裁阅片
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
|
||||
|
||||
Task ResetReadingRestTime(Guid? userId);
|
||||
Task<bool> ResetReadingRestTime(Guid? userId);
|
||||
|
||||
Task<List<GetReadingPastResultListOutDto>> GetReadingPastResultList(GetReadingPastResultListInDto inDto);
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
break;
|
||||
case ReadingCategory.Visit:
|
||||
// 有序
|
||||
if (medicalReviewInfo.IsReadingTaskViewInOrder)
|
||||
if (medicalReviewInfo.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
medicalReviewInfo.TaskList = await _visitTaskRepository
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using Panda.DynamicWebApi.Attributes;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -1093,10 +1094,10 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
await _readingTableQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.TrialCriterionId == trialCriterion.Id);
|
||||
await _readingTableQuestionTrialRepository.AddRangeAsync(needAddTableDatas);
|
||||
#endregion
|
||||
await _readingTableQuestionTrialRepository.AddRangeAsync(_mapper.Map<List<ReadingTableQuestionTrial>>(needAddTableDatas));
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
-2
@@ -250,7 +250,9 @@ namespace IRaCIS.Application.Services
|
||||
.Select(y => new GlobalQuestionInfo()
|
||||
{
|
||||
|
||||
QuestionId = y.ReadingQuestionTrialId,
|
||||
JudgeDifferenceValue= y.ReadingQuestionTrial.JudgeDifferenceValue,
|
||||
|
||||
QuestionId = y.ReadingQuestionTrialId,
|
||||
QuestionName = y.ReadingQuestionTrial.QuestionName.LanguageName(y.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us),
|
||||
QuestionEnName=y.ReadingQuestionTrial.QuestionEnName,
|
||||
AnswerGroup = y.ReadingQuestionTrial.AnswerGroup,
|
||||
@@ -290,6 +292,7 @@ namespace IRaCIS.Application.Services
|
||||
x.BeforeQuestionList.Add(new GlobalQuestionInfo()
|
||||
{
|
||||
QuestionId = y.Id,
|
||||
JudgeDifferenceValue=y.JudgeDifferenceValue,
|
||||
QuestionName = y.QuestionName.LanguageName(y.QuestionEnName, _userInfo.IsEn_Us),
|
||||
QuestionEnName = y.QuestionEnName,
|
||||
AnswerGroup = y.AnswerGroup,
|
||||
@@ -373,7 +376,8 @@ namespace IRaCIS.Application.Services
|
||||
(lr.global.Select(x => x.Answer).FirstOrDefault().IsNullOrEmpty() && inDto.UsingOriginalData ?
|
||||
lr.question.Answer : lr.global.Select(x => x.Answer).FirstOrDefault()
|
||||
),
|
||||
VisitAnswer = lr.question.Answer,
|
||||
JudgeDifferenceValue= lr.question.JudgeDifferenceValue,
|
||||
VisitAnswer = lr.question.Answer,
|
||||
IsHaveChange = lr.global.Any(x=>x.QuestionId!=null&&!x.Answer.IsNullOrEmpty()) ? true : false,
|
||||
QuestionId = lr.question.QuestionId,
|
||||
QuestionName = lr.question.QuestionName.LanguageName(lr.question.QuestionEnName, _userInfo.IsEn_Us),
|
||||
@@ -507,6 +511,7 @@ namespace IRaCIS.Application.Services
|
||||
.Select(x => new CriterionDictionaryInfo()
|
||||
{
|
||||
Id = x.Id,
|
||||
|
||||
DictionaryId = x.DictionaryId,
|
||||
ChildGroup = x.Dictionary.ChildGroup,
|
||||
IsBaseLineUse=x.IsBaseLineUse,
|
||||
|
||||
+523
-378
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user