diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
index d22d47fc8..144fd64c5 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
@@ -27,7 +27,34 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
}
-
+ public class SetTrialJudgyInfoInDto : GetTrialJudgyInfoOutDto
+ {
+
+ }
+
+ public class GetTrialJudgyInfoOutDto
+ {
+ public Guid TrialId { get; set; }
+
+
+ ///
+ /// 仲裁阅片
+ ///
+ public bool? IsArbitrationReading { get; set; }
+
+ ///
+ /// 仲裁规则
+ ///
+ public ArbitrationRule ArbitrationRule { get; set; }
+ }
+
+ public class GetTrialJudgyInfoInDto
+ {
+ [NotDefault]
+ public Guid TrialId { get; set; }
+ }
+
+
public class ReadingCriterionPageAddOrEdit
{
public Guid? Id { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs
index 1919d21db..5a8b8c4e9 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs
@@ -200,6 +200,8 @@ namespace IRaCIS.Application.Services
IsExistsSubjectClinicalData= await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId&&x.ClinicalDataLevel== ClinicalLevel.Subject && x.IsConfirm),
IsExistsVisitClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataLevel == ClinicalLevel.SubjectVisit && x.IsConfirm),
IsExistsReadingClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataLevel == ClinicalLevel.Read && x.IsConfirm),
+ IsGlobalReading= trialinfo.IsGlobalReading,
+
}) ;
#endregion
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
index fc5c055f4..86aae5140 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
@@ -745,15 +745,31 @@ namespace IRaCIS.Application.Services
if (visitTask.IsAnalysisCreate&& visitTask.ConsistentAnalysisOriginalTaskId!=null)
{
visitTaskids.Add(visitTask.Id);
- visitTaskids.Add(visitTask.ConsistentAnalysisOriginalTaskId.Value);
+ if (visitTask.ConsistentAnalysisOriginalTaskId != null)
+ {
+ visitTaskids.Add(visitTask.ConsistentAnalysisOriginalTaskId.Value);
+ }
+
+ // 这种情况是新产生的阅片期
+ if (visitTask.SouceReadModuleId != null)
+ {
+ var visitNum = await _readModuleRepository.Where(x => x.Id == visitTask.SouceReadModuleId).Select(x => x.VisitNum).FirstOrDefaultAsync();
+ var lastVisitId = await _visitTaskRepository.Where(x => !x.IsAnalysisCreate && x.SouceReadModuleId == visitTask.SouceReadModuleId && x.ReadModule.VisitNum <= visitNum).OrderByDescending(x => x.ReadModule.VisitNum).Select(x => x.Id).FirstOrDefaultAsync();
+ visitTaskids.Add(lastVisitId);
+ }
}
else
{
visitTaskids = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReadingCategory != ReadingCategory.Judge && x.ReReadingApplyState != ReReadingApplyState.Agree && x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.SouceReadModuleId == visitTask.SouceReadModuleId).Select(x => x.Id).ToListAsync();
}
+ var trialInfo = await _trialRepository.Where(x => x.Id == visitTask.TrialId).Select(x=> new {
+ x.IsArbitrationReading,
+ x.ArbitrationRule
- if (visitTaskids.Count == 2)
+ }).FirstNotNullAsync();
+
+ if (visitTaskids.Count == 2&& trialInfo.IsArbitrationReading??false)
{
var query = from questionAnswet in _readingTaskQuestionAnswerRepository.Where(x => visitTaskids.Contains(x.VisitTaskId))
join question in _readingQuestionTrialRepository.Where(x => x.IsJudgeQuestion) on new { ReadingQuestionTrialId = questionAnswet.ReadingQuestionTrialId } equals new { ReadingQuestionTrialId = question.Id }
@@ -842,10 +858,15 @@ namespace IRaCIS.Application.Services
}
else
{
- await this.SaveJudgeTask(new SaveJudgeTaskDto()
+
+ if ((visitTask.SourceSubjectVisitId != null && trialInfo.ArbitrationRule == ArbitrationRule.Visit) || (visitTask.SouceReadModuleId != null && trialInfo.ArbitrationRule == ArbitrationRule.Reading))
{
- VisitTaskIds = visitTaskids,
- });
+ await this.SaveJudgeTask(new SaveJudgeTaskDto()
+ {
+ VisitTaskIds = visitTaskids,
+ });
+ }
+
}
}
@@ -873,8 +894,6 @@ namespace IRaCIS.Application.Services
{
var trialId = await _visitTaskRepository.Where(x => inDto.VisitTaskIds.Contains(x.Id)).Select(x => x.TrialId).FirstOrDefaultAsync();
-
-
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
{
JudgeVisitTaskIdList= inDto.VisitTaskIds,
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
index 2f879b442..93f861f45 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs
@@ -68,6 +68,43 @@ namespace IRaCIS.Application.Services
this._previousPDFRepository = previousPDFRepository;
}
+ ///
+ /// 设置项目裁判信息
+ ///
+ ///
+ ///
+ public async Task SetTrialJudgyInfo(SetTrialJudgyInfoInDto inDto)
+ {
+ await _trialRepository.UpdatePartialFromQueryAsync(inDto.TrialId, x => new Trial()
+ {
+
+ ArbitrationRule = inDto.ArbitrationRule,
+ IsArbitrationReading = inDto.IsArbitrationReading,
+ });
+
+ var result = await _trialRepository.SaveChangesAsync();
+
+ return ResponseOutput.Ok(result);
+ }
+
+ ///
+ /// 获取项目裁判信息
+ ///
+ ///
+ ///
+ public async Task GetTrialJudgyInfo(GetTrialJudgyInfoInDto inDto)
+ {
+ GetTrialJudgyInfoOutDto result = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => new GetTrialJudgyInfoOutDto
+ {
+ TrialId = x.Id,
+ ArbitrationRule = x.ArbitrationRule,
+ IsArbitrationReading = x.IsArbitrationReading
+
+ }).FirstNotNullAsync();
+
+ return result;
+ }
+
///
/// 新增修改项目标准分页
diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs
index 43a529be1..53af11dcc 100644
--- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs
+++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs
@@ -671,7 +671,7 @@ namespace IRaCIS.Core.Application.Contracts
///
/// 仲裁规则/对象
///
- public int ArbitrationRule { get; set; } = 2;
+ public ArbitrationRule ArbitrationRule { get; set; }
}
public class SignConfirmDTO
diff --git a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
index 82d692ae1..82c50769a 100644
--- a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
+++ b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
@@ -201,6 +201,28 @@ namespace IRaCIS.Core.Domain.Share
Allocated = 2,
}
+ public enum ArbitrationRule
+ {
+ //默认值 看是否需要项目初始化时就给默认值 1 或者2
+ None = 0,
+
+ ///
+ /// 访视
+ ///
+ Visit=1,
+
+ ///
+ /// 阅片
+ ///
+ Reading = 2,
+
+ ///
+ /// 无
+ ///
+ NA=3,
+ }
+
+
public enum ReadingMethod
{
Single = 1,
diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs
index 2e3ef8e61..01653d3d0 100644
--- a/IRaCIS.Core.Domain/Trial/Trial.cs
+++ b/IRaCIS.Core.Domain/Trial/Trial.cs
@@ -221,12 +221,18 @@ namespace IRaCIS.Core.Domain.Models
public bool IsGlobalReading { get; set; } = true;
+ ///
+ /// ٲƬ
+ ///
public bool? IsArbitrationReading { get; set; } = true;
public bool IsClinicalReading { get; set; }
- public int ArbitrationRule { get; set; } = 2;
+ ///
+ /// ٲù
+ ///
+ public ArbitrationRule ArbitrationRule { get; set; } = ArbitrationRule.Reading;
public int ChangeDefalutDays { get; set; } = 5;