维护历史分页列表传递参数
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-08-22 15:57:02 +08:00
parent 7db339d876
commit 15fe8db248
59 changed files with 949 additions and 1083 deletions

View File

@ -127,7 +127,7 @@
<summary>
一致性分析列表 (自身 组内 最后勾选 产生的任务)
</summary>
<param name="queryVisitTask"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.TaskConsistentRuleService.GetDoctorSelfConsistentRuleSubjectList(IRaCIS.Core.Application.ViewModel.ConsistentQuery)">
@ -286,6 +286,11 @@
访视读片任务
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskAllocationRule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTaskReReading},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectCriteriaEvaluation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectCriteriaEvaluationVisitFilter},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectCriteriaEvaluationVisitStudyFilter})">
<summary>
访视读片任务
</summary>
</member>
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.SetTaskUrgent(IRaCIS.Application.Contracts.SetTaskUrgentInDto)">
<summary>
设置任务加急
@ -367,7 +372,7 @@
<summary>
访视任务
</summary>
<param name="queryVisitTask"></param>
<param name="inQuery"></param>
<param name="_visitTaskCommonService"></param>
<returns></returns>
</member>
@ -375,14 +380,14 @@
<summary>
裁判任务
</summary>
<param name="queryVisitTask"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetReadingTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
<summary>
PM阅片跟踪
</summary>
<param name="queryVisitTask"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetReReadingTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
@ -396,7 +401,7 @@
<summary>
获取IR 重阅影像阅片列表
</summary>
<param name="queryVisitTask"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetIRUnReadSubjectTaskList(IRaCIS.Core.Application.ViewModel.IRUnReadSubjectQuery)">
@ -416,7 +421,7 @@
<summary>
IR 已阅片任务
</summary>
<param name="queryVisitTask"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.ApplyReReading(IRaCIS.Core.Application.ViewModel.ApplyReReadingCommand)">
@ -871,7 +876,7 @@
<summary>
获取系统 邮件配置 勾选列表
</summary>
<param name="queryEmailNoticeConfig"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.BatchAddSysEmailConfig(System.Collections.Generic.List{IRaCIS.Core.Application.ViewModel.BatchAddTrialEmailNoticeConfig})">
@ -3847,7 +3852,7 @@
<summary>
获取CRC受试者临床数据
</summary>
<param name="inDto"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ClinicalAnswerService.GetClinicalQuestionFormList(IRaCIS.Core.Application.Service.Reading.Dto.GetClinicalQuestionAnswerListInDto)">
@ -9846,7 +9851,7 @@
<summary>
任务列表 第一层级
</summary>
<param name="queryVisitTask"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Third_partyProject.UltrasonicDicomService.GetDicomAndNoneDicomStudyList(System.Guid,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask})">
@ -12296,7 +12301,7 @@
<summary>
模板列表
</summary>
<param name="querySystemBasicData"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemBasicDataService.GetChildList(System.Guid)">
@ -12322,7 +12327,7 @@
<summary>
管理端列表
</summary>
<param name="querySystemDocument"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.getWaitSignSysDocList(IRaCIS.Core.Application.Contracts.SystemDocumentQuery)">
@ -12340,7 +12345,7 @@
<summary>
Setting 界面的 项目所有文档列表
</summary>
<param name="queryTrialDocument"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetNextUnSignDocument(IRaCIS.Core.Application.Contracts.GetNextUnSignDocumentInDto)">
@ -12354,7 +12359,7 @@
<summary>
具体用户看到的 系统文件列表 + 项目类型文档
</summary>
<param name="querySystemDocument"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetDocumentConfirmList(IRaCIS.Core.Application.Contracts.DocumentTrialUnionQuery)">
@ -12419,7 +12424,7 @@
<summary>
从 文档的维度 先看到文档列表(系统文档+项目文档 以及需要确认的人数 和已经确认人数) 点击数字查看某文档下面人确认情况
</summary>
<param name="querySystemDocument"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="T:IRaCIS.Core.Application.Services.TrialRevenuesPriceVerificationService">
@ -12554,7 +12559,7 @@
<summary>
QC 质疑列表 分页
</summary>
<param name="challengeQuery"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Image.QA.QCListService.GetNextQCInfo(IRaCIS.Core.Application.Contracts.GetNextQCInfoInDto)">
@ -12590,7 +12595,7 @@
<summary>
转发列表 查询一致性核查通过的,针对不一致性核查的 要维护CV状态
</summary>
<param name="forwardQuery"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Image.QA.QCListService.GetVisitQCInfo(System.Guid,IRaCIS.Core.Domain.Share.TrialQCProcess,IRaCIS.Core.Domain.Share.CurrentQC)">
@ -12876,14 +12881,14 @@
<summary>
中心调研 每个项目 需要处理的审批统计
</summary>
<param name="query"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetTrialDocStatList(IRaCIS.Core.Application.Contracts.TrialSiteSurveyStatQuery)">
<summary>
待签署的项目文件 需要签署文件数量 系统级别的在第一行
</summary>
<param name="query"></param>
<param name="inQuery"></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})">
@ -13383,7 +13388,7 @@
<summary>
New 查询条件
</summary>
<param name="basicDicQuery"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.DictionaryService.AddOrUpdateBasicDic(IRaCIS.Application.Contracts.AddOrEditBasicDic)">
@ -13977,7 +13982,7 @@
<summary>
获取用户列表
</summary>
<param name="param"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.UserService.GetUser(System.Guid)">
@ -14214,7 +14219,7 @@
<summary>
获取单个阅片临床数据的所有文件
</summary>
<param name="inDto"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.ReadingClinicalDataService.DeleteReadingClinicalDataPDF(System.Guid)">
@ -15124,7 +15129,7 @@
<summary>
Setting页面 获取项目参与人员列表
</summary>
<param name="param"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.TrialMaintenanceService.GetSiteCRCScreeningList(IRaCIS.Application.Contracts.SiteCRCQuery)">
@ -15147,7 +15152,7 @@
<summary>
分页获取临床项目列表 默认后台加急状态为3 查所有的
</summary>
<param name="searchParam"></param>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.TrialService.GetTrialInfoAndLockState(System.Guid)">

View File

@ -96,38 +96,38 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 一致性分析列表 (自身 组内 最后勾选 产生的任务)
/// </summary>
/// <param name="queryVisitTask"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput<PageOutput<AnalysisTaskView>>> GetAnalysisTaskList(VisitTaskQuery queryVisitTask)
public async Task<IResponseOutput<PageOutput<AnalysisTaskView>>> GetAnalysisTaskList(VisitTaskQuery inQuery)
{
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId)
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId)
.Where(t => t.IsAnalysisCreate)
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
.WhereIf(queryVisitTask.ArmEnum != null, t => t.ArmEnum == queryVisitTask.ArmEnum)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => /*(t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) ||*/ (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) /*&& t.IsAnalysisCreate == false*/))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => ((t.Subject.Code.Contains(queryVisitTask.SubjectCode) || t.Subject.MedicalNo.Contains(queryVisitTask.SubjectCode)) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime >= queryVisitTask.BeginAllocateDate)
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime <= queryVisitTask.EndAllocateDate)
.WhereIf(queryVisitTask.BeginSignTime != null, t => t.SignTime >= queryVisitTask.BeginSignTime)
.WhereIf(queryVisitTask.EndSignTime != null, t => t.SignTime <= queryVisitTask.EndSignTime)
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.IsSelfAnalysis != null, t => t.IsSelfAnalysis == inQuery.IsSelfAnalysis)
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => /*(t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) ||*/ (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) /*&& t.IsAnalysisCreate == false*/))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => ((t.Subject.Code.Contains(inQuery.SubjectCode) || t.Subject.MedicalNo.Contains(inQuery.SubjectCode)) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime >= inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime <= inQuery.EndAllocateDate)
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime >= inQuery.BeginSignTime)
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime <= inQuery.EndSignTime)
.ProjectTo<AnalysisTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
#region 统计一致性分析临床数据数量
foreach (var item in pageList.CurrentPageData)
@ -143,7 +143,7 @@ namespace IRaCIS.Core.Application.Service
}
#endregion
var trialTaskConfig = _repository.Where<Trial>(t => t.Id == queryVisitTask.TrialId).Select(t => new { IsHaveDoubleReadCriterion = t.TrialReadingCriterionList.Any(t => t.IsSigned && t.IsConfirm && t.ReadingType == ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault();
var trialTaskConfig = _repository.Where<Trial>(t => t.Id == inQuery.TrialId).Select(t => new { IsHaveDoubleReadCriterion = t.TrialReadingCriterionList.Any(t => t.IsSigned && t.IsConfirm && t.ReadingType == ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault();
return ResponseOutput.Ok(pageList, trialTaskConfig);
}
@ -159,7 +159,7 @@ namespace IRaCIS.Core.Application.Service
{
var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.Id == inQuery.TaskConsistentRuleId);
var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj, inQuery.DoctorUserId).ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);
var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj, inQuery.DoctorUserId).ToPagedListAsync(inQuery);
return pagedList;
}
@ -347,7 +347,7 @@ namespace IRaCIS.Core.Application.Service
var query = await GetGroupConsistentQueryAsync(filterObj);
var pagedList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);
var pagedList = await query.ToPagedListAsync(inQuery, nameof(DoctorSelfConsistentSubjectView.SubjectCode));
var rule = await _taskConsistentRuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis == false && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).ProjectTo<TaskConsistentRuleBasic>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();

View File

@ -84,7 +84,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum) , nameof(TaskMedicalReviewView.VisitTaskNum) };
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
}
@ -120,7 +120,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<GenerateMedicalReviewTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(GenerateMedicalReviewTaskView.IsUrgent) + " desc", nameof(GenerateMedicalReviewTaskView.SubjectId) };
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
@ -257,7 +257,7 @@ namespace IRaCIS.Core.Application.Service
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return ResponseOutput.Ok(pageList, new
{

View File

@ -112,35 +112,35 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput<PageOutput<SubjectAssignStat>>> GetSubjectAssignAndTaskStatList(SubjectAssignStatQuery querySubjectAssign)
public async Task<IResponseOutput<PageOutput<SubjectAssignStat>>> GetSubjectAssignAndTaskStatList(SubjectAssignStatQuery inQuery)
{
var isAddtinoarlCriterion = await _trialReadingCriterionRepository.AnyAsync(t => t.Id == querySubjectAssign.TrialReadingCriterionId && t.IsAutoCreate == false);
var isAddtinoarlCriterion = await _trialReadingCriterionRepository.AnyAsync(t => t.Id == inQuery.TrialReadingCriterionId && t.IsAutoCreate == false);
var subjectQuery = _subjectRepository.Where(t => t.TrialId == querySubjectAssign.TrialId && t.SubjectVisitTaskList.Any())
.WhereIf(querySubjectAssign.TrialSiteId != null, t => t.TrialSiteId == querySubjectAssign.TrialSiteId)
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
.WhereIf(querySubjectAssign.DoctorUserId != null, t => t.SubjectDoctorList.Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
.WhereIf(!string.IsNullOrEmpty(querySubjectAssign.SubjectCode), t => t.Code.Contains(querySubjectAssign.SubjectCode))
var subjectQuery = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId && t.SubjectVisitTaskList.Any())
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.Id == inQuery.SubjectId)
.WhereIf(inQuery.DoctorUserId != null, t => t.SubjectDoctorList.Any(t => t.DoctorUserId == inQuery.DoctorUserId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Code.Contains(inQuery.SubjectCode))
//未分配
.WhereIf(querySubjectAssign.SubjectAllocateState == 0, t => !t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
.WhereIf(inQuery.SubjectAllocateState == 0, t => !t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId))
//已分配
.WhereIf(querySubjectAssign.SubjectAllocateState == 1, t => t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
.WhereIf(inQuery.SubjectAllocateState == 1, t => t.SubjectDoctorList.Any(t => t.AssignTime != null && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId))
.WhereIf(querySubjectAssign.ArmList.Count > 0, t => !querySubjectAssign.ArmList.Except(t.SubjectDoctorList.Where(t => t.AssignTime != null && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId).Select(c => c.ArmEnum)).Any())
.WhereIf(inQuery.ArmList.Count > 0, t => !inQuery.ArmList.Except(t.SubjectDoctorList.Where(t => t.AssignTime != null && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).Select(c => c.ArmEnum)).Any())
.WhereIf(isAddtinoarlCriterion, t => t.SubjectCriteriaEvaluationList.Where(t => t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId).Any(t => t.IsJoinEvaluation))
.WhereIf(isAddtinoarlCriterion, t => t.SubjectCriteriaEvaluationList.Where(t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).Any(t => t.IsJoinEvaluation))
.ProjectTo<SubjectAssignStat>(_mapper.ConfigurationProvider, new { trialReadingCriterionId = querySubjectAssign.TrialReadingCriterionId });
.ProjectTo<SubjectAssignStat>(_mapper.ConfigurationProvider, new { trialReadingCriterionId = inQuery.TrialReadingCriterionId });
var pageList = await subjectQuery.ToPagedListAsync(querySubjectAssign.PageIndex, querySubjectAssign.PageSize, string.IsNullOrWhiteSpace(querySubjectAssign.SortField) ? nameof(querySubjectAssign.SubjectId) : querySubjectAssign.SortField, querySubjectAssign.Asc);
var pageList = await subjectQuery.ToPagedListAsync(inQuery);
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == querySubjectAssign.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder, x.ReadingType, x.IsArbitrationReading, x.IsOncologyReading, x.IsGlobalReading }).FirstOrDefaultAsync()).IfNullThrowException();
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder, x.ReadingType, x.IsArbitrationReading, x.IsOncologyReading, x.IsGlobalReading }).FirstOrDefaultAsync()).IfNullThrowException();
return ResponseOutput.Ok(pageList, criterionConfig);
}
@ -385,32 +385,32 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<SubjectAssignView>> GetSubjectAssignList(SubjectAssignQuery querySubjectAssign)
public async Task<PageOutput<SubjectAssignView>> GetSubjectAssignList(SubjectAssignQuery inQuery)
{
var subjectQuery = _subjectRepository.Where(t => t.TrialId == querySubjectAssign.TrialId)
.WhereIf(querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
.WhereIf(querySubjectAssign.IsJudgeDoctor, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
var subjectQuery = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(inQuery.IsJudgeDoctor == false, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
.WhereIf(inQuery.IsJudgeDoctor, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
.WhereIf(querySubjectAssign.TrialSiteId != null, t => t.TrialSiteId == querySubjectAssign.TrialSiteId)
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.Id == inQuery.SubjectId)
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == true && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == true && querySubjectAssign.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == false && querySubjectAssign.IsJudgeDoctor == false, t => !t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == false && querySubjectAssign.IsJudgeDoctor, t => !t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
.WhereIf(inQuery.IsHaveAssigned != null && inQuery.IsHaveAssigned == true && inQuery.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
.WhereIf(inQuery.IsHaveAssigned != null && inQuery.IsHaveAssigned == true && inQuery.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
.WhereIf(inQuery.IsHaveAssigned != null && inQuery.IsHaveAssigned == false && inQuery.IsJudgeDoctor == false, t => !t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
.WhereIf(inQuery.IsHaveAssigned != null && inQuery.IsHaveAssigned == false && inQuery.IsJudgeDoctor, t => !t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
.WhereIf(querySubjectAssign.IsAssignConfirmed != null && querySubjectAssign.IsAssignConfirmed == true && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).All(u => u.IsConfirmed))
.WhereIf(querySubjectAssign.IsAssignConfirmed != null && querySubjectAssign.IsAssignConfirmed == true && querySubjectAssign.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).All(u => u.IsConfirmed))
.WhereIf(inQuery.IsAssignConfirmed != null && inQuery.IsAssignConfirmed == true && inQuery.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).All(u => u.IsConfirmed))
.WhereIf(inQuery.IsAssignConfirmed != null && inQuery.IsAssignConfirmed == true && inQuery.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).All(u => u.IsConfirmed))
.WhereIf(querySubjectAssign.IsAssignConfirmed != null && querySubjectAssign.IsAssignConfirmed == false && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any(u => u.IsConfirmed == false))
.WhereIf(querySubjectAssign.IsAssignConfirmed != null && querySubjectAssign.IsAssignConfirmed == false && querySubjectAssign.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any(u => u.IsConfirmed == false))
.WhereIf(inQuery.IsAssignConfirmed != null && inQuery.IsAssignConfirmed == false && inQuery.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any(u => u.IsConfirmed == false))
.WhereIf(inQuery.IsAssignConfirmed != null && inQuery.IsAssignConfirmed == false && inQuery.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any(u => u.IsConfirmed == false))
.WhereIf(querySubjectAssign.DoctorUserId != null && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId))
.WhereIf(querySubjectAssign.DoctorUserId != null && querySubjectAssign.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId))
.ProjectTo<SubjectAssignView>(_mapper.ConfigurationProvider, new { isJudgeDoctor = querySubjectAssign.IsJudgeDoctor });
.WhereIf(inQuery.DoctorUserId != null && inQuery.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any(t => t.DoctorUserId == inQuery.DoctorUserId))
.WhereIf(inQuery.DoctorUserId != null && inQuery.IsJudgeDoctor, t => t.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any(t => t.DoctorUserId == inQuery.DoctorUserId))
.ProjectTo<SubjectAssignView>(_mapper.ConfigurationProvider, new { isJudgeDoctor = inQuery.IsJudgeDoctor });
var pageList = await subjectQuery.ToPagedListAsync(querySubjectAssign.PageIndex, querySubjectAssign.PageSize, string.IsNullOrWhiteSpace(querySubjectAssign.SortField) ? nameof(querySubjectAssign.SubjectId) : querySubjectAssign.SortField, querySubjectAssign.Asc);
var pageList = await subjectQuery.ToPagedListAsync(inQuery);
return pageList;
}
@ -636,43 +636,43 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// <summary>
/// 访视任务
/// </summary>
/// <param name="queryVisitTask"></param>
/// <param name="inQuery"></param>
/// <param name="_visitTaskCommonService"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<VisitTaskView>> GetVisitTaskList(VisitTaskQuery queryVisitTask, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
public async Task<PageOutput<VisitTaskView>> GetVisitTaskList(VisitTaskQuery inQuery, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
{
//以前访视未产生任务的,在查询这里要产生
var svIdList = await _subjectVisitRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.CheckState == CheckStateEnum.CVPassed && t.IsVisitTaskGenerated == false).Select(t => t.Id).ToListAsync();
var svIdList = await _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId && t.CheckState == CheckStateEnum.CVPassed && t.IsVisitTaskGenerated == false).Select(t => t.Id).ToListAsync();
//之前没有生成任务的逻辑 但是现在加了,任务要自动生成
await _visitTaskCommonService.GenerateVisitTaskAsync(queryVisitTask.TrialId, svIdList);
await _visitTaskCommonService.GenerateVisitTaskAsync(inQuery.TrialId, svIdList);
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.ReadingCategory == null, t => t.ReadingCategory != ReadingCategory.Judge)
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.ReadingCategory == null, t => t.ReadingCategory != ReadingCategory.Judge)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
.ProjectTo<VisitTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
//var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstOrDefault();
return pageList;
@ -683,35 +683,35 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// <summary>
/// 裁判任务
/// </summary>
/// <param name="queryVisitTask"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<JudgeVisitTaskView>/*, object)*/> GetJudgeVisitTaskList(VisitTaskQuery queryVisitTask)
public async Task<PageOutput<JudgeVisitTaskView>/*, object)*/> GetJudgeVisitTaskList(VisitTaskQuery inQuery)
{
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
.Where(t => t.ReadingCategory == ReadingCategory.Judge)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
.ProjectTo<JudgeVisitTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTaskView.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
//var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialTaskConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
@ -723,45 +723,45 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// <summary>
/// PM阅片跟踪
/// </summary>
/// <param name="queryVisitTask"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput<PageOutput<ReadingTaskView>>> GetReadingTaskList(VisitTaskQuery queryVisitTask)
public async Task<IResponseOutput<PageOutput<ReadingTaskView>>> GetReadingTaskList(VisitTaskQuery inQuery)
{
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false)
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
.WhereIf(queryVisitTask.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
.WhereIf(queryVisitTask.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
.WhereIf(inQuery.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
.WhereIf(inQuery.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(inQuery.ReReadingApplyState != null, t => t.ReReadingApplyState == inQuery.ReReadingApplyState)
.WhereIf(queryVisitTask.CompleteClinicalDataEnum == CompleteClinicalDataEnum.Complete, t => t.IsClinicalDataSign && t.IsNeedClinicalDataSign == true)
.WhereIf(queryVisitTask.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NotComplete, t => t.IsClinicalDataSign == false && t.IsNeedClinicalDataSign == true)
.WhereIf(queryVisitTask.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NA, t => t.IsNeedClinicalDataSign == false)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate)
.WhereIf(queryVisitTask.BeginSignTime != null, t => t.SignTime > queryVisitTask.BeginSignTime)
.WhereIf(queryVisitTask.EndSignTime != null, t => t.SignTime < queryVisitTask.EndSignTime)
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.Complete, t => t.IsClinicalDataSign && t.IsNeedClinicalDataSign == true)
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NotComplete, t => t.IsClinicalDataSign == false && t.IsNeedClinicalDataSign == true)
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NA, t => t.IsNeedClinicalDataSign == false)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialUrgentConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialUrgentConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
return ResponseOutput.Ok(pageList, trialTaskConfig);
}
@ -820,7 +820,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
}
@ -829,43 +829,43 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// <summary>
/// 获取IR 重阅影像阅片列表
/// </summary>
/// <param name="queryVisitTask"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ReReadingTaskView>> GetIRReReadingTaskList(VisitTaskQuery queryVisitTask)
public async Task<PageOutput<ReReadingTaskView>> GetIRReReadingTaskList(VisitTaskQuery inQuery)
{
var visitTaskQueryable = _visitTaskReReadingRepository
.Where(t => t.RequestReReadingType == RequestReReadingType.DocotorApply)
.Where(t => t.OriginalReReadingTask.DoctorUserId == _userInfo.Id)
.Where(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId)
.WhereIf(queryVisitTask.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == queryVisitTask.RequestReReadingResultEnum)
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
.Where(t => t.OriginalReReadingTask.TrialId == inQuery.TrialId)
.WhereIf(inQuery.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == inQuery.RequestReReadingResultEnum)
.WhereIf(inQuery.RootReReadingTaskId != null, t => t.RootReReadingTaskId == inQuery.RootReReadingTaskId || t.OriginalReReadingTaskId == inQuery.RootReReadingTaskId)
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(inQuery.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(inQuery.TaskCode!))
.WhereIf(inQuery.TaskState != null, t => t.OriginalReReadingTask.TaskState == inQuery.TaskState)
.WhereIf(inQuery.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == inQuery.ReReadingApplyState)
.WhereIf(inQuery.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == inQuery.ReadingTaskState)
.WhereIf(inQuery.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(queryVisitTask.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > queryVisitTask.BeginAllocateDate)
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(inQuery.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
.ProjectTo<ReReadingTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.IsUrgent) + " desc", nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.SubjectId), nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
}
@ -873,34 +873,34 @@ namespace IRaCIS.Core.Application.Service.Allocation
//SPM 能看到项目组申请记录
[HttpPost]
public async Task<PageOutput<ReReadingTaskView>> GetSPMReReadingTaskList(VisitTaskQuery queryVisitTask)
public async Task<PageOutput<ReReadingTaskView>> GetSPMReReadingTaskList(VisitTaskQuery inQuery)
{
var visitTaskQueryable = _visitTaskReReadingRepository.Where(t => t.RequestReReadingType == RequestReReadingType.TrialGroupApply && t.OriginalReReadingTask.IsAnalysisCreate == false)
.Where(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId)
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
.Where(t => t.OriginalReReadingTask.TrialId == inQuery.TrialId)
.WhereIf(inQuery.RootReReadingTaskId != null, t => t.RootReReadingTaskId == inQuery.RootReReadingTaskId || t.OriginalReReadingTaskId == inQuery.RootReReadingTaskId)
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(inQuery.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(inQuery.TaskCode!))
.WhereIf(inQuery.TaskState != null, t => t.OriginalReReadingTask.TaskState == inQuery.TaskState)
.WhereIf(inQuery.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.ReadingTaskState != null, t => t.OriginalReReadingTask.ReadingTaskState == inQuery.ReadingTaskState)
.WhereIf(inQuery.TaskAllocationState != null, t => t.OriginalReReadingTask.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.OriginalReReadingTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(queryVisitTask.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > queryVisitTask.BeginAllocateDate)
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(inQuery.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
.ProjectTo<ReReadingTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(ReReadingTaskView.RequestReReadingTime) };
//var defalutSortArray = new string[] { nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.IsUrgent) + " desc", nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.SubjectId), nameof(ReReadingTaskView.OriginalReReadingTask) + "." + nameof(ReReadingTaskView.OriginalReReadingTask.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
}
@ -1197,7 +1197,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
.ToList()
}).Where(x => x.UnReadCanReadTaskCount > 0);
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField, inQuery.Asc);
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery, nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) );
return pageList;
}
@ -1208,36 +1208,36 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// <summary>
/// IR 已阅片任务
/// </summary>
/// <param name="queryVisitTask"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<IRHaveReadView>> GetIRHaveReadTaskList(VisitTaskQuery queryVisitTask)
public async Task<PageOutput<IRHaveReadView>> GetIRHaveReadTaskList(VisitTaskQuery inQuery)
{
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId)
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId)
.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState == ReadingTaskState.HaveSigned)//该医生 已经签名的数据
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate!.Value.AddDays(1))
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
.ProjectTo<IRHaveReadView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
}

View File

@ -116,27 +116,27 @@ namespace IRaCIS.Application.Services
/// <summary>
/// New 查询条件
/// </summary>
/// <param name="basicDicQuery"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<BasicDicView>> GetBasicDicList(BasicDicQuery basicDicQuery)
public async Task<PageOutput<BasicDicView>> GetBasicDicList(BasicDicQuery inQuery)
{
var systemBasicDataQueryable = _dicRepository.Where(t => t.ParentId == null)
.WhereIf(!string.IsNullOrEmpty(basicDicQuery.Code), t => t.Code.Contains(basicDicQuery.Code!))
.WhereIf(!string.IsNullOrEmpty(basicDicQuery.keyInfo), t => t.Description.Contains(basicDicQuery.keyInfo!)
|| t.Code.Contains(basicDicQuery.keyInfo!)
|| t.ChildList.Any(u => u.ValueCN.Contains(basicDicQuery.keyInfo!))
|| t.ChildList.Any(u => u.Description.Contains(basicDicQuery.keyInfo!))
|| t.ChildList.Any(u => u.Value.Contains(basicDicQuery.keyInfo!)))
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), t => t.Code.Contains(inQuery.Code!))
.WhereIf(!string.IsNullOrEmpty(inQuery.keyInfo), t => t.Description.Contains(inQuery.keyInfo!)
|| t.Code.Contains(inQuery.keyInfo!)
|| t.ChildList.Any(u => u.ValueCN.Contains(inQuery.keyInfo!))
|| t.ChildList.Any(u => u.Description.Contains(inQuery.keyInfo!))
|| t.ChildList.Any(u => u.Value.Contains(inQuery.keyInfo!)))
.WhereIf(basicDicQuery.ConfigTypeId != null, t => t.ConfigTypeId == basicDicQuery.ConfigTypeId!)
.WhereIf(basicDicQuery.DataTypeEnum != null, t => t.DataTypeEnum == basicDicQuery.DataTypeEnum)
.WhereIf(basicDicQuery.DataTypeEnum == null, t => t.DataTypeEnum != DicDataTypeEnum.Config)
.WhereIf(inQuery.ConfigTypeId != null, t => t.ConfigTypeId == inQuery.ConfigTypeId!)
.WhereIf(inQuery.DataTypeEnum != null, t => t.DataTypeEnum == inQuery.DataTypeEnum)
.WhereIf(inQuery.DataTypeEnum == null, t => t.DataTypeEnum != DicDataTypeEnum.Config)
.ProjectTo<BasicDicView>(_mapper.ConfigurationProvider);
return await systemBasicDataQueryable.ToPagedListAsync(basicDicQuery.PageIndex, basicDicQuery.PageSize, String.IsNullOrEmpty(basicDicQuery.SortField) ? nameof(BasicDicView.ConfigType) : basicDicQuery.SortField, basicDicQuery.Asc, String.IsNullOrEmpty(basicDicQuery.SortField), new[] { nameof(BasicDicView.ConfigType), nameof(BasicDicView.ShowOrder) });
return await systemBasicDataQueryable.ToPagedListAsync(inQuery, new[] { nameof(BasicDicView.ConfigType), nameof(BasicDicView.ShowOrder) });
}

View File

@ -20,19 +20,19 @@ namespace IRaCIS.Core.Application.Contracts
{
[HttpPost]
public async Task<PageOutput<EmailNoticeConfigView>> GetEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
public async Task<PageOutput<EmailNoticeConfigView>> GetEmailNoticeConfigList(EmailNoticeConfigQuery inQuery)
{
var emailNoticeConfigQueryable = _emailNoticeConfigrepository
.WhereIf(queryEmailNoticeConfig.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
.WhereIf(queryEmailNoticeConfig.SystemLevel!=null, t =>t.SystemLevel == queryEmailNoticeConfig.SystemLevel)
.WhereIf(queryEmailNoticeConfig.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == queryEmailNoticeConfig.IsDistinguishCriteria)
.WhereIf(queryEmailNoticeConfig.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryEmailNoticeConfig.CriterionTypeEnum)
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
.WhereIf(inQuery.SystemLevel!=null, t =>t.SystemLevel == inQuery.SystemLevel)
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
.ProjectTo<EmailNoticeConfigView>(_mapper.ConfigurationProvider);
return await emailNoticeConfigQueryable.ToPagedListAsync(queryEmailNoticeConfig.PageIndex, queryEmailNoticeConfig.PageSize, queryEmailNoticeConfig.SortField, queryEmailNoticeConfig.Asc);
return await emailNoticeConfigQueryable.ToPagedListAsync(inQuery);
}

View File

@ -40,8 +40,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<ExploreRecommendView>(_mapper.ConfigurationProvider);
var pageList = await exploreRecommendQueryable
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(ExploreRecommendView.Id) : inQuery.SortField,
inQuery.Asc);
.ToPagedListAsync(inQuery);
return pageList;
}

View File

@ -113,8 +113,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<InternationalizationView>(_mapper.ConfigurationProvider);
var pageList = await internationalizationQueryable
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(InternationalizationView.State) : inQuery.SortField,
inQuery.Asc);
.ToPagedListAsync(inQuery);
return pageList;
}

View File

@ -38,7 +38,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<PublishLogView>(_mapper.ConfigurationProvider);
var pageList = await publishLogQueryable
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
.ToPagedListAsync(inQuery);
return pageList;
}

View File

@ -24,15 +24,15 @@ namespace IRaCIS.Core.Application.Services
/// <summary>
/// 模板列表
/// </summary>
/// <param name="querySystemBasicData"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<SystemBasicDataView>> GetSystemBasicDataList(SystemBasicDataQuery querySystemBasicData)
public async Task<PageOutput<SystemBasicDataView>> GetSystemBasicDataList(SystemBasicDataQuery inQuery)
{
var systemBasicDataQueryable = _systemBasicDataRepository.Where(t => t.ParentId == null)
.ProjectTo<SystemBasicDataView>(_mapper.ConfigurationProvider);
return await systemBasicDataQueryable.ToPagedListAsync(querySystemBasicData.PageIndex, querySystemBasicData.PageSize, String.IsNullOrEmpty(querySystemBasicData.SortField) ? "Code" : querySystemBasicData.SortField, querySystemBasicData.Asc);
return await systemBasicDataQueryable.ToPagedListAsync(inQuery);
}

View File

@ -21,38 +21,38 @@ namespace IRaCIS.Application.Services
/// Reviewer列表分页查询
/// </summary>
[HttpPost]
public async Task<PageOutput<DoctorDTO>> GetDoctorSearchList(DoctorSearchDTO doctorSearch)
public async Task<PageOutput<DoctorDTO>> GetDoctorSearchList(DoctorSearchDTO inQuery)
{
// 项目经验 多选
var evaluationCriteriaCount = doctorSearch.EvaluationCriteriaIdList.Count();
var evaluationCriteriaCount = inQuery.EvaluationCriteriaIdList.Count();
// 搜索条件 ReadingType 、Subspeciality、Title 多选
var count = doctorSearch.ReadingTypeIdList.Count + doctorSearch.TitleIdList.Count + doctorSearch.SubspecialityIdList.Count;
var count = inQuery.ReadingTypeIdList.Count + inQuery.TitleIdList.Count + inQuery.SubspecialityIdList.Count;
var guidList = doctorSearch.ReadingTypeIdList.Concat(doctorSearch.SubspecialityIdList).Concat(doctorSearch.TitleIdList);
var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList);
var query = _doctorRepository.AsQueryable()
.WhereIf(doctorSearch.DepartmentId != null, t => t.DepartmentId == doctorSearch.DepartmentId)
.WhereIf(doctorSearch.SpecialityId != null, t => t.SpecialityId == doctorSearch.SpecialityId)
.WhereIf(doctorSearch.HospitalId != null, t => t.HospitalId == doctorSearch.HospitalId)
.WhereIf(doctorSearch.PositionId != null, t => t.PositionId == doctorSearch.PositionId)
.WhereIf(doctorSearch.RankId != null, t => t.RankId == doctorSearch.RankId)
.WhereIf(doctorSearch.ContractorStatus != null, t => t.CooperateStatus == doctorSearch.ContractorStatus)
.WhereIf(doctorSearch.InformationConfirmed != null, t => t.ResumeStatus == doctorSearch.InformationConfirmed)
.WhereIf(doctorSearch.AcceptingNewTrial != null, t => t.AcceptingNewTrial == doctorSearch.AcceptingNewTrial)
.WhereIf(!string.IsNullOrWhiteSpace(doctorSearch.Name), t => t.ChineseName.Contains(doctorSearch.Name) || (t.LastName + t.FirstName).Contains(doctorSearch.Name))
.WhereIf(doctorSearch.Nation != null, t => t.Nation == doctorSearch.Nation)
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => doctorSearch.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
.WhereIf(inQuery.PositionId != null, t => t.PositionId == inQuery.PositionId)
.WhereIf(inQuery.RankId != null, t => t.RankId == inQuery.RankId)
.WhereIf(inQuery.ContractorStatus != null, t => t.CooperateStatus == inQuery.ContractorStatus)
.WhereIf(inQuery.InformationConfirmed != null, t => t.ResumeStatus == inQuery.InformationConfirmed)
.WhereIf(inQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == inQuery.AcceptingNewTrial)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ChineseName.Contains(inQuery.Name) || (t.LastName + t.FirstName).Contains(inQuery.Name))
.WhereIf(inQuery.Nation != null, t => t.Nation == inQuery.Nation)
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => inQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
////用户类型 看到简历的范围这里需要确认
//.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ReviewerCoordinator, t => t.UserList.Any(u => u.UserId == _userInfo.Id))
.WhereIf(count > 0, t => t.DoctorDicRelationList.Count(u => guidList.Contains(u.DictionaryId)) == count)
.WhereIf(doctorSearch.EnrollStatus != null && doctorSearch.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.WhereIf(inQuery.EnrollStatus != null && inQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.ProjectTo<DoctorDTO>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(doctorSearch.PageIndex, doctorSearch.PageSize, doctorSearch.SortField == string.Empty ? "CreateTime" : doctorSearch.SortField, doctorSearch.Asc);
return await query.ToPagedListAsync(inQuery);
}
@ -64,45 +64,45 @@ namespace IRaCIS.Application.Services
/// </summary>
[HttpPost]
public async Task<PageOutput<SelectionReviewerDTO>> GetSelectionReviewerList(
ReviewerSelectionQueryDTO selectionQuery)
ReviewerSelectionQueryDTO inQuery)
{
//项目配置需要的医生过滤 2表示混合
var trialConfig = await _repository.Where<Trial>(s => s.Id == selectionQuery.TrialId).Select(t=>new { t.AttendedReviewerTypeEnumList ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException();
var trialConfig = await _repository.Where<Trial>(s => s.Id == inQuery.TrialId).Select(t=>new { t.AttendedReviewerTypeEnumList ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException();
//var nation = trialConfig.AttendedReviewerType;
// 临床项目经验 多选
var evaluationCriteriaCount = selectionQuery.EvaluationCriteriaIdList.Count();
var evaluationCriteriaCount = inQuery.EvaluationCriteriaIdList.Count();
// 搜索条件 ReadingType 、Subspeciality、Title 多选
var count = selectionQuery.ReadingTypeIdList.Count + selectionQuery.TitleIdList.Count + selectionQuery.SubspecialityIdList.Count;
var count = inQuery.ReadingTypeIdList.Count + inQuery.TitleIdList.Count + inQuery.SubspecialityIdList.Count;
var guidList = selectionQuery.ReadingTypeIdList.Concat(selectionQuery.SubspecialityIdList).Concat(selectionQuery.TitleIdList);
var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList);
var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/
.WhereIf(selectionQuery.DepartmentId != null, t => t.DepartmentId == selectionQuery.DepartmentId)
.WhereIf(selectionQuery.SpecialityId != null, t => t.SpecialityId == selectionQuery.SpecialityId)
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
.WhereIf(trialConfig.TrialType == TrialType.NoneOfficial, t => t.IsVirtual ==true)
.WhereIf(trialConfig.TrialType != TrialType.NoneOfficial, t => t.IsVirtual == false)
.WhereIf(selectionQuery.HospitalId != null, t => t.HospitalId == selectionQuery.HospitalId)
.WhereIf(selectionQuery.PositionId != null, t => t.PositionId == selectionQuery.PositionId)
.WhereIf(selectionQuery.RankId != null, t => t.RankId == selectionQuery.RankId)
.WhereIf(selectionQuery.ContractorStatus != null, t => t.CooperateStatus == selectionQuery.ContractorStatus )
.WhereIf(selectionQuery.InformationConfirmed != null, t => t.ResumeStatus == selectionQuery.InformationConfirmed)
.WhereIf(selectionQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == selectionQuery.AcceptingNewTrial)
.WhereIf(!string.IsNullOrWhiteSpace(selectionQuery.Name), t => t.ChineseName.Contains(selectionQuery.Name) || (t.LastName + t.FirstName).Contains(selectionQuery.Name))
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => selectionQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
.WhereIf(inQuery.PositionId != null, t => t.PositionId == inQuery.PositionId)
.WhereIf(inQuery.RankId != null, t => t.RankId == inQuery.RankId)
.WhereIf(inQuery.ContractorStatus != null, t => t.CooperateStatus == inQuery.ContractorStatus )
.WhereIf(inQuery.InformationConfirmed != null, t => t.ResumeStatus == inQuery.InformationConfirmed)
.WhereIf(inQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == inQuery.AcceptingNewTrial)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ChineseName.Contains(inQuery.Name) || (t.LastName + t.FirstName).Contains(inQuery.Name))
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => inQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
//用户类型 看到简历的范围这里需要确认
//.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ReviewerCoordinator, t => t.UserList.Any(u => u.UserId == _userInfo.Id))
.WhereIf(count > 0, t => t.DoctorDicRelationList.Count(u => guidList.Contains(u.DictionaryId)) == count)
.WhereIf(selectionQuery.EnrollStatus != null && selectionQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.WhereIf(inQuery.EnrollStatus != null && inQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.ProjectTo<SelectionReviewerDTO>(_mapper.ConfigurationProvider);
var result = await query.ToPagedListAsync(selectionQuery.PageIndex, selectionQuery.PageSize, selectionQuery.SortField == string.Empty ? "ReviewerCode" : selectionQuery.SortField, selectionQuery.Asc);
var result = await query.ToPagedListAsync(inQuery);
//是否已申请 申请时间 申请人
var doctorStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == selectionQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
var doctorStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
result.CurrentPageData.ToList().ForEach(doctor =>
@ -130,24 +130,24 @@ namespace IRaCIS.Application.Services
/// </summary>
[HttpPost]
public async Task<PageOutput<ConfirmationReviewerDTO>> GetSubmissionOrApprovalReviewerList(
ReviewerSubmissionQueryDTO param)
ReviewerSubmissionQueryDTO inQuery)
{
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == param.TrialId)
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == inQuery.TrialId)
//提交CRO 以及下载简历列表
.WhereIf(param.IntoGroupSearchState == 1, t => t.EnrollStatus >= EnrollStatus.HasApplyDownloadResume)
.WhereIf(inQuery.IntoGroupSearchState == 1, t => t.EnrollStatus >= EnrollStatus.HasApplyDownloadResume)
//CRO确认列表 状态为 已提交CRO
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus >= EnrollStatus.HasCommittedToCRO)
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus >= EnrollStatus.HasCommittedToCRO)
.ProjectTo<ConfirmationReviewerDTO>(_mapper.ConfigurationProvider);
var doctorPageList = await doctorQuery.ToPagedListAsync(param.PageIndex, param.PageSize, param.SortField == "" ? "Code" : param.SortField, param.Asc);
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId)
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == inQuery.TrialId)
//提交CRO 以及下载简历列表
.WhereIf(param.IntoGroupSearchState == 1, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
.WhereIf(inQuery.IntoGroupSearchState == 1, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
//CRO确认列表 状态为 已提交CRO
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.InviteIntoGroup)
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.InviteIntoGroup)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
@ -158,22 +158,22 @@ namespace IRaCIS.Application.Services
var opt = enrollStateList.FirstOrDefault(t => t.DoctorId == u.Id);
if (opt != null)
{
u.DoctorTrialState = param.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasCommittedToCRO : (int)EnrollStatus.InviteIntoGroup;
u.DoctorTrialState = inQuery.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasCommittedToCRO : (int)EnrollStatus.InviteIntoGroup;
u.OptTime = opt.OptTime;
u.OptUserName = opt.OptUserName;
}
else
{
u.DoctorTrialState = param.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasDownloadResume : (int)EnrollStatus.HasCommittedToCRO;
u.DoctorTrialState = inQuery.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasDownloadResume : (int)EnrollStatus.HasCommittedToCRO;
}
});
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM)
{
//SPM 要看到提交的时间 提交人
var enrollCommitList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId)
var enrollCommitList = await _repository.Where<EnrollDetail>(x => x.TrialId == inQuery.TrialId)
//提交CRO 以及下载简历列表
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
@ -237,16 +237,16 @@ namespace IRaCIS.Application.Services
/// </summary>
[HttpPost]
public async Task<PageOutput<ConfirmationReviewerDTO>> GetConfirmationReviewerList(
ReviewerConfirmationQueryDTO param)
ReviewerConfirmationQueryDTO inQuery)
{
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == param.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
.ProjectTo<ConfirmationReviewerDTO>(_mapper.ConfigurationProvider);
var doctorPageList = await doctorQuery.ToPagedListAsync(param.PageIndex, param.PageSize, param.SortField == "" ? "Code" : param.SortField, param.Asc);
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == inQuery.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();

View File

@ -72,7 +72,7 @@ namespace IRaCIS.Application.Services
var query = _vacationRepository.Where(u => u.DoctorId == doctorId)
.ProjectTo<VacationCommand>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(pageIndex, pageSize, "StartDate");
return await query.ToPagedListAsync(new PageInput() { PageIndex = pageIndex,PageSize=pageSize },nameof(VacationCommand.StartDate));
}

View File

@ -37,17 +37,17 @@ namespace IRaCIS.Core.Application.Services
/// <summary>
/// 管理端列表
/// </summary>
/// <param name="querySystemDocument"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<SystemDocumentView>> GetSystemDocumentListAsync(SystemDocumentQuery querySystemDocument)
public async Task<PageOutput<SystemDocumentView>> GetSystemDocumentListAsync(SystemDocumentQuery inQuery)
{
var systemDocumentQueryable = _systemDocumentRepository.AsQueryable(true)
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
return await systemDocumentQueryable.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
return await systemDocumentQueryable.ToPagedListAsync(inQuery);
}
public async Task<IResponseOutput> AddOrUpdateSystemDocumentAsync(AddOrEditSystemDocument addOrEditSystemDocument)
@ -151,11 +151,11 @@ namespace IRaCIS.Core.Application.Services
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<UnionDocumentWithConfirmInfoView>> getWaitSignSysDocList(SystemDocumentQuery querySystemDocument)
public async Task<PageOutput<UnionDocumentWithConfirmInfoView>> getWaitSignSysDocList(SystemDocumentQuery inQuery)
{
var query = from sysDoc in _systemDocumentRepository.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
join confirm in _repository.GetQueryable<SystemDocConfirmedUser>() on new { ConfirmUserId = _userInfo.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
@ -184,9 +184,9 @@ namespace IRaCIS.Core.Application.Services
UserTypeShortName = user.UserTypeRole.UserTypeShortName
};
return await query.WhereIf(querySystemDocument.IsSigned==true,t=>t.ConfirmTime!=null)
.WhereIf(querySystemDocument.IsSigned == false, t => t.ConfirmTime == null)
.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
return await query.WhereIf(inQuery.IsSigned==true,t=>t.ConfirmTime!=null)
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null)
.ToPagedListAsync(inQuery);

View File

