Uat_Study
he 2023-06-14 09:45:47 +08:00
commit 3643693bde
31 changed files with 659 additions and 281 deletions

View File

@ -93,6 +93,7 @@ namespace IRaCIS.Api.Controllers
[FromServices] ITokenService _tokenService, [FromServices] IConfiguration configuration)
{
var returnModel = await _userService.Login(loginUser.UserName, loginUser.Password);
if (returnModel.IsSuccess)
@ -160,6 +161,17 @@ namespace IRaCIS.Api.Controllers
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);
}
var userId = returnModel.Data.BasicInfo.Id.ToString();
@ -205,6 +217,8 @@ namespace IRaCIS.Api.Controllers
var token = decodeUrl.Substring(decodeUrl.IndexOf("access_token=") + "access_token=".Length);
var lang = decodeUrl.Substring(decodeUrl.IndexOf("lang=") + "lang=".Length, 2);
var domainStrList = decodeUrl.Split("/").ToList().Take(3).ToList();
var errorUrl = domainStrList[0]+"//"+ domainStrList[2]+ "/error";
@ -212,7 +226,7 @@ namespace IRaCIS.Api.Controllers
if (!await _userRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd))
{
decodeUrl = errorUrl+ $"?ErrorMessage={System.Web.HttpUtility.UrlEncode("")} ";
decodeUrl = errorUrl+ $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(lang=="zh"? "": "ErrorThe initialization link has expired. Return")} ";
}
return Redirect(decodeUrl);

View File

