Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
This commit is contained in:
@@ -64,7 +64,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
throw new BusinessValidationFailedException("解析Json文件配置出现问题:"+e.Message);
|
||||
//---解析Json文件配置出现问题
|
||||
throw new BusinessValidationFailedException(_localizer["SysMon_JsonConfig"]+e.Message);
|
||||
}
|
||||
|
||||
//默认存储的路径
|
||||
|
||||
@@ -954,7 +954,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
else
|
||||
{
|
||||
return ResponseOutput.NotOk("项目配置为单审,不满足SubmmitState:已提交 或者 AuditState:待审核/审核中, 不允许领取,请刷新界面");
|
||||
// ---项目配置为单审,不满足Submmit State:已提交 或者 Audit State:待审核/审核中, 不允许领取,请刷新界面
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSingleAudit"]);
|
||||
}
|
||||
}
|
||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit)
|
||||
@@ -2044,8 +2045,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
|
||||
|
||||
return ResponseOutput.NotOk("转发影像失败: " + e.Message);
|
||||
// --转发影像失败
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + e.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -330,7 +330,30 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public List<AdditionalQuestionAnswer> AnswerList { get; set; } = new List<AdditionalQuestionAnswer>();
|
||||
}
|
||||
|
||||
public class GetTaskAdditionalQuestionInDto
|
||||
public class GetManualListInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class GetManualListOutDto
|
||||
{
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Path
|
||||
/// </summary>
|
||||
public string Path { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
public class GetTaskAdditionalQuestionInDto
|
||||
{
|
||||
//public Guid TrialReadingCriterionId { get; set; }
|
||||
public Guid VisitTaskId { get; set; }
|
||||
@@ -447,10 +470,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// </summary>
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TrialId
|
||||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
/// <summary>
|
||||
/// 标记工具
|
||||
/// </summary>
|
||||
public string MarkTool { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// TrialId
|
||||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 首次添加任务ID
|
||||
@@ -1181,7 +1209,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public List<GlobalQuestionInfo> AgreeOrNot { get; set; }
|
||||
|
||||
public List<GlobalQuestionInfo> AfterQuestionList { get; set; }
|
||||
}
|
||||
|
||||
public List<LesionDto> LesionCountList { get; set; } = new List<LesionDto>();
|
||||
}
|
||||
|
||||
public class GetGlobalQuestionType
|
||||
{
|
||||
@@ -1357,7 +1387,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public string SubjectCode { get; set; }=String.Empty;
|
||||
|
||||
public ReadingCategory ReadingCategory { get; set; }
|
||||
public bool ExistsManual { get; set; }
|
||||
|
||||
public ReadingCategory ReadingCategory { get; set; }
|
||||
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
@@ -1694,7 +1726,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public string FromMark { get; set; } = string.Empty;
|
||||
|
||||
public decimal RowIndex { get; set; }
|
||||
/// <summary>
|
||||
/// 标记工具
|
||||
/// </summary>
|
||||
public string MarkTool { get; set; } = string.Empty;
|
||||
|
||||
public decimal RowIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 截图地址
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2023-05-08 15:20:44
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Collections.Generic;
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
/// <summary> UserWLTemplateView 列表视图模型 </summary>
|
||||
public class UserWLTemplateView
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string TemplateName { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public int WW { get; set; }
|
||||
public int WL { get; set; }
|
||||
public int ShowOrder { get; set; } = 0;
|
||||
public bool IsPitchOn { get; set; }
|
||||
}
|
||||
|
||||
///<summary>UserWLTemplateQuery 列表查询参数模型</summary>
|
||||
public class UserWLTemplateQuery
|
||||
{
|
||||
///<summary> TemplateName</summary>
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SetAutoCutNextTaskInDto
|
||||
{
|
||||
public bool AutoCutNextTask { get; set; }
|
||||
}
|
||||
|
||||
///<summary> UserWLTemplateAddOrEdit 列表查询参数模型</summary>
|
||||
public class UserWLTemplateAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public string TemplateName { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public int WW { get; set; }
|
||||
public int WL { get; set; }
|
||||
//public int ShowOrder { get; set; }
|
||||
//public bool IsPitchOn { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+8
-3
@@ -230,8 +230,13 @@ namespace IRaCIS.Application.Services
|
||||
VisitNum = x.SourceSubjectVisit.VisitNum,
|
||||
IsBaseLine = x.SourceSubjectVisit.IsBaseLine,
|
||||
VisitId = x.SourceSubjectVisitId.Value,
|
||||
//CrterionDictionaryGroup= x.CrterionDictionaryGroup,
|
||||
BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType!=GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder)
|
||||
LesionCountList=x.LesionList.GroupBy(y=>y.ReadingQuestionTrial.LesionType).Select(x => new LesionDto
|
||||
{
|
||||
LesionType = x.Key.Value,
|
||||
Count = x.ToList().Count()
|
||||
}).ToList(),
|
||||
//CrterionDictionaryGroup= x.CrterionDictionaryGroup,
|
||||
BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType!=GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder)
|
||||
.Select(y => new GlobalQuestionInfo()
|
||||
{
|
||||
|
||||
@@ -345,7 +350,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
result.TaskList.ForEach(x =>
|
||||
{
|
||||
x.AfterQuestionList = x.BeforeQuestionList.Where(x => x.IsJudgeQuestion)
|
||||
x.AfterQuestionList = x.BeforeQuestionList
|
||||
.GroupJoin(
|
||||
globalReadingQuestion
|
||||
, l => new { a = l.QuestionId, b = x.VisitTaskId }
|
||||
|
||||
+50
-14
@@ -42,7 +42,9 @@ namespace IRaCIS.Application.Services
|
||||
private readonly IRepository<ReadModule> _readModuleRepository;
|
||||
private readonly IRepository<DicomInstance> _dicomInstanceRepository;
|
||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||
private readonly IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository;
|
||||
private readonly IRepository<TrialDocument> _trialDocumentRepository;
|
||||
private readonly IRepository<User> _userRepository;
|
||||
private readonly IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository;
|
||||
private readonly IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository;
|
||||
private readonly IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository;
|
||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||
@@ -79,7 +81,9 @@ namespace IRaCIS.Application.Services
|
||||
IRepository<ReadModule> readModuleRepository,
|
||||
IRepository<DicomInstance> dicomInstanceRepository,
|
||||
IRepository<OrganInfo> organInfoRepository,
|
||||
IMemoryCache cache,
|
||||
IRepository<TrialDocument> trialDocumentRepository,
|
||||
IRepository<User> userRepository,
|
||||
IMemoryCache cache,
|
||||
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
||||
IRepository<ReadingTrialCriterionDictionary> readingTrialCriterionDictionaryRepository,
|
||||
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
|
||||
@@ -114,7 +118,9 @@ namespace IRaCIS.Application.Services
|
||||
this._readModuleRepository = readModuleRepository;
|
||||
this._dicomInstanceRepository = dicomInstanceRepository;
|
||||
this._organInfoRepository = organInfoRepository;
|
||||
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
||||
this._trialDocumentRepository = trialDocumentRepository;
|
||||
this._userRepository = userRepository;
|
||||
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
||||
this._tumorAssessmentRepository = tumorAssessmentRepository;
|
||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||
this._readingTableQuestionSystemRepository = readingTableQuestionSystemRepository;
|
||||
@@ -132,11 +138,33 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取任务附加问题
|
||||
/// 获取手册
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto)
|
||||
{
|
||||
UserTypeEnum userType = (UserTypeEnum)_userInfo.UserTypeEnumInt;
|
||||
//_userInfo.UserTypeId
|
||||
|
||||
return await _trialDocumentRepository.Where(x => x.TrialId == inDto.TrialId
|
||||
&&x.TrialDocConfirmedUserList.Any(y=>y.ConfirmUserId== _userInfo.Id)
|
||||
&& x.NeedConfirmedUserTypeList.Any(y => y.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.Select(x => new GetManualListOutDto()
|
||||
{
|
||||
Id=x.Id,
|
||||
Name = x.Name,
|
||||
Path = x.Path
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取任务附加问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<(List<TrialAdditionaQuestion>, bool)> GetTaskAdditionalQuestion(GetTaskAdditionalQuestionInDto inDto)
|
||||
{
|
||||
|
||||
@@ -1027,7 +1055,7 @@ namespace IRaCIS.Application.Services
|
||||
var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
|
||||
pageGroupList.ForEach(x =>
|
||||
{
|
||||
this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer);
|
||||
this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, inDto.TaskId);
|
||||
});
|
||||
|
||||
page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||
@@ -1044,7 +1072,7 @@ namespace IRaCIS.Application.Services
|
||||
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
|
||||
groupList.ForEach(x =>
|
||||
{
|
||||
this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer);
|
||||
this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, inDto.TaskId);
|
||||
});
|
||||
|
||||
groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||
@@ -1064,7 +1092,7 @@ namespace IRaCIS.Application.Services
|
||||
/// <param name="item"></param>
|
||||
/// <param name="questionlists"></param>
|
||||
/// <param name="tableQuestionLists"></param>
|
||||
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos, List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer,bool isFirstChangeTask, List<ReadingTableQuestionAnswer> lastTaskTableAnswer)
|
||||
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos, List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer,bool isFirstChangeTask, List<ReadingTableQuestionAnswer> lastTaskTableAnswer,Guid? TaskId)
|
||||
{
|
||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (x.GroupId == item.Id && x.ParentId == null)).ToList();
|
||||
item.TableQuestions = new TrialReadTableQuestion();
|
||||
@@ -1193,16 +1221,20 @@ namespace IRaCIS.Application.Services
|
||||
answers.Add("MeasureData", rowInfo == null ? string.Empty : rowInfo.MeasureData);
|
||||
answers.Add("RowIndex", x.ToString());
|
||||
answers.Add("RowId", rowInfo.Id.ToString());
|
||||
answers.Add("StudyId", rowInfo.StudyId.ToString());
|
||||
answers.Add("MarkTool", rowInfo.MarkTool);
|
||||
answers.Add("StudyId", rowInfo.StudyId.ToString());
|
||||
answers.Add("OrganInfoId", rowInfo.OrganInfoId.ToString());
|
||||
answers.Add("IsCanEditPosition", rowInfo.IsCanEditPosition.ToString());
|
||||
answers.Add("IsFristAdd", (rowInfo.FristAddTaskId== TaskId).ToString());
|
||||
answers.Add("IsCanEditPosition", rowInfo.IsCanEditPosition.ToString());
|
||||
answers.Add("InstanceId", rowInfo == null ? string.Empty : rowInfo.InstanceId.ToString());
|
||||
answers.Add("SeriesId", rowInfo == null ? string.Empty : rowInfo.SeriesId.ToString());
|
||||
answers.Add("IsCurrentTaskAdd", rowInfo == null ? false.ToString() : rowInfo.IsCurrentTaskAdd.ToString());
|
||||
answers.Add("SplitOrMergeLesionName", rowInfo.SplitName.IsNullOrEmpty() ? rowInfo.MergeName : rowInfo.SplitName);
|
||||
answers.Add("SplitOrMergeType", rowInfo.SplitOrMergeType == null ? string.Empty : ((int)rowInfo.SplitOrMergeType).ToString());
|
||||
answers.Add("LastTaskState", lastTaskTableAnswer.Where(n=>n.QuestionId== item.Id&&n.ReadingTableQuestionTrial.QuestionMark==QuestionMark.State&&n.RowIndex==x).Select(n=>n.Answer).FirstOrDefault()??string.Empty);
|
||||
if (rowInfo.LesionType == LesionType.BaselineLesions)
|
||||
answers.Add("LastTaskMajorAxis", lastTaskTableAnswer.Where(n => n.QuestionId == item.Id && n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis && n.RowIndex == x).Select(n => n.Answer).FirstOrDefault() ?? string.Empty);
|
||||
answers.Add("LastTaskShortAxis", lastTaskTableAnswer.Where(n => n.QuestionId == item.Id && n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis && n.RowIndex == x).Select(n => n.Answer).FirstOrDefault() ?? string.Empty);
|
||||
if (rowInfo.LesionType == LesionType.BaselineLesions)
|
||||
{
|
||||
answers.Add("BaseLineLesionNumber", baseLineTableAnswer.Where(n => n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.LesionNumber && n.RowIndex == rowInfo.RowIndex).Select(x => x.Answer).FirstIsNullReturnEmpty());
|
||||
}
|
||||
@@ -1215,7 +1247,7 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
item.Childrens.ForEach(x =>
|
||||
{
|
||||
this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer);
|
||||
this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, TaskId);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1848,7 +1880,8 @@ namespace IRaCIS.Application.Services
|
||||
rowInfo.IsDicomReading = inDto.IsDicomReading;
|
||||
rowInfo.IsCurrentTaskAdd = isCurrentTaskAdd;
|
||||
rowInfo.NumberOfFrames = inDto.NumberOfFrames;
|
||||
rowInfo.FristAddTaskNum = taskinfo.VisitTaskNum;
|
||||
rowInfo.MarkTool = inDto.MarkTool;
|
||||
rowInfo.FristAddTaskNum = taskinfo.VisitTaskNum;
|
||||
rowInfo.FristAddTaskId = inDto.VisitTaskId;
|
||||
rowInfo.PicturePath = inDto.PicturePath;
|
||||
rowInfo.RowIndex = inDto.RowIndex;
|
||||
@@ -1899,6 +1932,7 @@ namespace IRaCIS.Application.Services
|
||||
IsCurrentTaskAdd = isCurrentTaskAdd,
|
||||
WL = rowInfo.WL,
|
||||
WW = rowInfo.WW,
|
||||
MarkTool = inDto.MarkTool,
|
||||
OrganInfoId = rowInfo.OrganInfoId,
|
||||
PicturePath = rowInfo.PicturePath,
|
||||
NumberOfFrames = rowInfo.NumberOfFrames,
|
||||
@@ -1908,7 +1942,7 @@ namespace IRaCIS.Application.Services
|
||||
VisitTaskId = rowInfo.VisitTaskId,
|
||||
StudyId = rowInfo.StudyId,
|
||||
IsCanEditPosition = rowInfo.IsCanEditPosition,
|
||||
});
|
||||
}) ;
|
||||
|
||||
|
||||
foreach (var item in inDto.AnswerList)
|
||||
@@ -2329,7 +2363,9 @@ namespace IRaCIS.Application.Services
|
||||
task.IsConvertedTask = visitTaskInfo.IsConvertedTask;
|
||||
var blindSubjectCode = await _visitTaskRepository.Where(x => x.Id == task.VisitTaskId).Select(x => x.BlindSubjectCode).FirstNotNullAsync();
|
||||
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
||||
return task;
|
||||
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count() > 0;
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -72,11 +72,13 @@ namespace IRaCIS.Application.Services
|
||||
if (await _readingPeriodSetRepository.AnyAsync(x => x.Id != addOrEditReadingPeriodSet.Id && x.IsTakeEffect != ReadingPeriodStatus.Revocation
|
||||
&& x.TrialId == addOrEditReadingPeriodSet.TrialId && x.ReadingPeriodName == addOrEditReadingPeriodSet.ReadingPeriodName && x.TrialReadingCriterionId == addOrEditReadingPeriodSet.TrialReadingCriterionId))
|
||||
{
|
||||
return ResponseOutput.NotOk("阅片期名称重复,操作失败");
|
||||
//---阅片期名称重复,操作失败
|
||||
return ResponseOutput.NotOk(_localizer["ReadingPeriodSet_NameDup"]);
|
||||
}
|
||||
if (addOrEditReadingPeriodSet.ReadingPeriodName == "Global")
|
||||
{
|
||||
return ResponseOutput.NotOk("阅片期名称不能为Global");
|
||||
//---阅片期名称不能为Global
|
||||
return ResponseOutput.NotOk(_localizer["ReadingPeriodSet_Global"]);
|
||||
}
|
||||
if (addOrEditReadingPeriodSet.Id == null)
|
||||
{
|
||||
|
||||
@@ -281,7 +281,20 @@ namespace IRaCIS.Core.Application.Service
|
||||
MetaKey = false,
|
||||
Text= "Space",
|
||||
Code= "Space"
|
||||
}, };
|
||||
},
|
||||
new ShortcutKey (){
|
||||
|
||||
Keyboardkey= "m",
|
||||
ShortcutKeyEnum = 19,
|
||||
ImageToolType= 0,
|
||||
AltKey = false,
|
||||
CtrlKey = false,
|
||||
ShiftKey = false,
|
||||
MetaKey = false,
|
||||
Text= "M",
|
||||
Code= "KeyM"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
return shortcutKeys;
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2023-05-08 15:26:52
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户WL模板
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Reading")]
|
||||
public class UserWLTemplateService : BaseService
|
||||
{
|
||||
|
||||
private readonly IRepository<UserWLTemplate> _userWLTemplateRepository;
|
||||
private readonly IRepository<User> _userRepository;
|
||||
|
||||
public UserWLTemplateService(IRepository<UserWLTemplate> userWLTemplateRepository,
|
||||
IRepository<User> userRepository
|
||||
)
|
||||
{
|
||||
_userWLTemplateRepository = userWLTemplateRepository;
|
||||
this._userRepository = userRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取模板
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<UserWLTemplateView>> GetUserWLTemplateList(UserWLTemplateQuery inQuery)
|
||||
{
|
||||
var userWLTemplateQueryable = _userWLTemplateRepository
|
||||
.Where(x=>x.UserId==_userInfo.Id)
|
||||
.ProjectTo<UserWLTemplateView>(_mapper.ConfigurationProvider);
|
||||
return await userWLTemplateQueryable.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增修改模板
|
||||
/// </summary>
|
||||
/// <param name="addOrEditUserWLTemplate"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate)
|
||||
{
|
||||
addOrEditUserWLTemplate.UserId = _userInfo.Id;
|
||||
var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除模板
|
||||
/// </summary>
|
||||
/// <param name="userWLTemplateId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{userWLTemplateId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteUserWLTemplate(Guid userWLTemplateId)
|
||||
{
|
||||
var success = await _userWLTemplateRepository.DeleteFromQueryAsync(t => t.Id == userWLTemplateId, true);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取自动切换任务配置
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<object> GetAutoCutNextTask()
|
||||
{
|
||||
|
||||
return await _userRepository.Where(x=>x.Id==_userInfo.Id).Select(x => new
|
||||
{
|
||||
AutoCutNextTask = x.AutoCutNextTask
|
||||
}).FirstNotNullAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置自动切换任务
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SetAutoCutNextTask(SetAutoCutNextTaskInDto inDto)
|
||||
{
|
||||
await _userRepository.UpdatePartialNowNoQueryAsync(_userInfo.Id, x => new User()
|
||||
{
|
||||
|
||||
AutoCutNextTask = inDto.AutoCutNextTask
|
||||
});
|
||||
|
||||
await _userRepository.SaveChangesAsync ();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<VisitTask, VisitTaskDto>();
|
||||
CreateMap<ShortcutKey, DefaultShortcutKeyView>();
|
||||
|
||||
CreateMap<ReadingPeriodSetAddOrEdit, ReadingPeriodSet>();
|
||||
|
||||
CreateMap<UserWLTemplate, UserWLTemplateView>();
|
||||
CreateMap<UserWLTemplate,UserWLTemplateAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<ReadingPeriodSetAddOrEdit, ReadingPeriodSet>();
|
||||
|
||||
CreateMap<AddOrUpdateTumorAssessmentInDto, TumorAssessment_RECIST1Point1>();
|
||||
|
||||
|
||||
+28
-18
@@ -535,10 +535,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
//整体肿瘤评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetTumor,IsConvertedTask=false},
|
||||
|
||||
|
||||
// 转化时整体肿瘤评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetConvertingTumor,IsConvertedTask=true,IsBeTransforming=true},
|
||||
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetConvertingTumor,IsConvertedTask=true,IsBeTransforming=true},
|
||||
|
||||
//IRECIST整体肿瘤评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetIRECSITTargetLesionEvaluate,IsConvertedTask=true},
|
||||
@@ -581,7 +579,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
QuestionType.NewLesions,
|
||||
QuestionType.Tumor,
|
||||
QuestionType.ExistDisease,
|
||||
};
|
||||
QuestionType.NewTargetLesion,
|
||||
QuestionType.NewNoTargetLesion,
|
||||
QuestionType.OtherNewTargetLesion,
|
||||
QuestionType.IRECISTNewTargetLesion,
|
||||
QuestionType.NewLesionEvaluation,
|
||||
};
|
||||
|
||||
// 没有靶病灶就删除其他几个答案的值
|
||||
var isNeedDeleteTypes = calculateList.Where(x => !questionTypes.Contains(x.QuestionType)).Select(x => x.QuestionType).ToList();
|
||||
@@ -783,9 +786,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.Answer == TargetState.UnableEvaluate.GetEnumInt()
|
||||
var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId
|
||||
&& x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State
|
||||
)
|
||||
).Where(x =>
|
||||
(x.ReadingQuestionTrial.LesionType==LesionType.TargetLesion && x.Answer == TargetState.UnableEvaluate.GetEnumInt())
|
||||
|| (x.ReadingQuestionTrial.LesionType == LesionType.NewLesions && x.Answer == NewTargetLesionState.NotEvaluable.GetEnumInt())
|
||||
|| (x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions && x.Answer == NoTargetState.UnableEvaluate.GetEnumInt())
|
||||
|| (x.ReadingQuestionTrial.LesionType == LesionType.NewTargetLesion && x.Answer == NewTargetLesionState.NotEvaluable.GetEnumInt())
|
||||
|| (x.ReadingQuestionTrial.LesionType == LesionType.NewNonTargetLesion && x.Answer == NewNoTargetLesionState.NotEvaluable.GetEnumInt())
|
||||
|| (x.ReadingQuestionTrial.LesionType == LesionType.OtherPreviousNewLesion && x.Answer == OtherPreviousNewLesionState.NotEvaluable.GetEnumInt())
|
||||
|| (x.ReadingQuestionTrial.LesionType == LesionType.TriggeringIRECSIT && x.Answer == NewLesionAfterTriggeringiRECSITState.NotEvaluable.GetEnumInt())
|
||||
)
|
||||
.Select(x => x.RowId).Distinct().ToListAsync();
|
||||
|
||||
|
||||
@@ -818,7 +829,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
|
||||
if (errorMassage != string.Empty)
|
||||
{
|
||||
errorMassage = _localizer["ReadingCalculate_Questionable"] + errorMassage;
|
||||
throw new BusinessValidationFailedException(errorMassage);
|
||||
}
|
||||
|
||||
@@ -1807,7 +1817,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
/// {
|
||||
/// 非靶病灶疗效为 iCPD
|
||||
/// }
|
||||
/// else if (满足RECIST1.1的PD标准 && 任一非靶病灶状态评估为“显著增大(iUPD)”)
|
||||
/// else if (任一非靶病灶状态评估为“显著增大(iUPD)”)
|
||||
/// {
|
||||
/// 非靶病灶疗效为 iUPD
|
||||
/// }
|
||||
@@ -1893,8 +1903,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
// 非靶病灶疗效为 iCPD
|
||||
result = NoTargetAssessment.iCPD;
|
||||
}
|
||||
// else if (满足RECIST1.1的PD标准 && 任一非靶病灶状态评估为“显著增大(iUPD)”)
|
||||
else if (data.RECISTPD && data.ExistiUPD)
|
||||
// else if ( 任一非靶病灶状态评估为“显著增大(iUPD)”)
|
||||
else if ( data.ExistiUPD)
|
||||
{
|
||||
// 非靶病灶疗效为 iUPD
|
||||
result = NoTargetAssessment.iUPD;
|
||||
@@ -1960,7 +1970,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
}
|
||||
var lastVisitTaskId = await GetLastVisitTaskId(inDto);
|
||||
var newTargetLesionQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewTargetLesion).Select(x => x.QuestionId).FirstOrDefault();
|
||||
var sodQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SOD).Select(x => x.QuestionId).FirstOrDefault();
|
||||
var isodQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ISOD).Select(x => x.QuestionId).FirstOrDefault();
|
||||
IRECISTNewTargetLesionDto data = new IRECISTNewTargetLesionDto()
|
||||
{
|
||||
// 不存在新靶病灶
|
||||
@@ -1974,14 +1984,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
.Select(x => x.Answer).FirstOrDefaultAsync()) ?? string.Empty,
|
||||
|
||||
//SOD增加5mm以上
|
||||
ISODAdd5mm = await GetSODData(inDto) - (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastVisitTaskId && x.ReadingQuestionTrialId == sodQuestionId)
|
||||
ISODAdd5mm = await GetiSODData(inDto) - (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastVisitTaskId && x.ReadingQuestionTrialId == isodQuestionId)
|
||||
.Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0() >= 5,
|
||||
|
||||
//有"存在"状态的新靶病灶
|
||||
HaveExixtsState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)),
|
||||
|
||||
// 至少有一个新靶病无法评估
|
||||
ExixtsUnevaluableState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)),
|
||||
ExixtsUnevaluableState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.NotEvaluable)),
|
||||
|
||||
};
|
||||
|
||||
@@ -1991,7 +2001,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
data.AllVanish = data.AllVanish && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Loss));
|
||||
}
|
||||
|
||||
NewTargetLesionAssessment result = NewTargetLesionAssessment.NE;
|
||||
NewTargetLesionAssessment result = NewTargetLesionAssessment.ND;
|
||||
|
||||
// if(所有新靶病灶消失或一直不存在任何新靶病灶)
|
||||
if(data.NotExistsNewTargetLesion||data.AllVanish)
|
||||
@@ -2021,7 +2031,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
else if (data.ExixtsUnevaluableState)
|
||||
{
|
||||
// 疗效为 NE
|
||||
result = NewTargetLesionAssessment.iUPD;
|
||||
result = NewTargetLesionAssessment.NE;
|
||||
}
|
||||
|
||||
return result.GetEnumInt();
|
||||
@@ -2088,7 +2098,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
ExixtsUnevaluableState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewNoTargetLesionState.NotEvaluable)),
|
||||
};
|
||||
|
||||
NewNoTargetLesionAssessment result = NewNoTargetLesionAssessment.NE;
|
||||
NewNoTargetLesionAssessment result = NewNoTargetLesionAssessment.ND;
|
||||
|
||||
// if(所有新非靶病灶消失或一直不存在任何新非靶病灶时评估为该结果)
|
||||
if(data.NotExistsNewNoTargetLesion|| data.AllVanish)
|
||||
@@ -2181,7 +2191,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
|
||||
};
|
||||
|
||||
OtherPreviousNewLesionAssessment result = OtherPreviousNewLesionAssessment.Equivocal;
|
||||
OtherPreviousNewLesionAssessment result = OtherPreviousNewLesionAssessment.ND;
|
||||
|
||||
// if(有其它既往新病灶消失或一直不存在任何其它既往新病灶)
|
||||
if (data.NotExistsOtherNewTargetLesion || data.AllVanish)
|
||||
@@ -2403,7 +2413,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iUPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.iUPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.iUPD))
|
||||
|| lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes))
|
||||
)
|
||||
{
|
||||
// 疗效为 iUPD
|
||||
|
||||
@@ -110,8 +110,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide).ToListAsync();
|
||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||
result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto
|
||||
{
|
||||
LesionType = x.Key.Value,
|
||||
Count = x.ToList().Count()
|
||||
}).ToList();
|
||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||
|
||||
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||
|
||||
@@ -442,7 +442,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
if (await _trialSiteSurveyRepository.AnyAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.PMCreatedAndLock))
|
||||
{
|
||||
return ResponseOutput.NotOk("中心调研表已锁定,不允许操作");
|
||||
//---中心调研已锁定,不允许操作。
|
||||
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]);
|
||||
}
|
||||
|
||||
var success = await _trialSiteSurveyRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialSiteSurveyId);
|
||||
@@ -561,7 +562,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
if (await _repository.AnyAsync<TrialSiteSurvey>(t => t.State == TrialSiteSurveyEnum.PMCreatedAndLock && t.Id == trialSiteSurveyId))
|
||||
{
|
||||
return ResponseOutput.NotOk("中心调研表已锁定,不允许操作。");
|
||||
//---中心调研已锁定,不允许操作。
|
||||
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]);
|
||||
}
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)
|
||||
@@ -668,7 +670,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
if (await _repository.AnyAsync<TrialSiteSurvey>(t => t.State == TrialSiteSurveyEnum.PMCreatedAndLock && t.Id == trialSiteSurveyId))
|
||||
{
|
||||
return ResponseOutput.NotOk("中心调研表已锁定,不允许操作。");
|
||||
//---中心调研已锁定,不允许操作。
|
||||
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]);
|
||||
}
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)
|
||||
|
||||
@@ -624,7 +624,8 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
if (inDto.TrialCriterionAdditionalAssessmentTypeList.All(t => t.IsSelected != true))
|
||||
{
|
||||
throw new BusinessValidationFailedException("选择了附加评估,必须勾选附加评估类型");
|
||||
//---选择了附加评估,必须勾选附加评估类型
|
||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_AddEvalReq"]);
|
||||
}
|
||||
|
||||
var trialId = _readingQuestionTrialRepository.Where(t => t.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).Select(t => t.TrialId).FirstOrDefault();
|
||||
|
||||
@@ -184,7 +184,8 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
if (await _repository.AnyAsync<TrialSiteUser>(t => t.UserId == trialUser.UserId && t.TrialId == trialUser.TrialId))
|
||||
{
|
||||
return ResponseOutput.NotOk("Participant has participated in site maintenance");
|
||||
// ----人员已加入现场维护
|
||||
return ResponseOutput.NotOk(_localizer["TrialMaint_PersonnelJoined"]);
|
||||
}
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC)
|
||||
|
||||
@@ -111,7 +111,8 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
if (!await _trialRepository.Where(t => t.Id == visitPlan.TrialId).IgnoreQueryFilters().AnyAsync(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing || t.TrialStatusStr == StaticData.TrialState.TrialInitializing))
|
||||
{
|
||||
throw new BusinessValidationFailedException("只有当项目状态为:初始化或进行中时,可以操作。 ");
|
||||
//---只有当项目状态为:初始化或进行中时,可以操作。
|
||||
throw new BusinessValidationFailedException(_localizer["VisitPlan_OnlyInitOrOngoing"]);
|
||||
}
|
||||
|
||||
var visitPlanList = await _visitStageRepository.Where(t => t.TrialId == visitPlan.TrialId, ignoreQueryFilters: true)
|
||||
|
||||
Reference in New Issue
Block a user