Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
86a3f1d2a5
|
|
@ -1073,6 +1073,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
[Comment("SPM 参与重阅审批")]
|
[Comment("SPM 参与重阅审批")]
|
||||||
public bool IsSPMJoinReReadingApproval { get; set; }
|
public bool IsSPMJoinReReadingApproval { get; set; }
|
||||||
|
|
||||||
|
public bool IsExternalViewTrialChart { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialConfigDTO : BasicTrialConfig
|
public class TrialConfigDTO : BasicTrialConfig
|
||||||
|
|
@ -1089,6 +1091,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
[Comment("SPM 参与重阅审批")]
|
[Comment("SPM 参与重阅审批")]
|
||||||
public bool IsSPMJoinReReadingApproval { get; set; }
|
public bool IsSPMJoinReReadingApproval { get; set; }
|
||||||
|
|
||||||
|
public bool IsExternalViewTrialChart { get; set; }
|
||||||
|
|
||||||
public List<string> ImageFormatList { get; set; }
|
public List<string> ImageFormatList { get; set; }
|
||||||
|
|
||||||
public List<Guid> TrialCriterionIds { get; set; } = new List<Guid>();
|
public List<Guid> TrialCriterionIds { get; set; } = new List<Guid>();
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,18 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double? MonthsDiff
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (DaysDiff.HasValue)
|
||||||
|
{
|
||||||
|
return Math.Round(DaysDiff.Value / 30.44, 2, MidpointRounding.AwayFromZero);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EfficacyEvaluationStatViewModel
|
public class EfficacyEvaluationStatViewModel
|
||||||
|
|
@ -125,7 +137,23 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public int SubjectCount => SubjectCodeList.Count();
|
public int SubjectCount => SubjectCodeList.Count();
|
||||||
|
|
||||||
public List<string> SubjectCodeList { get; set; }
|
public List<EfficacyEvaluationSubjectInfo> SubjectCodeList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class EfficacyEvaluationSubjectInfo
|
||||||
|
{
|
||||||
|
public string TrialSiteCode { get; set; }
|
||||||
|
|
||||||
|
public string SubjectCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialSiteOrrStat
|
||||||
|
{
|
||||||
|
public string TrialSiteCode { get; set; }
|
||||||
|
public int SiteSubjectCount { get; set; }
|
||||||
|
public int SiteCrPrSubjectCount { get; set; }
|
||||||
|
public string OrrPercent { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EfficacyEvaluationExport
|
public class EfficacyEvaluationExport
|
||||||
|
|
@ -140,6 +168,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public Guid SubjectId { get; set; }
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
public string TrialSiteCode { get; set; }
|
||||||
|
|
||||||
public string SubjectCode { get; set; } = String.Empty;
|
public string SubjectCode { get; set; } = String.Empty;
|
||||||
|
|
||||||
public decimal VisitTaskNum { get; set; }
|
public decimal VisitTaskNum { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public bool IsIQCAutoNextTask { get; set; }
|
public bool IsIQCAutoNextTask { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsExternalViewTrialChart { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1546,14 +1546,14 @@ namespace IRaCIS.Core.Application
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<TrialConfigInfo> GetTrialExtralConfig(Guid trialId)
|
public async Task<TrialConfigInfo> GetTrialExtralConfig(Guid trialId)
|
||||||
{
|
{
|
||||||
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr, t.TrialObjectNameList, t.CollectImagesEnum, t.IsIQCAutoNextTask }).FirstOrDefault();
|
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr,t.IsExternalViewTrialChart, t.TrialObjectNameList, t.CollectImagesEnum, t.IsIQCAutoNextTask }).FirstOrDefault();
|
||||||
|
|
||||||
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig();
|
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig();
|
||||||
|
|
||||||
var trialConfig = _mapper.Map<TrialConfigInfo>(extralConfig);
|
var trialConfig = _mapper.Map<TrialConfigInfo>(extralConfig);
|
||||||
|
|
||||||
trialConfig.TrialObjectNameList = extralObj.TrialObjectNameList;
|
trialConfig.TrialObjectNameList = extralObj.TrialObjectNameList;
|
||||||
|
trialConfig.IsExternalViewTrialChart = extralObj.IsExternalViewTrialChart;
|
||||||
trialConfig.CollectImagesEnum = extralObj.CollectImagesEnum;
|
trialConfig.CollectImagesEnum = extralObj.CollectImagesEnum;
|
||||||
trialConfig.IsIQCAutoNextTask = extralObj.IsIQCAutoNextTask;
|
trialConfig.IsIQCAutoNextTask = extralObj.IsIQCAutoNextTask;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -149,7 +150,7 @@ public class TrialStatService(
|
||||||
}
|
}
|
||||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||||
{
|
{
|
||||||
|
questionType = QuestionType.SiteVisitForTumorEvaluation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -162,6 +163,7 @@ public class TrialStatService(
|
||||||
{
|
{
|
||||||
Id = t.Id,
|
Id = t.Id,
|
||||||
SubjectId = t.SubjectId,
|
SubjectId = t.SubjectId,
|
||||||
|
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||||
SubjectCode = t.Subject.Code,
|
SubjectCode = t.Subject.Code,
|
||||||
VisitTaskNum = t.VisitTaskNum,
|
VisitTaskNum = t.VisitTaskNum,
|
||||||
TaskName = t.TaskName,
|
TaskName = t.TaskName,
|
||||||
|
|
@ -236,7 +238,7 @@ public class TrialStatService(
|
||||||
DictionaryCode = g.FirstOrDefault()?.DictionaryCode,
|
DictionaryCode = g.FirstOrDefault()?.DictionaryCode,
|
||||||
OverallTumorEvaluation = g.Key,
|
OverallTumorEvaluation = g.Key,
|
||||||
Code = g.Key,
|
Code = g.Key,
|
||||||
SubjectCodeList = g.Select(t => t.SubjectCode).Distinct().ToList()
|
SubjectCodeList = g.Select(t => new EfficacyEvaluationSubjectInfo { SubjectCode = t.SubjectCode, TrialSiteCode = t.TrialSiteCode }).Distinct().ToList()
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -254,27 +256,22 @@ public class TrialStatService(
|
||||||
t.Dictionary.Value,
|
t.Dictionary.Value,
|
||||||
})
|
})
|
||||||
.ToList()
|
.ToList()
|
||||||
.Where(t => t.Code != "-1")
|
.WhereIf(criterion.CriterionType != CriterionType.PCWG3, t => t.Code != "-1")
|
||||||
|
.WhereIf(criterion.CriterionType == CriterionType.PCWG3, t => t.Code != "5")
|
||||||
.Select(t => new EfficacyEvaluationStatViewModel
|
.Select(t => new EfficacyEvaluationStatViewModel
|
||||||
{
|
{
|
||||||
DictionaryCode = dicName,
|
DictionaryCode = dicName,
|
||||||
Code = t.Code, //方便找到首次PD的日期
|
Code = t.Code, //方便找到首次PD的日期
|
||||||
OverallTumorEvaluation = t.Value,//翻译后的值
|
OverallTumorEvaluation = t.Value,//翻译后的值
|
||||||
SubjectCodeList = resultDict.ContainsKey(t.Code) ? resultDict[t.Code] : new List<string>()
|
SubjectCodeList = resultDict.ContainsKey(t.Code) ? resultDict[t.Code] : new List<EfficacyEvaluationSubjectInfo>()
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
// (cr +pr) /总人数
|
|
||||||
|
|
||||||
var crAddPr = translateList.Where(t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR").Sum(t => t.SubjectCount);
|
|
||||||
|
|
||||||
var orrPercent = totalSubjectCount > 0
|
|
||||||
? ((decimal)crAddPr / totalSubjectCount * 100).ToString("0.00") + "%"
|
|
||||||
: "0.00%";
|
|
||||||
|
|
||||||
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.RECIST1Point1, t => t.OverallTumorEvaluation == "PD")
|
.WhereIf(criterion.CriterionType == CriterionType.Lugano2014, t => t.OverallTumorEvaluation == "PMD/PD")
|
||||||
|
.WhereIf(criterion.CriterionType != CriterionType.IRECIST1Point1 && criterion.CriterionType != CriterionType.Lugano2014, t => t.OverallTumorEvaluation == "PD")
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
var firstPdList = new List<FirstPdInfo>();
|
var firstPdList = new List<FirstPdInfo>();
|
||||||
|
|
@ -299,8 +296,58 @@ public class TrialStatService(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// (cr +pr) /总人数
|
||||||
|
|
||||||
return ResponseOutput.Ok(translateList, new { PDList = firstPdList, ORR = orrPercent });
|
var crAddPr = translateList
|
||||||
|
.WhereIf(criterion.CriterionType != CriterionType.Lugano2014 && criterion.CriterionType != CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR")
|
||||||
|
.WhereIf(criterion.CriterionType == CriterionType.Lugano2014, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR"
|
||||||
|
|| t.OverallTumorEvaluation == "PMR/PR" || t.OverallTumorEvaluation == "CMR/CR")
|
||||||
|
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR"
|
||||||
|
|| t.OverallTumorEvaluation == "iPR" || t.OverallTumorEvaluation == "iCR")
|
||||||
|
.Sum(t => t.SubjectCount);
|
||||||
|
|
||||||
|
var orrPercent = totalSubjectCount > 0
|
||||||
|
? ((decimal)crAddPr / totalSubjectCount * 100).ToString("0.00") + "%"
|
||||||
|
: "0.00%";
|
||||||
|
|
||||||
|
|
||||||
|
var centerOrrList = translateList
|
||||||
|
// 先把 Subject 拆平
|
||||||
|
.SelectMany(t => t.SubjectCodeList.Select(s => new
|
||||||
|
{
|
||||||
|
s.TrialSiteCode,
|
||||||
|
s.SubjectCode,
|
||||||
|
t.OverallTumorEvaluation
|
||||||
|
}))
|
||||||
|
// 按中心分组
|
||||||
|
.GroupBy(x => x.TrialSiteCode)
|
||||||
|
.Select(g =>
|
||||||
|
{
|
||||||
|
var total = g.Count();
|
||||||
|
|
||||||
|
var crPr = g
|
||||||
|
.WhereIf(criterion.CriterionType != CriterionType.Lugano2014 && criterion.CriterionType != CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR")
|
||||||
|
.WhereIf(criterion.CriterionType == CriterionType.Lugano2014, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR"
|
||||||
|
|| t.OverallTumorEvaluation == "PMR/PR" || t.OverallTumorEvaluation == "CMR/CR")
|
||||||
|
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR"
|
||||||
|
|| t.OverallTumorEvaluation == "iPR" || t.OverallTumorEvaluation == "iCR")
|
||||||
|
.Count();
|
||||||
|
|
||||||
|
|
||||||
|
return new TrialSiteOrrStat
|
||||||
|
{
|
||||||
|
TrialSiteCode = g.Key,
|
||||||
|
SiteSubjectCount = total,
|
||||||
|
SiteCrPrSubjectCount = crPr,
|
||||||
|
OrrPercent = total > 0
|
||||||
|
? ((decimal)crPr / total * 100).ToString("0.00") + "%"
|
||||||
|
: "0.00%"
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(translateList, new { PDList = firstPdList, ORR = orrPercent, SiteORRList = centerOrrList });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -289,9 +289,9 @@ namespace IRaCIS.Application.Contracts
|
||||||
public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; }
|
public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; }
|
||||||
|
|
||||||
//任务阅片状态
|
//任务阅片状态
|
||||||
public List<DoctorUserTask> ReadingTaskStateList { get; set; }
|
public List<DoctorUserTask> ReadingTaskStateList { get; set; } = new List<DoctorUserTask>();
|
||||||
|
|
||||||
public List<CriterionFile> CriterionFileList { get; set; }
|
public List<CriterionFile> CriterionFileList { get; set; } = new List<CriterionFile>();
|
||||||
|
|
||||||
|
|
||||||
public List<CriterionReadingCategory> CriterionCategoryList =>
|
public List<CriterionReadingCategory> CriterionCategoryList =>
|
||||||
|
|
|
||||||
|
|
@ -298,6 +298,9 @@ public partial class Trial : BaseFullDeleteAuditEntity
|
||||||
[Comment("SPM 参与重阅审批")]
|
[Comment("SPM 参与重阅审批")]
|
||||||
public bool IsSPMJoinReReadingApproval { get; set; }
|
public bool IsSPMJoinReReadingApproval { get; set; }
|
||||||
|
|
||||||
|
[Comment("外部人员 查看项目报表")]
|
||||||
|
public bool IsExternalViewTrialChart { get; set; }
|
||||||
|
|
||||||
[Comment("阅片任务产生之前 采集影像")]
|
[Comment("阅片任务产生之前 采集影像")]
|
||||||
public CollectImagesType CollectImagesEnum { get; set; }
|
public CollectImagesType CollectImagesEnum { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
21352
IRaCIS.Core.Infra.EFCore/Migrations/20260105061435_addTrialChart.Designer.cs
generated
Normal file
21352
IRaCIS.Core.Infra.EFCore/Migrations/20260105061435_addTrialChart.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,51 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addTrialChart : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsExternalViewTrialChart",
|
||||||
|
table: "Trial",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false,
|
||||||
|
comment: "外部人员 查看项目报表");
|
||||||
|
|
||||||
|
//migrationBuilder.CreateIndex(
|
||||||
|
// name: "IX_DicomInstance_TrialId",
|
||||||
|
// table: "DicomInstance",
|
||||||
|
// column: "TrialId");
|
||||||
|
|
||||||
|
//migrationBuilder.AddForeignKey(
|
||||||
|
// name: "FK_DicomInstance_Trial_TrialId",
|
||||||
|
// table: "DicomInstance",
|
||||||
|
// column: "TrialId",
|
||||||
|
// principalTable: "Trial",
|
||||||
|
// principalColumn: "Id",
|
||||||
|
// onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_DicomInstance_Trial_TrialId",
|
||||||
|
table: "DicomInstance");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_DicomInstance_TrialId",
|
||||||
|
table: "DicomInstance");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsExternalViewTrialChart",
|
||||||
|
table: "Trial");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1264,6 +1264,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.HasIndex("StudyId");
|
b.HasIndex("StudyId");
|
||||||
|
|
||||||
|
b.HasIndex("TrialId");
|
||||||
|
|
||||||
b.ToTable("DicomInstance", t =>
|
b.ToTable("DicomInstance", t =>
|
||||||
{
|
{
|
||||||
t.HasComment("归档 - Instance表");
|
t.HasComment("归档 - Instance表");
|
||||||
|
|
@ -11984,6 +11986,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("bit")
|
.HasColumnType("bit")
|
||||||
.HasComment("是否有 入组性确认");
|
.HasComment("是否有 入组性确认");
|
||||||
|
|
||||||
|
b.Property<bool>("IsExternalViewTrialChart")
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasComment("外部人员 查看项目报表");
|
||||||
|
|
||||||
b.Property<bool>("IsHaveFirstGiveMedicineDate")
|
b.Property<bool>("IsHaveFirstGiveMedicineDate")
|
||||||
.HasColumnType("bit")
|
.HasColumnType("bit")
|
||||||
.HasComment("是否 有基准时间(首次给药时间)");
|
.HasComment("是否 有基准时间(首次给药时间)");
|
||||||
|
|
@ -16551,11 +16557,19 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("TrialId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
b.Navigation("DicomSerie");
|
b.Navigation("DicomSerie");
|
||||||
|
|
||||||
b.Navigation("DicomStudy");
|
b.Navigation("DicomStudy");
|
||||||
|
|
||||||
|
b.Navigation("Trial");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomSeries", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomSeries", b =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue