代码修改
continuous-integration/drone/push Build is passing Details

Test_HIR_Net8
he 2025-09-26 10:49:49 +08:00
parent 9879625781
commit 1d38ee3f49
10 changed files with 19341 additions and 13 deletions

View File

@ -433,7 +433,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public string Answer { get; set; }
public string PCWGInterimAnswer { get; set; }
public string? PCWGInterimAnswer { get; set; }
/// <summary>
/// 问题名称

View File

@ -3356,14 +3356,14 @@ namespace IRaCIS.Core.Application.Service
// 如果是PCGW标准 则把中间答案赋值给正式答案
if (taskInfo.TrialReadingCriterion.CriterionType == CriterionType.PCWG3)
{
var answerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTask.TaskState==TaskState.Effect&& x.VisitTask.SubjectId == taskInfo.SubjectId && x.VisitTask.ArmEnum == taskInfo.ArmEnum && x.PCWGInterimAnswer != string.Empty).ToListAsync();
var answerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTask.TaskState==TaskState.Effect&& x.VisitTask.SubjectId == taskInfo.SubjectId && x.VisitTask.ArmEnum == taskInfo.ArmEnum && x.PCWGInterimAnswer != null).ToListAsync();
foreach (var item in answerList)
{
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x=>x.Id==item.Id, x => new ReadingTaskQuestionAnswer()
{
Answer = item.PCWGInterimAnswer,
PCWGInterimAnswer = string.Empty,
PCWGInterimAnswer = null,
});
}

View File

@ -227,7 +227,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
item.Answer = questionAnswers.Where(y => y.ReadingQuestionTrialId == item.QuestionId).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
item.PCWGInterimAnswer = questionAnswers.Where(y => y.ReadingQuestionTrialId == item.QuestionId).Select(x => x.PCWGInterimAnswer).FirstOrDefault() ?? string.Empty;
item.PCWGInterimAnswer = questionAnswers.Where(y => y.ReadingQuestionTrialId == item.QuestionId).Select(x => x.PCWGInterimAnswer).FirstOrDefault();
var thisItemRowInfo = rowInfoList.Where(x => x.QuestionId == item.QuestionId).ToList();
var thisItemTableQuestions = tableQuestion.Where(x => x.QuestionId == item.QuestionId).ToList();

View File

@ -362,7 +362,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
foreach (var item in answers)
{
item.Answer=item.PCWGInterimAnswer==string.Empty? item.Answer: item.PCWGInterimAnswer;
item.Answer=item.PCWGInterimAnswer==null? item.Answer: item.PCWGInterimAnswer;
}
}
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId))
@ -760,7 +760,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 只获取当前的 不会获取上一次临时修改的结果
foreach (var item in readingData.QuestionInfo)
{
if (item.PCWGInterimAnswer != string.Empty)
if (item.PCWGInterimAnswer != null)
{
item.Answer = item.PCWGInterimAnswer;
}
@ -780,7 +780,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 只获取当前的 不会获取上一次临时修改的结果
foreach (var item in readingData.QuestionInfo)
{
if (item.PCWGInterimAnswer != string.Empty)
if (item.PCWGInterimAnswer != null)
{
item.Answer = item.PCWGInterimAnswer;
}
@ -1181,7 +1181,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 只获取当前的 不会获取上一次临时修改的结果
foreach (var item in readingData.QuestionInfo)
{
if (item.PCWGInterimAnswer != string.Empty)
if (item.PCWGInterimAnswer != null)
{
item.Answer = item.PCWGInterimAnswer;
}
@ -1365,7 +1365,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 如果不是PD 需要把上一次的PD改为NoPD 这里去掉临时答案就是原始答案
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation, x => new ReadingTaskQuestionAnswer
{
PCWGInterimAnswer = string.Empty,
PCWGInterimAnswer = null,
});
}

View File

@ -38,5 +38,5 @@ public class ReadingTaskQuestionAnswer : BaseAddAuditEntity
/// <summary>
/// PCWG 临时Answer
/// </summary>
public string PCWGInterimAnswer { get; set; } = string.Empty;
public string? PCWGInterimAnswer { get; set; }
}

View File

@ -2933,7 +2933,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}).OrderBy(t => t.VisitTaskNum).ThenBy(t => t.ShowOrder).ToList();
if (questionAnswerList.Any(x => x.PCWGInterimAnswer != string.Empty))
if (questionAnswerList.Any(x => x.PCWGInterimAnswer != null))
{
var daysBetween = quesionList.Where(x => x.QuestionType == QuestionType.DaysBetween).FirstOrDefault();

View File

@ -53,7 +53,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
public string TaskName { get; set; }
public decimal? VisitTaskNum { get; set; }
public string Answer { get; set; }
public string PCWGInterimAnswer { get; set; }
public string? PCWGInterimAnswer { get; set; }
public string DictionaryCode { get; set; }
public Guid ReadingQuestionTrialId { get; set; }
public string QuestionName { get; set; }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class PCWGInterimAnswer : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "PCWGInterimAnswer",
table: "ReadingTaskQuestionAnswer",
type: "nvarchar(400)",
maxLength: 400,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(400)",
oldMaxLength: 400);
migrationBuilder.CreateIndex(
name: "IX_DicomSeries_SubjectVisitId",
table: "DicomSeries",
column: "SubjectVisitId");
migrationBuilder.CreateIndex(
name: "IX_DicomInstance_SubjectVisitId",
table: "DicomInstance",
column: "SubjectVisitId");
migrationBuilder.AddForeignKey(
name: "FK_DicomInstance_SubjectVisit_SubjectVisitId",
table: "DicomInstance",
column: "SubjectVisitId",
principalTable: "SubjectVisit",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DicomSeries_SubjectVisit_SubjectVisitId",
table: "DicomSeries",
column: "SubjectVisitId",
principalTable: "SubjectVisit",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DicomInstance_SubjectVisit_SubjectVisitId",
table: "DicomInstance");
migrationBuilder.DropForeignKey(
name: "FK_DicomSeries_SubjectVisit_SubjectVisitId",
table: "DicomSeries");
migrationBuilder.DropIndex(
name: "IX_DicomSeries_SubjectVisitId",
table: "DicomSeries");
migrationBuilder.DropIndex(
name: "IX_DicomInstance_SubjectVisitId",
table: "DicomInstance");
migrationBuilder.AlterColumn<string>(
name: "PCWGInterimAnswer",
table: "ReadingTaskQuestionAnswer",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(400)",
oldMaxLength: 400,
oldNullable: true);
}
}
}

View File

@ -1034,6 +1034,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.HasIndex("StudyId");
b.HasIndex("SubjectVisitId");
b.ToTable("DicomInstance", t =>
{
t.HasComment("归档 - Instance表");
@ -1193,6 +1195,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.HasIndex("StudyId");
b.HasIndex("SubjectVisitId");
b.ToTable("DicomSeries", t =>
{
t.HasComment("归档 - 序列表");
@ -7379,7 +7383,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasComment("全局阅片是否修改");
b.Property<string>("PCWGInterimAnswer")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
@ -14926,11 +14929,19 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("IRaCIS.Core.Domain.Models.SubjectVisit", "SubjectVisit")
.WithMany()
.HasForeignKey("SubjectVisitId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreateUserRole");
b.Navigation("DicomSerie");
b.Navigation("DicomStudy");
b.Navigation("SubjectVisit");
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomSeries", b =>
@ -14948,9 +14959,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("IRaCIS.Core.Domain.Models.SubjectVisit", "SubjectVisit")
.WithMany()
.HasForeignKey("SubjectVisitId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreateUserRole");
b.Navigation("DicomStudy");
b.Navigation("SubjectVisit");
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomStudy", b =>