@ -32,7 +32,7 @@
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,35 +4,35 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6;font-size: 16px'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
<div style='line-height: 40px;font-size: 16px'>
Dear {0} ,
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Extimaging has added an account for you. The account information is as follows:
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
Extensive Imaging has generated a user account for you. <br>The account information is as follows:
</div>
<span style="color: #00D1B2"></span>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;font-size: 16px'>
<div>
User name: {1}
User ID: {1}
</div>
<div>
Role: {2}
</div>
<div>
Before logging in for the first time, please modify your account information by this link
<a href='{3}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
Initialize the account information
Before logging in for the first time, please initialize your account information through this link:
<a href='{3}' style='margin-left:30px;font-size:12px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;font-size: 16px'>
Initialize Account Information
</a>
</div>
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -29,7 +29,7 @@
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,19 +4,19 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6;font-size: 16px'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
<div style='line-height: 40px;font-size: 16px'>
Dear {0} ,
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Extimaging has reset your account password, and the account information is as follows:
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
Extensive Imaging has reset your password.<br>The account information is as follows:
</div>
<span style="color: #00D1B2"></span>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 12px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;font-size: 16px'>
<div>
User name: {1}
User ID: {1}
</div>
<div>
Role: {2}
@ -27,9 +27,9 @@
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -19,7 +19,7 @@
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,22 +4,22 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;font-size: 16px'>
<div style='padding-left: 40px;background: #f6f6f6;font-size: 16px'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
Dear
<div style='line-height: 40px;font-size: 16px'>
Dear Sir or Madam:
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Thank you for using Extensive Imaging Cloud System.
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
Thank you for using our IRC imaging system.
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
{0}。
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -11,7 +11,7 @@
尊敬的 {0} ,您好:
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商诚邀您参加该项目IRC阅片相关工作,欢迎您提供指导和建议,非常感谢!
展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商诚邀您参加该项目IRC阅片相关工作
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
该项目采用电子化工作流,系统及您的账号信息如下:
@ -41,7 +41,7 @@
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,20 +4,20 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
<div style='line-height: 40px;font-size: 16px'>
Dear {0},
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] projectExtiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
As the IRC service provider of {1} trialProtocol ID is {2}, Extensive Imaging invites you to participate in the independent assessment work of this trial.
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
This project adopts electronic workflow. The system and your account information are as follows
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
Digital workflow is implemented for this trial, and your account information is as follows:
</div>
<span style="color: #00D1B2"></span>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;font-size: 16px'>
<div>
Trial ID: {3}
</div>
@ -25,23 +25,22 @@
Protocol ID: {2}
</div>
<div>
Study name: {1}
Study Name: {1}
</div>
<div>
User name: {4}
User Name: {4}
</div>
<div>
Role: {5}
</div>
<div>
System login address:{6}
Login URL: {6}
</div>
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -44,7 +44,7 @@
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,20 +4,21 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
<div style='line-height: 40px;font-size: 16px'>
Dear {0},
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] projectExtiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
As the IRC service provider of {1}trial (Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial.
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
This project adopts electronic workflow. The system and your account information are as follows
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
Digital workflow is implemented for this trial, and your account information is as follows:
</div>
<span style="color: #00D1B2"></span>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;font-size: 16px'>
<div>
Trial ID: {3}
</div>
@ -25,26 +26,26 @@
Protocol ID: {2}
</div>
<div>
Study name: {1}
Study Name: {1}
</div>
<div>
User name: {4}
User ID: {4}
</div>
<div>
Role: {5}
</div>
<div>
Before logging in for the first time, please modify your account information by this link
<a href='{6}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
Initialize the account information
Before logging in for the first time, please modify your account information through this link:
<a href='{6}' style='margin-left:30px;font-size:16px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
Initialize Account Information
</a>
</div>
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;font-size: 16px'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -41,7 +41,7 @@
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,17 +4,17 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;font-size: 16px'>
<div style='padding-left: 40px;background: #f6f6f6;font-size: 16px'>
<div style='padding-top: 20px;font-size: 16px'>
<div style='line-height: 40px;font-size: 16px'>
Dear {0} ,
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Hello, the center survey form you filled in has been rejected. The details are as follows
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
The site survey questionnaire you filled in has been rejected. Details are as follows:
</div>
<span style="color: #00D1B2"></span>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;font-size: 16px'>
<div>
Trial ID: {1}
</div>
@ -22,26 +22,26 @@
Protocol ID: {2}
</div>
<div>
Study name: {3}
Study Name: {3}
</div>
<div>
Site ID: {4}
</div>
<div>
Site name: {5}
Site Name: {5}
</div>
<div>
Reason for rejection: {6}
</div>
</div>
<a href='{7}' style='margin-left:60px;font-size:14px;padding: 10px;text-decoration: none;display:{8} ;height: 40px;width: 140px;background: #00D1B2;color:#fff;border-radius: 5px;line-height: 40px;text-align: center;margin-bottom: 100px;'>
Login and view
<a href='{7}' style='margin-left:60px;font-size:16px;padding: 10px;text-decoration: none;display:{8} ;height: 40px;width: 140px;background: #00D1B2;color:#fff;border-radius: 5px;line-height: 40px;text-align: center;margin-bottom: 100px;font-size: 16px'>
Login & View
</a>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -41,7 +41,7 @@
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,20 +4,20 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;font-size: 16px'>
<div style='padding-left: 40px;background: #f6f6f6;font-size: 16px'>
<div style='padding-top: 20px;font-size: 16px'>
<div style='line-height: 40px;font-size: 16px'>
Dear {0},
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] projectExtiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
As the IRC service provider of {1} trial (Protocol ID is {2}), Extensive Imaging invites you to participate in IRC-related work of this trial.
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
This project adopts electronic workflow. The system and your account information are as follows
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
Digital workflow is implemented for this trial, and your account information is as follows:
</div>
<span style="color: #00D1B2"></span>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;font-size: 16px'>
<div>
Trial ID: {3}
</div>
@ -25,23 +25,23 @@
Protocol ID: {2}
</div>
<div>
Study name: {1}
Study Name: {1}
</div>
<div>
User name: {4}
User Name: {4}
</div>
<div>
Role: {5}
</div>
<div>
System login address:{6}
Login URL: {6}
</div>
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -11,7 +11,7 @@
尊敬的 {0} ,您好:
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商诚邀您参加该项目IRC相关工作,欢迎您提供指导和建议,非常感谢!
展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商诚邀您参加该项目IRC相关工作
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
该项目采用电子化工作流,系统及您的账号信息如下:
@ -44,7 +44,7 @@
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,20 +4,20 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;font-size: 16px'>
<div style='padding-left: 40px;background: #f6f6f6'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
<div style='line-height: 40px;font-size: 16px'>
Dear {0},
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] projectExtiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
As the IRC service provider of {1} trial (Protocol ID is {2}), Extensive Imaging invites you to participate in IRC-related work of this trial.
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
This project adopts electronic workflow. The system and your account information are as follows
Digital workflow is implemented for this trial, and your account information is as follows:
</div>
<span style="color: #00D1B2"></span>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;font-size: 16px'>
<div>
Trial ID: {3}
</div>
@ -25,26 +25,26 @@
Protocol ID: {2}
</div>
<div>
Study name: {1}
Study Name: {1}
</div>
<div>
User name: {4}
User Name: {4}
</div>
<div>
Role: {5}
</div>
<div>
Before logging in for the first time, please modify your account information by this link
<a href='{6}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
Initialize the account information
Before logging in for the first time, please modify your account information through this link:
<a href='{6}' style='margin-left:30px;font-size:16px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
Initialize Account Information
</a>
</div>
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 16px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -8,18 +8,18 @@
<div style='padding-left: 40px;background: #f6f6f6'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
Dear {0},
亲爱的用户 ,
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
感谢您使用展影云平台。
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
{1},验证码是: {2}请在3分钟内输入该验证码进行后续操作。如非本人操作请忽略该邮件。
{0},验证码是: {1}请在3分钟内输入该验证码进行后续操作。如非本人操作请忽略该邮件。
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>祝您顺利!/Best Regards</div>
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
<div style="font-size: 14px;">展影医疗</div>
</div>
</div>
</div>

