修改一致性核查bug
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
public class VisitFinishedStatQuery
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? TrialReadingCriterionId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class VisitFinishedStatViewModel
|
||||
{
|
||||
public int? UploadedCount { get; set; }
|
||||
|
||||
public int? QCFinishedCount { get; set; }
|
||||
|
||||
public int? CheckFinishedCount { get; set; }
|
||||
|
||||
public List<VisitReadingCriterionInfo> CriterionList { get; set; }
|
||||
}
|
||||
|
||||
public class VisitReadingCriterionInfo
|
||||
{
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
public string TrialReadingCriterionName { get; set; }
|
||||
|
||||
public int? ReadingFinishedCount { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class VisitQuestionStatQuery
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class VisitQuestionViewModel
|
||||
{
|
||||
|
||||
public int? QCQuestion_IngCount { get; set; }
|
||||
|
||||
public int? QCQuestion_ClosedCount { get; set; }
|
||||
|
||||
public int? CheckQuestion_ClosedCount { get; set; }
|
||||
|
||||
public int? CheckQuestion_IngCount { get; set; }
|
||||
|
||||
public int? MedicalReviewQuestion_ClosedCount { get; set; }
|
||||
|
||||
public int? MedicalReviewQuestion_IngCount { get; set; }
|
||||
|
||||
|
||||
//public List<MedicalReviewQuestionInfo> CriterionList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class MedicalReviewQuestionInfo
|
||||
{
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
public string TrialReadingCriterionName { get; set; }
|
||||
|
||||
|
||||
public int? MedicalReviewQuestion_ClosedCount { get; set; }
|
||||
|
||||
public int? MedicalReviewQuestion_IngCount { get; set; }
|
||||
}
|
||||
|
||||
public class EfficacyEvaluationQuery
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
}
|
||||
|
||||
public class EfficacyEvaluationStatViewModel
|
||||
{
|
||||
public int OverallTumorEvaluation { get; set; }
|
||||
|
||||
public int SubjectCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application;
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TrialStatService(
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<TrialDocument> _trialDocumentRepository,
|
||||
IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IRepository<SystemNotice> _systemNoticeRepository,
|
||||
IRepository<SubjectVisitImageBackRecord> _subjectVisitImageBackRecordReposiotry,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 访视完成度
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<VisitFinishedStatViewModel>> GetTrialVisitFinishedStatList(VisitFinishedStatQuery inQuery)
|
||||
{
|
||||
|
||||
|
||||
var list = await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new VisitFinishedStatViewModel()
|
||||
{
|
||||
UploadedCount = t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted).Count(),
|
||||
QCFinishedCount = t.SubjectVisitList.Where(t => t.AuditState == AuditStateEnum.QCPassed || t.AuditState == AuditStateEnum.QCFailed).Count(),
|
||||
CheckFinishedCount = t.SubjectVisitList.Where(t => t.CheckState == CheckStateEnum.CVPassed).Count(),
|
||||
|
||||
CriterionList = t.TrialReadingCriterionList.Select(t => new VisitReadingCriterionInfo()
|
||||
{
|
||||
TrialReadingCriterionId = t.Id,
|
||||
TrialReadingCriterionName = t.CriterionName,
|
||||
ReadingFinishedCount = t.VisitTaskList.Where(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false
|
||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit)
|
||||
.GroupBy(t => t.SourceSubjectVisitId)
|
||||
.Where(g => t.ReadingType == ReadingMethod.Double ? g.Count() == 2 : true)
|
||||
.Count()
|
||||
|
||||
}).ToList()
|
||||
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 质疑统计列表 --医学审核不区分标准
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<VisitQuestionViewModel>> GetTrialQuestionStatList(VisitQuestionStatQuery inQuery)
|
||||
{
|
||||
|
||||
|
||||
var list = await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new VisitQuestionViewModel()
|
||||
{
|
||||
|
||||
|
||||
QCQuestion_ClosedCount = t.SubjectVisitList.SelectMany(t => t.QCChallengeList).Where(c => c.IsClosed).Count(),
|
||||
|
||||
QCQuestion_IngCount = t.SubjectVisitList.SelectMany(t => t.QCChallengeList).Where(c => c.IsClosed == false).Count(),
|
||||
|
||||
CheckQuestion_ClosedCount = t.SubjectVisitList.Where(t => t.CheckChallengeState == CheckChanllengeTypeEnum.Closed).Count(),
|
||||
CheckQuestion_IngCount = t.SubjectVisitList.Where(t => t.CheckChallengeState != CheckChanllengeTypeEnum.Closed).Count(),
|
||||
|
||||
|
||||
MedicalReviewQuestion_ClosedCount = t.TaskMedicalReviewList.Where(t => t.VisitTask.IsAnalysisCreate == false && t.IsClosedDialog).Count(),
|
||||
|
||||
MedicalReviewQuestion_IngCount = t.TaskMedicalReviewList.Where(t => t.VisitTask.IsAnalysisCreate == false && t.IsClosedDialog == false).Count(),
|
||||
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/////疗效统计表,只针对肿瘤标准 排除基线
|
||||
/////
|
||||
//public async Task<List<EfficacyEvaluationStatViewModel>> GetTrialEfficacyEvaluationStatList(EfficacyEvaluationQuery inQuery)
|
||||
//{
|
||||
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user