添加PCWG临时答案
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
bab20666af
commit
359a6bf602
|
|
@ -1855,7 +1855,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
await _readingTaskQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.ReadingQuestionTrialId == item.QuestionId && x.VisitTaskId == item.VisitTaskId, x => new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = item.Answer
|
||||
PCWGInterimAnswer = item.Answer
|
||||
});
|
||||
}
|
||||
else
|
||||
|
|
@ -1863,7 +1863,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
await _readingTaskQuestionAnswerRepository.AddAsync(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
VisitTaskId= item.VisitTaskId,
|
||||
Answer= item.Answer,
|
||||
PCWGInterimAnswer = item.Answer,
|
||||
ReadingQuestionTrialId= item.QuestionId,
|
||||
});
|
||||
}
|
||||
|
|
@ -3351,6 +3351,23 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <returns></returns>
|
||||
private async Task SubmitTaskChangeState(Guid visitTaskId)
|
||||
{
|
||||
|
||||
var taskInfo=await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x=>x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
// 如果是PCGW标准 则把中间答案赋值给正式答案
|
||||
if (taskInfo.TrialReadingCriterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
var answerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTask.SubjectId == taskInfo.SubjectId && x.VisitTask.ArmEnum == taskInfo.ArmEnum && x.PCWGInterimAnswer != string.Empty).ToListAsync();
|
||||
|
||||
foreach (var item in answerList)
|
||||
{
|
||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x=>x.Id==item.Id, x => new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = item.PCWGInterimAnswer,
|
||||
PCWGInterimAnswer = string.Empty,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
await VerifyTaskIsSign(visitTaskId);
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(visitTaskId, x => new VisitTask()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -353,6 +353,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId))
|
||||
.Where(x => x.ReadingQuestionTrialId != questionNewLesions.Id || x.VisitTaskId == visitTaskInfo.Id)
|
||||
.ToListAsync();
|
||||
|
||||
if (visitTaskInfo.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
{
|
||||
foreach (var item in answers)
|
||||
{
|
||||
item.Answer=item.PCWGInterimAnswer==string.Empty? item.Answer: item.PCWGInterimAnswer;
|
||||
}
|
||||
}
|
||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId))
|
||||
.Where(x => x.QuestionId != questionNewLesions.Id || x.VisitTaskId == visitTaskInfo.Id)
|
||||
.ToListAsync();
|
||||
|
|
@ -1159,7 +1167,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
var visitForTumorEvaluationQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation).Select(x => x.QuestionId).FirstOrDefault();
|
||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == visitForTumorEvaluationQuestionId, x => new ReadingTaskQuestionAnswer
|
||||
{
|
||||
Answer = VisitTumorEvaluation.PD.GetEnumInt(),
|
||||
PCWGInterimAnswer = VisitTumorEvaluation.PD.GetEnumInt(),
|
||||
});
|
||||
isPDResult = true;
|
||||
}
|
||||
|
|
@ -1167,6 +1175,26 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!isPDResult)
|
||||
{
|
||||
if (lastTask != null)
|
||||
{
|
||||
// 如果不是PD 需要把上一次的PD改为NoPD
|
||||
var visitForTumorEvaluationQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation).Select(x => x.QuestionId).FirstOrDefault();
|
||||
|
||||
var lastAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == visitForTumorEvaluationQuestionId).FirstOrDefaultAsync();
|
||||
if (lastAnswer != null)
|
||||
{
|
||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.Id == lastAnswer.Id, x => new ReadingTaskQuestionAnswer
|
||||
{
|
||||
PCWGInterimAnswer = string.Empty,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return isPDResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,4 +34,9 @@ public class ReadingTaskQuestionAnswer : BaseAddAuditEntity
|
|||
public string GlobalChangeAnswer { get; set; } = string.Empty;
|
||||
[Comment("全局阅片是否修改")]
|
||||
public bool IsGlobalChange { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// PCWG 临时Answer
|
||||
/// </summary>
|
||||
public string PCWGInterimAnswer { get; set; } = string.Empty;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2922,6 +2922,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
TaskName = taskList.FirstOrDefault(k => k.Id == t.VisitTaskId)?.TaskName,
|
||||
VisitTaskNum = taskList.FirstOrDefault(k => k.Id == t.VisitTaskId)?.VisitTaskNum,
|
||||
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||
PCWGInterimAnswer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.PCWGInterimAnswer),
|
||||
u.DictionaryCode,
|
||||
u.QuestionName,
|
||||
u.QuestionEnName,
|
||||
|
|
|
|||
19201
IRaCIS.Core.Infra.EFCore/Migrations/20250915081539_PCWGFinalAnswer.Designer.cs
generated
Normal file
19201
IRaCIS.Core.Infra.EFCore/Migrations/20250915081539_PCWGFinalAnswer.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,30 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class PCWGFinalAnswer : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PCWGInterimAnswer",
|
||||
table: "ReadingTaskQuestionAnswer",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PCWGInterimAnswer",
|
||||
table: "ReadingTaskQuestionAnswer");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7378,6 +7378,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
.HasColumnType("bit")
|
||||
.HasComment("全局阅片是否修改");
|
||||
|
||||
b.Property<string>("PCWGInterimAnswer")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<Guid>("ReadingQuestionCriterionTrialId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasComment("项目问题标准Id");
|
||||
|
|
|
|||
Loading…
Reference in New Issue