View File

@ -4,23 +4,25 @@
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<body style='font-family: Times New Roman;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<div style='padding-top: 20px;'>
<div style='line-height: 40px;font-size: 18px'>
Dear {0},
<div style='line-height: 40px;font-size: 16px'>
Dear Sir or Madam:
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Thank you for using Extensive Imaging Cloud System.
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
Thank you for using our IRC imaging system.
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
{1}, the verification code is {2}. Enter the verification code within 3 minutes for subsequent operations. Please ignore this email if not by yourself.
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
{0}, the verification code is {1}. Please enter this code within 3 minutes for follow-up operations.
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
If you are not the intended person, please ignore this email.
</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
<div>Best Regards</div>
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;font-size: 16px'>
<div>Best regards,</div>
<div style="font-size: 16px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -3,6 +3,7 @@ using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
@ -11,9 +12,9 @@ namespace IRaCIS.Core.Application.Filter;
public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilter
public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
{
public IStringLocalizer _localizer { get; set; }
private readonly IEasyCachingProvider _provider;
@ -21,11 +22,12 @@ public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilt
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
public LimitUserRequestAuthorization(IEasyCachingProvider provider, IUserInfo userInfo, IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig)
public LimitUserRequestAuthorization(IEasyCachingProvider provider, IUserInfo userInfo, IStringLocalizer localizer ,IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig)
{
_provider = provider;
_userInfo = userInfo;
_verifyConfig = verifyConfig;
_localizer = localizer;
}

View File

@ -9922,6 +9922,7 @@
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetReReadingApplyToBeDoneList(IRaCIS.Core.Application.Contracts.ReReadingApplyToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTaskReReading},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
@ -9929,6 +9930,8 @@
重阅申请待审核
</summary>
<param name="inQuery"></param>
<param name="_visitTaskReReadingRepository"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetReviewerSelectToBeDoneList(IRaCIS.Core.Application.Contracts.ReviewerSelectToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Enroll},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
@ -9936,6 +9939,8 @@
阅片人筛选
</summary>
<param name="inQuery"></param>
<param name="_enrollRepository"></param>
<param name="_trialRepository"></param>
<returns></returns> vvv
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetReReadingApprovalToBeDoneToBeDoneList(IRaCIS.Core.Application.Contracts.ReReadingApprovalToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTaskReReading},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
@ -9943,6 +9948,8 @@
重阅审批
</summary>
<param name="inQuery"></param>
<param name="_visitTaskReReadingRepository"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageClinicalDataToBeDoneList(IRaCIS.Core.Application.Contracts.ImageClinicalDataToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
@ -9959,6 +9966,7 @@
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageCheckQuestionToBeDoneList(IRaCIS.Core.Application.Contracts.ImageCheckQuestionToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
@ -10001,12 +10009,13 @@
<param name="_subjectVisitRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetIRImageReadingToBeDoneList(IRaCIS.Core.Application.Contracts.IRImageReadingToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetIRImageReadingToBeDoneList(IRaCIS.Core.Application.Contracts.IRImageReadingToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
IR 影像阅片 待阅量 复杂 --未完成
IR 影像阅片 待阅量
</summary>
<param name="inQuery"></param>
<param name="_visitTaskRepository"></param>
<param name="_trialReadingCriterionRepository"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>

View File

@ -1081,11 +1081,15 @@ namespace IRaCIS.Core.Application.Service.Allocation
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(t => t.IsGeneratedTask == false) ?
t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
//前序 不存在 未生成任务的访视
.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(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
// 前序 不存在 未一致性核查未通过的
.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))
@ -1412,7 +1416,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
//添加申请记录
var visitTaskReReading = await _visitTaskReReadingRepository.AddAsync(new VisitTaskReReading()
{
TrialId=applyReReadingCommand.TrialId,
RootReReadingTaskId = rootReReadingTaskId == Guid.Empty ? task.Id : rootReReadingTaskId,
OriginalReReadingTaskId = task.Id,
RequestReReadingTime = DateTime.Now,

View File

@ -186,7 +186,6 @@ namespace IRaCIS.Application.Services
builder.HtmlBody = string.Format(templateInfo,
"",
//---您正在进行邮箱重置密码操作
_localizer["Mail_ResettingPassword "],
verificationCode
@ -254,7 +253,6 @@ namespace IRaCIS.Application.Services
builder.HtmlBody = string.Format(templateInfo,
"",
//---您正在参与展影医疗IRC项目
_localizer["Mail_IRCProject"],
verificationCode
@ -321,7 +319,6 @@ namespace IRaCIS.Application.Services
builder.HtmlBody = string.Format(templateInfo,
"",
//---您正在参与展影医疗IRC项目中心调研工作
_localizer["Mail_CenterResearchReminder"],
verificationCode

View File

@ -383,16 +383,25 @@ namespace IRaCIS.Application.Services
}
//有序阅片才维护 IsFrontTaskNeedSignButNotSign 这个状态
if (_readingQuestionCriterionTrialRepository.Any(t=>t.Id==trialReadingCritrialId && t.IsReadingTaskViewInOrder == true))
{
Expression<Func<VisitTask, bool>> visitTaskLambda = x => x.TrialId == trialId && x.SubjectId == subjectId && x.TrialReadingCriterionId == trialReadingCritrialId;
//维护 IsFrontTaskNeedSignButNotSign 在添加任务哪里用触发器也维护了
var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
//小于自己任务号的任务 存在需要签名 但是没签名
.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
&& t.IsFrontTaskNeedSignButNotSign == false )
.Where(t => t.IsFrontTaskNeedSignButNotSign == false &&
(t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
// 前序存在 未一致性核查未通过的
|| t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum>sv.VisitNum)
))
.Select(t => t.Id);
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable.Contains(t.Id), u => new VisitTask()
@ -403,9 +412,15 @@ namespace IRaCIS.Application.Services
var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
//小于自己任务号的任务 存在需要签名 但是没签名
.Where(t => !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
&& t.IsFrontTaskNeedSignButNotSign == true )
.Where(t => t.IsFrontTaskNeedSignButNotSign == true &&
//前序任务 不存在需要签名 但是没签名
!t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
// 前序 不存在 未一致性核查未通过的
&& !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)
)
.Select(t => t.Id);
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask()
@ -413,6 +428,11 @@ namespace IRaCIS.Application.Services
IsFrontTaskNeedSignButNotSign = false
});
}
}

