修改项目文档角色过滤 完成邮件url语言

Uat_Study
hang 2023-06-12 11:07:39 +08:00
parent e66edbf2c7
commit 50fdea4095
13 changed files with 898 additions and 108 deletions

View File

@ -115,12 +115,6 @@
<Content Update="wwwroot\EmailTemplate\AdminResetUser.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\EmailTemplate\EmailConfigTest_US.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\EmailTemplate\EmailConfigTest.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\EmailTemplate\SubjectEnrollConfirmOrPDProgress_US.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

View File

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html lang='en'>
<head>
<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'>
您好:
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
感谢您使用展影云平台。
</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;">上海展影医疗科技有限公司</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html lang='en'>
<head>
<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'>
Dear
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
Thank you for using Extensive Imaging Cloud 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>
</div>
</div>
</body>
</html>

View File

@ -9904,18 +9904,126 @@
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetSiteSurveyApprovalList(IRaCIS.Core.Application.Contracts.TrialSiteSurveyStatQuery)">
<summary>
Site 调研 每个项目 需要处理的审批统计
中心调研 每个项目 需要处理的审批统计
</summary>
<param name="query"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetTrialDocStatList(IRaCIS.Core.Application.Contracts.TrialSiteSurveyStatQuery)">
<summary>
需要签署文件数量 系统级别的在第一行
待签署的项目文件 需要签署文件数量 系统级别的在第一行
</summary>
<param name="query"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetCheckToBeDoneList(IRaCIS.Core.Application.Contracts.CheckToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
一致性核查待处理
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></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})">
<summary>
重阅申请待审核
</summary>
<param name="inQuery"></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})">
<summary>
阅片人筛选
</summary>
<param name="inQuery"></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})">
<summary>
重阅审批
</summary>
<param name="inQuery"></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})">
<summary>
临床数据
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetCRCImageQuestionToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQuestionToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
CRC影像质疑待处理
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></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})">
<summary>
核查质疑待处理
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageReUploadToBeDoneList(IRaCIS.Core.Application.Contracts.ImageReUploadToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
影像重传
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageSubmittedToBeDoneList(IRaCIS.Core.Application.Contracts.ImageSubmittedToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
加急影像提交
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetImageQualityToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQualityToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
影像质控 待领取 跟项目配置有关系 --未完成
</summary>
<param name="inQuery"></param>
<param name="_subjectVisitRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetQCImageQuestionToBeDoneList(IRaCIS.Core.Application.Contracts.ImageQuestionToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
QC 质疑
</summary>
<param name="inQuery"></param>
<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})">
<summary>
IR 影像阅片 待阅量 复杂 --未完成
</summary>
<param name="inQuery"></param>
<param name="_visitTaskRepository"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetIRMedicalCommentsToBeDoneList(IRaCIS.Core.Application.Contracts.MedicalCommentsToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview})">
<summary>
IR医学反馈
</summary>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetMIMMedicalCommentsToBeDoneList(IRaCIS.Core.Application.Contracts.MedicalCommentsToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview})">
<summary>
MIM医学反馈
</summary>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.TrialConfigService.TrialReadingInfoSignVerify(IRaCIS.Core.Application.Contracts.TrialReadingInfoSignInDto)">
<summary>
阅片信息签名验证接口

View File

@ -398,7 +398,7 @@ namespace IRaCIS.Application.Services
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new User() { EmailToken = token });
routeUrl = routeUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&access_token=" + token;
routeUrl = routeUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us?"en":"zh") + "&access_token=" + token;
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
@ -512,7 +512,7 @@ namespace IRaCIS.Application.Services
{
var templateInfo = SourceReader.ReadToEnd();
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&access_token=" + token;
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
@ -576,7 +576,7 @@ namespace IRaCIS.Application.Services
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&access_token=" + token;
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
var redirectUrl = $"{domain}/api/User/UserRedirect?url={System.Web.HttpUtility.UrlEncode(routeUrl)}";
@ -694,7 +694,7 @@ namespace IRaCIS.Application.Services
{
var templateInfo = SourceReader.ReadToEnd();
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + userType.UserTypeShortName + "&access_token=" + token;
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + userType.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));