@ -55,27 +55,27 @@ namespace IRaCIS.Core.Application.Services
/// <summary>
/// Setting 界面的 项目所有文档列表
/// </summary>
/// <param name="queryTrialDocument"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery queryTrialDocument)
public async Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery inQuery)
{
var trialDocumentQueryable = _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == queryTrialDocument.TrialId)
.WhereIf(!string.IsNullOrEmpty(queryTrialDocument.Name), t => t.Name.Contains(queryTrialDocument.Name))
.WhereIf(queryTrialDocument.FileTypeId != null, t => t.FileTypeId == queryTrialDocument.FileTypeId)
.WhereIf(queryTrialDocument.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == queryTrialDocument.UserTypeId))
.WhereIf(queryTrialDocument.IsDeleted != null, t => t.IsDeleted == queryTrialDocument.IsDeleted)
var trialDocumentQueryable = _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId))
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.ProjectTo<TrialDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, isEn_Us = _userInfo.IsEn_Us });
return await trialDocumentQueryable.ToPagedListAsync(queryTrialDocument.PageIndex, queryTrialDocument.PageSize, queryTrialDocument.SortField, queryTrialDocument.Asc);
return await trialDocumentQueryable.ToPagedListAsync(inQuery);
}
[HttpPost]
public async Task<PageOutput<TrialSignDocView>> GetTrialSignDocumentList(TrialDocQuery querySystemDocument)
public async Task<PageOutput<TrialSignDocView>> GetTrialSignDocumentList(TrialDocQuery inQuery)
{
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true)
.WhereIf(querySystemDocument.TrialId != null, t => t.TrialId == querySystemDocument.TrialId)
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
join trialUser in _repository.Where<TrialUser>(t => t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
@ -110,13 +110,13 @@ namespace IRaCIS.Core.Application.Services
};
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
.WhereIf(querySystemDocument.IsSigned == true, t => t.ConfirmTime != null)
.WhereIf(querySystemDocument.IsSigned == false, t => t.ConfirmTime == null);
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null);
return await trialDocQueryable.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
return await trialDocQueryable.ToPagedListAsync(inQuery);
}
@ -170,10 +170,10 @@ namespace IRaCIS.Core.Application.Services
/// <summary>
/// 具体用户看到的 系统文件列表 + 项目类型文档
/// </summary>
/// <param name="querySystemDocument"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument)
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetUserDocumentList(TrialUserDocUnionQuery inQuery)
{
#region https://github.com/dotnet/efcore/issues/16243 操作不行
////系统文档查询
@ -235,9 +235,9 @@ namespace IRaCIS.Core.Application.Services
#endregion
var trialId = querySystemDocument.TrialId;
var trialId = inQuery.TrialId;
var trialInfo = await (_repository.Where<Trial>(t => t.Id == querySystemDocument.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
var trialInfo = await (_repository.Where<Trial>(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
//系统文档查询
var systemDocumentQueryable = from needConfirmedUserType in _repository.Where<SystemDocNeedConfirmedUserType>(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
@ -245,7 +245,7 @@ namespace IRaCIS.Core.Application.Services
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == querySystemDocument.TrialId && t.UserId == _userInfo.Id)
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.Id)
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
join confirm in _repository.GetQueryable<SystemDocConfirmedUser>() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
@ -275,12 +275,12 @@ namespace IRaCIS.Core.Application.Services
};
//项目文档查询
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == querySystemDocument.TrialId)
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == querySystemDocument.TrialId && t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
join confirm in _repository.Where<TrialDocConfirmedUser>(t => t.TrialDocument.TrialId == querySystemDocument.TrialId) on
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
join confirm in _repository.Where<TrialDocConfirmedUser>(t => t.TrialDocument.TrialId == inQuery.TrialId) on
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
from confirm in cc.DefaultIfEmpty()
select new UnionDocumentWithConfirmInfoView()
@ -309,14 +309,14 @@ namespace IRaCIS.Core.Application.Services
#region 报错 奇怪的bug
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
.WhereIf(querySystemDocument.IsSign == true, t => t.ConfirmTime != null)
.WhereIf(querySystemDocument.IsSign == false, t => t.ConfirmTime == null);
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsSign == true, t => t.ConfirmTime != null)
.WhereIf(inQuery.IsSign == false, t => t.ConfirmTime == null);
var result = await unionQuery.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
var result = await unionQuery.ToPagedListAsync(inQuery);
#endregion
#region 临时方案
@ -342,7 +342,7 @@ namespace IRaCIS.Core.Application.Services
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == querySystemDocument.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
.CountAsync();
@ -352,7 +352,7 @@ namespace IRaCIS.Core.Application.Services
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
.CountAsync();
var trialTaskConfig = _trialRepository.Where(t => t.Id == querySystemDocument.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
@ -489,7 +489,7 @@ namespace IRaCIS.Core.Application.Services
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.WhereIf(inQuery.UserTypeId != null, t => t.UserTypeId == inQuery.UserTypeId);
var result = await unionQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
var result = await unionQuery.ToPagedListAsync(inQuery);
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -819,11 +819,11 @@ namespace IRaCIS.Core.Application.Services
/// <summary>
/// 从 文档的维度 先看到文档列表(系统文档+项目文档 以及需要确认的人数 和已经确认人数) 点击数字查看某文档下面人确认情况
/// </summary>
/// <param name="querySystemDocument"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
[Obsolete]
public async Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument)
public async Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery inQuery)
{
var systemDocumentQueryable = _repository
.WhereIf<SystemDocument>(!_userInfo.IsAdmin, t => t.IsDeleted == false)
@ -842,10 +842,10 @@ namespace IRaCIS.Core.Application.Services
DocumentConfirmedUserCount = t.SystemDocConfirmedUserList.Count(),
//DocumentUserCount= _trialUserRepository.Where(tu=>tu.TrialId== querySystemDocument.TrialId).Count(u=>t.NeedConfirmedUserTypeList.Any(cc=>cc.NeedConfirmUserTypeId== u.User.UserTypeId ))
DocumentUserCount = t.NeedConfirmedUserTypeList.SelectMany(u => u.UserTypeRole.UserList.SelectMany(b => b.UserTrials.Where(r => r.TrialId == querySystemDocument.TrialId))).Count()
DocumentUserCount = t.NeedConfirmedUserTypeList.SelectMany(u => u.UserTypeRole.UserList.SelectMany(b => b.UserTrials.Where(r => r.TrialId == inQuery.TrialId))).Count()
});
var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == querySystemDocument.TrialId).Select(t => new DocumentUnionWithUserStatView()
var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == inQuery.TrialId).Select(t => new DocumentUnionWithUserStatView()
{
Id = t.Id,
IsSystemDoc = false,
@ -864,10 +864,10 @@ namespace IRaCIS.Core.Application.Services
});
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId);
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId);
return await unionQuery.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
return await unionQuery.ToPagedListAsync(inQuery);
}
#endregion

View File

@ -1266,21 +1266,21 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 获取系统 邮件配置 勾选列表
/// </summary>
/// <param name="queryEmailNoticeConfig"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TrialSelectEmailNoticeConfigView>> GetSysEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
public async Task<PageOutput<TrialSelectEmailNoticeConfigView>> GetSysEmailNoticeConfigList(EmailNoticeConfigQuery inQuery)
{
var emailNoticeConfigQueryable = _emailNoticeConfigRepository
.WhereIf(queryEmailNoticeConfig.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
.WhereIf(queryEmailNoticeConfig.SystemLevel != null, t => t.SystemLevel == queryEmailNoticeConfig.SystemLevel)
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
.WhereIf(queryEmailNoticeConfig.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == queryEmailNoticeConfig.IsDistinguishCriteria)
.ProjectTo<TrialSelectEmailNoticeConfigView>(_mapper.ConfigurationProvider, new { trialId = queryEmailNoticeConfig.TrialId });
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
.ProjectTo<TrialSelectEmailNoticeConfigView>(_mapper.ConfigurationProvider, new { trialId = inQuery.TrialId });
return await emailNoticeConfigQueryable.ToPagedListAsync(queryEmailNoticeConfig.PageIndex, queryEmailNoticeConfig.PageSize, queryEmailNoticeConfig.SortField, queryEmailNoticeConfig.Asc);
return await emailNoticeConfigQueryable.ToPagedListAsync(inQuery);
}
/// <summary>

View File

@ -99,16 +99,16 @@ namespace IRaCIS.Application.Services
}
[HttpPost]
public async Task<PageOutput<ExchangeRateCommand>> GetExchangeRateList(ExchangeRateQueryDTO queryParam)
public async Task<PageOutput<ExchangeRateCommand>> GetExchangeRateList(ExchangeRateQueryDTO inQuery)
{
var yearMonth = queryParam.SearchMonth?.ToString("yyyy-MM");
var yearMonth = inQuery.SearchMonth?.ToString("yyyy-MM");
var exchangeRateQueryable = _exchangeRateRepository.AsQueryable()
.WhereIf(queryParam.SearchMonth != null, o => o.YearMonth == yearMonth)
.WhereIf(inQuery.SearchMonth != null, o => o.YearMonth == yearMonth)
.ProjectTo<ExchangeRateCommand>(_mapper.ConfigurationProvider);
return await exchangeRateQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "YearMonth", false);
return await exchangeRateQueryable.ToPagedListAsync(inQuery);

View File

@ -63,7 +63,7 @@ namespace IRaCIS.Application.Services
/// Financials /MonthlyPayment 列表查询接口
/// </summary>
[NonDynamicMethod]
public async Task<PageOutput<PaymentModel>> GetMonthlyPaymentList(MonthlyPaymentQueryDTO queryParam)
public async Task<PageOutput<PaymentModel>> GetMonthlyPaymentList(MonthlyPaymentQueryDTO inQuery)
{
//var year = queryParam.StatisticsDate.Year;
//var month = queryParam.StatisticsDate.Month;
@ -74,21 +74,21 @@ namespace IRaCIS.Application.Services
//var rate = _exchangeRateRepository.FindSingleOrDefault(u => u.YearMonth == yearMonth);
//var exchangeRate = rate == null ? 0 : rate.Rate;
var yearMonth = queryParam.StatisticsDate.ToString("yyyy-MM");
var yearMonth = inQuery.StatisticsDate.ToString("yyyy-MM");
Expression<Func<Doctor, bool>> doctorLambda = x => true;
if (!string.IsNullOrWhiteSpace(queryParam.KeyWord))
if (!string.IsNullOrWhiteSpace(inQuery.KeyWord))
{
var reviewer = queryParam.KeyWord.Trim();
var reviewer = inQuery.KeyWord.Trim();
doctorLambda = doctorLambda.And(u => u.ChineseName.Contains(reviewer)
|| u.FirstName.Contains(reviewer)
|| u.LastName.Contains(reviewer)
|| u.ReviewerCode.Contains(reviewer));
}
if (queryParam.Nation != null)
if (inQuery.Nation != null)
{
doctorLambda = doctorLambda.And(u => u.Nation == queryParam.Nation);
doctorLambda = doctorLambda.And(u => u.Nation == inQuery.Nation);
}
var costStatisticsQueryable =
@ -132,7 +132,7 @@ namespace IRaCIS.Application.Services
return await costStatisticsQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrWhiteSpace(queryParam.SortField) ? "Code" : queryParam.SortField, queryParam.Asc);
return await costStatisticsQueryable.ToPagedListAsync(inQuery);
//var propName = string.IsNullOrWhiteSpace(queryParam.SortField) ? "Code" : queryParam.SortField;
//costStatisticsQueryable = queryParam.Asc ? costStatisticsQueryable.OrderBy(propName).ThenBy(u => u.Code)
@ -317,23 +317,23 @@ namespace IRaCIS.Application.Services
/// Financials / Payment History 列表查询接口(已经支付锁定的数据,包含调整的)[New]
/// </summary>
[HttpPost]
public async Task<PageOutput<MonthlyPaymentDTO>> GetPaymentHistoryList(PaymentQueryDTO queryParam)
public async Task<PageOutput<MonthlyPaymentDTO>> GetPaymentHistoryList(PaymentQueryDTO inQuery)
{
Expression<Func<Doctor, bool>> doctorLambda = x => true;
if (!string.IsNullOrWhiteSpace(queryParam.Reviewer))
if (!string.IsNullOrWhiteSpace(inQuery.Reviewer))
{
var reviewer = queryParam.Reviewer.Trim();
var reviewer = inQuery.Reviewer.Trim();
doctorLambda = doctorLambda.And(u => u.ChineseName.Contains(reviewer)
|| u.FirstName.Contains(reviewer)
|| u.LastName.Contains(reviewer)
|| u.ReviewerCode.Contains(reviewer));
}
if (queryParam.Nation != null)
if (inQuery.Nation != null)
{
doctorLambda = doctorLambda.And(u => u.Nation == queryParam.Nation);
doctorLambda = doctorLambda.And(u => u.Nation == inQuery.Nation);
}
Expression<Func<Payment, bool>> paymentLambda = x => x.IsLock && x.YearMonthDate >= queryParam.BeginMonth && x.YearMonthDate <= queryParam.EndMonth;
Expression<Func<Payment, bool>> paymentLambda = x => x.IsLock && x.YearMonthDate >= inQuery.BeginMonth && x.YearMonthDate <= inQuery.EndMonth;
#region 在 payment表加 调整总计前
@ -416,7 +416,7 @@ namespace IRaCIS.Application.Services
TotalUSD = monthlyPay.AdjustmentUSD + monthlyPay.PaymentUSD
};
return await query.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrWhiteSpace(queryParam.SortField) ? "ReviewerCode" : queryParam.SortField, queryParam.Asc);
return await query.ToPagedListAsync(inQuery);
//var propName = queryParam.SortField == string.Empty ? "ReviewerCode" : queryParam.SortField;
//query = queryParam.Asc ? query.OrderBy(propName).ThenBy(u => u.ReviewerCode) : query.OrderByDescending(propName).ThenBy(u => u.ReviewerCode);

View File

@ -231,19 +231,19 @@ namespace IRaCIS.Application.Services
/// 获取费用调整列表
/// </summary>
[HttpPost]
public async Task<PageOutput<PaymentAdjustmentDetailDTO>> GetPaymentAdjustmentList(PaymentAdjustmentQueryDTO queryParam)
public async Task<PageOutput<PaymentAdjustmentDetailDTO>> GetPaymentAdjustmentList(PaymentAdjustmentQueryDTO inQuery)
{
var beginYearMonth = queryParam.BeginMonth.AddDays(1 - queryParam.BeginMonth.Day);
var endYearMonth = queryParam.EndMonth.AddDays(1 - queryParam.EndMonth.Day).AddMonths(1).AddDays(-1);
var beginYearMonth = inQuery.BeginMonth.AddDays(1 - inQuery.BeginMonth.Day);
var endYearMonth = inQuery.EndMonth.AddDays(1 - inQuery.EndMonth.Day).AddMonths(1).AddDays(-1);
var costAdjustmentQueryable = from costAdjustment in _payAdjustmentRepository
.Where(t => t.YearMonthDate >= beginYearMonth && t.YearMonthDate <= endYearMonth)
join doctor in _doctorRepository.AsQueryable().
WhereIf(!string.IsNullOrWhiteSpace(queryParam.Reviewer),
u => u.ChineseName.Contains(queryParam.Reviewer) ||
(u.LastName + u.FirstName).Contains(queryParam.Reviewer) ||
u.ReviewerCode.Contains(queryParam.Reviewer))
WhereIf(!string.IsNullOrWhiteSpace(inQuery.Reviewer),
u => u.ChineseName.Contains(inQuery.Reviewer) ||
(u.LastName + u.FirstName).Contains(inQuery.Reviewer) ||
u.ReviewerCode.Contains(inQuery.Reviewer))
on costAdjustment.ReviewerId equals doctor.Id
select new PaymentAdjustmentDetailDTO()
@ -262,7 +262,7 @@ namespace IRaCIS.Application.Services
ChineseName = doctor.ChineseName
};
return await costAdjustmentQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrWhiteSpace(queryParam.SortField) ? "YearMonthDate" : queryParam.SortField, queryParam.Asc);
return await costAdjustmentQueryable.ToPagedListAsync(inQuery);
}

View File

@ -86,10 +86,10 @@ namespace IRaCIS.Application.Services
/// 获取职称单价列表
/// </summary>
[HttpPost]
public async Task<PageOutput<RankPriceDTO>> GetRankPriceList(RankPriceQueryDTO queryParam)
public async Task<PageOutput<RankPriceDTO>> GetRankPriceList(RankPriceQueryDTO inQuery)
{
var rankPriceQueryable = _rankPriceRepository.ProjectTo<RankPriceDTO>(_mapper.ConfigurationProvider);
return await rankPriceQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "ShowOrder", queryParam.Asc);
return await rankPriceQueryable.ToPagedListAsync(inQuery);
}

View File

@ -52,14 +52,14 @@ namespace IRaCIS.Application.Services
/// 获取医生支付信息列表
/// </summary>
[HttpPost]
public async Task<PageOutput<DoctorPayInfoQueryListDTO>> GetReviewerPayInfoList(DoctorPaymentInfoQueryDTO queryParam)
public async Task<PageOutput<DoctorPayInfoQueryListDTO>> GetReviewerPayInfoList(DoctorPaymentInfoQueryDTO inQuery)
{
var doctorQueryable = from doctor in _doctorRepository.AsQueryable()
.WhereIf(queryParam.HospitalId != null, o => o.HospitalId == queryParam.HospitalId)
.WhereIf(!string.IsNullOrEmpty(queryParam.SearchName),
u => u.ChineseName.Contains(queryParam.SearchName)|| (u.LastName+ u.FirstName).Contains(queryParam.SearchName))
.WhereIf(inQuery.HospitalId != null, o => o.HospitalId == inQuery.HospitalId)
.WhereIf(!string.IsNullOrEmpty(inQuery.SearchName),
u => u.ChineseName.Contains(inQuery.SearchName)|| (u.LastName+ u.FirstName).Contains(inQuery.SearchName))
join hospitalItem in _hospitalRepository.AsQueryable() on doctor.HospitalId equals hospitalItem.Id into gt
from hospital in gt.DefaultIfEmpty()
join trialPayInfo in _doctorPayInfoRepository.Where()
@ -88,7 +88,7 @@ namespace IRaCIS.Application.Services
CreateTime = doctor.CreateTime
};
return await doctorQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "Code", queryParam.Asc);
return await doctorQueryable.ToPagedListAsync(inQuery);
}

View File

@ -92,7 +92,7 @@ namespace IRaCIS.Application.Services
/// 获取项目支付价格信息列表
/// </summary>
[HttpPost]
public async Task<PageOutput<TrialPaymentPriceDTO>> GetTrialPaymentPriceList(TrialPaymentPriceQueryDTO queryParam)
public async Task<PageOutput<TrialPaymentPriceDTO>> GetTrialPaymentPriceList(TrialPaymentPriceQueryDTO inQuery)
{
#region hwt
//var trialQueryable = from trial in _trialRepository.AsQueryable()
@ -171,11 +171,11 @@ namespace IRaCIS.Application.Services
#region byzhouhang 方式二
var trialQueryable2 = _trialExtRepository.Where(t => t.Trial.IsDeleted == false)
.WhereIf(queryParam.CroId != null, o => o.Trial.CROId == queryParam.CroId)
.WhereIf(!string.IsNullOrEmpty(queryParam.KeyWord), o => o.Trial.TrialCode.Contains(queryParam.KeyWord) || o.Trial.Indication.Contains(queryParam.KeyWord))
.WhereIf(inQuery.CroId != null, o => o.Trial.CROId == inQuery.CroId)
.WhereIf(!string.IsNullOrEmpty(inQuery.KeyWord), o => o.Trial.TrialCode.Contains(inQuery.KeyWord) || o.Trial.Indication.Contains(inQuery.KeyWord))
.ProjectTo<TrialPaymentPriceDTO>(_mapper.ConfigurationProvider);
return await trialQueryable2.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrEmpty(queryParam.SortField) ? "CreateTime" : queryParam.SortField, queryParam.Asc);
return await trialQueryable2.ToPagedListAsync(inQuery);
#endregion

View File

@ -108,12 +108,12 @@ namespace IRaCIS.Application.Services
/// 获取项目收入费用信息列表[New]
/// </summary>
[HttpPost]
public async Task<PageOutput<TrialRevenuesPriceDetialDTO>> GetTrialRevenuesPriceList(TrialRevenuesPriceQueryDTO queryParam)
public async Task<PageOutput<TrialRevenuesPriceDetialDTO>> GetTrialRevenuesPriceList(TrialRevenuesPriceQueryDTO inQuery)
{
var trialQueryable = from trial in _trialRepository.AsQueryable()
.Where(u => u.TrialCode.Contains(queryParam.KeyWord)|| u.Indication.Contains(queryParam.KeyWord))
.WhereIf(queryParam.CroId != null, o => o.CROId == queryParam.CroId)
.Where(u => u.TrialCode.Contains(inQuery.KeyWord)|| u.Indication.Contains(inQuery.KeyWord))
.WhereIf(inQuery.CroId != null, o => o.CROId == inQuery.CroId)
join cro in _croRepository.AsQueryable() on trial.CROId equals cro.Id into CRO
from croInfo in CRO.DefaultIfEmpty()
join dic in _dictionaryRepository.AsQueryable() on trial.ReviewModeId equals dic.Id into dict
@ -143,7 +143,7 @@ namespace IRaCIS.Application.Services
};
return await trialQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "TrialCode", queryParam.Asc);
return await trialQueryable.ToPagedListAsync(inQuery);
}

View File

@ -50,11 +50,11 @@ namespace IRaCIS.Application.Services
/// 分页获取奖励单价列表
/// </summary>
[HttpPost]
public async Task<PageOutput<AwardPriceDTO>> GetVolumeRewardPriceList(AwardPriceQueryDTO queryParam)
public async Task<PageOutput<AwardPriceDTO>> GetVolumeRewardPriceList(AwardPriceQueryDTO inQuery)
{
var awardPriceQueryable = _volumeRewardRepository.ProjectTo<AwardPriceDTO>(_mapper.ConfigurationProvider);
return await awardPriceQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, "Min");
return await awardPriceQueryable.ToPagedListAsync(inQuery);
}
}

View File

@ -357,16 +357,16 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
[HttpPost]
public async Task<PageOutput<UnionStudyViewModel>> GetDicomAndNoneDicomStudyList(StudyQuery studyQuery)
public async Task<PageOutput<UnionStudyViewModel>> GetDicomAndNoneDicomStudyList(StudyQuery inQuery)
{
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(inQuery.VisitPlanArray);
var dicomStudyQuery = _repository.Where<DicomStudy>(t => t.TrialId == studyQuery.TrialId)
var dicomStudyQuery = _repository.Where<DicomStudy>(t => t.TrialId == inQuery.TrialId)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
.Select(t => new UnionStudyViewModel()
{
TrialId = t.TrialId,
@ -408,14 +408,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
//.ProjectTo<UnionStudyViewDodel>(_mapper.ConfigurationProvider);
var svExpression2 = QCCommon.GetNoneDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
var svExpression2 = QCCommon.GetNoneDicomStudySubjectVisitFilter(inQuery.VisitPlanArray);
var nodeDicomStudyQuery = _repository.Where<NoneDicomStudy>(t => t.TrialId == studyQuery.TrialId)
var nodeDicomStudyQuery = _repository.Where<NoneDicomStudy>(t => t.TrialId == inQuery.TrialId)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression2)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
.Select(t => new UnionStudyViewModel()
{
@ -460,12 +460,12 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var unionQuery = dicomStudyQuery.Union(nodeDicomStudyQuery)
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
.WhereIf(studyQuery.TrialSiteId != null, t => t.TrialSiteId == studyQuery.TrialSiteId)
.WhereIf(studyQuery.IsFromPACS != null, t => t.IsFromPACS == studyQuery.IsFromPACS);
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.IsFromPACS != null, t => t.IsFromPACS == inQuery.IsFromPACS);
return await unionQuery.ToPagedListAsync(studyQuery.PageIndex, studyQuery.PageSize, studyQuery.SortField, studyQuery.Asc);
return await unionQuery.ToPagedListAsync(inQuery);
}
@ -528,7 +528,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
});
return await StudyMonitorQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? "UploadTime" : inQuery.SortField, inQuery.Asc);
return await StudyMonitorQuery.ToPagedListAsync(inQuery);

View File

