合并
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
e71682f8fa
|
|
@ -35,7 +35,7 @@ namespace IRaCIS.Core.API
|
||||||
.Enrich.FromLogContext()
|
.Enrich.FromLogContext()
|
||||||
.Filter.ByExcluding(logEvent => logEvent.Properties.ContainsKey("RequestPath") && logEvent.Properties["RequestPath"].ToString().Contains("/health"))
|
.Filter.ByExcluding(logEvent => logEvent.Properties.ContainsKey("RequestPath") && logEvent.Properties["RequestPath"].ToString().Contains("/health"))
|
||||||
.WriteTo.Console()
|
.WriteTo.Console()
|
||||||
.WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day,retainedFileCountLimit:60);
|
.WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day,retainedFileCountLimit:365);
|
||||||
|
|
||||||
#region 根据环境配置是否打开错误发送邮件通知
|
#region 根据环境配置是否打开错误发送邮件通知
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3834,6 +3834,13 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.ReadingCalculateService.GetReportsChartSummary(IRaCIS.Core.Application.Service.Reading.Dto.GetReportsChartSummaryInDto)">
|
||||||
|
<summary>
|
||||||
|
获取报告图表汇总
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.ReadingCalculateService.GetReadingReportEvaluation(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingReportEvaluationInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.ReadingCalculateService.GetReadingReportEvaluation(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingReportEvaluationInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取阅片报告
|
获取阅片报告
|
||||||
|
|
@ -6872,6 +6879,13 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.IReadingCalculateService.GetReportsChartSummary(IRaCIS.Core.Application.Service.Reading.Dto.GetReportsChartSummaryInDto)">
|
||||||
|
<summary>
|
||||||
|
获取图表数据汇总
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.IReadingCalculateService.GetReportsChartData(IRaCIS.Core.Application.Service.Reading.Dto.GetReportsChartDataInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.IReadingCalculateService.GetReportsChartData(IRaCIS.Core.Application.Service.Reading.Dto.GetReportsChartDataInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取报告图表数据
|
获取报告图表数据
|
||||||
|
|
@ -14285,6 +14299,13 @@
|
||||||
<param name=""></param>
|
<param name=""></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.GetReportsChartSummary(IRaCIS.Core.Application.Service.Reading.Dto.GetReportsChartSummaryInDto)">
|
||||||
|
<summary>
|
||||||
|
获取图表数据汇总
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.SetReadKeyFile(IRaCIS.Core.Application.Service.Reading.Dto.SetReadKeyFileInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.SetReadKeyFile(IRaCIS.Core.Application.Service.Reading.Dto.SetReadKeyFileInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
设置已阅读关键文件
|
设置已阅读关键文件
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public string EmailTopic { get; set; } = string.Empty;
|
||||||
|
|
||||||
public EmailBusinessScenario? BusinessScenarioEnum { get; set; }
|
public EmailBusinessScenario? BusinessScenarioEnum { get; set; }
|
||||||
|
|
||||||
public CriterionType? CriterionTypeEnum { get; set; }
|
public CriterionType? CriterionTypeEnum { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1674,6 +1674,7 @@ x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.LesionNumber && x.Readi
|
||||||
var trialConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.IsEnrollementQualificationConfirm, t.IsPDProgressView }).First();
|
var trialConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.IsEnrollementQualificationConfirm, t.IsPDProgressView }).First();
|
||||||
|
|
||||||
var trialEmailNoticeConfigQueryable = _trialEmailNoticeConfigRepository.Where(t => t.TrialId == inQuery.TrialId)
|
var trialEmailNoticeConfigQueryable = _trialEmailNoticeConfigRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
|
.WhereIf(inQuery.EmailTopic.IsNotNullOrEmpty(), t => t.EmailTopic.Contains(inQuery.EmailTopic)||t.EmailTopicCN.Contains(inQuery.EmailTopic))
|
||||||
.WhereIf(inQuery.IsDistinguishCriteria == false, t => t.IsDistinguishCriteria == false)
|
.WhereIf(inQuery.IsDistinguishCriteria == false, t => t.IsDistinguishCriteria == false)
|
||||||
.WhereIf(inQuery.IsDistinguishCriteria == true, t => t.IsDistinguishCriteria == true)
|
.WhereIf(inQuery.IsDistinguishCriteria == true, t => t.IsDistinguishCriteria == true)
|
||||||
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeList.Any(c => c == inQuery.CriterionTypeEnum))
|
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeList.Any(c => c == inQuery.CriterionTypeEnum))
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<DicomSeries, DicomSeriesDTO>()
|
CreateMap<DicomSeries, DicomSeriesDTO>()
|
||||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.SubjectVisit.Subject.Code))
|
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.SubjectVisit.Subject.Code))
|
||||||
.ForMember(o => o.VisitName, t => t.MapFrom(u => u.SubjectVisit.VisitName));
|
.ForMember(o => o.VisitName, t => t.MapFrom(u => u.SubjectVisit.VisitName));
|
||||||
|
CreateMap<TaskSeries, DicomSeriesDTO>()
|
||||||
|
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.SubjectVisit.Subject.Code))
|
||||||
|
.ForMember(o => o.VisitName, t => t.MapFrom(u => u.SubjectVisit.VisitName));
|
||||||
CreateMap<SCPSeries, DicomSeriesDTO>();
|
CreateMap<SCPSeries, DicomSeriesDTO>();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
@ -198,9 +198,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public GetReportVerifyOutDto CalculateResult { get; set; }
|
public GetReportVerifyOutDto CalculateResult { get; set; }
|
||||||
public ReadingTaskState ReadingTaskState { get; set; }
|
public ReadingTaskState ReadingTaskState { get; set; }
|
||||||
|
|
||||||
public List<VisitTaskInfo> VisitTaskList { get; set; }
|
public List<VisitTaskInfo> VisitTaskList { get; set; } =new List<VisitTaskInfo> { };
|
||||||
|
|
||||||
public List<ReadingReportDto> TaskQuestions { get; set; }
|
public List<ReadingReportDto> TaskQuestions { get; set; } =new List<ReadingReportDto> { };
|
||||||
|
|
||||||
public List<LesionDto> LesionCountList { get; set; } = new List<LesionDto>();
|
public List<LesionDto> LesionCountList { get; set; } = new List<LesionDto>();
|
||||||
|
|
||||||
|
|
@ -491,6 +491,56 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public List<string> Value { get; set; }
|
public List<string> Value { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GetReportsChartTypeDataInDto
|
||||||
|
{
|
||||||
|
public ReportChartType ReportChartTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public CriterionType CriterionType { get; set; }
|
||||||
|
public GetReadingReportEvaluationOutDto Data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetReportsChartSummaryInDto
|
||||||
|
{
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialCriterionId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetReportsChartSummaryOutDto
|
||||||
|
{
|
||||||
|
public EvaluationColumn Evaluation { get; set; }
|
||||||
|
|
||||||
|
public List<ChartItem> TargetCharts { get; set; } = new List<ChartItem>();
|
||||||
|
|
||||||
|
public List<ChartItem> QuestionCharts { get; set; } = new List<ChartItem>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class EvaluationColumn
|
||||||
|
{
|
||||||
|
public List<List<EvaluationValue>> Evaluation { get; set; }
|
||||||
|
public string DictionaryCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class EvaluationValue
|
||||||
|
{
|
||||||
|
public string Value { get; set; }
|
||||||
|
|
||||||
|
public string DictionaryCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ChartItem
|
||||||
|
{
|
||||||
|
public Arm Arm { get; set; }
|
||||||
|
public ReportChartType? ChartType { get; set; }
|
||||||
|
public string GroupName { get; set; }
|
||||||
|
public ValueUnit? Unit { get; set; }
|
||||||
|
public List<string> VisitTaskNameList { get; set; } = new List<string>();
|
||||||
|
public List<DateTime?> LatestScanDateList { get; set; } = new List<DateTime?>();
|
||||||
|
public List<ReportChartData> ChartDataList { get; set; } = new List<ReportChartData>();
|
||||||
|
}
|
||||||
|
|
||||||
public class GetReportsChartDataInDto
|
public class GetReportsChartDataInDto
|
||||||
{
|
{
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,17 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return await _readingCalculateService.GetReportsChartData(inDto);
|
return await _readingCalculateService.GetReportsChartData(inDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取图表数据汇总
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<GetReportsChartSummaryOutDto> GetReportsChartSummary(GetReportsChartSummaryInDto inDto)
|
||||||
|
{
|
||||||
|
return await _readingCalculateService.GetReportsChartSummary(inDto);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置已阅读关键文件
|
/// 设置已阅读关键文件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -531,7 +531,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ReadingCalculateDto> GetReadingCalculateDto(Guid visitTaskId)
|
public async Task<ReadingCalculateDto> GetReadingCalculateDto(Guid visitTaskId)
|
||||||
{
|
{
|
||||||
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x=>x.SourceSubjectVisit).FirstNotNullAsync();
|
||||||
|
|
||||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == visitTask.TrialReadingCriterionId).FirstNotNullAsync();
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == visitTask.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == (visitTask.SourceSubjectVisitId ?? default(Guid))).FirstOrDefaultAsync();
|
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == (visitTask.SourceSubjectVisitId ?? default(Guid))).FirstOrDefaultAsync();
|
||||||
|
|
|
||||||
|
|
@ -248,6 +248,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
public async Task<GetReportsChartDataOutDto> GetReportsChartData(GetReportsChartDataInDto inDto)
|
public async Task<GetReportsChartDataOutDto> GetReportsChartData(GetReportsChartDataInDto inDto)
|
||||||
{
|
{
|
||||||
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstNotNullAsync();
|
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
|
|
@ -272,91 +273,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
if (inDto.ReportChartTypeEnum != null)
|
if (inDto.ReportChartTypeEnum != null)
|
||||||
{
|
{
|
||||||
switch (inDto.ReportChartTypeEnum)
|
var reportData = await GetReportsChartTypeData(new GetReportsChartTypeDataInDto()
|
||||||
{
|
{
|
||||||
case ReportChartType.Target:
|
CriterionType = criterionType,
|
||||||
{
|
Data = data,
|
||||||
// 这是病灶
|
ReportChartTypeEnum = inDto.ReportChartTypeEnum.Value,
|
||||||
var target = data.TaskQuestions.SelectMany(x => x.Childrens)
|
});
|
||||||
.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x=>x.Childrens)
|
result.ChartDataList = reportData.ChartDataList;
|
||||||
.ToList();
|
result.Unit = reportData.Unit;
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in target)
|
|
||||||
{
|
|
||||||
ReportChartData chartData = new ReportChartData()
|
|
||||||
{
|
|
||||||
Name = item.QuestionName,
|
|
||||||
Value= new List<string>(),
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var i = 0; i < result.VisitTaskNameList.Count; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (criterionType)
|
|
||||||
{
|
|
||||||
case CriterionType.RECIST1Point1:
|
|
||||||
case CriterionType.RECIST1Pointt1_MB:
|
|
||||||
case CriterionType.mRECISTHCC:
|
|
||||||
case CriterionType.IRECIST1Point1:
|
|
||||||
// 淋巴结的短径
|
|
||||||
if (item.Childrens.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer[i].Answer.EqEnum(ReadingYesOrNo.Yes)))
|
|
||||||
{
|
|
||||||
chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer[i].Answer).FirstOrDefault());
|
|
||||||
result.Unit = item.Childrens.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Unit).FirstOrDefault();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer[i].Answer).FirstOrDefault());
|
|
||||||
result.Unit = item.Childrens.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Unit).FirstOrDefault();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CriterionType.Lugano2014:
|
|
||||||
case CriterionType.Lugano2014WithoutPET:
|
|
||||||
chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.PPD).Select(x => x.Answer[i].Answer).FirstOrDefault());
|
|
||||||
result.Unit = item.Childrens.Where(x => x.QuestionMark == QuestionMark.PPD).Select(x => x.Unit).FirstOrDefault();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
result.ChartDataList.Add(chartData);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ReportChartType.BaseLineTarget:
|
|
||||||
// 这是病灶
|
|
||||||
var baseTarget = data.TaskQuestions.SelectMany(x => x.Childrens)
|
|
||||||
.Where(x => x.LesionType == LesionType.BaselineLesions).SelectMany(x => x.Childrens)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
foreach (var item in baseTarget)
|
|
||||||
{
|
|
||||||
ReportChartData chartData = new ReportChartData()
|
|
||||||
{
|
|
||||||
Name = item.QuestionName,
|
|
||||||
Value = new List<string>(),
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var i = 0; i < result.VisitTaskNameList.Count; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.LesionNumber).Select(x => x.Answer[i].Answer).FirstOrDefault());
|
|
||||||
result.Unit = item.Childrens.Where(x => x.QuestionMark == QuestionMark.LesionNumber).Select(x => x.Unit).FirstOrDefault();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
result.ChartDataList.Add(chartData);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (inDto.QuestionId != null)
|
else if (inDto.QuestionId != null)
|
||||||
{
|
{
|
||||||
|
|
@ -411,6 +335,293 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private async Task<GetReportsChartDataOutDto> GetReportsChartTypeData(GetReportsChartTypeDataInDto inDto)
|
||||||
|
{
|
||||||
|
var visitTaskNameList = inDto.Data.VisitTaskList.Select(x => x.BlindName).ToList();
|
||||||
|
GetReportsChartDataOutDto result = new GetReportsChartDataOutDto() {
|
||||||
|
|
||||||
|
ChartDataList=new List<ReportChartData>() { },
|
||||||
|
|
||||||
|
};
|
||||||
|
switch (inDto.ReportChartTypeEnum)
|
||||||
|
{
|
||||||
|
case ReportChartType.Target:
|
||||||
|
{
|
||||||
|
// 这是病灶
|
||||||
|
var target = inDto.Data.TaskQuestions.SelectMany(x => x.Childrens)
|
||||||
|
.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.Childrens)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in target)
|
||||||
|
{
|
||||||
|
ReportChartData chartData = new ReportChartData()
|
||||||
|
{
|
||||||
|
Name = item.QuestionName,
|
||||||
|
Value = new List<string>(),
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var i = 0; i < visitTaskNameList.Count; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (inDto.CriterionType)
|
||||||
|
{
|
||||||
|
case CriterionType.RECIST1Point1:
|
||||||
|
case CriterionType.RECIST1Pointt1_MB:
|
||||||
|
case CriterionType.mRECISTHCC:
|
||||||
|
case CriterionType.IRECIST1Point1:
|
||||||
|
// 淋巴结的短径
|
||||||
|
if (item.Childrens.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer[i].Answer.EqEnum(ReadingYesOrNo.Yes)))
|
||||||
|
{
|
||||||
|
chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer[i].Answer).FirstOrDefault());
|
||||||
|
result.Unit = item.Childrens.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Unit).FirstOrDefault();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer[i].Answer).FirstOrDefault());
|
||||||
|
result.Unit = item.Childrens.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Unit).FirstOrDefault();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CriterionType.Lugano2014:
|
||||||
|
case CriterionType.Lugano2014WithoutPET:
|
||||||
|
chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.PPD).Select(x => x.Answer[i].Answer).FirstOrDefault());
|
||||||
|
result.Unit = item.Childrens.Where(x => x.QuestionMark == QuestionMark.PPD).Select(x => x.Unit).FirstOrDefault();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
result.ChartDataList.Add(chartData);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ReportChartType.BaseLineTarget:
|
||||||
|
// 这是病灶
|
||||||
|
var baseTarget = inDto.Data.TaskQuestions.SelectMany(x => x.Childrens)
|
||||||
|
.Where(x => x.LesionType == LesionType.BaselineLesions).SelectMany(x => x.Childrens)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach (var item in baseTarget)
|
||||||
|
{
|
||||||
|
ReportChartData chartData = new ReportChartData()
|
||||||
|
{
|
||||||
|
Name = item.QuestionName,
|
||||||
|
Value = new List<string>(),
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var i = 0; i < result.VisitTaskNameList.Count; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.LesionNumber).Select(x => x.Answer[i].Answer).FirstOrDefault());
|
||||||
|
result.Unit = item.Childrens.Where(x => x.QuestionMark == QuestionMark.LesionNumber).Select(x => x.Unit).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
result.ChartDataList.Add(chartData);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取报告图表汇总
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<GetReportsChartSummaryOutDto> GetReportsChartSummary(GetReportsChartSummaryInDto inDto)
|
||||||
|
{
|
||||||
|
var criterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialCriterionId).FirstNotNullAsync();
|
||||||
|
var result= new GetReportsChartSummaryOutDto();
|
||||||
|
var r1Data = await GetData(new List<Arm>() { Arm.SingleReadingArm, Arm.DoubleReadingArm1 });
|
||||||
|
var r2Data = await GetData(new List<Arm>() { Arm.DoubleReadingArm2 });
|
||||||
|
async Task<GetReadingReportEvaluationOutDto> GetData(List<Arm> arms)
|
||||||
|
{
|
||||||
|
var data = new GetReadingReportEvaluationOutDto() { };
|
||||||
|
var task = await _visitTaskRepository.Where(x =>
|
||||||
|
x.SubjectId == inDto.SubjectId
|
||||||
|
&& arms.Contains(x.ArmEnum)
|
||||||
|
&& x.ReadingCategory== ReadingCategory.Visit
|
||||||
|
&& x.ReadingTaskState == ReadingTaskState.HaveSigned
|
||||||
|
&& x.TaskState == TaskState.Effect
|
||||||
|
&& x.TrialReadingCriterionId==inDto.TrialCriterionId
|
||||||
|
).OrderByDescending(x => x.VisitTaskNum).FirstOrDefaultAsync();
|
||||||
|
if (task != null)
|
||||||
|
{
|
||||||
|
data = await GetReadingReportEvaluation(new GetReadingReportEvaluationInDto()
|
||||||
|
{
|
||||||
|
TrialId = task.TrialId,
|
||||||
|
VisitTaskId = task.Id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EvaluationColumn BuildEvaluationTable(GetReadingReportEvaluationOutDto r1, GetReadingReportEvaluationOutDto r2)
|
||||||
|
{
|
||||||
|
EvaluationColumn result = new EvaluationColumn()
|
||||||
|
{
|
||||||
|
Evaluation = new List<List<EvaluationValue>>() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
var data = r1.VisitTaskList.Count() > r2.VisitTaskList.Count() ? r1 : r2;
|
||||||
|
var visitTaskName = data.VisitTaskList.Select(x => x.BlindName).ToList();
|
||||||
|
var length = data.VisitTaskList.Count();
|
||||||
|
result.Evaluation.Add(visitTaskName.Select(x=> new EvaluationValue() {
|
||||||
|
Value=x
|
||||||
|
}).ToList());
|
||||||
|
|
||||||
|
var r1baseLine= data.TaskQuestions
|
||||||
|
.SelectMany(x => x.Childrens)
|
||||||
|
.Where(x => x.QuestionType == QuestionType.ExistDisease)
|
||||||
|
.SelectMany(x => x.Answer.Select(a => new EvaluationValue
|
||||||
|
{
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
Value = a.Answer
|
||||||
|
}))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
var r1data = data.TaskQuestions
|
||||||
|
.SelectMany(x => x.Childrens)
|
||||||
|
.Where(x => x.QuestionType == QuestionType.Tumor)
|
||||||
|
.SelectMany(x => x.Answer.Select(a => new EvaluationValue
|
||||||
|
{
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
Value = a.Answer
|
||||||
|
}))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
r1data = r1baseLine.Take(1).Concat(r1data.Skip(1)).ToList();
|
||||||
|
|
||||||
|
r1data= r1data.Concat(Enumerable.Repeat(new EvaluationValue() { Value = "" }, length))
|
||||||
|
.Take(length)
|
||||||
|
.ToList();
|
||||||
|
result.Evaluation.Add(r1data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var r2baseLine = data.TaskQuestions
|
||||||
|
.SelectMany(x => x.Childrens)
|
||||||
|
.Where(x => x.QuestionType == QuestionType.ExistDisease)
|
||||||
|
.SelectMany(x => x.Answer.Select(a => new EvaluationValue
|
||||||
|
{
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
Value = a.Answer
|
||||||
|
}))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
var r2data = data.TaskQuestions
|
||||||
|
.SelectMany(x => x.Childrens)
|
||||||
|
.Where(x => x.QuestionType == QuestionType.Tumor)
|
||||||
|
.SelectMany(x => x.Answer.Select(a => new EvaluationValue
|
||||||
|
{
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
Value = a.Answer
|
||||||
|
}))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
r2data = r2baseLine.Take(1).Concat(r2data.Skip(1)).ToList();
|
||||||
|
|
||||||
|
r2data = r2data.Concat(Enumerable.Repeat(new EvaluationValue() { Value = "" }, length))
|
||||||
|
.Take(length)
|
||||||
|
.ToList();
|
||||||
|
result.Evaluation.Add(r2data);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ChartItem> BuildShowChartGroups(GetReadingReportEvaluationOutDto data, Arm arm)
|
||||||
|
{
|
||||||
|
var groups = new List<ChartItem>();
|
||||||
|
if (data.TaskQuestions == null || data.VisitTaskList == null) return groups;
|
||||||
|
foreach (var g in data.TaskQuestions)
|
||||||
|
{
|
||||||
|
var items = g.Childrens?.Where(c => c.ShowChartTypeEnum != ShowChartType.NotShow).ToList() ?? new List<ReadingReportDto>();
|
||||||
|
if (items.Count == 0) continue;
|
||||||
|
var chartList = new List<ReportChartData>();
|
||||||
|
foreach (var item in items)
|
||||||
|
{
|
||||||
|
var cd = new ReportChartData
|
||||||
|
{
|
||||||
|
Name = item.QuestionName,
|
||||||
|
Value = item.Answer?.Select(a => a.Answer).ToList() ?? new List<string>()
|
||||||
|
};
|
||||||
|
chartList.Add(cd);
|
||||||
|
}
|
||||||
|
groups.Add(new ChartItem
|
||||||
|
{
|
||||||
|
Arm = arm,
|
||||||
|
ChartType = null,
|
||||||
|
GroupName = g.GroupName,
|
||||||
|
Unit = items.FirstOrDefault()?.Unit,
|
||||||
|
VisitTaskNameList = data.VisitTaskList.Select(x => x.BlindName).ToList(),
|
||||||
|
LatestScanDateList = data.VisitTaskList.Select(x => x.LatestScanDate).ToList(),
|
||||||
|
ChartDataList = chartList
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
async Task<ChartItem> BuildTargetChart(GetReadingReportEvaluationOutDto data, Arm arm)
|
||||||
|
{
|
||||||
|
var item = new ChartItem
|
||||||
|
{
|
||||||
|
Arm = arm,
|
||||||
|
ChartType = ReportChartType.Target,
|
||||||
|
GroupName = _localizer["Tumor_TargetLesions"],
|
||||||
|
VisitTaskNameList = data.VisitTaskList?.Select(x => x.BlindName).ToList() ?? new List<string>(),
|
||||||
|
LatestScanDateList = data.VisitTaskList?.Select(x => x.LatestScanDate).ToList() ?? new List<DateTime?>(),
|
||||||
|
ChartDataList = new List<ReportChartData>(),
|
||||||
|
};
|
||||||
|
if (data.VisitTaskList != null && data.TaskQuestions != null)
|
||||||
|
{
|
||||||
|
var chart = await GetReportsChartTypeData(new GetReportsChartTypeDataInDto
|
||||||
|
{
|
||||||
|
CriterionType = criterion.CriterionType,
|
||||||
|
Data = data,
|
||||||
|
ReportChartTypeEnum = ReportChartType.Target
|
||||||
|
});
|
||||||
|
item.ChartDataList = chart.ChartDataList;
|
||||||
|
item.Unit = chart.Unit;
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
result.Evaluation = BuildEvaluationTable(r1Data, r2Data);
|
||||||
|
if (r1Data != null)
|
||||||
|
{
|
||||||
|
var r1Target = await BuildTargetChart(r1Data, Arm.DoubleReadingArm1);
|
||||||
|
result.TargetCharts.Add(r1Target);
|
||||||
|
var r1Groups = BuildShowChartGroups(r1Data, Arm.DoubleReadingArm1);
|
||||||
|
result.QuestionCharts.AddRange(r1Groups);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (r2Data != null)
|
||||||
|
{
|
||||||
|
var r2Target = await BuildTargetChart(r2Data, Arm.DoubleReadingArm2);
|
||||||
|
result.TargetCharts.Add(r2Target);
|
||||||
|
var r2Groups = BuildShowChartGroups(r2Data, Arm.DoubleReadingArm2);
|
||||||
|
result.QuestionCharts.AddRange(r2Groups);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取阅片报告
|
/// 获取阅片报告
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -663,30 +663,33 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
// 交集
|
||||||
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
|
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
|
||||||
|
// 差集
|
||||||
measureDataList = measureDataList.Except(allExists).ToList();
|
measureDataList = measureDataList.Except(allExists).ToList();
|
||||||
stateIsNullList = stateIsNullList.Except(allExists).ToList();
|
stateIsNullList = stateIsNullList.Except(allExists).ToList();
|
||||||
|
|
||||||
|
|
||||||
if (measureDataList.Count() > 0)
|
if (measureDataList.Count() > 0)
|
||||||
{
|
{
|
||||||
|
// 无标记
|
||||||
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stateIsNullList.Count > 0)
|
||||||
if (tableAnswerList.Count > 0)
|
|
||||||
{
|
{
|
||||||
|
// 状态为空
|
||||||
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allExists.Count > 0)
|
if (allExists.Count > 0)
|
||||||
{
|
{
|
||||||
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', stateIsNullList)] + ",";
|
// 未做标记且状态为空
|
||||||
|
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', allExists)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (errorMassage != string.Empty)
|
if (errorMassage != string.Empty)
|
||||||
{
|
{
|
||||||
|
errorMassage = _localizer["ReadingCalculate_Questionable"] + errorMassage;
|
||||||
throw new BusinessValidationFailedException(errorMassage);
|
throw new BusinessValidationFailedException(errorMassage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task CalculateTask(CalculateTaskInDto inDto);
|
Task CalculateTask(CalculateTaskInDto inDto);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取图表数据汇总
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<GetReportsChartSummaryOutDto> GetReportsChartSummary(GetReportsChartSummaryInDto inDto);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取报告图表数据
|
/// 获取报告图表数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -479,8 +479,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
List<string> measureDataList = rowAnswerList.Where(x => !unableEvaluateRowIds.Contains(x.Id)).Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
List<string> measureDataList = rowAnswerList.Where(x => !unableEvaluateRowIds.Contains(x.Id)).Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
||||||
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
||||||
|
// 交集
|
||||||
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
|
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
|
||||||
// 取差
|
// 差集
|
||||||
measureDataList = measureDataList.Except(allExists).ToList();
|
measureDataList = measureDataList.Except(allExists).ToList();
|
||||||
stateIsNullList = stateIsNullList.Except(allExists).ToList();
|
stateIsNullList = stateIsNullList.Except(allExists).ToList();
|
||||||
if (measureDataList.Count() > 0)
|
if (measureDataList.Count() > 0)
|
||||||
|
|
@ -489,7 +490,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tableAnswerList.Count > 0)
|
if (stateIsNullList.Count > 0)
|
||||||
{
|
{
|
||||||
// 状态为空
|
// 状态为空
|
||||||
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
|
||||||
|
|
@ -498,7 +499,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
if (allExists.Count > 0)
|
if (allExists.Count > 0)
|
||||||
{
|
{
|
||||||
// 未做标记且状态为空
|
// 未做标记且状态为空
|
||||||
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', stateIsNullList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', allExists)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -481,8 +481,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
List<string> measureDataList = rowAnswerList.Where(x => !unableEvaluateRowIds.Contains(x.Id)).Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
List<string> measureDataList = rowAnswerList.Where(x => !unableEvaluateRowIds.Contains(x.Id)).Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
||||||
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
||||||
|
|
||||||
|
// 交集
|
||||||
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
|
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
|
||||||
// 取差
|
// 差集
|
||||||
measureDataList = measureDataList.Except(allExists).ToList();
|
measureDataList = measureDataList.Except(allExists).ToList();
|
||||||
stateIsNullList = stateIsNullList.Except(allExists).ToList();
|
stateIsNullList = stateIsNullList.Except(allExists).ToList();
|
||||||
if (measureDataList.Count() > 0)
|
if (measureDataList.Count() > 0)
|
||||||
|
|
@ -491,7 +493,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tableAnswerList.Count > 0)
|
if (stateIsNullList.Count > 0)
|
||||||
{
|
{
|
||||||
// 状态为空
|
// 状态为空
|
||||||
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
|
||||||
|
|
@ -500,7 +502,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
if (allExists.Count > 0)
|
if (allExists.Count > 0)
|
||||||
{
|
{
|
||||||
// 未做标记且状态为空
|
// 未做标记且状态为空
|
||||||
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', stateIsNullList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', allExists)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -482,25 +482,27 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
List<string> stateIsNullList = tableAnswerList.Select(x => x.OrderMark + x.RowIndex.GetLesionMark()).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
// 交集
|
||||||
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
|
List<string> allExists = measureDataList.Intersect(stateIsNullList).ToList();
|
||||||
|
// 差集
|
||||||
measureDataList = measureDataList.Except(allExists).ToList();
|
measureDataList = measureDataList.Except(allExists).ToList();
|
||||||
stateIsNullList = stateIsNullList.Except(allExists).ToList();
|
stateIsNullList = stateIsNullList.Except(allExists).ToList();
|
||||||
|
|
||||||
|
|
||||||
if (measureDataList.Count() > 0)
|
if (measureDataList.Count() > 0)
|
||||||
{
|
{
|
||||||
|
// 无标记
|
||||||
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stateIsNullList.Count > 0)
|
||||||
if (tableAnswerList.Count > 0)
|
|
||||||
{
|
{
|
||||||
|
// 状态为空
|
||||||
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
|
errorMassage += _localizer["ReadingCalculate_StatusIsEmpty", string.Join(',', stateIsNullList)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allExists.Count > 0)
|
if (allExists.Count > 0)
|
||||||
{
|
{
|
||||||
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', stateIsNullList)] + ",";
|
// 未做标记且状态为空
|
||||||
|
errorMassage += _localizer["ReadingCalculate_NoMarkerEmpty", string.Join(',', allExists)] + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ namespace IRaCIS.Core.Application;
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class TrialStatService(
|
public class TrialStatService(
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
|
IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository,
|
||||||
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<TrialDocument> _trialDocumentRepository,
|
IRepository<TrialDocument> _trialDocumentRepository,
|
||||||
|
|
@ -90,7 +91,7 @@ public class TrialStatService(
|
||||||
CheckQuestion_ClosedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
CheckQuestion_ClosedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
.Where(t => t.CheckChallengeState == CheckChanllengeTypeEnum.Closed).Count(),
|
.Where(t => t.CheckChallengeState == CheckChanllengeTypeEnum.Closed).Count(),
|
||||||
CheckQuestion_IngCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
CheckQuestion_IngCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
.Where(t => t.CheckChallengeState != CheckChanllengeTypeEnum.Closed).Count(),
|
.Where(t => t.CheckChallengeState == CheckChanllengeTypeEnum.CRCWaitPMReply || t.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count(),
|
||||||
|
|
||||||
|
|
||||||
MedicalReviewQuestion_ClosedCount = t.TaskMedicalReviewList.Where(t => inQuery.TrialSiteId != null ? t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId : true)
|
MedicalReviewQuestion_ClosedCount = t.TaskMedicalReviewList.Where(t => inQuery.TrialSiteId != null ? t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
|
|
@ -119,7 +120,7 @@ public class TrialStatService(
|
||||||
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
|
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
|
||||||
|
|
||||||
//每次查询必须是单标准的
|
//每次查询必须是单标准的
|
||||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionGroup, t.IsGlobalReading, t.IsArbitrationReading, t.IsOncologyReading, t.CriterionName, t.ArbitrationRule, t.TrialId }).FirstNotNullAsync();
|
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.Id, t.CriterionType, t.CriterionGroup, t.IsGlobalReading, t.IsArbitrationReading, t.IsOncologyReading, t.CriterionName, t.ArbitrationRule, t.TrialId }).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
if (criterion.CriterionGroup == CriterionGroup.Nontumorous)
|
if (criterion.CriterionGroup == CriterionGroup.Nontumorous)
|
||||||
|
|
@ -240,15 +241,18 @@ public class TrialStatService(
|
||||||
// 先把 resultList 转成内存字典
|
// 先把 resultList 转成内存字典
|
||||||
var resultDict = resultList.ToDictionary(r => r.OverallTumorEvaluation, r => r.SubjectCodeList);
|
var resultDict = resultList.ToDictionary(r => r.OverallTumorEvaluation, r => r.SubjectCodeList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 查询字典表,先把数据拉出来到内存,再合并
|
// 查询字典表,先把数据拉出来到内存,再合并
|
||||||
var translateList = _dictionaryRepository
|
var translateList = _readingTrialCriterionDictionaryRepository
|
||||||
.Where(t => t.Parent.Code == dicName)
|
.Where(t => t.ParentCode == dicName && t.CriterionId == criterion.Id)
|
||||||
.Select(t => new
|
.Select(t => new
|
||||||
{
|
{
|
||||||
t.Code,
|
t.Dictionary.Code,
|
||||||
t.Value,
|
t.Dictionary.Value,
|
||||||
})
|
})
|
||||||
.ToList()
|
.ToList()
|
||||||
|
.Where(t => t.Code != "-1")
|
||||||
.Select(t => new EfficacyEvaluationStatViewModel
|
.Select(t => new EfficacyEvaluationStatViewModel
|
||||||
{
|
{
|
||||||
DictionaryCode = dicName,
|
DictionaryCode = dicName,
|
||||||
|
|
@ -268,7 +272,7 @@ public class TrialStatService(
|
||||||
|
|
||||||
var pdInfo = translateList
|
var pdInfo = translateList
|
||||||
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "ICPD")
|
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "ICPD")
|
||||||
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PD")
|
.WhereIf(criterion.CriterionType == CriterionType.RECIST1Point1, t => t.OverallTumorEvaluation == "PD")
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
var firstPdList = new List<FirstPdInfo>();
|
var firstPdList = new List<FirstPdInfo>();
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ namespace IRaCIS.Core.Application.Services
|
||||||
IRepository<Subject> _subjectRepository,
|
IRepository<Subject> _subjectRepository,
|
||||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||||
IRepository<TaskStudy> _taskStudyRepository,
|
IRepository<TaskStudy> _taskStudyRepository,
|
||||||
|
IRepository<TaskSeries> _taskSeriesRepository,
|
||||||
|
IRepository<TaskInstance> _taskInstanceRepository,
|
||||||
IServiceProvider _serviceProvider,
|
IServiceProvider _serviceProvider,
|
||||||
IRepository<DicomSeries> _dicomSeriesRepository,
|
IRepository<DicomSeries> _dicomSeriesRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISubjectVisitService
|
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISubjectVisitService
|
||||||
|
|
@ -337,8 +339,10 @@ namespace IRaCIS.Core.Application.Services
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<DicomSeriesDTO> GetDicomSeriesInfo(GetDicomSeriesInfoInDto inDto)
|
public async Task<DicomSeriesDTO> GetDicomSeriesInfo(GetDicomSeriesInfoInDto inDto)
|
||||||
{
|
{
|
||||||
DicomSeriesDTO series = await _dicomSeriesRepository.Where(s => s.Id == inDto.SeriesId).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
DicomSeriesDTO? series = await _dicomSeriesRepository.Where(s => s.Id == inDto.SeriesId).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (series != null)
|
||||||
|
{
|
||||||
var instanceList = await _dicomInstanceRepository.Where(t => t.SeriesId == inDto.SeriesId)
|
var instanceList = await _dicomInstanceRepository.Where(t => t.SeriesId == inDto.SeriesId)
|
||||||
.Select(t => new { t.SeriesId, t.StudyId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.SliceLocation, t.FileSize }).ToListAsync();
|
.Select(t => new { t.SeriesId, t.StudyId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.SliceLocation, t.FileSize }).ToListAsync();
|
||||||
|
|
||||||
|
|
@ -355,11 +359,28 @@ namespace IRaCIS.Core.Application.Services
|
||||||
FileSize = k.FileSize
|
FileSize = k.FileSize
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
series = await _taskSeriesRepository .Where(s => s.Id == inDto.SeriesId).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var instanceList = await _taskInstanceRepository.Where(t => t.SeriesId == inDto.SeriesId)
|
||||||
|
.Select(t => new { t.SeriesId, t.StudyId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.SliceLocation, t.FileSize }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth;
|
series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k =>
|
||||||
//series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter;
|
new InstanceBasicInfo()
|
||||||
|
{
|
||||||
|
Id = k.Id,
|
||||||
|
NumberOfFrames = k.NumberOfFrames,
|
||||||
|
HtmlPath = k.HtmlPath,
|
||||||
|
Path = k.Path,
|
||||||
|
InstanceNumber = k.InstanceNumber,
|
||||||
|
FileSize = k.FileSize
|
||||||
|
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
return series;
|
return series;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3644,6 +3644,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
var entity = item.Entity as ReadingNoneDicomMarkBinding;
|
var entity = item.Entity as ReadingNoneDicomMarkBinding;
|
||||||
var selfDefineIdentification = string.Empty;
|
var selfDefineIdentification = string.Empty;
|
||||||
|
|
||||||
|
var answer = string.Empty;
|
||||||
|
Guid? questionId=Guid.Empty;
|
||||||
|
string tableQuestionName = string.Empty;
|
||||||
|
var rowMark= string.Empty;
|
||||||
|
if (entity.TableQuestionId == null)
|
||||||
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case "Add":
|
case "Add":
|
||||||
|
|
@ -3657,7 +3664,31 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var answer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).FirstOrDefault();
|
questionId = entity.QuestionId;
|
||||||
|
answer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(x => x.Entity as ReadingTaskQuestionAnswer).Select(x => x.Answer).FirstOrDefault();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case "Add":
|
||||||
|
selfDefineIdentification = "saveTableQuestionMark/-10/ReadingTableQuestionAnswer/Add/AddMark";
|
||||||
|
break;
|
||||||
|
case "Update":
|
||||||
|
selfDefineIdentification = "saveTableQuestionMark/-10/ReadingTableQuestionAnswer/Add/UpdateMark";
|
||||||
|
break;
|
||||||
|
case "Deleted":
|
||||||
|
selfDefineIdentification = "saveTableQuestionMark/-10/ReadingTableQuestionAnswer/Add/DeleteMark";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
questionId = entity.QuestionId;
|
||||||
|
tableQuestionName= _dbContext.ReadingTableQuestionTrial.Where(x => x.Id == entity.TableQuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefault();
|
||||||
|
answer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(x => x.Entity as ReadingTableQuestionAnswer).Select(x => x.Answer).FirstOrDefault();
|
||||||
|
rowMark= _dbContext.ReadingTableAnswerRowInfo.Where(x => x.Id == entity.RowId).Select(x => x.RowMark).FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var mark = entitys.Where(x => x.Entity.GetType() == typeof(ReadingNoneDicomMark)).Select(x => x.Entity as ReadingNoneDicomMark).FirstOrDefault();
|
var mark = entitys.Where(x => x.Entity.GetType() == typeof(ReadingNoneDicomMark)).Select(x => x.Entity as ReadingNoneDicomMark).FirstOrDefault();
|
||||||
if (mark == null)
|
if (mark == null)
|
||||||
|
|
@ -3668,13 +3699,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var QuestionName = string.Empty;
|
var QuestionName = string.Empty;
|
||||||
if (answer != null)
|
if (answer != null)
|
||||||
{
|
{
|
||||||
QuestionName= _dbContext.ReadingQuestionTrial.Where(x => x.Id == (answer.Entity as ReadingTaskQuestionAnswer).ReadingQuestionTrialId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefault();
|
QuestionName= _dbContext.ReadingQuestionTrial.Where(x => x.Id == questionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefault();
|
||||||
}
|
}
|
||||||
//var selfDefineIdentification = "ReadingImageTask/submitCustomTag/ReadingTaskQuestionMark/";
|
|
||||||
//if (type == "Deleted")
|
|
||||||
//{
|
|
||||||
// selfDefineIdentification = "ReadingImageTask/deleteCustomTag/ReadingTaskQuestionMark/";
|
|
||||||
//}
|
|
||||||
|
|
||||||
await InsertInspection<ReadingNoneDicomMarkBinding>(entity, type, x => new InspectionConvertDTO()
|
await InsertInspection<ReadingNoneDicomMarkBinding>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
|
|
@ -3682,10 +3708,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
|
RowMark= rowMark,
|
||||||
|
TableQuestionName = tableQuestionName,
|
||||||
MarkName = mark==null|| type== "Deleted" ? string.Empty: mark.OrderMarkName,
|
MarkName = mark==null|| type== "Deleted" ? string.Empty: mark.OrderMarkName,
|
||||||
PicturePath= mark == null ? string.Empty : mark.PicturePath,
|
PicturePath= mark == null ? string.Empty : mark.PicturePath,
|
||||||
QuestionName = QuestionName,
|
QuestionName = QuestionName,
|
||||||
QuestinonAnswer= answer==null?string.Empty:(answer.Entity as ReadingTaskQuestionAnswer).Answer
|
QuestinonAnswer= answer
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue