diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index c075e736f..d0898bfe9 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -1704,6 +1704,16 @@
序号标记
+
+
+ 数值类型
+
+
+
+
+ 单位
+
+
序号标记
@@ -2334,6 +2344,16 @@
问题标识
+
+
+ 数值类型
+
+
+
+
+ 单位
+
+
阅片人是否认同
@@ -6011,9 +6031,9 @@
项目问题集合
-
+
- 项目ID
+ 项目标准ID
@@ -6056,7 +6076,7 @@
修约小数点
-
+
项目标准ID
@@ -6685,6 +6705,12 @@
+
+
+ 获取项目已经确认的标准
+
+
+
阅片信息签名
@@ -6692,7 +6718,7 @@
-
+
获取项目阅片信息
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs
index 39fb31500..65f8437a4 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs
@@ -162,7 +162,7 @@ namespace IRaCIS.Core.Application.ViewModel
public class SynchronizeSystemOrganToTrialInDto
{
- public Guid TrialCriterionId { get; set; }
+ public Guid TrialReadingCriterionId { get; set; }
@@ -177,7 +177,9 @@ namespace IRaCIS.Core.Application.ViewModel
}
public class GetTrialOrganListInDto
{
- public Guid TrialReadingCriterionId { get; set; }
+ public Guid? TrialReadingCriterionId { get; set; }
+
+ public Guid? VisitTaskId { get; set; }
public OrganType? OrganType { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
index e86e9acae..e9e91dcc6 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
@@ -311,13 +311,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class SynchronizeCriterionInDto
{
[NotDefault]
- public Guid TrialCriterionId { get; set; }
+ public Guid TrialReadingCriterionId { get; set; }
}
public class VerifyeCriterionNeedSynchronizeInDto
{
[NotDefault]
- public Guid TrialId { get; set; }
+ public Guid TrialReadingCriterionId { get; set; }
}
public class GetTrialJudgyInfoInDto
{
diff --git a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs
index 5aa92c3b6..e015a5e0f 100644
--- a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs
@@ -24,6 +24,7 @@ namespace IRaCIS.Core.Application.Service
private readonly IRepository _organInfoRepository;
private readonly IRepository _dictionaryRepository;
+ private readonly IRepository _visitTaskRepository;
private readonly IRepository _organTrialInfoRepository;
private readonly IRepository _readingQuestionCriterionTrial;
private readonly IRepository _criterionNidusRepository;
@@ -31,7 +32,7 @@ namespace IRaCIS.Core.Application.Service
public OrganInfoService(
IRepository organInfoRepository,
IRepository dictionaryRepository,
-
+ IRepository visitTaskRepository,
IRepository organTrialInfoRepository,
IRepository readingQuestionCriterionTrial,
IRepository criterionNidusRepository
@@ -39,6 +40,7 @@ namespace IRaCIS.Core.Application.Service
{
_organInfoRepository = organInfoRepository;
this._dictionaryRepository = dictionaryRepository;
+ this._visitTaskRepository = visitTaskRepository;
this._organTrialInfoRepository = organTrialInfoRepository;
this._readingQuestionCriterionTrial = readingQuestionCriterionTrial;
this._criterionNidusRepository = criterionNidusRepository;
@@ -233,6 +235,12 @@ namespace IRaCIS.Core.Application.Service
List organs = new List();
+ if (inDto.TrialReadingCriterionId == null)
+ {
+ inDto.TrialReadingCriterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync();
+ }
+
+
if (inDto.LesionType != null)
{
var criterion = await _readingQuestionCriterionTrial.Where(x => x.Id==inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
@@ -310,7 +318,7 @@ namespace IRaCIS.Core.Application.Service
public async Task SynchronizeSystemOrganToTrial(SynchronizeSystemOrganToTrialInDto inDto)
{
// 选中的标准进行修改
- var readingQuestionCriterionTrial = await _readingQuestionCriterionTrial.Where(x => x.Id==inDto.TrialCriterionId).FirstOrDefaultAsync();
+ var readingQuestionCriterionTrial = await _readingQuestionCriterionTrial.Where(x => x.Id==inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
if (readingQuestionCriterionTrial != null)
{
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
index 7701dd7e4..77ff8d1f0 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
@@ -921,11 +921,8 @@ namespace IRaCIS.Application.Services
throw new BusinessValidationFailedException("当前任务不是肿瘤学任务");
}
- var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == taskInfo.TrialId && x.IsConfirm).FirstOrDefaultAsync();
- if (trialCriterion == null)
- {
- throw new BusinessValidationFailedException("请先确认一个项目标准。");
- }
+ var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id== taskInfo.TrialReadingCriterionId).FirstOrDefaultAsync();
+
GetOncologyReadingInfoOutDto result = new GetOncologyReadingInfoOutDto() {
TrialEvaluationResult = trialCriterion.EvaluationResult,
@@ -2336,9 +2333,53 @@ namespace IRaCIS.Application.Services
// 修改编号
- //var taskinfo
+ var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
+
+ // 获取标准表格外层问题
+ var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.LesionType != null && x.ReadingTableQuestionTrialList.Any(x => x.QuestionMark == QuestionMark.AutoId))
+ .SelectMany(x => x.ReadingTableQuestionTrialList).Where(x => x.QuestionMark == QuestionMark.AutoId).Select(x => new
+ {
+ x.ReadingQuestionId,
+ TableQuestionId=x.Id,
+
+ }).ToListAsync();
+
+ var questionIds = questionList.Select(x => x.ReadingQuestionId).ToList();
+
+ var questionMarkList = await _readingQuestionTrialRepository.Where(x => questionIds.Contains(x.Id)).Select(x => new
+ {
+ QuestionId=x.Id,
+ x.OrderMark,
+
+ }).ToListAsync();
+
+ var rowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && questionIds.Contains(x.QuestionId)).ToListAsync();
+ List questionAnswerList = new List< ReadingTableQuestionAnswer >();
+ foreach (var item in questionList)
+ {
+ await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == item.ReadingQuestionId
+ && x.TableQuestionId == item.TableQuestionId && x.VisitTaskId == inDto.VisitTaskId);
+
+ var orderMark= questionMarkList.Where(x=>x.QuestionId==item.ReadingQuestionId).Select(x=>x.OrderMark).FirstOrDefault();
+
+ foreach (var row in rowInfo.Where(x=>x.QuestionId== item.ReadingQuestionId))
+ {
+ questionAnswerList.Add(new ReadingTableQuestionAnswer() {
+ Answer= orderMark+row.RowIndex.GetLesionMark(),
+ Id=NewId.NextGuid(),
+ QuestionId= item.ReadingQuestionId,
+ RowId= row.Id,
+ RowIndex=row.RowIndex,
+ TableQuestionId=item.TableQuestionId,
+ TrialId= taskInfo.TrialId,
+ VisitTaskId= taskInfo.Id,
+
+ });
+ }
+ }
+ await _readingTableQuestionAnswerRepository.AddRangeAsync(questionAnswerList);
+ await _readingTableQuestionAnswerRepository.SaveChangesAsync();
-
await this.SubmitTaskChangeState(inDto.VisitTaskId);
return ResponseOutput.Ok(true);
}
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
index 44df698dc..46fef5dcd 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
@@ -447,7 +447,7 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task VerifyeCriterionNeedSynchronize(VerifyeCriterionNeedSynchronizeInDto inDto)
{
- var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync();
+ var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id==inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
if (trialCriterion == null)
{
return NeedSynchronize.NotNeed;
@@ -504,7 +504,7 @@ namespace IRaCIS.Application.Services
///
public async Task SynchronizeCriterion(SynchronizeCriterionInDto inDto)
{
- var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id==inDto.TrialCriterionId).AsNoTracking().FirstOrDefaultAsync();
+ var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id==inDto.TrialReadingCriterionId).AsNoTracking().FirstOrDefaultAsync();
if (trialCriterion != null)
{
diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
index 348a00ac5..a92e4d593 100644
--- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
+++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
@@ -148,10 +148,7 @@ namespace IRaCIS.Core.Application
{
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
- if (trialCriterion == null)
- {
- throw new BusinessValidationFailedException("请先确认一个项目标准。");
- }
+
return new GetOncologySetOutDto
{
@@ -193,10 +190,7 @@ namespace IRaCIS.Core.Application
public async Task<(List,object)> GetTrialReadingJudgeList(GetTrialReadingInfoInDto inDto)
{
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
- if (trialCriterion == null)
- {
- throw new BusinessValidationFailedException("请先确认一个项目标准。");
- }
+
var judgeQuestionList= await _readingQuestionTrialRepository
.WhereIf(trialCriterion.FormType==FormType.SinglePage,x=>x.ReadingCriterionPageId==null)
.WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null)
@@ -257,7 +251,7 @@ namespace IRaCIS.Core.Application
// 同步器官
await _iOrganInfoService.SynchronizeSystemOrganToTrial(new SynchronizeSystemOrganToTrialInDto()
{
- TrialCriterionId = inDto.TrialReadingCriterionId,
+ TrialReadingCriterionId = inDto.TrialReadingCriterionId,
SystemCriterionId = trialCriterion.ReadingQuestionCriterionSystemId
});
@@ -265,7 +259,7 @@ namespace IRaCIS.Core.Application
await iReadingQuestionService.SynchronizeCriterion(new SynchronizeCriterionInDto()
{
- TrialCriterionId = inDto.TrialReadingCriterionId,
+ TrialReadingCriterionId = inDto.TrialReadingCriterionId,
});
}
@@ -539,10 +533,7 @@ namespace IRaCIS.Core.Application
return ResponseOutput.NotOk("该项目当前状态不是初始化,不允许进行该操作。");
}
- if (trialConfig.TrialCriterionIds.Count() > 1)
- {
- throw new BusinessValidationFailedException("项目最多可选择一个标准。");
- }
+
var trialInfo = await _trialRepository.Where(t => t.Id == trialConfig.TrialId, true).Include(t => t.TrialDicList.Where(u => u.KeyName == StaticData.Criterion)).FirstOrDefaultAsync();
diff --git a/IRaCIS.Core.Domain/Reading/ReadingQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingQuestionTrial.cs
index d05b2fb44..67ae122f6 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingQuestionTrial.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingQuestionTrial.cs
@@ -200,6 +200,9 @@ namespace IRaCIS.Core.Domain.Models
public ReadingQuestionCriterionTrial ReadingQuestionCriterionTrial { get; set; }
+ public List ReadingTableQuestionTrialList { get; set; }
+
+
}
diff --git a/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs
index 2503fe69f..5526d7574 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs
@@ -156,6 +156,10 @@ namespace IRaCIS.Core.Domain.Models
[ForeignKey("DependParentId")]
public ReadingTableQuestionTrial DependParentQuestion { get; set; }
+ [JsonIgnore]
+ [ForeignKey("ReadingQuestionId")]
+ public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
+
}