@ -24,17 +24,17 @@ namespace IRaCIS.Core.Application.Service
}
[HttpPost]
public async Task<PageOutput<SystemAnonymizationView>> GetSystemAnonymizationList(SystemAnonymizationQuery querySystemAnonymization)
public async Task<PageOutput<SystemAnonymizationView>> GetSystemAnonymizationList(SystemAnonymizationQuery inQuery)
{
var systemAnonymizationQueryable = systemAnonymizationRepository
.WhereIf(!string.IsNullOrEmpty(querySystemAnonymization.Group), t => t.Group.Contains(querySystemAnonymization.Group))
.WhereIf(!string.IsNullOrEmpty(querySystemAnonymization.Element), t => t.Element.Contains(querySystemAnonymization.Element))
.WhereIf(querySystemAnonymization.IsAdd != null, t => t.IsAdd == querySystemAnonymization.IsAdd)
.WhereIf(!string.IsNullOrEmpty(querySystemAnonymization.ValueRepresentation), t => t.ValueRepresentation.Contains(querySystemAnonymization.ValueRepresentation))
.WhereIf(!string.IsNullOrEmpty(inQuery.Group), t => t.Group.Contains(inQuery.Group))
.WhereIf(!string.IsNullOrEmpty(inQuery.Element), t => t.Element.Contains(inQuery.Element))
.WhereIf(inQuery.IsAdd != null, t => t.IsAdd == inQuery.IsAdd)
.WhereIf(!string.IsNullOrEmpty(inQuery.ValueRepresentation), t => t.ValueRepresentation.Contains(inQuery.ValueRepresentation))
.ProjectTo<SystemAnonymizationView>(_mapper.ConfigurationProvider);
return await systemAnonymizationQueryable.ToPagedListAsync(querySystemAnonymization.PageIndex, querySystemAnonymization.PageSize, querySystemAnonymization.SortField, querySystemAnonymization.Asc);
return await systemAnonymizationQueryable.ToPagedListAsync(inQuery);
}

View File

@ -26,11 +26,11 @@ namespace IRaCIS.Core.Application.Service.Inspection
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionList(GetDataInspectionDto dto)
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionList(GetDataInspectionDto inQuery)
{
//_repository.GetQueryable.GetQueryable < DataInspection >
var trialData = await _repository.GetQueryable<Trial>().Where(x => x.Id == dto.TrialId).AsNoTracking().FirstNotNullAsync();
var trialData = await _repository.GetQueryable<Trial>().Where(x => x.Id == inQuery.TrialId).AsNoTracking().FirstNotNullAsync();
trialData.TrialFinishTime = trialData.TrialFinishTime == null ? DateTime.Now : trialData.TrialFinishTime;
@ -164,9 +164,9 @@ namespace IRaCIS.Core.Application.Service.Inspection
TrialReadingCriterionName = data.TrialReadingCriterion.CriterionName
};
query = query.WhereIf(dto.TrialSiteId != null, x => x.TrialSiteId == dto.TrialSiteId)
query = query.WhereIf(inQuery.TrialSiteId != null, x => x.TrialSiteId == inQuery.TrialSiteId)
//.Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime))
.Where(x => x.TrialId == dto.TrialId )
.Where(x => x.TrialId == inQuery.TrialId )
#region 废弃
// .WhereIf(dto.BatchId != null && dto.ObjectRelationParentId == null && dto.GeneralId == null, x => x.BatchId == dto.BatchId)
@ -183,36 +183,36 @@ namespace IRaCIS.Core.Application.Service.Inspection
// x.ObjectRelationParentId == dto.GeneralId //父稽查 查询子记录
// ) && x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1)))
#endregion
.WhereIf(dto.BatchId != null, x => x.BatchId == dto.BatchId)
.WhereIf(dto.BatchId == null && dto.GeneralId != null, x => x.GeneralId == dto.GeneralId)
.WhereIf(dto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == dto.TrialReadingCriterionId)
.WhereIf(inQuery.BatchId != null, x => x.BatchId == inQuery.BatchId)
.WhereIf(inQuery.BatchId == null && inQuery.GeneralId != null, x => x.GeneralId == inQuery.GeneralId)
.WhereIf(inQuery.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(!dto.TaskName.IsNullOrEmpty(), x => x.TaskName.Contains(dto.TaskName) || x.BlindName.Contains(dto.TaskName))
.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
.WhereIf(!dto.RoleName.IsNullOrEmpty(), x => x.RoleName.Contains(dto.RoleName))
.WhereIf(!inQuery.TaskName.IsNullOrEmpty(), x => x.TaskName.Contains(inQuery.TaskName) || x.BlindName.Contains(inQuery.TaskName))
.WhereIf(!inQuery.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(inQuery.SubjectInfo))
.WhereIf(!inQuery.RoleName.IsNullOrEmpty(), x => x.RoleName.Contains(inQuery.RoleName))
//.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo)
//.WhereIf(dto.VisitPlanInfo != (decimal)1.11,x=>x.InPlan!=null&& x.InPlan==false)
.WhereIf(dto.StartTime != null, x => x.CreateTime >= dto.StartTime)
.WhereIf(dto.EndTime != null, x => x.CreateTime <= dto.EndTime)
.WhereIf(dto.ModuleType != null, x => x.ModuleTypeId == dto.ModuleType)
.WhereIf(!dto.Description.IsNullOrEmpty(), x => x.Description.Contains(dto.Description)|| x.DescriptionCN.Contains(dto.Description))
.WhereIf(!dto.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.OpByUserName))
.WhereIf(!dto.CreateUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.CreateUserName) || x.CreateUserRealName.Contains(dto.CreateUserName))
.WhereIf(inQuery.StartTime != null, x => x.CreateTime >= inQuery.StartTime)
.WhereIf(inQuery.EndTime != null, x => x.CreateTime <= inQuery.EndTime)
.WhereIf(inQuery.ModuleType != null, x => x.ModuleTypeId == inQuery.ModuleType)
.WhereIf(!inQuery.Description.IsNullOrEmpty(), x => x.Description.Contains(inQuery.Description)|| x.DescriptionCN.Contains(inQuery.Description))
.WhereIf(!inQuery.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.OpByUserName))
.WhereIf(!inQuery.CreateUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.CreateUserName) || x.CreateUserRealName.Contains(inQuery.CreateUserName))
//.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
.WhereIf(dto.IsSign != null, x => x.IsSign == dto.IsSign);
.WhereIf(inQuery.IsSign != null, x => x.IsSign == inQuery.IsSign);
#endregion
if (dto.VisitPlanInfo != null && dto.VisitPlanInfo.Value != (decimal)1.11)
if (inQuery.VisitPlanInfo != null && inQuery.VisitPlanInfo.Value != (decimal)1.11)
{
query = query.Where(x => x.VisitNum == dto.VisitPlanInfo.Value);
query = query.Where(x => x.VisitNum == inQuery.VisitPlanInfo.Value);
}
else if (dto.VisitPlanInfo != null)
else if (inQuery.VisitPlanInfo != null)
{
query = query.Where(x => x.InPlan == false);
}
return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, dto.SortField.IsNullOrEmpty() ? nameof(GetDataInspectionOutDto.CreateTime) : dto.SortField, dto.Asc);
return await query.ToPagedListAsync(inQuery, nameof(GetDataInspectionOutDto.CreateTime) );
}

View File

@ -19,15 +19,14 @@ namespace IRaCIS.Application.Services
/// <summary> 分页获取CRO列表 </summary>
[HttpPost]
public async Task<PageOutput<CROCompanyDTO>> GetCroList(CROCompanyQueryDTO croCompanySearchModel)
public async Task<PageOutput<CROCompanyDTO>> GetCroList(CROCompanyQueryDTO inQuery)
{
var croQueryable = _croRepository
.WhereIf(!string.IsNullOrEmpty(croCompanySearchModel.CROName), t => t.CROName.Contains(croCompanySearchModel.CROName) || t.CRONameCN.Contains(croCompanySearchModel.CROName))
.WhereIf(!string.IsNullOrEmpty(croCompanySearchModel.CROCode), t => t.CROCode.Contains(croCompanySearchModel.CROCode))
.WhereIf(!string.IsNullOrEmpty(inQuery.CROName), t => t.CROName.Contains(inQuery.CROName) || t.CRONameCN.Contains(inQuery.CROName))
.WhereIf(!string.IsNullOrEmpty(inQuery.CROCode), t => t.CROCode.Contains(inQuery.CROCode))
.ProjectTo<CROCompanyDTO>(_mapper.ConfigurationProvider);
return await croQueryable.ToPagedListAsync(croCompanySearchModel.PageIndex, croCompanySearchModel.PageSize,
string.IsNullOrWhiteSpace(croCompanySearchModel.SortField) ? "CROName" : croCompanySearchModel.SortField, croCompanySearchModel.Asc);
return await croQueryable.ToPagedListAsync(inQuery);
}

View File

@ -83,19 +83,18 @@ namespace IRaCIS.Application.Services
/// <summary> 分页获取医院列表 </summary>
[HttpPost]
public async Task<PageOutput<HospitalDTO>> GetHospitalPageList(HospitalQueryDTO hospitalSearchModel)
public async Task<PageOutput<HospitalDTO>> GetHospitalPageList(HospitalQueryDTO inQuery)
{
var hospitalQueryable =
_hospitalRepository
.WhereIf(hospitalSearchModel.HospitalName != null, t => t.HospitalName.Contains(hospitalSearchModel.HospitalName!) || t.HospitalNameCN.Contains(hospitalSearchModel.HospitalName!))
.WhereIf(hospitalSearchModel.City != null, t => t.City.Contains(hospitalSearchModel.City!) || t.HospitalNameCN.Contains(hospitalSearchModel.City!))
.WhereIf(hospitalSearchModel.Province != null, t => t.Province.Contains(hospitalSearchModel.Province!) || t.HospitalNameCN.Contains(hospitalSearchModel.Province!))
.WhereIf(inQuery.HospitalName != null, t => t.HospitalName.Contains(inQuery.HospitalName!) || t.HospitalNameCN.Contains(inQuery.HospitalName!))
.WhereIf(inQuery.City != null, t => t.City.Contains(inQuery.City!) || t.HospitalNameCN.Contains(inQuery.City!))
.WhereIf(inQuery.Province != null, t => t.Province.Contains(inQuery.Province!) || t.HospitalNameCN.Contains(inQuery.Province!))
.ProjectTo<HospitalDTO>(_mapper.ConfigurationProvider);
//优化后
return await hospitalQueryable.ToPagedListAsync(hospitalSearchModel.PageIndex, hospitalSearchModel.PageSize, string.IsNullOrWhiteSpace(hospitalSearchModel.SortField) ? "HospitalName" : hospitalSearchModel.SortField,
hospitalSearchModel.Asc);
return await hospitalQueryable.ToPagedListAsync(inQuery);

View File

@ -28,19 +28,19 @@ namespace IRaCIS.Application.Services
/// <summary> 分页获取研究中心列表 </summary>
[HttpPost]
public async Task<PageOutput<SiteSelectDTO>> GetSiteList(SiteQueryParam searchModel)
public async Task<PageOutput<SiteSelectDTO>> GetSiteList(SiteQueryParam inQuery)
{
var siteQueryable = _siteRepository
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.SiteName), t => t.SiteName.Contains(searchModel.SiteName) || t.SiteNameCN.Contains(searchModel.SiteName))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.AliasName), t => t.AliasName.Contains(searchModel.AliasName))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Province.Contains(searchModel.Province))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SiteName), t => t.SiteName.Contains(inQuery.SiteName) || t.SiteNameCN.Contains(inQuery.SiteName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.AliasName), t => t.AliasName.Contains(inQuery.AliasName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.City), t => t.City.Contains(inQuery.City))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Country), t => t.Country.Contains(inQuery.Country))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Province), t => t.Province.Contains(inQuery.Province))
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
return await siteQueryable.ToPagedListAsync(inQuery);
}
@ -64,7 +64,7 @@ namespace IRaCIS.Application.Services
TrialSiteName = t.TrialSiteName
});
return await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TrialSiteAddView.TrialCode) : inQuery.SortField, inQuery.Asc);
return await query.ToPagedListAsync(inQuery, nameof(TrialSiteAddView.TrialCode));
}
/// <summary> 添加研究中心 </summary>

View File

@ -20,16 +20,15 @@ namespace IRaCIS.Application.Services
/// <summary> 分页获取申办方列表 </summary>
[HttpPost]
public async Task<PageOutput<SponsorDTO>> GetSponsorList(SponsorQueryDTO sponsorSearchModel)
public async Task<PageOutput<SponsorDTO>> GetSponsorList(SponsorQueryDTO inQuery)
{
var sponsorQueryable = _sponsorRepository
.WhereIf(!string.IsNullOrWhiteSpace(sponsorSearchModel.SponsorName),t => t.SponsorName.Contains(sponsorSearchModel.SponsorName)|| t.SponsorNameCN.Contains(sponsorSearchModel.SponsorName))
.WhereIf(!string.IsNullOrEmpty(sponsorSearchModel.SponsorCode), t => t.SponsorCode.Contains(sponsorSearchModel.SponsorCode))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SponsorName),t => t.SponsorName.Contains(inQuery.SponsorName)|| t.SponsorNameCN.Contains(inQuery.SponsorName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SponsorCode), t => t.SponsorCode.Contains(inQuery.SponsorCode))
.ProjectTo<SponsorDTO>(_mapper.ConfigurationProvider);
return await sponsorQueryable.ToPagedListAsync(sponsorSearchModel.PageIndex,
sponsorSearchModel.PageSize, string.IsNullOrWhiteSpace(sponsorSearchModel.SortField) ? "Id" : sponsorSearchModel.SortField, sponsorSearchModel.Asc);
return await sponsorQueryable.ToPagedListAsync(inQuery);
}

View File

@ -25,23 +25,23 @@ namespace IRaCIS.Core.Application.Service
}
[HttpPost]
public async Task<PageOutput<SystemNoticeView>> GetSystemNoticeList(SystemNoticeQuery querySystemNotice)
public async Task<PageOutput<SystemNoticeView>> GetSystemNoticeList(SystemNoticeQuery inQuery)
{
//防止生成sql生成GETDATE() 时区导致的问题
var appDateTimeNow = DateTime.Now;
var systemNoticeQueryable = _systemNoticeRepository
.WhereIf(querySystemNotice.ApplicableProjectEnum != null, t => t.ApplicableProjectEnum == querySystemNotice.ApplicableProjectEnum)
.WhereIf(querySystemNotice.NoticeLevelEnum != null, t => t.NoticeLevelEnum == querySystemNotice.NoticeLevelEnum)
.WhereIf(querySystemNotice.NoticeModeEnum != null, t => t.NoticeModeEnum == querySystemNotice.NoticeModeEnum)
.WhereIf(querySystemNotice.NoticeStateEnum != null && querySystemNotice.NoticeStateEnum != Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == querySystemNotice.NoticeStateEnum)
.WhereIf(querySystemNotice.NoticeModeEnum != null && querySystemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && t.EndDate !=null && t.EndDate < appDateTimeNow)
.WhereIf(querySystemNotice.NoticeTypeEnum != null, t => t.NoticeTypeEnum == querySystemNotice.NoticeTypeEnum)
.WhereIf(!string.IsNullOrWhiteSpace(querySystemNotice.FileName), t => t.FileName.Contains(querySystemNotice.FileName))
.WhereIf(!string.IsNullOrWhiteSpace(querySystemNotice.NoticeContent), t => t.NoticeContent.Contains(querySystemNotice.NoticeContent))
.WhereIf(inQuery.ApplicableProjectEnum != null, t => t.ApplicableProjectEnum == inQuery.ApplicableProjectEnum)
.WhereIf(inQuery.NoticeLevelEnum != null, t => t.NoticeLevelEnum == inQuery.NoticeLevelEnum)
.WhereIf(inQuery.NoticeModeEnum != null, t => t.NoticeModeEnum == inQuery.NoticeModeEnum)
.WhereIf(inQuery.NoticeStateEnum != null && inQuery.NoticeStateEnum != Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == inQuery.NoticeStateEnum)
.WhereIf(inQuery.NoticeModeEnum != null && inQuery.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && t.EndDate !=null && t.EndDate < appDateTimeNow)
.WhereIf(inQuery.NoticeTypeEnum != null, t => t.NoticeTypeEnum == inQuery.NoticeTypeEnum)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.FileName), t => t.FileName.Contains(inQuery.FileName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.NoticeContent), t => t.NoticeContent.Contains(inQuery.NoticeContent))
.ProjectTo<SystemNoticeView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken });
return await systemNoticeQueryable.ToPagedListAsync(querySystemNotice.PageIndex, querySystemNotice.PageSize, querySystemNotice.SortField, querySystemNotice.Asc);
return await systemNoticeQueryable.ToPagedListAsync(inQuery);
}
@ -116,24 +116,24 @@ namespace IRaCIS.Core.Application.Service
/// <summary>获取登陆用户的系统通知列表 只是过滤了用户类型 和已经发布的</summary>
[HttpPost]
public async Task<PageOutput<SystemNoticeReadDTO>> GetUserSystemNoticeList(SystemNoticeQuery querySystemNotice)
public async Task<PageOutput<SystemNoticeReadDTO>> GetUserSystemNoticeList(SystemNoticeQuery inQuery)
{
//防止生成sql生成GETDATE() 时区导致的问题
var appDateTimeNow = DateTime.Now;
var systemNoticeQueryable = _systemNoticeRepository
.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum==Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished)
.WhereIf(querySystemNotice.ApplicableProjectEnum != null, t => t.ApplicableProjectEnum == querySystemNotice.ApplicableProjectEnum)
.WhereIf(querySystemNotice.NoticeLevelEnum != null, t => t.NoticeLevelEnum == querySystemNotice.NoticeLevelEnum)
.WhereIf(querySystemNotice.NoticeModeEnum != null, t => t.NoticeModeEnum == querySystemNotice.NoticeModeEnum)
.WhereIf(querySystemNotice.NoticeStateEnum != null && querySystemNotice.NoticeStateEnum != Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == querySystemNotice.NoticeStateEnum)
.WhereIf(querySystemNotice.NoticeModeEnum != null && querySystemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && t.EndDate != null && t.EndDate < appDateTimeNow)
.WhereIf(querySystemNotice.NoticeTypeEnum != null, t => t.NoticeTypeEnum == querySystemNotice.NoticeTypeEnum)
.WhereIf(!string.IsNullOrWhiteSpace(querySystemNotice.FileName), t => t.FileName.Contains(querySystemNotice.FileName))
.WhereIf(!string.IsNullOrWhiteSpace(querySystemNotice.NoticeContent), t => t.NoticeContent.Contains(querySystemNotice.NoticeContent))
.WhereIf(inQuery.ApplicableProjectEnum != null, t => t.ApplicableProjectEnum == inQuery.ApplicableProjectEnum)
.WhereIf(inQuery.NoticeLevelEnum != null, t => t.NoticeLevelEnum == inQuery.NoticeLevelEnum)
.WhereIf(inQuery.NoticeModeEnum != null, t => t.NoticeModeEnum == inQuery.NoticeModeEnum)
.WhereIf(inQuery.NoticeStateEnum != null && inQuery.NoticeStateEnum != Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == inQuery.NoticeStateEnum)
.WhereIf(inQuery.NoticeModeEnum != null && inQuery.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && t.EndDate != null && t.EndDate < appDateTimeNow)
.WhereIf(inQuery.NoticeTypeEnum != null, t => t.NoticeTypeEnum == inQuery.NoticeTypeEnum)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.FileName), t => t.FileName.Contains(inQuery.FileName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.NoticeContent), t => t.NoticeContent.Contains(inQuery.NoticeContent))
.ProjectTo<SystemNoticeReadDTO>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
return await systemNoticeQueryable.ToPagedListAsync(querySystemNotice.PageIndex, querySystemNotice.PageSize, querySystemNotice.SortField, querySystemNotice.Asc);
return await systemNoticeQueryable.ToPagedListAsync(inQuery);
}

View File

@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<UserFeedBackView>(_mapper.ConfigurationProvider);
var pageList = await userFeedBackQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(UserFeedBackView.Id) : inQuery.SortField, inQuery.Asc);
var pageList = await userFeedBackQueryable.ToPagedListAsync(inQuery);
return pageList;
}

View File

@ -499,26 +499,26 @@ namespace IRaCIS.Application.Services
/// <summary>
/// 获取用户列表
/// </summary>
/// <param name="param"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<UserListDTO>> GetUserList(UserListQueryDTO param)
public async Task<PageOutput<UserListDTO>> GetUserList(UserListQueryDTO inQuery)
{
var userQueryable = _userRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin)
.WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.UserName.Contains(param.UserName))
.WhereIf(!string.IsNullOrWhiteSpace(param.RealName), t => t.FullName.Contains(param.RealName))
.WhereIf(!string.IsNullOrWhiteSpace(param.Phone), t => t.Phone.Contains(param.Phone))
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName), t => t.OrganizationName.Contains(param.OrganizationName))
.WhereIf(!string.IsNullOrWhiteSpace(param.EMail), t => t.EMail.Contains(param.EMail))
.WhereIf(param.BeginCreateTime != null, t => t.CreateTime >= param.BeginCreateTime)
.WhereIf(param.EndCreateTime != null, t => t.CreateTime <= param.EndCreateTime)
.WhereIf(param.UserType != null, t => t.UserTypeId == param.UserType)
.WhereIf(param.UserState != null, t => t.Status == param.UserState)
.WhereIf(param.IsTestUser != null, t => t.IsTestUser == param.IsTestUser)
.WhereIf(param.IsZhiZhun != null, t => t.IsZhiZhun == param.IsZhiZhun)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.RealName), t => t.FullName.Contains(inQuery.RealName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Phone), t => t.Phone.Contains(inQuery.Phone))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.OrganizationName), t => t.OrganizationName.Contains(inQuery.OrganizationName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.EMail), t => t.EMail.Contains(inQuery.EMail))
.WhereIf(inQuery.BeginCreateTime != null, t => t.CreateTime >= inQuery.BeginCreateTime)
.WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime)
.WhereIf(inQuery.UserType != null, t => t.UserTypeId == inQuery.UserType)
.WhereIf(inQuery.UserState != null, t => t.Status == inQuery.UserState)
.WhereIf(inQuery.IsTestUser != null, t => t.IsTestUser == inQuery.IsTestUser)
.WhereIf(inQuery.IsZhiZhun != null, t => t.IsZhiZhun == inQuery.IsZhiZhun)
.ProjectTo<UserListDTO>(_mapper.ConfigurationProvider);
return await userQueryable.ToPagedListAsync(param.PageIndex, param.PageSize, param.SortField == string.Empty ? "UserName" : param.SortField, param.Asc);
return await userQueryable.ToPagedListAsync(inQuery);
}
@ -867,7 +867,7 @@ namespace IRaCIS.Application.Services
.ProjectTo<UserLogView>(_mapper.ConfigurationProvider);
var pageList = await userLogQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "Id" : inQuery.SortField, inQuery.Asc);
var pageList = await userLogQueryable.ToPagedListAsync(inQuery);
return pageList;
}

View File

@ -169,12 +169,11 @@ namespace IRaCIS.Core.Application.Contracts.DTO
}
public class GetConsistencyCheckFileInDto
public class GetConsistencyCheckFileInDto:PageInput
{
public Guid TrialId { get; set; }
public int PageIndex { get; set; } = 1;
public int PageSize { set; get; } = 10;
}

