Uat_Study
he 2022-12-08 15:59:29 +08:00
parent bea0811eb8
commit 422dadad36
8 changed files with 152 additions and 20 deletions

View File

@ -289,6 +289,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary> /// </summary>
public string CalculateQuestions { get; set; } = "[]"; public string CalculateQuestions { get; set; } = "[]";
/// <summary>
/// 限制编辑
/// </summary>
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
/// <summary> /// <summary>
/// 数值类型 /// 数值类型
/// </summary> /// </summary>
@ -863,6 +868,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary> /// </summary>
public string CalculateQuestions { get; set; } public string CalculateQuestions { get; set; }
/// <summary>
/// 限制编辑
/// </summary>
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
/// <summary> /// <summary>
/// 数据来源 /// 数据来源
/// </summary> /// </summary>
@ -1622,8 +1632,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary> /// </summary>
public string CalculateQuestions { get; set; } = "[]"; public string CalculateQuestions { get; set; } = "[]";
/// <summary>
/// 限制编辑
/// </summary>
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
public List<string> ParentTriggerValueList { get; set; } public List<string> ParentTriggerValueList { get; set; }
public List<string> RelevanceValueList { get; set; } public List<string> RelevanceValueList { get; set; }

View File

@ -354,7 +354,7 @@ namespace IRaCIS.Application.Services
[HttpPost] [HttpPost]
public async Task<(List<DicomReadingQuestionAnswer>, object)> GetDicomReadingQuestionAnswer(GetDicomReadingQuestionAnswerInDto inDto) public async Task<(List<DicomReadingQuestionAnswer>, object)> GetDicomReadingQuestionAnswer(GetDicomReadingQuestionAnswerInDto inDto)
{ {
await AddDefaultValueToTask(inDto.VisitTaskId); //await AddDefaultValueToTask(inDto.VisitTaskId);
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id); var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id);
@ -410,7 +410,9 @@ namespace IRaCIS.Application.Services
private void GetDicomReadingAnswer(DicomReadingQuestionAnswer item, List<DicomReadingQuestionAnswer> questions, List<ReadingTaskQuestionAnswer> answers) private void GetDicomReadingAnswer(DicomReadingQuestionAnswer item, List<DicomReadingQuestionAnswer> questions, List<ReadingTaskQuestionAnswer> answers)
{ {
item.Answer = answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty(); var answer= answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
item.Answer = answer.IsNullOrEmpty() ? item.DefaultValue : answer;
item.Childrens = questions.Where(x => x.ParentId == item.Id || ((item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName))).ToList(); item.Childrens = questions.Where(x => x.ParentId == item.Id || ((item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName))).ToList();
if (item.Childrens != null && item.Childrens.Count > 0) if (item.Childrens != null && item.Childrens.Count > 0)
@ -470,7 +472,7 @@ namespace IRaCIS.Application.Services
public async Task<(GetReadingQuestionAndAnswerOutDto, object)> GetReadingQuestionAndAnswer(GetReadingQuestionAndAnswerInDto inDto) public async Task<(GetReadingQuestionAndAnswerOutDto, object)> GetReadingQuestionAndAnswer(GetReadingQuestionAndAnswerInDto inDto)
{ {
await AddDefaultValueToTask(inDto.VisitTaskId); //await AddDefaultValueToTask(inDto.VisitTaskId);
var result = new GetReadingQuestionAndAnswerOutDto(); var result = new GetReadingQuestionAndAnswerOutDto();
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
@ -568,7 +570,8 @@ namespace IRaCIS.Application.Services
var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == taskId).ToListAsync(); var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == taskId).ToListAsync();
qusetionList.ForEach(x => qusetionList.ForEach(x =>
{ {
x.Answer = answers.Where(y => y.ReadingQuestionTrialId == x.Id).Select(x => x.Answer).FirstOrDefault() ?? string.Empty; var answer= answers.Where(y => y.ReadingQuestionTrialId == x.Id).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
x.Answer = answer.IsNullOrEmpty() ? x.DefaultValue : answer;
}); });
} }
@ -911,8 +914,17 @@ namespace IRaCIS.Application.Services
} }
var index = await _readingCalculateService.GetDeleteLesionStatrIndex(inDto); var index = await _readingCalculateService.GetDeleteLesionStatrIndex(inDto);
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.RowId == inDto.RowId);
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.Id == inDto.RowId);
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.RowId == inDto.RowId, x => new ReadingTableQuestionAnswer()
{
IsDeleted = true
});
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.RowId,x=>new ReadingTableAnswerRowInfo() {
IsDeleted=true
});
await _readingTableAnswerRowInfoRepository.SaveChangesAsync(); await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
@ -1025,7 +1037,9 @@ namespace IRaCIS.Application.Services
public async Task<SubmitTableQuestionOutDto> SubmitTableQuestion(SubmitTableQuestionInDto inDto) public async Task<SubmitTableQuestionOutDto> SubmitTableQuestion(SubmitTableQuestionInDto inDto)
{ {
SubmitTableQuestionOutDto result = new SubmitTableQuestionOutDto(); SubmitTableQuestionOutDto result = new SubmitTableQuestionOutDto();
await VerifyTaskIsSign(inDto.VisitTaskId); await VerifyTaskIsSign(inDto.VisitTaskId);
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync();
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync(); var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync();
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync(); var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync();
var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList(); var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList();
@ -1043,7 +1057,7 @@ namespace IRaCIS.Application.Services
if (inDto.RowIndex % 1 == 0) if (inDto.RowIndex % 1 == 0)
{ {
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync();
if (questionInfo.MaxQuestionCount != null && questionInfo.MaxQuestionCount != 0) if (questionInfo.MaxQuestionCount != null && questionInfo.MaxQuestionCount != 0)
{ {
if (questionInfo.MaxQuestionCount < if (questionInfo.MaxQuestionCount <
@ -1116,6 +1130,7 @@ namespace IRaCIS.Application.Services
rowInfo.InstanceId = inDto.InstanceId; rowInfo.InstanceId = inDto.InstanceId;
rowInfo.SeriesId = inDto.SeriesId; rowInfo.SeriesId = inDto.SeriesId;
rowInfo.VisitTaskId = inDto.VisitTaskId; rowInfo.VisitTaskId = inDto.VisitTaskId;
rowInfo.OrderMark = questionInfo.OrderMark;
rowInfo.StudyId = inDto.StudyId; rowInfo.StudyId = inDto.StudyId;
rowInfo.IsCanEditPosition = inDto.IsCanEditPosition; rowInfo.IsCanEditPosition = inDto.IsCanEditPosition;
result.RowId = rowInfo.Id; result.RowId = rowInfo.Id;

View File

@ -51,7 +51,7 @@ namespace IRaCIS.Application.Services
{ {
if (inDto.VisitTaskId != null) if (inDto.VisitTaskId != null)
{ {
await AddDefaultValueToTask(inDto.VisitTaskId.Value); //await AddDefaultValueToTask(inDto.VisitTaskId.Value);
} }
var result = new GetTrialReadingQuestionPageDto(); var result = new GetTrialReadingQuestionPageDto();

View File

@ -1180,6 +1180,29 @@ namespace IRaCIS.Core.Domain.Share
} }
/// <summary>
/// 限制编辑
/// </summary>
public enum LimitEdit
{
/// <summary>
/// 否
/// </summary>
None = 0,
/// <summary>
/// 仅基线
/// </summary>
OnlyBaseLine = 1,
/// <summary>
/// 仅随访
/// </summary>
OnlyVisit = 2
}
/// <summary> /// <summary>
/// 是否必填 /// 是否必填
/// </summary> /// </summary>

View File

@ -205,6 +205,11 @@ namespace IRaCIS.Core.Domain.Models
/// </summary> /// </summary>
public CustomCalculateMark? CustomCalculateMark { get; set; } public CustomCalculateMark? CustomCalculateMark { get; set; }
/// <summary>
/// 限制编辑
/// </summary>
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
/// <summary> /// <summary>
/// 自定义计算标记 /// 自定义计算标记
/// </summary> /// </summary>

View File

@ -165,6 +165,11 @@ namespace IRaCIS.Core.Domain.Models
/// </summary> /// </summary>
public CustomCalculateMark? CustomCalculateMark { get; set; } public CustomCalculateMark? CustomCalculateMark { get; set; }
/// <summary>
/// 限制编辑
/// </summary>
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
/// <summary> /// <summary>
/// 自定义计算标记 /// 自定义计算标记
/// </summary> /// </summary>

View File

@ -7,21 +7,23 @@ using System;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
///<summary> ///<summary>
/// 表格问题答案行数据 /// 表格问题答案行数据
///</summary> ///</summary>
[Table("ReadingTableAnswerRowInfo")] [Table("ReadingTableAnswerRowInfo")]
public class ReadingTableAnswerRowInfo : Entity, IAuditAdd public class ReadingTableAnswerRowInfo : Entity, IAuditAdd, IAuditUpdate, ISoftDelete
{ {
[JsonIgnore] [JsonIgnore]
[ForeignKey("InstanceId")] [ForeignKey("InstanceId")]
public DicomInstance Instance { get; set; } public DicomInstance Instance { get; set; }
/// <summary> /// <summary>
/// 第一层的Question /// 第一层的Question
/// </summary> /// </summary>
public Guid QuestionId { get; set; } public Guid QuestionId { get; set; }
/// <summary> /// <summary>
@ -93,6 +95,8 @@ namespace IRaCIS.Core.Domain.Models
public string BlindName { get; set; } = string.Empty; public string BlindName { get; set; } = string.Empty;
public string OrderMark { get; set; } = string.Empty;
/// <summary> /// <summary>
/// 第一次添加的任务ID /// 第一次添加的任务ID
/// </summary> /// </summary>
@ -106,6 +110,16 @@ namespace IRaCIS.Core.Domain.Models
/// </summary> /// </summary>
public Guid CreateUserId { get; set; } public Guid CreateUserId { get; set; }
public Guid UpdateUserId { get; set; }
//string UpdateUserName { get; set; }
public DateTime UpdateTime { get; set; }
public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; }
public Guid? DeleteUserId { get; set; }
[JsonIgnore] [JsonIgnore]
[ForeignKey("SplitRowId")] [ForeignKey("SplitRowId")]
public ReadingTableAnswerRowInfo SplitRow { get; set; } public ReadingTableAnswerRowInfo SplitRow { get; set; }
@ -117,10 +131,56 @@ namespace IRaCIS.Core.Domain.Models
public ReadingQuestionTrial ReadingQuestionTrial { get; set; } public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
public string RowMark
{
get
{
Dictionary<int, string> splitLesionDic = new Dictionary<int, string>()
{
{1, "a" },
{2, "b" },
{3, "c" },
{4, "d" },
{5, "e" },
{6, "f" },
{7, "g" },
{8, "h" },
{9, "i" },
{10, "j" },
{11, "k" },
{12, "l" },
{13, "m" },
{14, "n" },
{15, "o" },
{16, "p" },
{17, "q" },
{18, "r" },
{19, "s" },
{20, "t" },
{21, "u" },
{22, "v" },
{23, "w" },
{24, "x" },
{25, "y" },
{26, "z" },
};
if (RowIndex % 1 == 0)
{
return decimal.ToInt32(RowIndex).ToString().PadLeft(2, '0');
}
else
{
return Math.Floor(RowIndex).ToString().PadLeft(2, '0') + splitLesionDic[decimal.ToInt32((RowIndex % 1) * 100)];
}
}
}
}
}
} }

View File

@ -13,8 +13,8 @@ namespace IRaCIS.Core.Domain.Models
///ReadingTableQuestionAnswer ///ReadingTableQuestionAnswer
///</summary> ///</summary>
[Table("ReadingTableQuestionAnswer")] [Table("ReadingTableQuestionAnswer")]
public class ReadingTableQuestionAnswer : Entity, IAuditAdd public class ReadingTableQuestionAnswer : Entity, IAuditAdd, IAuditUpdate, ISoftDelete
{ {
/// <summary> /// <summary>
/// 问题Id /// 问题Id
/// </summary> /// </summary>
@ -63,7 +63,18 @@ namespace IRaCIS.Core.Domain.Models
public Guid RowId { get; set; } public Guid RowId { get; set; }
[JsonIgnore] public Guid UpdateUserId { get; set; }
//string UpdateUserName { get; set; }
public DateTime UpdateTime { get; set; }
public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; }
public Guid? DeleteUserId { get; set; }
[JsonIgnore]
[ForeignKey("QuestionId")] [ForeignKey("QuestionId")]
public ReadingQuestionTrial ReadingQuestionTrial { get; set; } public ReadingQuestionTrial ReadingQuestionTrial { get; set; }