View File

@ -149,6 +149,10 @@ namespace IRaCIS.Core.Application.Contracts
public class IRImageReadingToBeDoneDto : TrialBaseInfoDto
{
public Guid TrialReadingCriterionId { get; set; }
public string CriterionName { get; set; }
public int? UrgentCount { get; set; }
public int? UnReadCount { get; set; }
@ -167,11 +171,11 @@ namespace IRaCIS.Core.Application.Contracts
public class MedicalCommentsToBeDoneDto : TrialBaseInfoDto
{
public Guid TrialReadingCriterionId { get; set; }
public string CriterionName { get; set; }
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
public int? ToBeReplyedCount { get; set; }
}
public class ImageCheckQuestionToBeDoneQuery : PageInput
@ -183,7 +187,7 @@ namespace IRaCIS.Core.Application.Contracts
{
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
public int? ToBeReplyedCount { get; set; }
}
public class ImageSubmittedToBeDoneQuery : PageInput
@ -224,7 +228,7 @@ namespace IRaCIS.Core.Application.Contracts
{
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
public int? ToBeReUploadCount { get; set; }
}
public class ImageClinicalDataToBeDoneQuery : PageInput
@ -239,7 +243,52 @@ namespace IRaCIS.Core.Application.Contracts
public int? ToBeDealedCount { get; set; }
}
public class TrialToBeDoneQuery : PageInput
{
public string ExperimentName { get; set; } = string.Empty;
public string Code { get; set; } = string.Empty;
public string ResearchProgramNo { get; set; } = string.Empty;
public Guid? SponsorId { get; set; }
}
public class TrialToBeDoneDto : TrialBaseInfoDto
{
public Guid Id => TrialId;
public DateTime? CreateTime { get; set; }
public string Sponsor { get; set; }
public string TrialStatusStr { get; set; }
public int? ExpetiedTaskCount { get; set; }
public int? ReReadingApprovalCount { get; set; }
public int? PendingReconciliationCount { get; set; }
public int? PendingResponseCount { get; set; }
public bool IsIQCHaveToBeDone { get; set; }
public bool IsCRCHaveToBeDone { get; set; }
public bool IsMIMHaveToBeDone { get; set; }
public bool IsIRHaveToBeDone { get; set; }
public bool IsSPMOrCPMHaveToBeDone { get; set; }
}

View File

@ -1,5 +1,8 @@
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application
@ -163,19 +166,22 @@ namespace IRaCIS.Core.Application
#region PM APM 待办
/// <summary>
/// 一致性核查待处理
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<CheckToBeDoneDto>> GetCheckToBeDoneList(CheckToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<CheckToBeDoneDto>>> GetCheckToBeDoneList(CheckToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new CheckToBeDoneDto()
{
TrialId = t.Id,
@ -183,14 +189,25 @@ namespace IRaCIS.Core.Application
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList.Where(u => (u.CheckState == CheckStateEnum.ToCheck || u.CheckState == CheckStateEnum.CVIng) && u.IsUrgent).Count(),
ToBeCheckedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.ToCheck).Count(),
ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.ToCheck &&
u.CheckChallengeDialogList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)).Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync();
var totalToBeRepliedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.CheckState == CheckStateEnum.ToCheck &&
u.CheckChallengeDialogList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)).CountAsync();
return ResponseOutput.Ok(result, new { TotalToBeCheckedCount = totalToBeCheckedCount, TotalToBeRepliedCount = totalToBeRepliedCount });
}
@ -198,14 +215,18 @@ namespace IRaCIS.Core.Application
/// 重阅申请待审核
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_visitTaskReReadingRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ReReadingApplyToBeDoneDto>> GetReReadingApplyToBeDoneList(ReReadingApplyToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ReReadingApplyToBeDoneDto>>> GetReReadingApplyToBeDoneList(ReReadingApplyToBeDoneQuery inQuery,
[FromServices] IRepository<VisitTaskReReading> _visitTaskReReadingRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed)
var query = _visitTaskReReadingRepository
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed)
.GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId })
.Select(g => new ReReadingApplyToBeDoneDto()
{
@ -221,11 +242,17 @@ namespace IRaCIS.Core.Application
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeApprovalCount = _visitTaskReReadingRepository
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed).Count();
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount });
}
#endregion
@ -235,13 +262,16 @@ namespace IRaCIS.Core.Application
/// 阅片人筛选
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_enrollRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns> vvv
[HttpPost]
public async Task<PageOutput<ReviewerSelectToBeDoneDto>> GetReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery
public async Task<IResponseOutput<PageOutput<ReviewerSelectToBeDoneDto>>> GetReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery
, [FromServices] IRepository<Enroll> _enrollRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ReviewerSelectToBeDoneDto()
{
TrialId = t.Id,
@ -255,7 +285,10 @@ namespace IRaCIS.Core.Application
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
return ResponseOutput.Ok(result, new { ToBeApprovalCount = toBeApprovalCount }); ;
}
@ -263,14 +296,18 @@ namespace IRaCIS.Core.Application
/// 重阅审批
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_visitTaskReReadingRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ReReadingApprovalToBeDoneDto>> GetReReadingApprovalToBeDoneToBeDoneList(ReReadingApprovalToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ReReadingApprovalToBeDoneDto>>> GetReReadingApprovalToBeDoneToBeDoneList(ReReadingApprovalToBeDoneQuery inQuery,
[FromServices] IRepository<VisitTaskReReading> _visitTaskReReadingRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
var query = _visitTaskReReadingRepository
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
.GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId })
.Select(g => new ReReadingApprovalToBeDoneDto()
{
@ -286,7 +323,11 @@ namespace IRaCIS.Core.Application
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeApprovalCount = _visitTaskReReadingRepository
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed).Count();
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount });
}
@ -303,12 +344,13 @@ namespace IRaCIS.Core.Application
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageClinicalDataToBeDoneDto>> GetImageClinicalDataToBeDoneList(ImageClinicalDataToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ImageClinicalDataToBeDoneDto>>> GetImageClinicalDataToBeDoneList(ImageClinicalDataToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
.Select(t => new ImageClinicalDataToBeDoneDto()
{
@ -323,7 +365,11 @@ namespace IRaCIS.Core.Application
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count();
return ResponseOutput.Ok(result, new { TotalToBeDealedCount = toBeDealedCount });
}
@ -336,14 +382,16 @@ namespace IRaCIS.Core.Application
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageQuestionToBeDoneDto>> GetCRCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ImageQuestionToBeDoneDto>>> GetCRCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ImageQuestionToBeDoneDto()
{
TrialId = t.Id,
@ -352,6 +400,7 @@ namespace IRaCIS.Core.Application
TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC && u.SubjectVisit.IsUrgent).Count(),
ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(),
@ -360,7 +409,12 @@ namespace IRaCIS.Core.Application
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count();
return ResponseOutput.Ok(result, new { TotalToBeDealedCount = toBeDealedCount });
}
@ -371,12 +425,13 @@ namespace IRaCIS.Core.Application
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageCheckQuestionToBeDoneDto>> GetImageCheckQuestionToBeDoneList(ImageCheckQuestionToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ImageCheckQuestionToBeDoneDto>>> GetImageCheckQuestionToBeDoneList(ImageCheckQuestionToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ImageCheckQuestionToBeDoneDto()
{
TrialId = t.Id,
@ -384,13 +439,21 @@ namespace IRaCIS.Core.Application
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply && u.IsUrgent).Count(),
ToBeDealedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply ).Count()
ToBeReplyedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count()
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count();
return ResponseOutput.Ok(result, new { TotalToBeReplyedCount = toBeDealedCount });
}
@ -402,12 +465,13 @@ namespace IRaCIS.Core.Application
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageReUploadToBeDoneDto>> GetImageReUploadToBeDoneList(ImageReUploadToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ImageReUploadToBeDoneDto>>> GetImageReUploadToBeDoneList(ImageReUploadToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ImageReUploadToBeDoneDto()
{
TrialId = t.Id,
@ -415,13 +479,17 @@ namespace IRaCIS.Core.Application
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsUrgent && u.IsPMBackOrReReading).Count(),
ToBeDealedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(),
ToBeReUploadCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count();
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount });
}
@ -435,12 +503,13 @@ namespace IRaCIS.Core.Application
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageSubmittedToBeDoneDto>> GetImageSubmittedToBeDoneList(ImageSubmittedToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ImageSubmittedToBeDoneDto>>> GetImageSubmittedToBeDoneList(ImageSubmittedToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ImageSubmittedToBeDoneDto()
{
TrialId = t.Id,
@ -454,7 +523,11 @@ namespace IRaCIS.Core.Application
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count();
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount });
}
@ -473,12 +546,14 @@ namespace IRaCIS.Core.Application
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageQualityToBeDoneDto>> GetImageQualityToBeDoneList(ImageQualityToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ImageQualityToBeDoneDto>>> GetImageQualityToBeDoneList(ImageQualityToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository.Where(t=>t.QCProcessEnum != TrialQCProcess.NotAudit)
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit)
.Select(t => new ImageQualityToBeDoneDto()
{
TrialId = t.Id,
@ -486,21 +561,31 @@ namespace IRaCIS.Core.Application
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
// 待审核 加急的(待领取 已领取)-- 领取了 还没做 就是待审核
// 待审核 加急的(待领取 已领取)-- 领取了 还没做 就是待审核
UrgentCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && u.IsUrgent).Count(),
//待领取量
ToBeClaimedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(),
ToBeClaimedCount = t.SubjectVisitList.Where(u =>u.CurrentActionUserId==null &&(u.PreliminaryAuditUserId==null ||(u.PreliminaryAuditUserId!=_userInfo.Id && u.ReviewAuditUserId==null)) ).Count(),
//已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
//待审核通过统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeClaimedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count();
var toBeReviwedCount = _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.CurrentActionUserId == _userInfo.Id).Count();
return ResponseOutput.Ok(result, new { TotalToBeClaimedCount = toBeClaimedCount, TotalToBeReviewedCount= toBeReviwedCount });
}
@ -512,12 +597,13 @@ namespace IRaCIS.Core.Application
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageQuestionToBeDoneDto>> GetQCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<ImageQuestionToBeDoneDto>>> GetQCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ImageQuestionToBeDoneDto()
{
TrialId = t.Id,
@ -533,7 +619,12 @@ namespace IRaCIS.Core.Application
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count();
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount });
}
@ -543,61 +634,142 @@ namespace IRaCIS.Core.Application
#region IR待办
/// <summary>
/// IR 影像阅片 待阅量 复杂 --未完成
/// IR 影像阅片 待阅量
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_visitTaskRepository"></param>
/// <param name="_trialReadingCriterionRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<IRImageReadingToBeDoneDto>> GetIRImageReadingToBeDoneList(IRImageReadingToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<IRImageReadingToBeDoneDto>>> GetIRImageReadingToBeDoneList(IRImageReadingToBeDoneQuery inQuery,
[FromServices] IRepository<VisitTask> _visitTaskRepository,
[FromServices] IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Select(t => new IRImageReadingToBeDoneDto()
var newQuery = _trialReadingCriterionRepository.Where(t => t.IsConfirm == true && t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(c => new IRImageReadingToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
TrialId = c.TrialId,
ResearchProgramNo = c.Trial.ResearchProgramNo,
ExperimentName = c.Trial.ExperimentName,
TrialCode = c.Trial.TrialCode,
CriterionName = c.CriterionName,
TrialReadingCriterionId = c.Id,
UrgentCount = c.VisitTaskList.AsQueryable().Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
// 前序 不存在 未一致性核查未通过的
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
//前序 不存在 未生成任务的访视
.Where(t => c.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(),
UnReadCount=t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
.Count(t => t.IsUrgent),
UnReadCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
// 前序 不存在 未一致性核查未通过的
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
//前序 不存在 未生成任务的访视
//.WhereIf(g.Key.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
.Where(t => c.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
.Count(),
HaveSignedCount = t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id
&& (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
&& t.ReadingTaskState==ReadingTaskState.HaveSigned).Count()
});
//var query = _visitTaskRepository.Where(t=>t.DoctorUserId==_userInfo.Id && (t.TaskState == TaskState.Effect ||t.TaskState==TaskState.Freeze))
// .GroupBy(t=>new {t.SubjectId,t.TrialId,t.Subject.Code,t.Trial.ResearchProgramNo,t.Trial.ExperimentName, t.BlindSubjectCode})
HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
&& t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
})
;
#region 废弃
//var query = _trialRepository
// .Select(t => new IRImageReadingToBeDoneDto()
// {
// TrialId = t.Id,
// ResearchProgramNo = t.ResearchProgramNo,
// ExperimentName = t.ExperimentName,
// TrialCode = t.TrialCode,
// UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
// .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(),
// ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
// .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
// UnReadCount=t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
// // 前序 不存在 未一致性核查未通过的
// .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
// //前序 不存在 未生成任务的访视
// .Where(t=>t.TrialReadingCriterion.IsAutoCreate == false? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum):true)
// .Where(y=>y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
// .Count(),
// HaveSignedCount = t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id
// && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
// && t.ReadingTaskState==ReadingTaskState.HaveSigned).Count()
// });
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
// 不能对包含聚合或子查询的表达式执行聚合函数
return result;
//var query = _visitTaskRepository.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
// .GroupBy(t => new { t.TrialId, t.Trial.ResearchProgramNo, t.Trial.TrialCode, t.Trial.ExperimentName, t.TrialReadingCriterionId, t.TrialReadingCriterion.CriterionName, t.TrialReadingCriterion.IsAutoCreate })
// .Select(g => new IRImageReadingToBeDoneDto()
// {
// TrialId = g.Key.TrialId,
// ResearchProgramNo = g.Key.ResearchProgramNo,
// ExperimentName = g.Key.ExperimentName,
// TrialCode = g.Key.TrialCode,
// CriterionName = g.Key.CriterionName,
// TrialReadingCriterionId = g.Key.TrialReadingCriterionId,
// //UrgentCount = g.AsQueryable().Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
// // // 前序 不存在 未一致性核查未通过的
// // .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
// // //前序 不存在 未生成任务的访视
// // .Where( t => g.Key.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum):true)
// // .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
// // .Count(t=>t.IsUrgent),
// UnReadCount = g.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
// // 前序 不存在 未一致性核查未通过的
// .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
// //前序 不存在 未生成任务的访视
// //.WhereIf(g.Key.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
// //.Where(t => g.Key.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
// .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
// .Count(),
// HaveSignedCount = g.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
// && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
// });
#endregion
var result = await newQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(IRImageReadingToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var toBeDealedCount = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.SelectMany(t => t.VisitTaskList)
.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
// 前序 不存在 未一致性核查未通过的
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
//前序 不存在 未生成任务的访视
.Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
.Count();
return ResponseOutput.Ok(result, new { TotalUnReadCount = toBeDealedCount });
}
@ -609,14 +781,22 @@ namespace IRaCIS.Core.Application
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<MedicalCommentsToBeDoneDto>> GetIRMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<MedicalCommentsToBeDoneDto>>> GetIRMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery,
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository)
{
var query = _taskMedicalReviewRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.IsClosedDialog == false)
.GroupBy(t=>new {t.TrialId, t.Trial.ResearchProgramNo, t.Trial.ExperimentName, t.Trial.TrialCode ,
t.VisitTask.TrialReadingCriterionId,t.VisitTask.TrialReadingCriterion.CriterionName})
.GroupBy(t => new
{
t.TrialId,
t.Trial.ResearchProgramNo,
t.Trial.ExperimentName,
t.Trial.TrialCode,
t.VisitTask.TrialReadingCriterionId,
t.VisitTask.TrialReadingCriterion.CriterionName
})
.Select(g => new MedicalCommentsToBeDoneDto()
{
TrialId = g.Key.TrialId,
@ -624,18 +804,23 @@ namespace IRaCIS.Core.Application
ExperimentName = g.Key.ExperimentName,
TrialCode = g.Key.TrialCode,
CriterionName = g.Key.CriterionName,
TrialReadingCriterionId = g.Key.TrialReadingCriterionId,
UrgentCount = g.Where(u => u.VisitTask.IsUrgent
&& u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(),
ToBeDealedCount = g.Where(u =>
ToBeReplyedCount = g.Where(u =>
u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeDealedCount = _taskMedicalReviewRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.IsClosedDialog == false)
.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count();
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount });
}
@ -653,13 +838,15 @@ namespace IRaCIS.Core.Application
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<MedicalCommentsToBeDoneDto>> GetMIMMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery,
public async Task<IResponseOutput<PageOutput<MedicalCommentsToBeDoneDto>>> GetMIMMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery,
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository)
{
var query = _taskMedicalReviewRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.IsClosedDialog == false)
.GroupBy(t => new {
.GroupBy(t => new
{
t.TrialId,
t.Trial.ResearchProgramNo,
t.Trial.ExperimentName,
@ -678,15 +865,73 @@ namespace IRaCIS.Core.Application
UrgentCount = g.Where(u => u.VisitTask.IsUrgent
&& u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer).Count(),
ToBeDealedCount = g.Where(u =>
ToBeReplyedCount = g.Where(u =>
u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer).Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
var toBeDealedCount = _taskMedicalReviewRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.IsClosedDialog == false)
.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer).Count();
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount });
}
#endregion
#region 项目列表查询
[HttpPost]
public async Task<IResponseOutput<PageOutput<TrialToBeDoneDto>>> GetTrialToBeDoneList(TrialToBeDoneQuery inQuery,
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository)
{
var isPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager;
var isCRC = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator;
var isIQC = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC;
var isMIM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM;
var isSPMOrCPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM;
var query = _trialRepository.AsQueryable().IgnoreQueryFilters()
.WhereIf(inQuery.SponsorId != null, o => o.SponsorId == inQuery.SponsorId)
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
.Select(t => new TrialToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
CreateTime=t.CreateTime,
Sponsor= _userInfo.IsEn_Us? t.Sponsor.SponsorName:t.Sponsor.SponsorNameCN,
TrialStatusStr=t.TrialStatusStr,
ExpetiedTaskCount= isPM ? t.VisitTaskList.Where(t=>t.IsUrgent).Count():0,
ReReadingApprovalCount= isPM? t.VisitTaskReReadingList.Where(t=>t.OriginalReReadingTask.ReReadingApplyState==ReReadingApplyState.DocotorHaveApplyed).Count():0,
PendingReconciliationCount=isPM? t.SubjectVisitList.Where(t=>t.CheckState==CheckStateEnum.ToCheck).Count():0,
});
//.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id });
var result= await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "CreateTime" : inQuery.SortField, inQuery.Asc);
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = 0 });
}
#endregion

View File

@ -51,13 +51,23 @@ namespace IRaCIS.Core.Application.Triggers
if (context.ChangeType == ChangeType.Added)
{
//判断是否需要临床数据签名 不需要 就不用维护
if (visitTask.IsNeedClinicalDataSign)
{
//有序阅片 IsFrontTaskNeedSignButNotSign 维护才有意义
if (_trialReadingCriterionRepository.Any(t => t.Id == visitTask.TrialReadingCriterionId && t.IsReadingTaskViewInOrder == true))
{
var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
//小于自己任务号的任务 存在需要签名 但是没签名
.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
&& t.IsFrontTaskNeedSignButNotSign == false)
.Where(t => t.IsFrontTaskNeedSignButNotSign == false &&
(t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
// 前序存在 未一致性核查未通过的
|| t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)
))
.Select(t => t.Id);
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable.Contains(t.Id), u => new VisitTask()
@ -68,9 +78,15 @@ namespace IRaCIS.Core.Application.Triggers
var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
//小于自己任务号的任务 存在需要签名 但是没签名
.Where(t => !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
&& t.IsFrontTaskNeedSignButNotSign == true)
.Where(t => t.IsFrontTaskNeedSignButNotSign == true &&
//前序任务 不存在需要签名 但是没签名
!t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
// 前序 不存在 未一致性核查未通过的
&& !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)
)
.Select(t => t.Id);
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask()
@ -79,6 +95,10 @@ namespace IRaCIS.Core.Application.Triggers
});
}
}
}