View File

@ -78,7 +78,7 @@ namespace IRaCIS.Core.Application.Image.QA
var defalutSortArray = new string[] { nameof(SubjectVisit.IsUrgent) + " desc", nameof(SubjectVisit.SubjectId), nameof(SubjectVisit.VisitNum) };
var pageList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var pageList = await query.ToPagedListAsync(inQuery, defalutSortArray);
var config = await _repository.Where<Trial>(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
config.IsHaveSubjectClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.Subject ) && x.UploadRole == UploadRole.CRC);
@ -172,7 +172,7 @@ namespace IRaCIS.Core.Application.Image.QA
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), new string[] { "IsUrgent desc", "CreateTime asc" });
var pageList = await query.ToPagedListAsync(inQuery, new string[] { "IsUrgent desc", "CreateTime asc" });
var config = await _repository.Where<Trial>(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return ResponseOutput.Ok (pageList, config);
@ -187,32 +187,32 @@ namespace IRaCIS.Core.Application.Image.QA
/// <summary>
/// QC 质疑列表 分页
/// </summary>
/// <param name="challengeQuery"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<(PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig)> GetQCChallengeList(ChallengeQuery challengeQuery)
public async Task<(PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig)> GetQCChallengeList(ChallengeQuery inQuery)
{
var svExpression = QCCommon.GetQCChallengeFilter(challengeQuery.VisitPlanArray);
var svExpression = QCCommon.GetQCChallengeFilter(inQuery.VisitPlanArray);
var query = _repository.Where<QCChallenge>(x => x.TrialId == challengeQuery.TrialId)
var query = _repository.Where<QCChallenge>(x => x.TrialId == inQuery.TrialId)
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
.WhereIf(challengeQuery.ReuploadEnum != null, t => t.ReuploadEnum == challengeQuery.ReuploadEnum)
.WhereIf(challengeQuery.IsClosed != null, t => t.IsClosed == challengeQuery.IsClosed)
.WhereIf(challengeQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == challengeQuery.TrialSiteId)
.WhereIf(challengeQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == challengeQuery.SubjectId)
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
.WhereIf(!string.IsNullOrEmpty(challengeQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode))
.WhereIf(challengeQuery.VisitPlanArray != null && challengeQuery.VisitPlanArray?.Length > 0, svExpression)
.WhereIf(inQuery.ReuploadEnum != null, t => t.ReuploadEnum == inQuery.ReuploadEnum)
.WhereIf(inQuery.IsClosed != null, t => t.IsClosed == inQuery.IsClosed)
.WhereIf(inQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.CreateUserId != null, t => t.CreateUserId == inQuery.CreateUserId)
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(inQuery.SubjectCode))
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
//.WhereIf(!string.IsNullOrEmpty(challengeQuery.VisitPlanInfo), challengeQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.InPlan == false : t => t.SubjectVisit.VisitNum == decimal.Parse(challengeQuery.VisitPlanInfo))
.WhereIf(challengeQuery.IsUrgent != null, t => t.SubjectVisit.IsUrgent == challengeQuery.IsUrgent)
.WhereIf(challengeQuery.IsOverTime != null && challengeQuery.IsOverTime == true, t => t.IsClosed ? t.ClosedTime > t.DeadlineTime : DateTime.Now > t.DeadlineTime)
.WhereIf(challengeQuery.IsOverTime != null && challengeQuery.IsOverTime == false, t => t.IsClosed ? t.ClosedTime < t.DeadlineTime : DateTime.Now < t.DeadlineTime)
.WhereIf(inQuery.IsUrgent != null, t => t.SubjectVisit.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.IsOverTime != null && inQuery.IsOverTime == true, t => t.IsClosed ? t.ClosedTime > t.DeadlineTime : DateTime.Now > t.DeadlineTime)
.WhereIf(inQuery.IsOverTime != null && inQuery.IsOverTime == false, t => t.IsClosed ? t.ClosedTime < t.DeadlineTime : DateTime.Now < t.DeadlineTime)
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, challengeQuery.SortField, challengeQuery.Asc, string.IsNullOrWhiteSpace(challengeQuery.SortField), new string[] { "IsUrgent desc", "IsClosed asc" });
var pageList = await query.ToPagedListAsync(inQuery, new string[] { "IsUrgent desc", "IsClosed asc" });
var config = await _repository.Where<Trial>(t => t.Id == challengeQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
var config = await _repository.Where<Trial>(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return (pageList, config);
}
@ -277,7 +277,7 @@ namespace IRaCIS.Core.Application.Image.QA
var defalutSortArray = new string[] { nameof(QCVisitViewModel.IsUrgent) + " desc", nameof(QCVisitViewModel.SubjectId), nameof(QCVisitViewModel.VisitNum) };
//var defalutSortArray = new string[] { nameof(SubjectVisit.IsUrgent) + " desc", nameof(QCVisitViewModel.AuditState) +" asc" };
var pageList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var pageList = await query.ToPagedListAsync(inQuery, defalutSortArray);
@ -313,7 +313,7 @@ namespace IRaCIS.Core.Application.Image.QA
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site
.ProjectTo<QCCheckWithModalityView>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc);
var pageList = await query.ToPagedListAsync(inQuery);
var config = await _repository.Where<Trial>(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return (pageList, config);
}
@ -340,26 +340,26 @@ namespace IRaCIS.Core.Application.Image.QA
/// <summary>
/// 转发列表 查询一致性核查通过的,针对不一致性核查的 要维护CV状态
/// </summary>
/// <param name="forwardQuery"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ForWardViewModel>> GetForwardList(ForwardQuery forwardQuery)
public async Task<PageOutput<ForWardViewModel>> GetForwardList(ForwardQuery inQuery)
{
//var trialConfig = _trialReposioty.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification }).FirstOrDefault(t => t.TrialId == forwardQuery.TrialId);
var svExpression = QCCommon.GetSubjectVisitFilter(forwardQuery.VisitPlanArray);
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
var query = _subjectVisitRepository.Where(x => x.TrialId == forwardQuery.TrialId)
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
.Where(t => t.CheckState == CheckStateEnum.CVPassed)
.WhereIf(forwardQuery.ForwardState != null, t => t.ForwardState == forwardQuery.ForwardState)
.WhereIf(forwardQuery.TrialSiteId != null, t => t.TrialSiteId == forwardQuery.TrialSiteId)
.WhereIf(!string.IsNullOrEmpty(forwardQuery.SubjectInfo), t => t.Subject.Code.Contains(forwardQuery.SubjectInfo))
.WhereIf(forwardQuery.VisitPlanArray != null && forwardQuery.VisitPlanArray?.Length > 0, svExpression)
.WhereIf(inQuery.ForwardState != null, t => t.ForwardState == inQuery.ForwardState)
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
//.WhereIf(!string.IsNullOrEmpty(forwardQuery.VisitPlanInfo), forwardQuery.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(forwardQuery.VisitPlanInfo))
//.WhereIf(_userInfo.UserTypeEnumInt == (int)UserType.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site
.ProjectTo<ForWardViewModel>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(forwardQuery.PageIndex, forwardQuery.PageSize, forwardQuery.SortField, forwardQuery.Asc);
return await query.ToPagedListAsync(inQuery);
}
@ -635,12 +635,12 @@ namespace IRaCIS.Core.Application.Image.QA
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<GetUserUploadFileDto>> GetConsistencyCheckFile(GetConsistencyCheckFileInDto indto)
public async Task<PageOutput<GetUserUploadFileDto>> GetConsistencyCheckFile(GetConsistencyCheckFileInDto inQuery)
{
var query = _repository.Where<InspectionFile>(t => t.TrialId == indto.TrialId)
var query = _repository.Where<InspectionFile>(t => t.TrialId == inQuery.TrialId)
.ProjectTo<GetUserUploadFileDto>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false);
return await query.ToPagedListAsync(inQuery);
}

View File

@ -149,7 +149,7 @@ namespace IRaCIS.Core.Application.Service
var pageList = await subjectCriteriaEvaluationQueryable
.WhereIf(inQuery.IsImageFiltering != null, t => t.IsImageFiltering == inQuery.IsImageFiltering)
.WhereIf(inQuery.IsJoinEvaluation != null, t => t.IsJoinEvaluation == inQuery.IsJoinEvaluation)
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField == string.Empty ? nameof(SubjectCriteriaEvaluationView.SubjectCode) : inQuery.SortField, inQuery.Asc);
.ToPagedListAsync(inQuery,nameof(SubjectCriteriaEvaluationView.SubjectCode));
foreach (var item in pageList.CurrentPageData)

View File

@ -264,10 +264,10 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 获取CRC受试者临床数据
/// </summary>
/// <param name="inDto"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<GetCRCSubjectClinicalOutDto>> GetCRCSubjectClinicalList(GetCRCSubjectClinicalInDto inDto)
public async Task<PageOutput<GetCRCSubjectClinicalOutDto>> GetCRCSubjectClinicalList(GetCRCSubjectClinicalInDto inQuery)
{
//await AutoAddCRCClinical(new AutoAddClinicalInDto()
@ -275,22 +275,22 @@ namespace IRaCIS.Core.Application.Service
// TrialId = inDto.TrialId
//}) ;
var subjects = await _subjectRepository.Where(x => x.TrialId == inDto.TrialId).Select(x => new GetCRCSubjectClinicalResultDto()
var subjects = await _subjectRepository.Where(x => x.TrialId == inQuery.TrialId).Select(x => new GetCRCSubjectClinicalResultDto()
{
SubjectId = x.Id,
SubjectCode = x.Code
}).ToListAsync();
var clinicalData= _readingClinicalDataRepository.Where(x=>x.TrialId == inDto.TrialId&&x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC&&x.ClinicalDataTrialSet.ClinicalDataLevel!= ClinicalLevel.SubjectVisit)
var clinicalData= _readingClinicalDataRepository.Where(x=>x.TrialId == inQuery.TrialId&&x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC&&x.ClinicalDataTrialSet.ClinicalDataLevel!= ClinicalLevel.SubjectVisit)
.Where(x=>!x.IsSign)
.WhereIf(inDto.SubjectId!=null,x=>x.SubjectId==inDto.SubjectId)
.WhereIf(inDto.SubjectCode != null, x => x.Subject.Code.Contains(inDto.SubjectCode??string.Empty))
.WhereIf(inQuery.SubjectId!=null,x=>x.SubjectId==inQuery.SubjectId)
.WhereIf(inQuery.SubjectCode != null, x => x.Subject.Code.Contains(inQuery.SubjectCode??string.Empty))
.Where(x=> x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject)
.Include(x=>x.ClinicalDataTrialSet).Select(x=>new GetCRCSubjectClinicalOutDto() {
SubjectId=x.SubjectId,
SubjectCode=x.Subject.Code,
TrialId=inDto.TrialId,
TrialId=inQuery.TrialId,
ReadingId= x.ReadingId,
ReadingClinicalDataId=x.Id,
UploadRole = x.ClinicalDataTrialSet.UploadRole,
@ -302,13 +302,13 @@ namespace IRaCIS.Core.Application.Service
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName,
});
var pageList = await clinicalData.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, string.IsNullOrWhiteSpace(inDto.SortField) ? nameof(GetCRCSubjectClinicalOutDto.SubjectCode) : inDto.SortField, inDto.Asc);
var pageList = await clinicalData.ToPagedListAsync(inQuery, nameof(GetCRCSubjectClinicalOutDto.SubjectCode) );
// 一次查询报错 分两次写
pageList.CurrentPageData.ForEach(x =>
{
x.ClinicalDataSetEnName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us);
});
var clinicalFormData = await _clinicalFormRepository.Where(x => x.TrialId == inDto.TrialId).ToListAsync();
var clinicalFormData = await _clinicalFormRepository.Where(x => x.TrialId == inQuery.TrialId).ToListAsync();
pageList.CurrentPageData.ForEach(n =>
{
n.ClinicalCount = clinicalFormData.Where(y => y.ClinicalDataTrialSetId == n.ClinicalDataTrialSetId && y.SubjectId == n.SubjectId).Count();

View File

@ -52,8 +52,8 @@ namespace IRaCIS.Core.Application.Service
public async Task<List<GetTrialClinicalQuestionCalculateRelationOutDto>> GetTrialClinicalQuestionCalculateRelation(GetTrialClinicalQuestionCalculateRelationInDto inDto)
{
var result= await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
.Where( x=> x.ClinicalQuestionType == "number")
var result = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
.Where(x => x.ClinicalQuestionType == "number")
.Where(x => x.CustomCalculateMark != null && x.CustomCalculateMark > ClinicalCalculateMark.None)
.Select(x => new GetTrialClinicalQuestionCalculateRelationOutDto()
{
@ -91,7 +91,7 @@ namespace IRaCIS.Core.Application.Service
new
{
TableQuestionId = x.Id,
QuestionId= x.QuestionId,
QuestionId = x.QuestionId,
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
}).ToListAsync();
@ -123,18 +123,20 @@ namespace IRaCIS.Core.Application.Service
if (_userInfo.IsEn_Us)
{
questions.ForEach(x => {
questions.ForEach(x =>
{
x.GroupName = x.GroupEnName;
x.QuestionName = x.QuestionEnName;
});
}
var tableQuestions= await _systemClinicalTableQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
var tableQuestions = await _systemClinicalTableQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
.ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
if (_userInfo.IsEn_Us)
{
tableQuestions.ForEach(x => {
tableQuestions.ForEach(x =>
{
x.QuestionName = x.QuestionEnName;
});
}
@ -159,11 +161,12 @@ namespace IRaCIS.Core.Application.Service
public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetTrialClinicalQuestionPreview(GetTrialClinicalQuestionPreviewDto inDto)
{
var questions = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync();
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
if (_userInfo.IsEn_Us)
{
questions.ForEach(x => {
questions.ForEach(x =>
{
x.GroupName = x.GroupEnName;
x.QuestionName = x.QuestionEnName;
});
@ -175,7 +178,8 @@ namespace IRaCIS.Core.Application.Service
if (_userInfo.IsEn_Us)
{
tableQuestions.ForEach(x => {
tableQuestions.ForEach(x =>
{
x.QuestionName = x.QuestionEnName;
});
}
@ -185,7 +189,7 @@ namespace IRaCIS.Core.Application.Service
result.ForEach(x =>
{
this.FindChildQuestion(x, questions, tableQuestions,new List<ClinicalFormQuestionAnswer> (),new List<ClinicalFormTableQuestionAnswer>());
this.FindChildQuestion(x, questions, tableQuestions, new List<ClinicalFormQuestionAnswer>(), new List<ClinicalFormTableQuestionAnswer>());
});
return (result, true);
@ -201,15 +205,15 @@ namespace IRaCIS.Core.Application.Service
/// <param name="tableQuestions"></param>
/// <param name="answers"></param>
/// <param name="tableAnswers"></param>
public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions,List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers)
public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions, List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers)
{
item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).OrderBy(x => x.ShowOrder).ToList();
item.Childrens = questions.Where(x => (x.ParentId == item.Id) || (x.GroupId == item.Id && x.ParentId == null)).OrderBy(x => x.ShowOrder).ToList();
item.RelationQuestions = questions.Where(x => x.RelevanceId == item.Id).ToList();
item.Answer = answers.Where(x => x.QuestionId == item.Id).Select(x => x.Answer).FirstOrDefault()??string.Empty;
item.Answer = answers.Where(x => x.QuestionId == item.Id).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
var tableIndexs = tableAnswers.Where(x => x.QuestionId == item.Id).Select(x => x.RowIndex).Distinct().OrderBy(x=>x).ToList();
var tableIndexs = tableAnswers.Where(x => x.QuestionId == item.Id).Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList();
item.TableAnswer = new List<Dictionary<Guid, string>>();
@ -221,13 +225,15 @@ namespace IRaCIS.Core.Application.Service
});
item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).OrderBy(x => x.ShowOrder).ToList();
item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x => x.ShowOrder).OrderBy(x => x.ShowOrder).ToList();
item.RelationQuestions.ForEach(x => {
item.RelationQuestions.ForEach(x =>
{
this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers);
});
item.Childrens.ForEach(x => {
item.Childrens.ForEach(x =>
{
this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers);
});
}
@ -243,12 +249,11 @@ namespace IRaCIS.Core.Application.Service
public async Task<PageOutput<TrialClinicalQuestionDto>> GetTrialClinicalQuestionList(TrialClinicalQuestionQuery inQuery)
{
var trialClinicalQuestionQueryable = _trialClinicalQuestionRepository.Where(x=>x.TrialClinicalId==inQuery.TrialClinicalId)
var trialClinicalQuestionQueryable = _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inQuery.TrialClinicalId)
.WhereIf(!inQuery.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inQuery.QuestionName) || x.QuestionEnName.Contains(inQuery.QuestionName))
.ProjectTo<TrialClinicalQuestionDto>(_mapper.ConfigurationProvider);
var pageList = await trialClinicalQuestionQueryable
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TrialClinicalQuestion.ShowOrder) : inQuery.SortField,
inQuery.Asc);
.ToPagedListAsync(inQuery, nameof(TrialClinicalQuestion.ShowOrder));
return pageList;
}
@ -265,7 +270,7 @@ namespace IRaCIS.Core.Application.Service
{
if (await _trialClinicalQuestionRepository.AnyAsync(x => x.TrialClinicalId == inDto.TrialClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
{
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"],string.Empty,ApiResponseCodeEnum.NeedTips);
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"], string.Empty, ApiResponseCodeEnum.NeedTips);
}
}
@ -276,7 +281,7 @@ namespace IRaCIS.Core.Application.Service
return ResponseOutput.NotOk("问题序号存在重复!");
}
if (await _trialClinicalQuestionRepository.AnyAsync(x => x.TrialClinicalId == inDto.TrialClinicalId && x.Id != inDto.Id && x.IsCheckDate == inDto.IsCheckDate&&inDto.IsCheckDate))
if (await _trialClinicalQuestionRepository.AnyAsync(x => x.TrialClinicalId == inDto.TrialClinicalId && x.Id != inDto.Id && x.IsCheckDate == inDto.IsCheckDate && inDto.IsCheckDate))
{
return ResponseOutput.NotOk("已经添加过类型为检查日期的问题!");
}
@ -306,7 +311,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<List<TrialClinicalQuestionDto>> GetTrialClinicalGroupQuestionList(GetTrialGroupDto inDto)
{
return await this._trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId&&x.ClinicalQuestionType== "group")
return await this._trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId && x.ClinicalQuestionType == "group")
.ProjectTo<TrialClinicalQuestionDto>(_mapper.ConfigurationProvider).ToListAsync();
}
@ -322,7 +327,7 @@ namespace IRaCIS.Core.Application.Service
{
"select","radio"
};
return await this._trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId && types.Contains( x.ClinicalQuestionType))
return await this._trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId && types.Contains(x.ClinicalQuestionType))
.ProjectTo<TrialClinicalQuestionDto>(_mapper.ConfigurationProvider).ToListAsync();
}
@ -341,12 +346,11 @@ namespace IRaCIS.Core.Application.Service
{
var systemClinicalQuestionQueryable = _systemClinicalQuestionRepository
.Where(x=>x.SystemClinicalId==inQuery.SystemClinicalId)
.Where(x => x.SystemClinicalId == inQuery.SystemClinicalId)
.WhereIf(!inQuery.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inQuery.QuestionName) || x.QuestionEnName.Contains(inQuery.QuestionName))
.ProjectTo<SystemClinicalQuestionDto>(_mapper.ConfigurationProvider);
var pageList = await systemClinicalQuestionQueryable
.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(SystemClinicalQuestion.ShowOrder) : inQuery.SortField,
inQuery.Asc);
.ToPagedListAsync(inQuery, nameof(SystemClinicalQuestion.ShowOrder));
return pageList;
}
@ -404,7 +408,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<List<SystemClinicalQuestionDto>> GetSystemClinicalGroupQuestionList(GetSystemGroupDto inDto)
{
return await this._systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId && x.ClinicalQuestionType =="group")
return await this._systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId && x.ClinicalQuestionType == "group")
.ProjectTo<SystemClinicalQuestionDto>(_mapper.ConfigurationProvider).ToListAsync();
}
@ -443,8 +447,7 @@ namespace IRaCIS.Core.Application.Service
.Where(x => x.QuestionId == inQuery.QuestionId)
.ProjectTo<SystemClinicalTableQuestionDto>(_mapper.ConfigurationProvider);
var pageList = await systemClinicalTableQuestionQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(SystemClinicalTableQuestion.ShowOrder) : inQuery.SortField,
inQuery.Asc);
var pageList = await systemClinicalTableQuestionQueryable.ToPagedListAsync(inQuery, nameof(SystemClinicalTableQuestion.ShowOrder));
return pageList;
}
@ -502,7 +505,7 @@ namespace IRaCIS.Core.Application.Service
"select","radio"
};
return await this._systemClinicalTableQuestionRepository.Where(x => x.QuestionId == inDto.QuestionId && types.Contains(x.ClinicalTableQuestionType))
.Where(x=>x.Id!= inDto.TableQuestionId)
.Where(x => x.Id != inDto.TableQuestionId)
.ProjectTo<SystemClinicalTableQuestionDto>(_mapper.ConfigurationProvider).ToListAsync();
}
#endregion
@ -541,8 +544,7 @@ namespace IRaCIS.Core.Application.Service
.Where(x => x.QuestionId == inQuery.QuestionId)
.ProjectTo<TrialClinicalTableQuestionDto>(_mapper.ConfigurationProvider);
var pageList = await trialClinicalTableQuestionQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TrialClinicalTableQuestion.ShowOrder) : inQuery.SortField,
inQuery.Asc);
var pageList = await trialClinicalTableQuestionQueryable.ToPagedListAsync(inQuery, nameof(TrialClinicalTableQuestion.ShowOrder));
return pageList;
}
@ -600,11 +602,11 @@ namespace IRaCIS.Core.Application.Service
var trialClinicalId = inDto.Select(x => x.TrialClinicalId).ToList();
var systemClinicalId = inDto.Select(x => x.SystemClinicalId).ToList();
var questionRelationList =await _trialClinicalQuestionRepository.Where(x => trialClinicalId.Contains(x.TrialClinicalId)).Select(x => new QuestionDic()
var questionRelationList = await _trialClinicalQuestionRepository.Where(x => trialClinicalId.Contains(x.TrialClinicalId)).Select(x => new QuestionDic()
{
SystemQuestionId=x.SystemClinicalQuestionId?? default(Guid),
TrialQuestionId=x.Id,
TrialClinicalId=x.TrialClinicalId,
SystemQuestionId = x.SystemClinicalQuestionId ?? default(Guid),
TrialQuestionId = x.Id,
TrialClinicalId = x.TrialClinicalId,
}).ToListAsync();
var tableQuestionRelationList = await _trialClinicalTableQuestionRepository.Where(x => trialClinicalId.Contains(x.TrialClinicalId)).Select(x => new QuestionDic()
@ -625,7 +627,7 @@ namespace IRaCIS.Core.Application.Service
List<TrialClinicalTableQuestion> addTrialTableList = new List<TrialClinicalTableQuestion>();
foreach (var item in inDto)
{
var questionRelation = questionRelationList.Where(x=>x.TrialClinicalId==item.TrialClinicalId).ToDictionary(
var questionRelation = questionRelationList.Where(x => x.TrialClinicalId == item.TrialClinicalId).ToDictionary(
x => x.SystemQuestionId,
x => x.TrialQuestionId
);
@ -711,7 +713,7 @@ namespace IRaCIS.Core.Application.Service
await _trialClinicalQuestionRepository.BatchDeleteNoTrackingAsync(x => trialClinicalId.Contains(x.TrialClinicalId));
await _trialClinicalQuestionRepository.AddRangeAsync(addTrialDataList);
await _trialClinicalTableQuestionRepository.BatchDeleteNoTrackingAsync(x => trialClinicalId.Contains(x.TrialClinicalId) );
await _trialClinicalTableQuestionRepository.BatchDeleteNoTrackingAsync(x => trialClinicalId.Contains(x.TrialClinicalId));
await _trialClinicalTableQuestionRepository.AddRangeAsync(addTrialTableList);
await _trialClinicalQuestionRepository.SaveChangesAsync();
}

View File

@ -255,7 +255,7 @@ namespace IRaCIS.Application.Services
var query = _readingClinicalDataRepository.AsQueryable();
if (inDto.StudyId != null)
{
query = query.Where(x => x.StudyId == inDto.StudyId.Value && x.TrialId==inDto.TrialId&&x.SubjectId==inDto.SubjectId);
query = query.Where(x => x.StudyId == inDto.StudyId.Value && x.TrialId == inDto.TrialId && x.SubjectId == inDto.SubjectId);
}
else
{
@ -393,7 +393,7 @@ namespace IRaCIS.Application.Services
//如果先生成了任务再签名subject级别 PM 临床数据,那么会导致其他标准的任务签名状态无法得到维护
if (await _repository.AnyAsync<ClinicalDataTrialSet>(t => t.Id == data.ClinicalDataTrialSetId && t.UploadRole == UploadRole.PM && (t.ClinicalDataLevel == ClinicalLevel.Subject|| t.ClinicalDataLevel == ClinicalLevel.SubjectVisit)))
if (await _repository.AnyAsync<ClinicalDataTrialSet>(t => t.Id == data.ClinicalDataTrialSetId && t.UploadRole == UploadRole.PM && (t.ClinicalDataLevel == ClinicalLevel.Subject || t.ClinicalDataLevel == ClinicalLevel.SubjectVisit)))
{
var needDealTrialReadingCriterionIdList = _repository.Where<ClinicalDataTrialSet>(t => t.Id == data.ClinicalDataTrialSetId)
.SelectMany(t => t.TrialClinicalDataSetCriteriaList)
@ -573,7 +573,7 @@ namespace IRaCIS.Application.Services
Expression<Func<VisitTask, bool>> visitTaskLambda = x => x.TrialId == trialId && x.SubjectId == subjectId && x.TrialReadingCriterionId == trialReadingCritrialId;
if (isVisit ||(isVisit==false && readModule.ReadingSetType == ReadingSetType.ImageReading))
if (isVisit || (isVisit == false && readModule.ReadingSetType == ReadingSetType.ImageReading))
{
//访视类型的任务 不影响肿瘤学任务的临床数据状态
visitTaskLambda = visitTaskLambda.And(x => x.ArmEnum != Arm.TumorArm);
@ -730,10 +730,10 @@ namespace IRaCIS.Application.Services
var subjectCode = string.Empty;
if (inDto.ReadingId == null)
{
var visitTask = await _visitTaskRepository.AsQueryable().Include(x=>x.Subject)
var visitTask = await _visitTaskRepository.AsQueryable().Include(x => x.Subject)
.FirstOrDefaultAsync(x => x.Id == inDto.VisitTaskId);
subjectCode=visitTask.BlindSubjectCode.IsNullOrEmpty() ? visitTask.Subject.Code : visitTask.BlindSubjectCode;
subjectCode = visitTask.BlindSubjectCode.IsNullOrEmpty() ? visitTask.Subject.Code : visitTask.BlindSubjectCode;
readingNameOrTaskBlindName = visitTask.TaskBlindName;
}
inDto.SelectIsSign = false;
@ -806,13 +806,14 @@ namespace IRaCIS.Application.Services
var isBaseLine = await _subjectVisitRepository.AnyAsync(x => x.Id == inDto.ReadingId && x.IsBaseLine);
var result = await this.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto() {
var result = await this.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto()
{
ClinicalDataTrialSetId = inDto.ClinicalDataTrialSetId,
GetClinicalType=inDto.GetClinicalType,
SubjectId=inDto.SubjectId,
TrialId=inDto.TrialId,
SelectIsSign=false,
ReadingId =inDto.ReadingId,
GetClinicalType = inDto.GetClinicalType,
SubjectId = inDto.SubjectId,
TrialId = inDto.TrialId,
SelectIsSign = false,
ReadingId = inDto.ReadingId,
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
});
var readingIds = result.Select(x => x.ReadingId).ToList();
@ -841,9 +842,9 @@ namespace IRaCIS.Application.Services
public async Task<List<GetReadingClinicalDataListOutDto>> GetClinicalDataList(GetReadingOrTaskClinicalDataListInDto inDto)
{
var resultQuery = _readingClinicalDataRepository.Where(x=>1==1).Select(x=> new GetReadingClinicalDataListOutDto() { });
var resultQuery = _readingClinicalDataRepository.Where(x => 1 == 1).Select(x => new GetReadingClinicalDataListOutDto() { });
bool isSelfAnalysis = false;
var otherIsSelfAnalysisList=new List<GetReadingClinicalDataListOutDto>();
var otherIsSelfAnalysisList = new List<GetReadingClinicalDataListOutDto>();
if (inDto.ReadingId == null)
{
var visitTask = await _visitTaskRepository.FirstOrDefaultAsync(x => x.Id == inDto.VisitTaskId);
@ -890,23 +891,23 @@ namespace IRaCIS.Application.Services
Id = y.Id,
FileName = y.FileName,
Path = y.Path,
Size=y.Size,
Type=y.Type,
Size = y.Size,
Type = y.Type,
CreateTime = y.CreateTime,
}).ToList(),
});
// 是否获取所有一致性分析的数据
if(inDto.IsGetAllConsistencyAnalysis)
if (inDto.IsGetAllConsistencyAnalysis)
{
// 原来的非PDF
otherIsSelfAnalysisList =await _readingClinicalDataRepository.Where(x => x.SubjectId == inDto.SubjectId)
otherIsSelfAnalysisList = await _readingClinicalDataRepository.Where(x => x.SubjectId == inDto.SubjectId)
.WhereIf(inDto.ReadingClinicalDataId != null, x => x.Id == inDto.ReadingClinicalDataId)
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
.WhereIf(inDto.SelectIsSign, x => x.IsSign == true)
.Where(x => x.ReadingId == inDto.ReadingId)
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
.Where(x => x.ClinicalDataTrialSet.ClinicalUploadType != ClinicalUploadType.PDF||x.ClinicalDataTrialSet.ClinicalDataLevel== ClinicalLevel.Study)
.Where(x => x.ClinicalDataTrialSet.ClinicalUploadType != ClinicalUploadType.PDF || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Study)
.Select(x => new GetReadingClinicalDataListOutDto()
{
ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel,
@ -1143,10 +1144,10 @@ namespace IRaCIS.Application.Services
TrialId = inDto.TrialId,
SelectIsSign = false,
IsGetAllConsistencyAnalysis = false,
VisitTaskId=inDto.VisitTaskId,
VisitTaskId = inDto.VisitTaskId,
});
return (result,true);
return (result, true);
}
@ -1227,7 +1228,7 @@ namespace IRaCIS.Application.Services
entity.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded;
entity.IsSign = false;
entity.FileCount = fileCount;
entity.CreateTime=DateTime.Now;
entity.CreateTime = DateTime.Now;
var success = await _readingConsistentClinicalDataRepository.SaveChangesAsync();
return ResponseOutput.Ok(entity.Id);
@ -1254,7 +1255,7 @@ namespace IRaCIS.Application.Services
IsSign = true,
IsBlind = inDto.IsBlind,
IsComplete = inDto.IsComplete,
ReadingClinicalDataState= ReadingClinicalDataStatus.HaveSigned,
ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned,
});
await _readingClinicalDataPDFRepository.SaveChangesAsync();
return ResponseOutput.Ok(pdfCount);
@ -1268,8 +1269,8 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<IResponseOutput> SetTaskValid(SetTaskValidInDto inDto)
{
var visittask = await _visitTaskRepository.AsQueryable().Include(x=>x.TrialReadingCriterion).Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var readingId = visittask.SouceReadModuleId==null? visittask.SourceSubjectVisitId: visittask.SouceReadModuleId;
var visittask = await _visitTaskRepository.AsQueryable().Include(x => x.TrialReadingCriterion).Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var readingId = visittask.SouceReadModuleId == null ? visittask.SourceSubjectVisitId : visittask.SouceReadModuleId;
if (await _readingConsistentClinicalDataRepository.AnyAsync(x => x.ReadingId == readingId
@ -1277,12 +1278,12 @@ namespace IRaCIS.Application.Services
{
return ResponseOutput.NotOk(_localizer["ReadingClinicalData_HaveUnsignedClinicalData"]);
}
if(visittask.TrialReadingCriterion.IsReadingTaskViewInOrder== ReadingOrder.InOrder)
if (visittask.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
{
if(await _visitTaskRepository.Where(x=>x.SubjectId== visittask.SubjectId
&&x.TrialReadingCriterionId== visittask.TrialReadingCriterionId
&&x.VisitTaskNum< visittask.VisitTaskNum&&x.IsAnalysisCreate==visittask.IsAnalysisCreate
&&x.IsSelfAnalysis==visittask.IsSelfAnalysis&&x.ArmEnum==visittask.ArmEnum&&x.TaskState==TaskState.NotEffect).AnyAsync()
if (await _visitTaskRepository.Where(x => x.SubjectId == visittask.SubjectId
&& x.TrialReadingCriterionId == visittask.TrialReadingCriterionId
&& x.VisitTaskNum < visittask.VisitTaskNum && x.IsAnalysisCreate == visittask.IsAnalysisCreate
&& x.IsSelfAnalysis == visittask.IsSelfAnalysis && x.ArmEnum == visittask.ArmEnum && x.TaskState == TaskState.NotEffect).AnyAsync()
)
{
return ResponseOutput.NotOk(_localizer["ReadingClinicalData_NeedSetBeforeTaskEffect"]);
@ -1305,15 +1306,14 @@ namespace IRaCIS.Application.Services
/// <summary>
/// 获取单个阅片临床数据的所有文件
/// </summary>
/// <param name="inDto"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<GetReadingClinicalDataPDFListOutDto>> GetReadingClinicalDataPDFList(GetReadingClinicalDataPDFListIndto inDto)
public async Task<PageOutput<GetReadingClinicalDataPDFListOutDto>> GetReadingClinicalDataPDFList(GetReadingClinicalDataPDFListIndto inQuery)
{
var result = await _readingClinicalDataPDFRepository.Where(x => x.ReadingClinicalDataId == inDto.ReadingClinicalDataId).ProjectTo<GetReadingClinicalDataPDFListOutDto>(_mapper.ConfigurationProvider)
.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(GetReadingClinicalDataPDFListOutDto.FileName) : inDto.SortField,
inDto.Asc);
var result = await _readingClinicalDataPDFRepository.Where(x => x.ReadingClinicalDataId == inQuery.ReadingClinicalDataId).ProjectTo<GetReadingClinicalDataPDFListOutDto>(_mapper.ConfigurationProvider)
.ToPagedListAsync(inQuery, nameof(GetReadingClinicalDataPDFListOutDto.FileName));
return result;
}

View File

@ -880,8 +880,7 @@ namespace IRaCIS.Core.Application.Service
}).WhereIf(!inDto.SubjectCode.IsNullOrEmpty(), x => x.SubjectCode == inDto.SubjectCode);
var result=await taskMedicalReviewquery.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField.IsNullOrEmpty() ? nameof(GetIRMedicalFeedbackListOutDto.AuditState) : inDto.SortField,
inDto.Asc);
var result=await taskMedicalReviewquery.ToPagedListAsync(inDto, nameof(GetIRMedicalFeedbackListOutDto.AuditState));
return result;
}

View File

@ -166,26 +166,26 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<(PageOutput<ReadingMedicineTrialQuestionView>, object)> GetReadingMedicineTrialQuestionList(ReadingMedicineTrialQuestionQuery inDto)
public async Task<(PageOutput<ReadingMedicineTrialQuestionView>, object)> GetReadingMedicineTrialQuestionList(ReadingMedicineTrialQuestionQuery inQuery)
{
var query = _readingMedicineTrialQuestionRepository.AsQueryable()
.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId)
.WhereIf(!inDto.TypeValue.IsNullOrEmpty(), x => x.TypeValue.Contains(inDto.TypeValue))
.WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue))
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName))
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type))
.WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory)
.WhereIf(inDto.LanguageType != null, x => x.LanguageType == inDto.LanguageType)
.Where(x => x.TrialId == inQuery.TrialId && x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(!inQuery.TypeValue.IsNullOrEmpty(), x => x.TypeValue.Contains(inQuery.TypeValue))
.WhereIf(!inQuery.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inQuery.ParentTriggerValue))
.WhereIf(!inQuery.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inQuery.QuestionName))
.WhereIf(!inQuery.Type.IsNullOrEmpty(), x => x.Type.Contains(inQuery.Type))
.WhereIf(inQuery.ReadingCategory != null, x => x.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.LanguageType != null, x => x.LanguageType == inQuery.LanguageType)
.ProjectTo<ReadingMedicineTrialQuestionView>(_mapper.ConfigurationProvider).OrderByDescending(x=>x.LanguageType).ThenBy(x => x.ShowOrder);
var isConfirmMedicineQuestion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => x.IsConfirmMedicineQuestion).FirstOrDefaultAsync();
var questionList = await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField, inDto.Asc);
var isConfirmMedicineQuestion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => x.IsConfirmMedicineQuestion).FirstOrDefaultAsync();
var questionList = await query.ToPagedListAsync(inQuery);
return (questionList, new
{
IsConfirmMedicineQuestion = isConfirmMedicineQuestion,
LanguageType=(await _readingMedicineTrialQuestionRepository.FirstOrDefaultAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId&& x.SystemQuestionId != null))?.LanguageType,
LanguageType=(await _readingMedicineTrialQuestionRepository.FirstOrDefaultAsync(x => x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId&& x.SystemQuestionId != null))?.LanguageType,
//QuestionCount = questionList.Count(),
});
}

