修改邮件模板和统计

Uat_Study
hang 2023-06-12 17:12:28 +08:00
parent 48ede05926
commit 44ad83790d
22 changed files with 183 additions and 103 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();

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

@ -11,28 +11,28 @@
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:
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>
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
Before logging in for the first time, please initialize your account information through 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
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>Best regards,</div>
<div style="font-size: 14px;">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

@ -11,12 +11,12 @@
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:
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>
User name: {1}
User ID: {1}
</div>
<div>
Role: {2}
@ -28,8 +28,8 @@
<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>Best regards,</div>
<div style="font-size: 14px;">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

@ -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
Dear Sir or Madam:
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Thank you for using Extensive Imaging Cloud System.
Thank you for using our IRC imaging system.
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
{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>Best regards,</div>
<div style="font-size: 14px;">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

@ -11,10 +11,10 @@
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.
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
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;'>
@ -25,23 +25,25 @@
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: 40px;padding-left: 40px;margin-bottom: 10px;'>
Your opinions and suggestions will be greatly appreciated!
</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>Best regards,</div>
<div style="font-size: 14px;">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

@ -11,10 +11,10 @@
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.
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. Your opinions and suggestions will be greatly appreciated!
</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;'>
@ -43,8 +43,8 @@
<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>Best regards,</div>
<div style="font-size: 14px;">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

@ -11,7 +11,7 @@
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
The site survey you filled in has been rejected. The 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;'>
@ -22,13 +22,13 @@
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}
@ -36,12 +36,12 @@
</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
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>Best regards,</div>
<div style="font-size: 14px;">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

@ -11,10 +11,10 @@
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.
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
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;'>
@ -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}
System 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>Best regards,</div>
<div style="font-size: 14px;">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

@ -11,10 +11,10 @@
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.
As the IRC service provider of {1}trialProtocol ID is {2}. Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.
</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;'>
@ -25,10 +25,10 @@
Protocol ID: {2}
</div>
<div>
Study name: {1}
Study Name: {1}
</div>
<div>
User name: {4}
User Name: {4}
</div>
<div>
Role: {5}
@ -43,8 +43,8 @@
<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>Best regards,</div>
<div style="font-size: 14px;">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

@ -11,7 +11,7 @@
Dear {0},
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Thank you for using Extensive Imaging Cloud System.
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.
@ -19,8 +19,8 @@
<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>Best regards,</div>
<div style="font-size: 14px;">Extensive Imaging</div>
</div>
</div>
</div>

View File

@ -10001,12 +10001,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 影像阅片 待阅量 复杂 --未完成
</summary>
<param name="inQuery"></param>
<param name="_visitTaskRepository"></param>
<param name="_trialReadingCriterionRepository"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>

View File

@ -1,5 +1,6 @@
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application
@ -309,14 +310,14 @@ namespace IRaCIS.Core.Application
{
var query = _trialRepository
.Where(t=>t.clinicalDataTrialSets.Any(t=>t.ClinicalDataLevel==ClinicalLevel.Subject && t.IsConfirm))
.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
.Select(t => new ImageClinicalDataToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine&& u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent ).Count(),
UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(),
ToBeDealedCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count(),
});
@ -350,12 +351,12 @@ namespace IRaCIS.Core.Application
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.IQC && u.SubjectVisit.IsUrgent).Count(),
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(),
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
@ -383,9 +384,9 @@ namespace IRaCIS.Core.Application
ResearchProgramNo = t.ResearchProgramNo,
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()
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()
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
@ -418,14 +419,14 @@ namespace IRaCIS.Core.Application
ToBeDealedCount = 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;
}
/// <summary>
@ -447,8 +448,8 @@ namespace IRaCIS.Core.Application
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList.Where(u => u.SubmitState ==SubmitStateEnum.ToSubmit && u.IsUrgent).Count(),
ToBeDealedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit ).Count(),
UrgentCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsUrgent).Count(),
ToBeDealedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(),
});
@ -478,7 +479,7 @@ namespace IRaCIS.Core.Application
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository.Where(t=>t.QCProcessEnum != TrialQCProcess.NotAudit)
var query = _trialRepository.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit)
.Select(t => new ImageQualityToBeDoneDto()
{
TrialId = t.Id,
@ -487,14 +488,14 @@ namespace IRaCIS.Core.Application
TrialCode = t.TrialCode,
// 待审核 加急的(待领取 已领取)-- 领取了 还没做 就是待审核
UrgentCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId==_userInfo.Id && u.IsUrgent).Count(),
UrgentCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && u.IsUrgent).Count(),
//待领取量
ToBeClaimedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(),
//已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
ToBeReviewedCount= t.SubjectVisitList.Where(u => u.CurrentActionUserId==_userInfo.Id ).Count()
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
});
@ -547,12 +548,14 @@ namespace IRaCIS.Core.Application
/// </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,
[FromServices] IRepository<VisitTask> _visitTaskRepository,
[FromServices] IRepository<Trial> _trialRepository)
[FromServices] IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
//var query = _trialRepository
@ -583,35 +586,84 @@ namespace IRaCIS.Core.Application
// });
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 })
.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,
var newQuery= _trialReadingCriterionRepository.Where(t=>t.IsConfirm==true && t.Trial.TrialUserList.Any(t=>t.UserId==_userInfo.Id))
.Select(c => new IRImageReadingToBeDoneDto()
{
TrialId = c.TrialId,
ResearchProgramNo = c.Trial.ResearchProgramNo,
ExperimentName = c.Trial.ExperimentName,
TrialCode = c.Trial.TrialCode,
CriterionName = c.CriterionName,
TrialReadingCriterionId = c.Id,
//UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
//.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(),
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 => g.Key.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
UnReadCount = g.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
.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))
//前序 不存在 未生成任务的访视
.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)
//前序 不存在 未生成任务的访视
//.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(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
HaveSignedCount = c.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.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(),
// });
var result = await newQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ?nameof(IRImageReadingToBeDoneDto.TrialId): inQuery.SortField, inQuery.Asc);
return result;
@ -630,21 +682,28 @@ namespace IRaCIS.Core.Application
{
var query = _taskMedicalReviewRepository
.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})
.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
})
.Select(g => new MedicalCommentsToBeDoneDto()
{
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.Where(u => u.VisitTask.IsUrgent
&& u.ReadingMedicalReviewDialogList.OrderByDescending(l=>l.CreateTime).First().UserTypeEnumInt==(int) UserTypeEnum.MIM).Count(),
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 =>
ToBeDealedCount = g.Where(u =>
u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(),
});
@ -675,7 +734,8 @@ namespace IRaCIS.Core.Application
var query = _taskMedicalReviewRepository
.Where(t => t.IsClosedDialog == false)
.GroupBy(t => new {
.GroupBy(t => new
{
t.TrialId,
t.Trial.ResearchProgramNo,
t.Trial.ExperimentName,

View File

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