View File

@ -17,7 +17,7 @@ namespace IRaCIS.Core.Domain.Models
[Table("VisitTaskReReading")]
public class VisitTaskReReading : Entity, IAuditUpdate, IAuditAdd
{
public Guid TrialId { get; set; }
//重阅原始任务Id 重阅会产生新的任务
public Guid OriginalReReadingTaskId { get; set; }

View File

@ -261,6 +261,11 @@ namespace IRaCIS.Core.Domain.Models
[JsonIgnore]
public List<TrialCriterionAdditionalAssessmentType> TrialCriterionAdditionalAssessmentTypeList { get; set; } = new List<TrialCriterionAdditionalAssessmentType>();
[JsonIgnore]
public List<VisitTask> VisitTaskList { get; set; }
}

View File

@ -0,0 +1,8 @@
--
UPDATE VisitTaskReReading
SET TrialId = VisitTask.TrialId
FROM VisitTaskReReading
INNER JOIN VisitTask ON VisitTaskReReading.OriginalReReadingTaskId = VisitTask.Id;
delete VisitTaskReReading where TrialId is NULL

View File

@ -27,6 +27,9 @@ namespace IRaCIS.Core.Domain.Models
public List<SubjectUser> SubjectDoctorUserList { get; set; } = new List<SubjectUser>();
[JsonIgnore]
public List<VisitTask> VisitTaskList { get; set; } = new List<VisitTask>() { };
[JsonIgnore]
public List<VisitTaskReReading> VisitTaskReReadingList { get; set; }
[JsonIgnore]
public List<TrialSiteSurvey> TrialSiteSurveyList { get; set; } = new List<TrialSiteSurvey>();