View File

@ -106,7 +106,8 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(inQuery.LesionType != null, x => organs.Contains(x.OrganType))
.WhereIf(inQuery.OrganType != null, x => x.OrganType == inQuery.OrganType)
.ProjectTo<OrganInfoView>(_mapper.ConfigurationProvider);
return await organInfoQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(OrganInfoView.ShowOrder) : inQuery.SortField, inQuery.Asc,true,new string[] { nameof(OrganInfoView.OrganType) , nameof(OrganInfoView.ShowOrder) });
return await organInfoQueryable.ToPagedListAsync(inQuery,new string[] { nameof(OrganInfoView.OrganType) , nameof(OrganInfoView.ShowOrder) });
}
/// <summary>

View File

@ -263,8 +263,7 @@ namespace IRaCIS.Core.Application.Service.RC
.WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName))
.ProjectTo<ReadingQuestionCriterionSystemView>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField.IsNullOrEmpty() ? nameof(ReadingQuestionCriterionSystemView.ShowOrder) : inDto.SortField,
inDto.Asc);
return await query.ToPagedListAsync(inDto, nameof(ReadingQuestionCriterionSystemView.ShowOrder));
}
/// <summary>
@ -450,8 +449,7 @@ namespace IRaCIS.Core.Application.Service.RC
.WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName))
.ProjectTo<ReadingQuestionCriterionTrialView>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField.IsNullOrEmpty() ? nameof(ReadingQuestionCriterionTrialView.ShowOrder) : inDto.SortField,
inDto.Asc);
return await query.ToPagedListAsync(inDto, nameof(ReadingQuestionCriterionTrialView.ShowOrder));
}
/// <summary>

View File

@ -231,8 +231,7 @@ namespace IRaCIS.Application.Services
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName))
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type))
.ProjectTo<ReadingQuestionSystemView>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, nameof(ReadingQuestionSystemView.ShowOrder),
inDto.Asc);
return await query.ToPagedListAsync(inDto, nameof(ReadingQuestionSystemView.ShowOrder));
}
/// <summary>

View File

@ -19,7 +19,7 @@ namespace IRaCIS.Core.Application.Service.TA
private readonly IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentIRepository1Point1;
private readonly IRepository<TumorAssessment_RECIST1Point1BM> _tumorAssessmentRepository1Point1BM;
public ReadingQuestionService( IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository1Point1,
public ReadingQuestionService(IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository1Point1,
IRepository<TumorAssessment_IRECIST1Point1> tumorAssessmentIRepository1Point1,
IRepository<TumorAssessment_RECIST1Point1BM> tumorAssessmentRepository1Point1BM
)
@ -52,14 +52,14 @@ namespace IRaCIS.Core.Application.Service.TA
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<(object,List<ColumnInfo>)> GetTumorAssessmentPageList(GetTumorAssessmentListInDto inQuery)
public async Task<(object, List<ColumnInfo>)> GetTumorAssessmentPageList(GetTumorAssessmentListInDto inQuery)
{
var result = new object();
List<ColumnInfo> columnList = new List<ColumnInfo>();
switch (inQuery.CriterionType)
{
case CriterionType.RECIST1Point1:
result= await _tumorAssessmentRepository1Point1.AsQueryable().ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
result = await _tumorAssessmentRepository1Point1.AsQueryable().ToPagedListAsync(inQuery, nameof(TumorAssessmentView.Id));
columnList = new List<ColumnInfo>()
{
new ColumnInfo(){ ColumnName="靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.TargetLesion),DictionaryKey=typeof(TargetAssessment).Name },
@ -69,7 +69,7 @@ namespace IRaCIS.Core.Application.Service.TA
};
break;
case CriterionType.RECIST1Pointt1_MB:
result = await _tumorAssessmentRepository1Point1BM.AsQueryable().ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
result = await _tumorAssessmentRepository1Point1BM.AsQueryable().ToPagedListAsync(inQuery, nameof(TumorAssessmentView.Id));
columnList = new List<ColumnInfo>()
{
new ColumnInfo(){ ColumnName="靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.TargetLesion),DictionaryKey=typeof(TargetAssessment).Name },
@ -79,7 +79,7 @@ namespace IRaCIS.Core.Application.Service.TA
};
break;
case CriterionType.IRECIST1Point1:
result = await _tumorAssessmentIRepository1Point1.AsQueryable().ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
result = await _tumorAssessmentIRepository1Point1.AsQueryable().ToPagedListAsync(inQuery, nameof(TumorAssessmentView.Id));
columnList = new List<ColumnInfo>()
{
new ColumnInfo(){ ColumnName="靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.TargetLesion),DictionaryKey=typeof(TargetAssessment).Name },

View File

@ -137,12 +137,12 @@ namespace IRaCIS.Application.Services
{
IsDeleted = true
}) ;
});
await _readingPeriodPlanRepository.UpdatePartialFromQueryAsync(t => t.ReadingPeriodSetId == readingPeriodSetId, x => new ReadingPeriodPlan()
{
IsDeleted = true
}) ;
});
await _readingPeriodPlanRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
@ -248,7 +248,8 @@ namespace IRaCIS.Application.Services
var globalTaskInfo = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && globalModuleIds.Contains(x.SouceReadModuleId ?? default(Guid))
&& x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).GroupBy(x => new { x.SouceReadModuleId }).Select(x =>
new {
new
{
SouceReadModuleId = x.Key.SouceReadModuleId,
Count = x.ToList().Count,
TaskId = x.Select(x => x.Id).FirstOrDefault(),
@ -319,9 +320,10 @@ namespace IRaCIS.Application.Services
TaskState = TaskState.Adbandon
});
await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.ReadingPeriodSetId == indto.Id,x=>new ReadModule() {
await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.ReadingPeriodSetId == indto.Id, x => new ReadModule()
{
IsDeleted=true
IsDeleted = true
});
}
@ -366,8 +368,7 @@ namespace IRaCIS.Application.Services
EffectOfTime = x.ReadingPeriodSet.EffectOfTime,
});
return await plans.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(PreviewTheReadingListOutDto.SubjectId) : inDto.SortField,
inDto.Asc);
return await plans.ToPagedListAsync(inDto, nameof(PreviewTheReadingListOutDto.SubjectId));
}
@ -420,8 +421,7 @@ namespace IRaCIS.Application.Services
.WhereIf(query.ReadingPeriodName != null, x => x.ReadingPeriodName.Contains(query.ReadingPeriodName!))
.WhereIf(query.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == query.TrialReadingCriterionId)
.ProjectTo<ReadingPeriodSetView>(_mapper.ConfigurationProvider);
var pageList = await readQuery.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField == null ? nameof(ReadingPeriodSetView.CreateTime) : query.SortField,
query.Asc);
var pageList = await readQuery.ToPagedListAsync(query, nameof(ReadingPeriodSetView.CreateTime));
pageList.CurrentPageData.ForEach(x =>
{
@ -470,7 +470,7 @@ namespace IRaCIS.Application.Services
List<GetReadingVisitListOutDto> result = await _visitStageRepository.Where(x => x.TrialId == inDto.TrialId)
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => globalVisitNum.Contains(x.VisitNum))
.Where(x=>x.VisitNum>0)// 不能是基线
.Where(x => x.VisitNum > 0)// 不能是基线
.Where(x => x.VisitNum == thisVisitNum || x.VisitNum >= maxVisitNum).Select(x => new GetReadingVisitListOutDto()
{
VisitName = x.VisitName,
@ -494,7 +494,7 @@ namespace IRaCIS.Application.Services
// 当前项目 最晚拍片日期不为null 中心筛选
var visitQuery = _subjectVisitRepository.Where(x => x.TrialId == inDto.TrialId && x.LatestScanDate != null && !x.IsLostVisit)
.WhereIf(inDto.ReadingScope == ReadingScopeEnum.Site, x => inDto.SiteIds.Contains(x.TrialSiteId))
.Where(x=>!x.IsBaseLine);// 排除基线
.Where(x => !x.IsBaseLine);// 排除基线
// 已经存在的访视 需要排除
var existsBubjectVisitsQuery = _readModuleRepository.Where(y => y.ReadingSetType == inDto.ReadingSetType && y.TrialId == inDto.TrialId && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId).Select(x => x.SubjectVisitId);

View File

@ -468,22 +468,22 @@ namespace IRaCIS.Core.Application.Contracts
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TrialSiteSurveyView>> GetTrialSiteSurveyList(TrialSiteSurveyQueryDTO surveyQueryDTO)
public async Task<PageOutput<TrialSiteSurveyView>> GetTrialSiteSurveyList(TrialSiteSurveyQueryDTO inQuery)
{
var trialSiteSurveyQueryable = _trialSiteSurveyRepository.Where(t => t.TrialId == surveyQueryDTO.TrialId).IgnoreQueryFilters()
.WhereIf(surveyQueryDTO.TrialSiteId != null, t => t.TrialSiteId == surveyQueryDTO.TrialSiteId)
.WhereIf(surveyQueryDTO.IsDeleted != null, t => t.IsDeleted == surveyQueryDTO.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.UserKeyInfo), t => t.UserName.Contains(surveyQueryDTO.UserKeyInfo) || t.Phone.Contains(surveyQueryDTO.UserKeyInfo) || t.Email.Contains(surveyQueryDTO.UserKeyInfo))
.WhereIf(surveyQueryDTO.State != null, t => t.State == surveyQueryDTO.State)
.WhereIf(surveyQueryDTO.UpdateTimeBegin != null, t => t.UpdateTime >= surveyQueryDTO.UpdateTimeBegin)
.WhereIf(surveyQueryDTO.UpdateTimeEnd != null, t => t.UpdateTime <= surveyQueryDTO.UpdateTimeEnd)
var trialSiteSurveyQueryable = _trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId).IgnoreQueryFilters()
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.UserName.Contains(inQuery.UserKeyInfo) || t.Phone.Contains(inQuery.UserKeyInfo) || t.Email.Contains(inQuery.UserKeyInfo))
.WhereIf(inQuery.State != null, t => t.State == inQuery.State)
.WhereIf(inQuery.UpdateTimeBegin != null, t => t.UpdateTime >= inQuery.UpdateTimeBegin)
.WhereIf(inQuery.UpdateTimeEnd != null, t => t.UpdateTime <= inQuery.UpdateTimeEnd)
.ProjectTo<TrialSiteSurveyView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us })
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(surveyQueryDTO.PreliminaryUserName))
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(surveyQueryDTO.ReviewerUserName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(inQuery.PreliminaryUserName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(inQuery.ReviewerUserName))
;
return await trialSiteSurveyQueryable.ToPagedListAsync(surveyQueryDTO.PageIndex, surveyQueryDTO.PageSize, surveyQueryDTO.SortField, surveyQueryDTO.Asc);
return await trialSiteSurveyQueryable.ToPagedListAsync(inQuery);
}
[HttpPost]
@ -501,32 +501,32 @@ namespace IRaCIS.Core.Application.Contracts
/// 项目Site调研用户列表 所有site的调研用户 最新的调研表的记录的用户 new
/// </summary>
/// <returns></returns>
public async Task<PageOutput<TrialSiteUserSurveyAllDTO>> TrialSiteSurveyUserList(TrialSiteUserSurveyAllQuery queryParam)
public async Task<PageOutput<TrialSiteUserSurveyAllDTO>> TrialSiteSurveyUserList(TrialSiteUserSurveyAllQuery inQuery)
{
var groupSelectIdQuery =
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
.WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId)
_trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
.WhereIf(!string.IsNullOrEmpty(inQuery.FormWriterKeyInfo), t => (t.UserName).Contains(inQuery.FormWriterKeyInfo) || t.Email.Contains(inQuery.FormWriterKeyInfo) || t.Phone.Contains(inQuery.FormWriterKeyInfo))
.GroupBy(t => t.TrialSiteId)
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
var query = _trialSiteUserSurveyRepository
.Where(t => groupSelectIdQuery.Contains(t.TrialSiteSurveyId))
.WhereIf(queryParam.TrialRoleCode != null, t => t.TrialRoleCode == queryParam.TrialRoleCode)
.WhereIf(queryParam.UserTypeId != null, t => t.UserTypeId == queryParam.UserTypeId)
.WhereIf(queryParam.IsGenerateAccount != null, t => t.IsGenerateAccount == queryParam.IsGenerateAccount)
.WhereIf(queryParam.State != null && queryParam.State != TrialSiteUserStateEnum.OverTime, t => t.InviteState == queryParam.State)
.WhereIf(!string.IsNullOrEmpty(queryParam.UserName), t => (t.LastName + " / " + t.FirstName).Contains(queryParam.UserName))
.WhereIf(!string.IsNullOrEmpty(queryParam.OrganizationName), t => t.OrganizationName.Contains(queryParam.OrganizationName))
.WhereIf(inQuery.TrialRoleCode != null, t => t.TrialRoleCode == inQuery.TrialRoleCode)
.WhereIf(inQuery.UserTypeId != null, t => t.UserTypeId == inQuery.UserTypeId)
.WhereIf(inQuery.IsGenerateAccount != null, t => t.IsGenerateAccount == inQuery.IsGenerateAccount)
.WhereIf(inQuery.State != null && inQuery.State != TrialSiteUserStateEnum.OverTime, t => t.InviteState == inQuery.State)
.WhereIf(!string.IsNullOrEmpty(inQuery.UserName), t => (t.LastName + " / " + t.FirstName).Contains(inQuery.UserName))
.WhereIf(!string.IsNullOrEmpty(inQuery.OrganizationName), t => t.OrganizationName.Contains(inQuery.OrganizationName))
.ProjectTo<TrialSiteUserSurveyAllDTO>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, queryParam.SortField, queryParam.Asc);
return await query.ToPagedListAsync(inQuery);