View File

@ -157,7 +157,7 @@ namespace IRaCIS.Core.Application.Contracts
public async Task<List<TrialUserType>> GetTrialUserTypeList()
{
var query = userTypeServiceRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin)
//.Where(t => t.Type == UserTypeGroup.TrialUser)
.Where(t => !t.UserTypeGroupList.Any(t=> t.Group.Code=="3"))
.OrderBy(t => t.Order).ProjectTo<TrialUserType>(_mapper.ConfigurationProvider);
return await query.ToListAsync();

View File

@ -42,7 +42,7 @@ namespace IRaCIS.Core.Application.Contracts
public int? TotalNeedSignDocCount => TotalNeedSignTrialDocCount + TotalNeedSignSystemDocCount;
public int? TotalApprovalRequiredCount { get; set; }
public int? TotalApprovalRequiredCount { get; set; }
public int? TotalSystemNoticeCount { get; set; }
@ -56,9 +56,9 @@ namespace IRaCIS.Core.Application.Contracts
}
public class TrialSiteSurveyStat:TrialSelectDTO
public class TrialSiteSurveyStat : TrialSelectDTO
{
public int? ApprovalRequiredCount { get; set; }
public int? ApprovalRequiredCount { get; set; }
@ -75,4 +75,181 @@ namespace IRaCIS.Core.Application.Contracts
}
public class CheckToBeDoneQuery : PageInput
{
}
public class CheckToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeCheckedCount { get; set; }
public int? ToBeRepliedCount { get; set; }
}
public class ReReadingApplyToBeDoneQuery : PageInput
{
}
public class ReReadingApplyToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeApprovalCount { get; set; }
}
public class ReviewerSelectToBeDoneQuery : PageInput
{
}
public class ReviewerSelectToBeDoneDto : TrialBaseInfoDto
{
public bool IsUrgent { get; set; }
public int? ToBeApprovalCount { get; set; }
}
public class ReReadingApprovalToBeDoneQuery : PageInput
{
}
public class ReReadingApprovalToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeApprovalCount { get; set; }
}
public class ImageQuestionToBeDoneQuery : PageInput
{
}
public class ImageQuestionToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
}
public class IRImageReadingToBeDoneQuery : PageInput
{
}
public class IRImageReadingToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? UnReadCount { get; set; }
public int? HaveSignedCount { get; set; }
}
public class MedicalCommentsToBeDoneQuery : PageInput
{
}
public class MedicalCommentsToBeDoneDto : TrialBaseInfoDto
{
public string CriterionName { get; set; }
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
}
public class ImageCheckQuestionToBeDoneQuery : PageInput
{
}
public class ImageCheckQuestionToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
}
public class ImageSubmittedToBeDoneQuery : PageInput
{
}
public class ImageSubmittedToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
}
public class ImageQualityToBeDoneQuery : PageInput
{
}
public class ImageQualityToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeReviewedCount { get; set; }
public int? ToBeClaimedCount { get; set; }
}
public class ImageReUploadToBeDoneQuery : PageInput
{
}
public class ImageReUploadToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
}
public class ImageClinicalDataToBeDoneQuery : PageInput
{
}
public class ImageClinicalDataToBeDoneDto : TrialBaseInfoDto
{
public int? UrgentCount { get; set; }
public int? ToBeDealedCount { get; set; }
}
public class TrialBaseInfoDto
{
public Guid TrialId { get; set; }
public string ExperimentName { get; set; } = string.Empty;
public string TrialCode { get; set; } = string.Empty;
public string ResearchProgramNo { get; set; } = string.Empty;
}
}

View File

@ -13,8 +13,8 @@ namespace IRaCIS.Core.Application
private readonly IRepository<SystemDocument> _systemDocumentRepository;
private readonly IRepository<SystemNotice> _systemNoticeRepository;
public PersonalWorkstation(IRepository<Trial> trialRepository, IRepository<TrialUser> trialUserRepository, IRepository<TrialDocument> trialDocumentRepository,
IRepository<SystemDocument> systemDocumentRepository,IRepository<SystemNotice> systemNoticeRepository)
public PersonalWorkstation(IRepository<Trial> trialRepository, IRepository<TrialUser> trialUserRepository, IRepository<TrialDocument> trialDocumentRepository,
IRepository<SystemDocument> systemDocumentRepository, IRepository<SystemNotice> systemNoticeRepository)
{
_trialRepository = trialRepository;
_trialUserRepository = trialUserRepository;
@ -44,7 +44,7 @@ namespace IRaCIS.Core.Application
TotalNeedSignTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
? 0
? 0
: await _trialDocumentRepository.AsQueryable(true).Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)))
@ -56,15 +56,15 @@ namespace IRaCIS.Core.Application
? 0
//废除了 已经签署了也要算进去
: await _trialDocumentRepository.AsQueryable(true).Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
.Where( t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
.SelectMany(t => t.TrialDocConfirmedUserList)
.CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime !=null),
.CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null),
TotalNeedSignSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
? 0
: await _systemDocumentRepository
.Where(t => t.IsDeleted == false || (t.IsDeleted == true && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime !=null)))
.Where(t => t.IsDeleted == false || (t.IsDeleted == true && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)))
.SelectMany(t => t.NeedConfirmedUserTypeList)
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId),
@ -76,22 +76,22 @@ namespace IRaCIS.Core.Application
.SelectMany(t => t.SystemDocConfirmedUserList)
.CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null),
TotalApprovalRequiredCount=
TotalApprovalRequiredCount =
_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM ?
_trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t=>t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count()
: _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM|| _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM
? _trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t => t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count()
:0,
_trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t => t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count()
: _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM
? _trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t => t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count()
: 0,
TotalSystemNoticeCount= _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
? 0:await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum== Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished)
TotalSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
? 0 : await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished)
.CountAsync(),
NeedReadSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
NeedReadSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
? 0 : await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished
&& !t.NoticeUserReadList.Any(t=>t.CreateUserId==_userInfo.Id))
&& !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id))
.Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > DateTime.Now)
.CountAsync(),
@ -102,7 +102,7 @@ namespace IRaCIS.Core.Application
/// <summary>
/// Site 调研 每个项目 需要处理的审批统计
/// 中心调研 每个项目 需要处理的审批统计
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
@ -134,7 +134,7 @@ namespace IRaCIS.Core.Application
/// <summary>
/// 需要签署文件数量 系统级别的在第一行
/// 待签署的项目文件 需要签署文件数量 系统级别的在第一行
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
@ -147,35 +147,183 @@ namespace IRaCIS.Core.Application
}
else
{
var trialDocStat = await _trialRepository/*.AsQueryable(true)*/.Where(t=>t.TrialStatusStr != StaticData.TrialState.TrialStopped)
var trialDocStat = await _trialRepository/*.AsQueryable(true)*/.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped)
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(!_userInfo.IsAdmin, c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime!=null))
.WhereIf(!_userInfo.IsAdmin, c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))
.Count() > 0)
.ProjectTo<DocSignStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, userTypeId = _userInfo.UserTypeId })
.OrderByDescending(t => t.WaitSignCount)
.ToPagedListAsync(query.PageIndex, query.PageSize , query.SortField, query.Asc);
//var sysDocStat = new DocSignStat()
//{
// IsSystemDoc = true,
// WaitSignCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
// ? 0
// : await _systemDocumentRepository
// .Where(t =>
// t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) &&
// !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id))
// .CountAsync()
//};
//var list = trialDocStat.CurrentPageData.ToList();
//list.Insert(0, sysDocStat);
//trialDocStat.CurrentPageData = list;
//trialDocStat.TotalCount++;
.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField, query.Asc);
return trialDocStat;
}
}
#region PM APM 待办
/// <summary>
/// 一致性核查待处理
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<CheckToBeDoneDto>> GetCheckToBeDoneList(CheckToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Select(t => new CheckToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
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;
}
/// <summary>
/// 重阅申请待审核
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ReReadingApplyToBeDoneDto>> GetReReadingApplyToBeDoneList(ReReadingApplyToBeDoneQuery inQuery,
[FromServices] IRepository<VisitTaskReReading> _visitTaskReReadingRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _visitTaskReReadingRepository.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()
{
TrialId = g.Key.TrialId,
ResearchProgramNo = g.Key.ResearchProgramNo,
ExperimentName = g.Key.ExperimentName,
TrialCode = g.Key.TrialCode,
UrgentCount = g.Where(u => u.OriginalReReadingTask.IsUrgent == true).Count(),
ToBeApprovalCount = g.Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
#endregion
#region SPM CPM 待办
/// <summary>
/// 阅片人筛选
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns> vvv
[HttpPost]
public async Task<PageOutput<ReviewerSelectToBeDoneDto>> GetReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery
, [FromServices] IRepository<Enroll> _enrollRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Select(t => new ReviewerSelectToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count()
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
/// <summary>
/// 重阅审批
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ReReadingApprovalToBeDoneDto>> GetReReadingApprovalToBeDoneToBeDoneList(ReReadingApprovalToBeDoneQuery inQuery,
[FromServices] IRepository<VisitTaskReReading> _visitTaskReReadingRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _visitTaskReReadingRepository.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()
{
TrialId = g.Key.TrialId,
ResearchProgramNo = g.Key.ResearchProgramNo,
ExperimentName = g.Key.ExperimentName,
TrialCode = g.Key.TrialCode,
UrgentCount = g.Where(u => u.OriginalReReadingTask.IsUrgent == true).Count(),
ToBeApprovalCount = g.Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
#endregion
#region CRC 待办
/// <summary>
/// 临床数据
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageClinicalDataToBeDoneDto>> GetImageClinicalDataToBeDoneList(ImageClinicalDataToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.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(),
ToBeDealedCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
@ -183,6 +331,364 @@ namespace IRaCIS.Core.Application
/// <summary>
/// CRC影像质疑待处理
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageQuestionToBeDoneDto>> GetCRCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Select(t => new ImageQuestionToBeDoneDto()
{
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.IQC && u.SubjectVisit.IsUrgent).Count(),
ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC ).Count(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
/// <summary>
/// 核查质疑待处理
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageCheckQuestionToBeDoneDto>> GetImageCheckQuestionToBeDoneList(ImageCheckQuestionToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Select(t => new ImageCheckQuestionToBeDoneDto()
{
TrialId = t.Id,
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()
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
/// <summary>
/// 影像重传
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageReUploadToBeDoneDto>> GetImageReUploadToBeDoneList(ImageReUploadToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Select(t => new ImageReUploadToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
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(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
/// <summary>
/// 加急影像提交
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageSubmittedToBeDoneDto>> GetImageSubmittedToBeDoneList(ImageSubmittedToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Select(t => new ImageSubmittedToBeDoneDto()
{
TrialId = t.Id,
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(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
#endregion
#region IQC待办
/// <summary>
/// 影像质控 待领取 跟项目配置有关系 --未完成
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageQualityToBeDoneDto>> GetImageQualityToBeDoneList(ImageQualityToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository.Where(t=>t.QCProcessEnum != TrialQCProcess.NotAudit)
.Select(t => new ImageQualityToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
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(),
//已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
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;
}
/// <summary>
/// QC 质疑
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_subjectVisitRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ImageQuestionToBeDoneDto>> GetQCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery,
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Select(t => new ImageQuestionToBeDoneDto()
{
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(),
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
#endregion
#region IR待办
/// <summary>
/// IR 影像阅片 待阅量 复杂 --未完成
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_visitTaskRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<IRImageReadingToBeDoneDto>> GetIRImageReadingToBeDoneList(IRImageReadingToBeDoneQuery inQuery,
[FromServices] IRepository<VisitTask> _visitTaskRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
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(),
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(),
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})
// .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(),
// });
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
return result;
}
/// <summary>
/// IR医学反馈
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<MedicalCommentsToBeDoneDto>> GetIRMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery,
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository)
{
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})
.Select(g => new MedicalCommentsToBeDoneDto()
{
TrialId = g.Key.TrialId,
ResearchProgramNo = g.Key.ResearchProgramNo,
ExperimentName = g.Key.ExperimentName,
TrialCode = g.Key.TrialCode,
CriterionName=g.Key.CriterionName,
UrgentCount = g.Where(u => u.VisitTask.IsUrgent
&& u.ReadingMedicalReviewDialogList.OrderByDescending(l=>l.CreateTime).First().UserTypeEnumInt==(int) UserTypeEnum.MIM).Count(),
ToBeDealedCount = 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;
}
#endregion
#region MIM待办
/// <summary>
/// MIM医学反馈
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<MedicalCommentsToBeDoneDto>> GetMIMMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery,
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository)
{
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
})
.Select(g => new MedicalCommentsToBeDoneDto()
{
TrialId = g.Key.TrialId,
ResearchProgramNo = g.Key.ResearchProgramNo,
ExperimentName = g.Key.ExperimentName,
TrialCode = g.Key.TrialCode,
CriterionName = g.Key.CriterionName,
UrgentCount = g.Where(u => u.VisitTask.IsUrgent
&& u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer).Count(),
ToBeDealedCount = 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;
}
#endregion
}
}

View File

@ -0,0 +1,51 @@
using AutoMapper;
using AutoMapper.EquivalencyExpression;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Contracts.DTO;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Application.Service
{
public class PersonalWorkstation : Profile
{
public PersonalWorkstation()
{
var userTypeEnumInt = 0;
var userTypeId = Guid.Empty;
CreateMap<Trial, CheckToBeDoneDto>()
.ForMember(t => t.ExperimentName, u => u.MapFrom(c => c.ExperimentName))
.ForMember(t => t.TrialCode, u => u.MapFrom(c => c.TrialCode))
.ForMember(t => t.ResearchProgramNo, u => u.MapFrom(c => c.ResearchProgramNo))
.ForMember(t => t.UrgentCount, u => u.MapFrom(c => c
.SubjectVisitList.Where(t=>(t.CheckState==CheckStateEnum.ToCheck ||t.CheckState==CheckStateEnum.CVIng) && t.IsUrgent).Count()))
.ForMember(t => t.ToBeCheckedCount, u => u.MapFrom(c => c
.SubjectVisitList.Where(t => t.CheckState == CheckStateEnum.ToCheck ).Count()))
.ForMember(t => t.ToBeRepliedCount, u => u.MapFrom(c => c
.SubjectVisitList.Where(t => (t.CheckState == CheckStateEnum.ToCheck || t.CheckState == CheckStateEnum.CVIng) && t.IsUrgent).Count()));
CreateMap<VisitTask, ReReadingApplyToBeDoneDto>();
CreateMap<Enroll, ReviewerSelectToBeDoneDto>();
CreateMap<VisitTask, ReReadingApprovalToBeDoneDto>();
}
}
}

View File

@ -82,6 +82,8 @@ namespace IRaCIS.Core.Domain.Models
public Guid TrialId { get; set; }
public Trial Trial { get; set; }
/// <summary>
/// 冗余 废弃
/// </summary>

View File

@ -17,6 +17,10 @@ namespace IRaCIS.Core.Domain.Models
TrialDicList = new List<TrialDictionary>();
}
[JsonIgnore]
public List<TaskMedicalReview> TaskMedicalReviewList { get; set; }
[JsonIgnore]
public List<TaskConsistentRule> TaskConsistentRuleList { get; set; }
[JsonIgnore]
@ -39,6 +43,8 @@ namespace IRaCIS.Core.Domain.Models
[JsonIgnore]
public List<Subject> SubjectList { get; set; } = new List<Subject>();
[JsonIgnore]
public List<SubjectVisit> SubjectVisitList { get; set; } = new List<SubjectVisit>();
[JsonIgnore]
public List<DicomStudy> StudyList { get; set; } = new List<DicomStudy>();
[JsonIgnore]
public List<TrialSite> TrialSiteList { get; set; } = new List<TrialSite>();