View File

@ -50,13 +50,13 @@ namespace IRaCIS.Application.Services
/// <summary> 根据项目和医生,分页获取工作量统计[New] </summary>
[HttpPost]
public async Task<PageOutput<WorkloadByTrialAndReviewerDTO>> GetWorkloadByTrialAndReviewer(
StatisticsWorkloadQueryParam param)
StatisticsWorkloadQueryParam inQuery)
{
var bDate = new DateTime(param.BeginDate.Year, param.BeginDate.Month, param.BeginDate.Day);
var eDate = new DateTime(param.EndDate.Year, param.EndDate.Month, param.EndDate.Day);
var bDate = new DateTime(inQuery.BeginDate.Year, inQuery.BeginDate.Month, inQuery.BeginDate.Day);
var eDate = new DateTime(inQuery.EndDate.Year, inQuery.EndDate.Month, inQuery.EndDate.Day);
eDate = eDate.AddDays(1);
Expression<Func<Workload, bool>> workloadLambda = x => x.DataFrom == (int)WorkLoadFromStatus.FinalConfirm;
workloadLambda = workloadLambda.And(x => x.WorkTime >= bDate && x.WorkTime < eDate);
@ -64,9 +64,9 @@ namespace IRaCIS.Application.Services
Expression<Func<Trial, bool>> trialLambda = x => true;
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin) //超级管理员按照条件查询所有
{
if (param.CroId != null)
if (inQuery.CroId != null)
{
trialLambda = trialLambda.And(u => u.CROId == param.CroId);
trialLambda = trialLambda.And(u => u.CROId == inQuery.CroId);
}
}
@ -75,16 +75,16 @@ namespace IRaCIS.Application.Services
List<Guid> trialIdList = _userTrialRepository.Where(u => u.UserId == _userInfo.Id).Select(u => u.TrialId).ToList();
trialLambda = trialLambda.And(u => trialIdList.Contains(u.Id));
}
if (!string.IsNullOrWhiteSpace(param.TrialCode))
if (!string.IsNullOrWhiteSpace(inQuery.TrialCode))
{
trialLambda = trialLambda.And(u => u.TrialCode.Contains(param.TrialCode));
trialLambda = trialLambda.And(u => u.TrialCode.Contains(inQuery.TrialCode));
}
Expression<Func<Doctor, bool>> doctorLambda = x => true;
if (!string.IsNullOrWhiteSpace(param.Reviewer))
if (!string.IsNullOrWhiteSpace(inQuery.Reviewer))
{
var reviewer = param.Reviewer.Trim();
var reviewer = inQuery.Reviewer.Trim();
doctorLambda = doctorLambda.And(u => u.ChineseName.Contains(reviewer)
|| u.FirstName.Contains(reviewer)
|| u.LastName.Contains(reviewer)
@ -92,9 +92,9 @@ namespace IRaCIS.Application.Services
);
}
if (Guid.Empty != param.HospitalId && param.HospitalId != null)
if (Guid.Empty != inQuery.HospitalId && inQuery.HospitalId != null)
{
doctorLambda = doctorLambda.And(u => u.HospitalId == param.HospitalId);
doctorLambda = doctorLambda.And(u => u.HospitalId == inQuery.HospitalId);
}
var workloadQuery = from workLoad in _workloadRepository.Where(workloadLambda)
@ -154,7 +154,7 @@ namespace IRaCIS.Application.Services
};
return await query.ToPagedListAsync(param.PageIndex, param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "ReviewerCode" : param.SortField, param.Asc);
return await query.ToPagedListAsync(inQuery);
//var propName = param.SortField == "" ? "ReviewerCode" : param.SortField;
//query = param.Asc
@ -182,26 +182,26 @@ namespace IRaCIS.Application.Services
/// <summary> 项目入组 医生维度统计[New] </summary>
[HttpPost]
public async Task<PageOutput<EnrollStatByReviewerDTO>> GetEnrollStatByReviewer(EnrollStatByReviewerQueryDTO param)
public async Task<PageOutput<EnrollStatByReviewerDTO>> GetEnrollStatByReviewer(EnrollStatByReviewerQueryDTO inQuery)
{
var bDate = new DateTime(param.BeginDate.Year, param.BeginDate.Month, 1);
var eDate = new DateTime(param.EndDate.Year, param.EndDate.Month, 1);
var bDate = new DateTime(inQuery.BeginDate.Year, inQuery.BeginDate.Month, 1);
var eDate = new DateTime(inQuery.EndDate.Year, inQuery.EndDate.Month, 1);
eDate = eDate.AddMonths(1);
Expression<Func<Enroll, bool>> enrollLambda = x => true;
enrollLambda = enrollLambda.And(x => x.EnrollTime >= bDate && x.EnrollTime < eDate);
Expression<Func<Hospital, bool>> hospitalLambda = x => true;
if (Guid.Empty != param.HospitalId && param.HospitalId != null)
if (Guid.Empty != inQuery.HospitalId && inQuery.HospitalId != null)
{
hospitalLambda = hospitalLambda.And(u => u.Id == param.HospitalId);
hospitalLambda = hospitalLambda.And(u => u.Id == inQuery.HospitalId);
}
Expression<Func<Doctor, bool>> doctorLambda = x => true;
if (!string.IsNullOrWhiteSpace(param.Reviewer))
if (!string.IsNullOrWhiteSpace(inQuery.Reviewer))
{
var reviewer = param.Reviewer.Trim();
var reviewer = inQuery.Reviewer.Trim();
doctorLambda = doctorLambda.And(u => u.ChineseName.Contains(reviewer)
|| u.FirstName.Contains(reviewer)
|| u.LastName.Contains(reviewer)
@ -249,9 +249,9 @@ namespace IRaCIS.Application.Services
};
var pageData = await query.ToPagedListAsync(param.PageIndex, param.PageIndex, param.SortField == "" ? "ReviewerCode" : param.SortField, param.Asc);
var pageData = await query.ToPagedListAsync(inQuery);
if (param.SortField == "EntryRate")
if (inQuery.SortField == "EntryRate")
{
pageData.CurrentPageData.OrderBy(t => t.EntryRate);
}

View File

@ -72,7 +72,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
TrialStatusStr = t.TrialStatusStr
});
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TrialListDTO_UltrasonicDicom.CreateTime) : inQuery.SortField, inQuery.Asc);
var result = await query.ToPagedListAsync(inQuery);
return ResponseOutput.Ok(result);
}
@ -81,27 +81,27 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
/// <summary>
/// 任务列表 第一层级
/// </summary>
/// <param name="queryVisitTask"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<VisitTaskDTO_UltrasonicDicom>> GetVisitTaskList(VisitTaskQuery_UltrasonicDicom queryVisitTask)
public async Task<PageOutput<VisitTaskDTO_UltrasonicDicom>> GetVisitTaskList(VisitTaskQuery_UltrasonicDicom inQuery)
{
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.SourceSubjectVisitId != null)
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.SourceSubjectVisitId != null)
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => (t.Subject.Code.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(queryVisitTask.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
.ProjectTo<VisitTaskDTO_UltrasonicDicom>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
}

View File

@ -123,10 +123,10 @@ namespace IRaCIS.Core.Application
/// <summary>
/// 中心调研 每个项目 需要处理的审批统计
/// </summary>
/// <param name="query"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TrialSiteSurveyStat>> GetSiteSurveyApprovalList(TrialSiteSurveyStatQuery query)
public async Task<PageOutput<TrialSiteSurveyStat>> GetSiteSurveyApprovalList(TrialSiteSurveyStatQuery inQuery)
{
@ -140,12 +140,12 @@ namespace IRaCIS.Core.Application
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() > 0)
.ProjectTo<TrialSiteSurveyStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id })
.OrderByDescending(t => t.ApprovalRequiredCount).ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField, query.Asc);
.OrderByDescending(t => t.ApprovalRequiredCount).ToPagedListAsync(inQuery);
}
else
{
return new PageOutput<TrialSiteSurveyStat>(query.PageIndex, query.PageSize, 0, new List<TrialSiteSurveyStat>());
return new PageOutput<TrialSiteSurveyStat>(inQuery.PageIndex, inQuery.PageSize, 0, new List<TrialSiteSurveyStat>());
}
@ -155,14 +155,14 @@ namespace IRaCIS.Core.Application
/// <summary>
/// 待签署的项目文件 需要签署文件数量 系统级别的在第一行
/// </summary>
/// <param name="query"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<DocSignStat>> GetTrialDocStatList(TrialSiteSurveyStatQuery query)
public async Task<PageOutput<DocSignStat>> GetTrialDocStatList(TrialSiteSurveyStatQuery inQuery)
{
if (_userInfo.IsAdmin)
{
return new PageOutput<DocSignStat>(query.PageIndex, query.PageSize, 0, new List<DocSignStat>());
return new PageOutput<DocSignStat>(inQuery.PageIndex, inQuery.PageSize, 0, new List<DocSignStat>());
}
else
{
@ -172,7 +172,7 @@ namespace IRaCIS.Core.Application
.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);
.ToPagedListAsync(inQuery);
return trialDocStat;
@ -215,7 +215,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(CheckToBeDoneDto.UrgentCount) + " desc", nameof(CheckToBeDoneDto.ToBeCheckedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync();
@ -259,7 +259,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ReReadingApplyToBeDoneDto.UrgentCount) + " desc", nameof(ReReadingApplyToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeApprovalCount = _visitTaskReReadingRepository
@ -298,7 +298,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ReviewerSelectToBeDoneDto.IsUrgent) + " desc", nameof(ReReadingApplyToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -334,7 +334,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(GetPMClinicalDataToBeDoneListOutDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
@ -383,7 +383,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ReviewerSelectToBeDoneDto.IsUrgent) + " desc", nameof(ReviewerSelectToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -424,7 +424,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ReReadingApprovalToBeDoneDto.UrgentCount) + " desc", nameof(ReReadingApprovalToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeApprovalCount = _visitTaskReReadingRepository
@ -472,7 +472,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ImageClinicalDataToBeDoneDto.UrgentCount) + " desc", nameof(ImageClinicalDataToBeDoneDto.ReadModuleCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
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))
@ -514,7 +514,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ImageClinicalDataToBeDoneDto.UrgentCount) + " desc", nameof(ImageClinicalDataToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
// ReadModuleCount情况太多了 暂时用之前的方法
foreach (var item in result.CurrentPageData)
@ -579,7 +579,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ImageQuestionToBeDoneDto.UrgentCount) + " desc", nameof(ImageQuestionToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeDealedCount = _subjectVisitRepository
@ -625,7 +625,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ImageCheckQuestionToBeDoneDto.UrgentCount) + " desc", nameof(ImageCheckQuestionToBeDoneDto.ToBeReplyedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeDealedCount = _subjectVisitRepository
@ -672,7 +672,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ImageReUploadToBeDoneDto.UrgentCount) + " desc", nameof(ImageReUploadToBeDoneDto.ToBeReUploadCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -721,7 +721,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ImageSubmittedToBeDoneDto.UrgentCount) + " desc", nameof(ImageSubmittedToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeDealedCount = _subjectVisitRepository
@ -780,7 +780,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ImageQualityToBeDoneDto.UrgentCount) + " desc", nameof(ImageQualityToBeDoneDto.ToBeClaimedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
@ -829,7 +829,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(ImageQuestionToBeDoneDto.UrgentCount) + " desc", nameof(ImageQuestionToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
var toBeDealedCount = _subjectVisitRepository
@ -973,7 +973,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(IRImageReadingToBeDoneDto.TrialCode) ,nameof(IRImageReadingToBeDoneDto.UrgentCount) + " desc", nameof(IRImageReadingToBeDoneDto.UnReadCount) + " desc" };
var result = await newQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await newQuery.ToPagedListAsync(inQuery, defalutSortArray);
var toBeDealedCount = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -1043,7 +1043,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(MedicalCommentsToBeDoneDto.UrgentCount) + " desc", nameof(MedicalCommentsToBeDoneDto.ToBeReplyedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
@ -1114,7 +1114,7 @@ namespace IRaCIS.Core.Application
var defalutSortArray = new string[] { nameof(MedicalCommentsToBeDoneDto.UrgentCount) + " desc", nameof(MedicalCommentsToBeDoneDto.ToBeReplyedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
@ -1550,7 +1550,7 @@ namespace IRaCIS.Core.Application
//.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);
var result = await query.ToPagedListAsync(inQuery);
return ResponseOutput.Ok(result);
}

View File

@ -73,22 +73,22 @@ namespace IRaCIS.Application.Services
/// <summary>
/// Setting页面 获取项目参与人员列表
/// </summary>
/// <param name="param"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TrialMaintenanceDTO>> GetMaintenanceUserList(TrialMaintenanceQuery param)
public async Task<PageOutput<TrialMaintenanceDTO>> GetMaintenanceUserList(TrialMaintenanceQuery inQuery)
{
var query = _trialUseRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
.WhereIf(param.UserTypeId != null, t => t.User.UserTypeId == param.UserTypeId)
.WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.User.UserName.Contains(param.UserName))
var query = _trialUseRepository.Where(t => t.TrialId == inQuery.TrialId).IgnoreQueryFilters()
.WhereIf(inQuery.UserTypeId != null, t => t.User.UserTypeId == inQuery.UserTypeId)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserName), t => t.User.UserName.Contains(inQuery.UserName))
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName), t => t.User.OrganizationName.Contains(param.OrganizationName))
.WhereIf(!string.IsNullOrWhiteSpace(param.UserRealName), t => (t.User.FullName).Contains(param.UserRealName))
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.OrganizationName), t => t.User.OrganizationName.Contains(inQuery.OrganizationName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.User.FullName).Contains(inQuery.UserRealName))
.ProjectTo<TrialMaintenanceDTO>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(param.PageIndex, param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "UpdateTime" : param.SortField, param.Asc);
return await query.ToPagedListAsync(inQuery);
}
@ -98,28 +98,27 @@ namespace IRaCIS.Application.Services
/// <summary> Setting页面 为 site 勾选CRC用户列表</summary>
[HttpPost]
public async Task<PageOutput<AssginSiteCRCListDTO>> GetSiteCRCScreeningList(SiteCRCQuery param)
public async Task<PageOutput<AssginSiteCRCListDTO>> GetSiteCRCScreeningList(SiteCRCQuery inQuery)
{
// 最开始过滤site已经选择的用户 现在又改回去。。。
var query = _trialUseRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
var query = _trialUseRepository.Where(t => t.TrialId == inQuery.TrialId).IgnoreQueryFilters()
.Where(t => t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator || t.User.UserTypeEnum == UserTypeEnum.CRA)
.WhereIf(param.UserTypeId != null, t => t.User.UserTypeId == param.UserTypeId)
.WhereIf(!string.IsNullOrWhiteSpace(param.UserRealName), t => (t.User.FullName).Contains(param.UserRealName))
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName), t => t.User.OrganizationName.Contains(param.OrganizationName))
.ProjectTo<AssginSiteCRCListDTO>(_mapper.ConfigurationProvider, new { trialSiteId = param.TrialSiteId });
.WhereIf(inQuery.UserTypeId != null, t => t.User.UserTypeId == inQuery.UserTypeId)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.User.FullName).Contains(inQuery.UserRealName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.OrganizationName), t => t.User.OrganizationName.Contains(inQuery.OrganizationName))
.ProjectTo<AssginSiteCRCListDTO>(_mapper.ConfigurationProvider, new { trialSiteId = inQuery.TrialSiteId });
return await query.ToPagedListAsync(param.PageIndex,
param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "UpdateTime" : param.SortField, param.Asc);
return await query.ToPagedListAsync(inQuery);
}
/// <summary> Setting页面 项目参与人员勾选列表 </summary>
[HttpPost]
public async Task<PageOutput<TrialUserScreeningDTO>> GetTrialUserScreeningList(TrialUserQuery trialUserQuery)
public async Task<PageOutput<TrialUserScreeningDTO>> GetTrialUserScreeningList(TrialUserQuery inQuery)
{
var trialType = _trialRepository.Where(t => t.Id == trialUserQuery.TrialId).Select(t => t.TrialType).FirstOrDefault();
var trialType = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.TrialType).FirstOrDefault();
var userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.ClinicalResearchCoordinator, UserTypeEnum.CRA, UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA, UserTypeEnum.MW, UserTypeEnum.MC };
@ -142,16 +141,15 @@ namespace IRaCIS.Application.Services
.Where(t=>userTypeEnums.Contains(t.UserTypeEnum))
.WhereIf(!string.IsNullOrWhiteSpace(trialUserQuery.UserRealName), t => (t.FullName).Contains(trialUserQuery.UserRealName))
.WhereIf(!string.IsNullOrWhiteSpace(trialUserQuery.UserName), t => t.UserName.Contains(trialUserQuery.UserName))
.WhereIf(!string.IsNullOrWhiteSpace(trialUserQuery.OrganizationName), t => t.OrganizationName.Contains(trialUserQuery.OrganizationName))
.WhereIf(trialUserQuery.UserTypeEnum != null, t => t.UserTypeEnum == trialUserQuery.UserTypeEnum)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.FullName).Contains(inQuery.UserRealName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.OrganizationName), t => t.OrganizationName.Contains(inQuery.OrganizationName))
.WhereIf(inQuery.UserTypeEnum != null, t => t.UserTypeEnum == inQuery.UserTypeEnum)
//.WhereIf(_userInfo.IsAdmin, t => t.UserTypeRole.Type == UserTypeGroup.TrialUser)
//.WhereIf(!_userInfo.IsAdmin, t => t.UserTypeRole.Type == UserTypeGroup.TrialUser || t.UserTypeEnum != UserTypeEnum.ProjectManager)
.ProjectTo<TrialUserScreeningDTO>(_mapper.ConfigurationProvider, new { trialId = trialUserQuery.TrialId });
.ProjectTo<TrialUserScreeningDTO>(_mapper.ConfigurationProvider, new { trialId = inQuery.TrialId });
return await query.ToPagedListAsync(trialUserQuery.PageIndex,
trialUserQuery.PageSize, string.IsNullOrWhiteSpace(trialUserQuery.SortField) ? "UserRealName" : trialUserQuery.SortField, trialUserQuery.Asc);
return await query.ToPagedListAsync(inQuery);
}

View File

@ -42,52 +42,52 @@ namespace IRaCIS.Application.Services
/// <summary>
/// 分页获取临床项目列表 默认后台加急状态为3 查所有的
/// </summary>
/// <param name="searchParam"></param>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TrialDetailDTO>> GetTrialList(TrialQueryDTO searchParam)
public async Task<PageOutput<TrialDetailDTO>> GetTrialList(TrialQueryDTO inQuery)
{
var multiModalityIdSelectCount = searchParam.ModalityIds.Count;
var multiCriteriaSelectCount = searchParam.CriterionIds.Count;
var multiReviewTypeSelectCount = searchParam.ReviewTypeIds.Count;
var multiModalityIdSelectCount = inQuery.ModalityIds.Count;
var multiCriteriaSelectCount = inQuery.CriterionIds.Count;
var multiReviewTypeSelectCount = inQuery.ReviewTypeIds.Count;
Expression<Func<Trial, bool>> trialDeclarationTypeExpression = x => true;
foreach (var item in searchParam.DeclarationTypeEnumList)
foreach (var item in inQuery.DeclarationTypeEnumList)
{
trialDeclarationTypeExpression = trialDeclarationTypeExpression.And(t => t.DeclarationTypes.Contains($"|{item}|"));
}
Expression<Func<Trial, bool>> trialAttendedReviewerTypeExpression = x => true;
foreach (var item in searchParam.AttendedReviewerTypeEnumList)
foreach (var item in inQuery.AttendedReviewerTypeEnumList)
{
trialAttendedReviewerTypeExpression = trialAttendedReviewerTypeExpression.And(t => t.AttendedReviewerTypes.Contains($"|{item}|"));
}
var query = _trialRepository.AsQueryable()
.WhereIf(!string.IsNullOrEmpty(searchParam.TrialStatusStr), o => o.TrialStatusStr.Contains(searchParam.TrialStatusStr))
.WhereIf(searchParam.SponsorId != null, o => o.SponsorId == searchParam.SponsorId)
.WhereIf(searchParam.Expedited != null, o => o.Expedited == searchParam.Expedited)
.WhereIf(!string.IsNullOrEmpty(searchParam.Code), o => o.TrialCode.Contains(searchParam.Code))
.WhereIf(!string.IsNullOrWhiteSpace(searchParam.Indication), o => o.Indication.Contains(searchParam.Indication))
.WhereIf(!string.IsNullOrEmpty(searchParam.ResearchProgramNo), o => o.ResearchProgramNo.Contains(searchParam.ResearchProgramNo))
.WhereIf(!string.IsNullOrWhiteSpace(searchParam.ExperimentName), o => o.ExperimentName.Contains(searchParam.ExperimentName))
.WhereIf(searchParam.PhaseId != null, o => o.PhaseId == searchParam.PhaseId)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialStatusStr), o => o.TrialStatusStr.Contains(inQuery.TrialStatusStr))
.WhereIf(inQuery.SponsorId != null, o => o.SponsorId == inQuery.SponsorId)
.WhereIf(inQuery.Expedited != null, o => o.Expedited == inQuery.Expedited)
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Indication), o => o.Indication.Contains(inQuery.Indication))
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
.WhereIf(inQuery.PhaseId != null, o => o.PhaseId == inQuery.PhaseId)
.WhereIf(searchParam.DeclarationTypeEnumList.Count > 0, trialDeclarationTypeExpression)
.WhereIf(searchParam.AttendedReviewerTypeEnumList.Count > 0, trialAttendedReviewerTypeExpression)
.WhereIf(inQuery.DeclarationTypeEnumList.Count > 0, trialDeclarationTypeExpression)
.WhereIf(inQuery.AttendedReviewerTypeEnumList.Count > 0, trialAttendedReviewerTypeExpression)
//.WhereIf(searchParam.AttendedReviewerType != null, o => o.AttendedReviewerType == searchParam.AttendedReviewerType)
.WhereIf(searchParam.IndicationTypeId != null, o => o.IndicationTypeId == searchParam.IndicationTypeId)
.WhereIf(searchParam.CROId != null, o => o.CROId == searchParam.CROId)
.WhereIf(searchParam.BeginDate != null, o => o.CreateTime >= searchParam.BeginDate)
.WhereIf(searchParam.EndDate != null, o => o.CreateTime <= searchParam.EndDate)
.WhereIf(inQuery.IndicationTypeId != null, o => o.IndicationTypeId == inQuery.IndicationTypeId)
.WhereIf(inQuery.CROId != null, o => o.CROId == inQuery.CROId)
.WhereIf(inQuery.BeginDate != null, o => o.CreateTime >= inQuery.BeginDate)
.WhereIf(inQuery.EndDate != null, o => o.CreateTime <= inQuery.EndDate)
.WhereIf(multiModalityIdSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.Modality) == multiModalityIdSelectCount)
.WhereIf(multiCriteriaSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.Criterion) == multiCriteriaSelectCount)
@ -95,7 +95,7 @@ namespace IRaCIS.Application.Services
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, isEn_Us = _userInfo.IsEn_Us });
return await query.ToPagedListAsync(searchParam.PageIndex, searchParam.PageSize, string.IsNullOrWhiteSpace(searchParam.SortField) ? "CreateTime" : searchParam.SortField, searchParam.Asc);
return await query.ToPagedListAsync(inQuery);
}
@ -606,17 +606,17 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<PageOutput<TrialDetailDTO>> GetReviewerTrialListByEnrollmentStatus(TrialByStatusQueryDTO param)
public async Task<PageOutput<TrialDetailDTO>> GetReviewerTrialListByEnrollmentStatus(TrialByStatusQueryDTO inQuery)
{
var query = _trialRepository.AsQueryable()
.WhereIf(param.Status == 5, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO))
.WhereIf(param.Status == 8, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup))
.WhereIf(param.Status == 10, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.WhereIf(param.Status == 14, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.Finished))
.WhereIf(inQuery.Status == 5, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO))
.WhereIf(inQuery.Status == 8, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup))
.WhereIf(inQuery.Status == 10, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.WhereIf(inQuery.Status == 14, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.Finished))
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, isEn_Us = _userInfo.IsEn_Us });
return await query.ToPagedListAsync(param.PageIndex, param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "CreateTime" : param.SortField, param.Asc);
return await query.ToPagedListAsync(inQuery);
}
@ -639,20 +639,20 @@ namespace IRaCIS.Application.Services
/// <summary> 分页获取医生参与的临床实验项目列表(查询条件)</summary>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TrialDetailDTO>> GetTrialListByReviewer(ReviewerTrialQueryDTO searchModel)
public async Task<PageOutput<TrialDetailDTO>> GetTrialListByReviewer(ReviewerTrialQueryDTO inQuery)
{
var query = _trialRepository
.WhereIf(searchModel.EnrollStatus != null, o => (int)searchModel.EnrollStatus! == 10 ?
.WhereIf(inQuery.EnrollStatus != null, o => (int)inQuery.EnrollStatus! == 10 ?
o.EnrollList.Any(o => o.EnrollStatus >= EnrollStatus.ConfirmIntoGroup && o.EnrollStatus <= EnrollStatus.DoctorReading && o.DoctorId == _userInfo.Id) :
o.EnrollList.Any(o => o.EnrollStatus == searchModel.EnrollStatus && o.DoctorId == _userInfo.Id))
.WhereIf(searchModel.Expedited != null, o => o.Expedited == searchModel.Expedited)
.WhereIf(!string.IsNullOrEmpty(searchModel.Code), o => o.TrialCode.Contains(searchModel.Code))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Indication), o => o.Indication.Contains(searchModel.Indication))
o.EnrollList.Any(o => o.EnrollStatus == inQuery.EnrollStatus && o.DoctorId == _userInfo.Id))
.WhereIf(inQuery.Expedited != null, o => o.Expedited == inQuery.Expedited)
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Indication), o => o.Indication.Contains(inQuery.Indication))
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, isEn_Us = _userInfo.IsEn_Us });
return await query.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "CreateTime" : searchModel.SortField, searchModel.Asc);
return await query.ToPagedListAsync(inQuery);

View File

@ -34,22 +34,21 @@ namespace IRaCIS.Core.Application.Services
/// <summary>Pannel 进去 SiteTab </summary>
[HttpPost]
public async Task<PageOutput<SiteStatDTO>> GetSiteCRCList(SiteCrcQueryDTO param)
public async Task<PageOutput<SiteStatDTO>> GetSiteCRCList(SiteCrcQueryDTO inQuery)
{
var siteStatQuery = _trialSiteRepository.Where(t => t.TrialId == param.TrialId, ignoreQueryFilters: true)
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.TrialSiteName.Contains(param.SiteName))
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode), t => t.TrialSiteCode.Contains(param.TrialSiteCode))
var siteStatQuery = _trialSiteRepository.Where(t => t.TrialId == inQuery.TrialId, ignoreQueryFilters: true)
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SiteName), t => t.TrialSiteName.Contains(inQuery.SiteName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(inQuery.TrialSiteAliasName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSiteCode.Contains(inQuery.TrialSiteCode))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.Id))
.WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => t.CRCUserList.Any(k => (k.User.FullName).Contains(param.UserKeyInfo)
|| k.User.UserName.Contains(param.UserKeyInfo) || k.User.EMail.Contains(param.UserKeyInfo)))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.User.FullName).Contains(inQuery.UserKeyInfo)
|| k.User.UserName.Contains(inQuery.UserKeyInfo) || k.User.EMail.Contains(inQuery.UserKeyInfo)))
.ProjectTo<SiteStatDTO>(_mapper.ConfigurationProvider);
return await siteStatQuery.ToPagedListAsync(param.PageIndex,
param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "SiteCode" : param.SortField, param.Asc);
return await siteStatQuery.ToPagedListAsync(inQuery);
}
@ -57,23 +56,22 @@ namespace IRaCIS.Core.Application.Services
/// <summary>[new] setting页面Site列表和getSiteCRCList对比 没有统计数据增加了一些site信息 </summary>
[HttpPost]
public async Task<PageOutput<SiteStatSimpleDTO>> GetSiteCRCSimpleList(SiteCrcQueryDTO param)
public async Task<PageOutput<SiteStatSimpleDTO>> GetSiteCRCSimpleList(SiteCrcQueryDTO inQuery)
{
var siteStatQuery = _trialSiteRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.TrialSiteName.Contains(param.SiteName) || t.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode), t => t.TrialSiteCode.Contains(param.TrialSiteCode))
var siteStatQuery = _trialSiteRepository.Where(t => t.TrialId == inQuery.TrialId).IgnoreQueryFilters()
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SiteName), t => t.TrialSiteName.Contains(inQuery.SiteName) || t.TrialSiteAliasName.Contains(inQuery.TrialSiteAliasName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(inQuery.TrialSiteAliasName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSiteCode.Contains(inQuery.TrialSiteCode))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.Id))
.WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => t.CRCUserList.Any(k => (k.User.FullName).Contains(param.UserKeyInfo)
|| k.User.UserName.Contains(param.UserKeyInfo) || k.User.EMail.Contains(param.UserKeyInfo)))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.User.FullName).Contains(inQuery.UserKeyInfo)
|| k.User.UserName.Contains(inQuery.UserKeyInfo) || k.User.EMail.Contains(inQuery.UserKeyInfo)))
.ProjectTo<SiteStatSimpleDTO>(_mapper.ConfigurationProvider ,new { isEn_Us = _userInfo.IsEn_Us });
var result = await siteStatQuery.ToPagedListAsync(param.PageIndex,
param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "Site" : param.SortField, param.Asc);
var result = await siteStatQuery.ToPagedListAsync(inQuery);
return result;
}
@ -92,21 +90,20 @@ namespace IRaCIS.Core.Application.Services
/// <summary>[new] Setting页面 Site勾选列表 </summary>
[HttpPost]
public async Task<PageOutput<TrialSiteScreeningDTO>> GetTrialSiteScreeningList(TrialSiteQuery searchModel)
public async Task<PageOutput<TrialSiteScreeningDTO>> GetTrialSiteScreeningList(TrialSiteQuery inQuery)
{
// 之前选择了的不能再次出现在列表,做的时候我就不建议这样搞,搞好了 现在又要改回去。。。 瞎折腾。。。。
var siteQueryable = _siteRepository.AsQueryable(true)
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.SiteName), t => t.SiteName.Contains(searchModel.SiteName) || t.SiteNameCN.Contains(searchModel.SiteName) || t.AliasName.Contains(searchModel.SiteName))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.AliasName), t => t.AliasName.Contains(searchModel.AliasName))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
.ProjectTo<TrialSiteScreeningDTO>(_mapper.ConfigurationProvider, new { trialId = searchModel.TrialId , isEn_Us =_userInfo.IsEn_Us});
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SiteName), t => t.SiteName.Contains(inQuery.SiteName) || t.SiteNameCN.Contains(inQuery.SiteName) || t.AliasName.Contains(inQuery.SiteName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.AliasName), t => t.AliasName.Contains(inQuery.AliasName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.City), t => t.City.Contains(inQuery.City))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Country), t => t.Country.Contains(inQuery.Country))
.ProjectTo<TrialSiteScreeningDTO>(_mapper.ConfigurationProvider, new { trialId = inQuery.TrialId , isEn_Us =_userInfo.IsEn_Us});
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex,
searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
return await siteQueryable.ToPagedListAsync(inQuery);
}

View File

@ -125,7 +125,7 @@ namespace IRaCIS.Application.Services
.ProjectTo<SCPImageUploadView>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField == string.Empty ? nameof(SCPImageUploadView.CallingAE) : inQuery.SortField, inQuery.Asc);
var pageList = await query.ToPagedListAsync(inQuery);
return ResponseOutput.Ok(pageList);
@ -197,7 +197,7 @@ namespace IRaCIS.Application.Services
var pageList = await resultQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField == string.Empty ? nameof(PatientQueryView.PatientIdStr) : inQuery.SortField, inQuery.Asc);
var pageList = await resultQuery.ToPagedListAsync(inQuery);
#endregion
@ -246,7 +246,7 @@ namespace IRaCIS.Application.Services
//var list = await orderQuery.ToListAsync();
var pageList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField == string.Empty ? nameof(PatientStudySimpleView.StudyTime) : inQuery.SortField, inQuery.Asc);
var pageList = await query.ToPagedListAsync(inQuery);
return pageList;
}
@ -315,7 +315,7 @@ namespace IRaCIS.Application.Services
};
var pageList = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField == string.Empty ? nameof(PatientStudySimpleView.StudyTime) : inQuery.SortField, inQuery.Asc);
var pageList = await query.ToPagedListAsync(inQuery);
return pageList;
}

View File

@ -127,7 +127,7 @@ namespace IRaCIS.Application.Services
.WhereIf(inQuery.IsMissingImages != null, t => t.IsMissingImages == inQuery.IsMissingImages);
var pageList = await subjectQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField == string.Empty ? "Code" : inQuery.SortField, inQuery.Asc);
var pageList = await subjectQuery.ToPagedListAsync(inQuery);
var trialConfig = await _repository.Where<Trial>(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();

View File

@ -43,7 +43,7 @@ namespace IRaCIS.Application.Services
.WhereIf(!string.IsNullOrWhiteSpace(param.Keyword), t => t.VisitName.Contains(param.Keyword))
.ProjectTo<VisitStageDTO>(_mapper.ConfigurationProvider);
return await visitStageQuery.ToPagedListAsync(param.PageIndex, param.PageSize, "CreateTime", param.Asc);
return await visitStageQuery.ToPagedListAsync(param);
}

View File

@ -304,7 +304,7 @@ namespace IRaCIS.Application.Services
};
return await doctorIntoGroupQueryable.ToPagedListAsync(doctorSearchModel.PageIndex, doctorSearchModel.PageSize, doctorSearchModel.SortField == "" ? "EnrollTime" : doctorSearchModel.SortField, doctorSearchModel.Asc);
return await doctorIntoGroupQueryable.ToPagedListAsync(doctorSearchModel);
}

View File

@ -106,7 +106,7 @@ namespace IRaCIS.Application.Services
ReviewerCode = dociorc.ReviewerCode,
Downtime = enroll.Downtime,
};
return await costStatisticsQueryable.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, "ChineseName");
return await costStatisticsQueryable.ToPagedListAsync(challengeQuery);

View File

@ -47,32 +47,34 @@ namespace IRaCIS.Core.Infrastructure.Extention
}
else
{
#region 单字段排序,前端不传递,后端给排序字段
//var propName = string.Empty;
var propName = string.Empty;
//if (string.IsNullOrWhiteSpace(pageInput.SortField))
//{
// //没有指定优先以Id排序否则从属性里面随便取出来一个排序
// var propertyNameList = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(t => t.CanWrite).Select(t => t.Name).OrderBy(t => t).ToList();
if (string.IsNullOrWhiteSpace(pageInput.SortField))
{
//没有指定优先以Id排序否则从属性里面随便取出来一个排序
var propertyNameList = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(t => t.CanWrite).Select(t => t.Name).OrderBy(t => t).ToList();
// if (propertyNameList.Count == 0)
// {
// throw new InvalidOperationException("no default sort field.");
// }
// else
// {
// propName = propertyNameList.Contains("Id") ? "Id" : propertyNameList.FirstOrDefault();
// }
if (propertyNameList.Count == 0)
{
throw new InvalidOperationException("no default sort field.");
}
else
{
propName = propertyNameList.Contains("Id") ? "Id" : propertyNameList.FirstOrDefault();
}
//}
//else
//{
// //有值,以前段传输的为主
// propName = pageInput.SortField;
//}
}
else
{
//有值,以前段传输的为主
propName = pageInput.SortField;
}
source = pageInput.Asc ? source.OrderBy(propName) : source.OrderBy(propName + " desc");
//source = pageInput.Asc ? source.OrderBy(propName) : source.OrderBy(propName + " desc");
#endregion
source = string.IsNullOrWhiteSpace(pageInput.SortField) ? source : (pageInput.Asc ? source.OrderBy(pageInput.SortField) : source.OrderBy(pageInput.SortField + " desc"));
}
source = source.Skip((pageInput.PageIndex - 1) * pageInput.PageSize);
@ -93,54 +95,46 @@ namespace IRaCIS.Core.Infrastructure.Extention
}
//单字段排序 异步
public static async Task<PageOutput<T>> ToPagedListAsync<T>(this IQueryable<T> source, int pageNumber, int pageSize, string defaultSortFiled = "Id", bool isAsc = true, bool isMultiSortFiled = false, string[] sortArray = default)
//兼容之前后端给了默认值的,不影响之前的逻辑,只是改写法
public static async Task<PageOutput<T>> ToPagedListAsync<T>(this IQueryable<T> source, PageInput pageInput, string sortField , CancellationToken cancellationToken = default)
{
if (isMultiSortFiled && sortArray == default)
if (pageInput.PageIndex <= 0)
{
throw new System.Exception("The sort field must be specified");
pageInput.PageIndex = 1;
}
if (pageInput.PageSize <= 0)
{
pageInput.PageSize = 10;
}
if (pageNumber <= 0)
{
pageNumber = 1;
}
if (pageSize <= 0)
{
pageSize = 10;
}
var count = await source.CountAsync().ConfigureAwait(false);
var count = await source.CountAsync(cancellationToken).ConfigureAwait(false);
if (count == 0)
{
return new PageOutput<T>() { CurrentPageData = new T[0] };
}
var propName = string.IsNullOrWhiteSpace(defaultSortFiled) ? "Id" : defaultSortFiled;
if (!isMultiSortFiled)
var propName = string.Empty;
if (string.IsNullOrWhiteSpace(pageInput.SortField))
{
source = isAsc ? source.OrderBy(propName) : source.OrderBy(propName + " desc");
propName = sortField;
}
else
{
var sortString = string.Join(',', sortArray);
source = source.OrderBy(sortString);
}
source = source.Skip((pageNumber - 1) * pageSize);
source = string.IsNullOrWhiteSpace(propName) ? source : (pageInput.Asc ? source.OrderBy(propName) : source.OrderBy(propName + " desc"));
source = source.Skip((pageInput.PageIndex - 1) * pageInput.PageSize);
var items = await source
.Take(pageSize)
.ToArrayAsync()
.Take(pageInput.PageSize)
.ToArrayAsync(cancellationToken)
.ConfigureAwait(false);
var pagedList = new PageOutput<T>()
{
PageIndex = pageNumber,
PageSize = pageSize,
PageIndex = pageInput.PageIndex,
PageSize = pageInput.PageSize,
TotalCount = count,
CurrentPageData = items
};
@ -149,127 +143,6 @@ namespace IRaCIS.Core.Infrastructure.Extention
}
#region 同步方法废弃
////单字段排序
//public static PageOutput<T> ToPagedList<T>(this IQueryable<T> source, int pageIndex, int pageSize, string defaultSortFiled = "Id", bool isAsc = true)
//{
// if (pageIndex <= 0)
// {
// pageIndex = 1;
// }
// if (pageSize <= 0)
// {
// pageSize = 10;
// }
// var count = source.Count();
// if (count == 0)
// {
// return new PageOutput<T>() { CurrentPageData = new T[0] };
// }
// var propName = string.IsNullOrWhiteSpace(defaultSortFiled) ? "Id" : defaultSortFiled;
// source = isAsc ? source.OrderBy(propName) : source.OrderBy(propName + " desc");
// source = source.Skip((pageIndex - 1) * pageSize);
// var items = source
// .Take(pageSize)
// .ToArray();
// var pagedList = new PageOutput<T>()
// {
// PageIndex = pageIndex,
// PageSize = pageSize,
// TotalCount = count,
// CurrentPageData = items
// };
// return pagedList;
//}
//public static PageOutput<T> ToPagedList<T>(this IList<T> source, int pageIndex, int pageSize, string defaultSortFiled = "Id", bool isAsc = true)
//{
// if (pageIndex <= 0)
// {
// pageIndex = 1;
// }
// if (pageSize <= 0)
// {
// pageSize = 10;
// }
// var count = source.Count();
// if (count == 0)
// {
// return new PageOutput<T>() { CurrentPageData = new List<T>() };
// }
// var propName = string.IsNullOrWhiteSpace(defaultSortFiled) ? "Id" : defaultSortFiled;
// IQueryable<T> sourceQuery = isAsc ? source.AsQueryable().OrderBy(propName) : source.AsQueryable().OrderBy(propName + " desc");
// sourceQuery = sourceQuery.Skip((pageIndex - 1) * pageSize);
// var items = sourceQuery
// .Take(pageSize)
// .ToArray();
// var pagedList = new PageOutput<T>()
// {
// PageIndex = pageIndex,
// PageSize = pageSize,
// TotalCount = count,
// CurrentPageData = items
// };
// return pagedList;
//}
////多字段排序 ["a asc", "b desc", "c asc"]
//public static PageOutput<T> ToPagedList<T>(this IQueryable<T> source, int pageIndex, int pageSize, string[] sortArray)
//{
// if (pageIndex <= 0)
// {
// pageIndex = 1;
// }
// if (pageSize <= 0)
// {
// pageSize = 10;
// }
// var count = source.Count();
// if (count == 0)
// {
// return new PageOutput<T>() { CurrentPageData = new T[0] };
// }
// var sortString = string.Join(',', sortArray);
// source.OrderBy(sortString);
// source = source.Skip((pageIndex - 1) * pageSize);
// var items = source
// .Take(pageSize)
// .ToArray();
// var pagedList = new PageOutput<T>()
// {
// PageIndex = pageIndex,
// PageSize = pageSize,
// TotalCount = count,
// CurrentPageData = items
// };
// return pagedList;
//}
#endregion
}
}