Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing Details

IRC_NewDev
he 2024-09-26 10:20:20 +08:00
commit 627f3bf4a9
6 changed files with 73 additions and 29 deletions

View File

@ -11445,7 +11445,7 @@
<param name="inDto"></param> <param name="inDto"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService,IRaCIS.Core.Application.Service.IReadingCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskRelation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.User},IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCustomTag},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingSystemCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTrialCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TumorAssessment_RECIST1Point1},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Application.Service.IGeneralCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskStudy},IRaCIS.Core.Application.Interfaces.ITrialEmailNoticeConfigService)"> <member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService,IRaCIS.Core.Application.Service.IReadingCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskRelation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCustomTag},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTrialCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Application.Service.IGeneralCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskStudy},IRaCIS.Core.Application.Service.ImageAndDoc.IDownloadAndUploadService,IRaCIS.Core.Application.Interfaces.ITrialEmailNoticeConfigService)">
<summary> <summary>
IR影像阅片 IR影像阅片
</summary> </summary>

View File

@ -409,14 +409,12 @@ namespace IRaCIS.Core.Application.Contracts
public class IRUploadStudyQuery : SortInput public class IRUploadStudyQuery : SortInput
{ {
[NotDefault] public Guid? SubjectId { get; set; }
public Guid SubjectId { get; set; }
[NotDefault] [NotDefault]
public Guid TrialReadingCriterionId { get; set; } public Guid TrialReadingCriterionId { get; set; }
[NotDefault] public string? SubjectCode { get; set; }
public string SubjectCode { get; set; }
public Guid? VisitTaskId { get; set; } public Guid? VisitTaskId { get; set; }
} }

View File

@ -23,7 +23,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
public interface IDownloadAndUploadService public interface IDownloadAndUploadService
{ {
Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true); Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true);
Task<IResponseOutput> SubejctRandomReadingTaskNameDeal(Guid subjectId, Guid trialReadingCriterionId);
} }
[ApiExplorerSettings(GroupName = "Trial")] [ApiExplorerSettings(GroupName = "Trial")]
public class DownloadAndUploadService( public class DownloadAndUploadService(
IRepository<SystemAnonymization> _systemAnonymizationRepository, IRepository<SystemAnonymization> _systemAnonymizationRepository,
@ -77,7 +80,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit && t.TaskBlindName != "Timepoint").Select(t => new { t.TaskBlindName, t.SourceSubjectVisitId, t.SouceReadModuleId }).ToListAsync(); && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit && t.TaskBlindName != "Timepoint").Select(t => new { t.TaskBlindName, t.SourceSubjectVisitId, t.SouceReadModuleId }).ToListAsync();
//随机赋值编号 比如要处理5个任务实例化一个包含1-5的数组每次随机取出一个 //随机赋值编号 比如要处理5个任务实例化一个包含1-5的数组每次随机取出一个
List<int> availableNumbers = Enumerable.Range(haveDealedTaskList.Count + haveFinishedTaskCount + 1, needDealTaskList.Count).ToList(); List<int> availableNumbers = Enumerable.Range(haveDealedTaskList.Count + haveFinishedTaskCount + 1, needDealTaskList.Count).ToList();
Random rng = new Random(); Random rng = new Random();
@ -111,13 +113,44 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
[HttpPost] [HttpPost]
public async Task<IResponseOutput<List<SubjectImageUploadDTO>>> GetSubjectImageUploadList(IRUploadStudyQuery inQuery) public async Task<IResponseOutput<List<SubjectImageUploadDTO>>> GetSubjectImageUploadList(IRUploadStudyQuery inQuery)
{ {
await SubejctRandomReadingTaskNameDeal(inQuery.SubjectId, inQuery.TrialReadingCriterionId);
//要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的 //要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); .Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SourceSubjectVisitId != null var subjectCode = string.Empty;
var subjectId = inQuery.SubjectId;
if (criterionInfo.IsReadingTaskViewInOrder == ReadingOrder.Random)
{
if (inQuery.VisitTaskId == null)
{
throw new Exception("无序阅片,前端参数传递错误");
}
//考虑到一致性分析,必须要这个编号进行过滤
var taskInfo = _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId).Select(t => new {
SubjectCode= t.IsAnalysisCreate ? t.BlindSubjectCode : t.Subject.Code,
SubjectId= t.SubjectId,
}).FirstOrDefault();
subjectId = taskInfo.SubjectId;
subjectCode = taskInfo.SubjectCode;
}
else
{
if (inQuery.SubjectId == null || inQuery.SubjectCode == null)
{
throw new Exception("有序阅片,前端参数传递错误");
}
//考虑到一致性分析,必须要这个编号进行过滤
subjectCode = inQuery.SubjectCode;
}
await SubejctRandomReadingTaskNameDeal((Guid)subjectId, inQuery.TrialReadingCriterionId);
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SourceSubjectVisitId != null
&& t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect) && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
//满足 有序或者随机只看到当前任务的dicom 非dicom检查 //满足 有序或者随机只看到当前任务的dicom 非dicom检查
.WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId) .WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId)
@ -177,8 +210,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
}).ToList() }).ToList()
}) })
; ;
//var test = await query.ToListAsync();
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync(); var list = await query.Where(t => t.SubjectCode == subjectCode).ToListAsync();
return ResponseOutput.Ok(list); return ResponseOutput.Ok(list);
@ -253,11 +287,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
public async Task<List<TaskStudyArchiveConfirmResult>> VerifyIRStudyAllowUpload(TaskStudyAchivePreConfirmCommand inCommand, [FromServices] IRepository<DicomStudy> _dicomStudyRepository) public async Task<List<TaskStudyArchiveConfirmResult>> VerifyIRStudyAllowUpload(TaskStudyAchivePreConfirmCommand inCommand, [FromServices] IRepository<DicomStudy> _dicomStudyRepository)
{ {
var currentUploadSubjectVisitId = inCommand.VisitTaskId == null ? null : _visitTaskRepository.Where(t => t.Id == inCommand.VisitTaskId).Select(t => t.SourceSubjectVisitId).FirstOrDefault();
//重阅任务排除 //重阅任务排除
var notAllowedUidList1 = _taskStudyRepository.Where(t => t.TrialId == inCommand.TrialId && t.VisitTask.TaskState == TaskState.Effect && inCommand.StudyInstanceUidList.Contains(t.StudyInstanceUid)).Select(t => new var notAllowedUidList1 = _taskStudyRepository.Where(t => t.TrialId == inCommand.TrialId && t.VisitTask.TaskState == TaskState.Effect && inCommand.StudyInstanceUidList.Contains(t.StudyInstanceUid)).Select(t => new
{ {
t.StudyInstanceUid, t.StudyInstanceUid,
t.SubjectId, t.SubjectId,
SubjectVisitId = t.VisitTask.SourceSubjectVisitId,
SubejectCode = t.VisitTask.IsAnalysisCreate ? t.VisitTask.BlindSubjectCode : t.Subject.Code, SubejectCode = t.VisitTask.IsAnalysisCreate ? t.VisitTask.BlindSubjectCode : t.Subject.Code,
VisitTaskId = (Guid?)t.VisitTaskId VisitTaskId = (Guid?)t.VisitTaskId
}).ToList(); }).ToList();
@ -266,6 +303,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{ {
t.StudyInstanceUid, t.StudyInstanceUid,
t.SubjectId, t.SubjectId,
SubjectVisitId = (Guid?)t.SubjectVisitId,
SubejectCode = t.Subject.Code, SubejectCode = t.Subject.Code,
VisitTaskId = (Guid?)null VisitTaskId = (Guid?)null
}).ToList(); }).ToList();
@ -283,12 +321,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
//同一个subject 同一份影响 //同一个subject 同一份影响
if (findStudy.SubejectCode == inCommand.SubjectCode && findStudy.SubjectId == inCommand.SubjectId) if (findStudy.SubejectCode == inCommand.SubjectCode && findStudy.SubjectId == inCommand.SubjectId)
{ {
//上传给后处理其他访视了
if (inCommand.VisitTaskId != null && findStudy.VisitTaskId != null && findStudy.VisitTaskId != inCommand.VisitTaskId) if (inCommand.VisitTaskId != null && findStudy.VisitTaskId != null && findStudy.VisitTaskId != inCommand.VisitTaskId)
{ {
result.Add(new TaskStudyArchiveConfirmResult() { StudyInstanceUid = studyUid, IsAllowReUpload = false, IsAllowUpload = false }); result.Add(new TaskStudyArchiveConfirmResult() { StudyInstanceUid = studyUid, IsAllowReUpload = false, IsAllowUpload = false });
} }
//在原始crc 里面上传了 //在原始crc 里面上传了,并且不是当前访视
else if (inCommand.VisitTaskId != null && findStudy.VisitTaskId == null) else if (inCommand.VisitTaskId != null && findStudy.VisitTaskId == null && findStudy.SubjectVisitId != currentUploadSubjectVisitId)
{ {
result.Add(new TaskStudyArchiveConfirmResult() { StudyInstanceUid = studyUid, IsAllowReUpload = false, IsAllowUpload = false }); result.Add(new TaskStudyArchiveConfirmResult() { StudyInstanceUid = studyUid, IsAllowReUpload = false, IsAllowUpload = false });
} }

View File

@ -2,6 +2,7 @@
using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.Service.ImageAndDoc;
using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; using IRaCIS.Core.Application.Service.ReadingCalculate.Interface;
using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Application.ViewModel;
@ -44,24 +45,21 @@ namespace IRaCIS.Core.Application.Service
IRepository<DicomInstance> _dicomInstanceRepository, IRepository<DicomInstance> _dicomInstanceRepository,
IRepository<OrganInfo> _organInfoRepository, IRepository<OrganInfo> _organInfoRepository,
IRepository<TrialDocument> _trialDocumentRepository, IRepository<TrialDocument> _trialDocumentRepository,
IRepository<User> _userRepository,
ILuganoCalculateService _luganoCalculateService, ILuganoCalculateService _luganoCalculateService,
IRepository<ReadingCustomTag> _readingCustomTagRepository, IRepository<ReadingCustomTag> _readingCustomTagRepository,
IRepository<ReadingTaskQuestionMark> _readingTaskQuestionMarkRepository, IRepository<ReadingTaskQuestionMark> _readingTaskQuestionMarkRepository,
IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository,
IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository, IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository,
IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository,
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository, IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
IRepository<ReadingTableQuestionSystem> _readingTableQuestionSystemRepository, IRepository<ReadingTableQuestionSystem> _readingTableQuestionSystemRepository,
IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository, IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository,
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository, IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository, IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystemRepository,
IRepository<ReadingQuestionSystem> _readingQuestionSystem, IRepository<ReadingQuestionSystem> _readingQuestionSystem,
IRepository<NoneDicomStudyFile> _noneDicomStudyFileSystem, IRepository<NoneDicomStudyFile> _noneDicomStudyFileSystem,
IGeneralCalculateService _generalCalculateService, IGeneralCalculateService _generalCalculateService,
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository, IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
IRepository<TaskStudy> _taskStudyRepository, IRepository<TaskStudy> _taskStudyRepository,
IDownloadAndUploadService _downloadAndUploadService,
ITrialEmailNoticeConfigService _trialEmailNoticeConfigService) : BaseService, IReadingImageTaskService ITrialEmailNoticeConfigService _trialEmailNoticeConfigService) : BaseService, IReadingImageTaskService
{ {
@ -783,7 +781,7 @@ namespace IRaCIS.Core.Application.Service
var criterionIdInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == trialReadingCriterionId).FirstNotNullAsync(); var criterionIdInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == trialReadingCriterionId).FirstNotNullAsync();
var groupIds = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId&& x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.BasicTable).Select(x => x.GroupId).Distinct().ToListAsync(); var groupIds = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.BasicTable).Select(x => x.GroupId).Distinct().ToListAsync();
var questionIds = await _readingQuestionTrialRepository var questionIds = await _readingQuestionTrialRepository
.Where(x => x.IsShowInDicom) .Where(x => x.IsShowInDicom)
@ -792,10 +790,10 @@ namespace IRaCIS.Core.Application.Service
//排除表格问题 以及在表格问题分组的外层问题 //排除表格问题 以及在表格问题分组的外层问题
var questions = await _readingQuestionTrialRepository var questions = await _readingQuestionTrialRepository
.Where(x=> !questionIds.Contains(x.Id)) .Where(x => !questionIds.Contains(x.Id))
.WhereIf(questionClassify != null, x => x.QuestionClassify == questionClassify) .WhereIf(questionClassify != null, x => x.QuestionClassify == questionClassify)
.Where( x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table && x.Type != ReadingQestionType.BasicTable) .Where(x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table && x.Type != ReadingQestionType.BasicTable)
.ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider, new .ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider, new
{ {
@ -1085,7 +1083,7 @@ namespace IRaCIS.Core.Application.Service
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
var qusetionList = await _readingQuestionTrialRepository var qusetionList = await _readingQuestionTrialRepository
.Where(x=>x.IsShowInDicom) .Where(x => x.IsShowInDicom)
.WhereIf(inDto.QuestionClassify != null, x => x.QuestionClassify == inDto.QuestionClassify) .WhereIf(inDto.QuestionClassify != null, x => x.QuestionClassify == inDto.QuestionClassify)
.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider, new .Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider, new
{ {
@ -2606,10 +2604,10 @@ namespace IRaCIS.Core.Application.Service
public async Task<IResponseOutput> VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) public async Task<IResponseOutput> VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
{ {
//验证后处理影像必须传 //验证后处理影像必须传
if (_visitTaskRepository.Any(t => t.Id==inDto.VisitTaskId && t.TrialReadingCriterion.ImageUploadEnum != ReadingImageUpload.None)) if (_visitTaskRepository.Any(t => t.Id == inDto.VisitTaskId && t.TrialReadingCriterion.ImageUploadEnum != ReadingImageUpload.None))
{ {
if (!_taskStudyRepository.Any(t => t.VisitTaskId == inDto.VisitTaskId)) if (!_taskStudyRepository.Any(t => t.VisitTaskId == inDto.VisitTaskId))
{ {
return ResponseOutput.NotOk(_localizer["ReadingImage_BackImageNotExist"]); return ResponseOutput.NotOk(_localizer["ReadingImage_BackImageNotExist"]);
} }
} }
@ -2827,6 +2825,8 @@ namespace IRaCIS.Core.Application.Service
} }
else if (inDto.SubjectId != null && trialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom) else if (inDto.SubjectId != null && trialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom)
{ {
await _downloadAndUploadService.SubejctRandomReadingTaskNameDeal((Guid)inDto.SubjectId, (Guid)trialReadingCriterionId);
var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto() var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
{ {
TrialId = inDto.TrialId, TrialId = inDto.TrialId,
@ -2848,17 +2848,22 @@ namespace IRaCIS.Core.Application.Service
// 排除跳过的 // 排除跳过的
List<Guid> remainingItems = taskList.Select(x => x.Id).Except(cacheSkipIds).ToList(); List<Guid> remainingItems = taskList.Select(x => x.Id).Except(cacheSkipIds).ToList();
taskList = taskList.Where(x => remainingItems.Contains(x.Id)).ToList(); //受试者随机固定排序
taskList = taskList.Where(x => remainingItems.Contains(x.Id)).OrderBy(t=>t.TaskBlindName).ToList();
if (taskList.Count() == 0) if (taskList.Count() == 0)
{ {
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows); throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
} }
Random random = new Random(); #region 随机废弃
//返回的范围是 0- taskList.Count-1 //Random random = new Random();
int randomIndex = random.Next(taskList.Count); ////返回的范围是 0- taskList.Count-1
//int randomIndex = random.Next(taskList.Count);
var visitTaskId = taskList[randomIndex].Id; //var visitTaskId = taskList[randomIndex].Id;
#endregion
var visitTaskId = taskList[0].Id;
task = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x => new GetReadingTaskDto() task = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x => new GetReadingTaskDto()
{ {

View File

@ -14,6 +14,7 @@ public class SystemBasicData : BaseFullAuditEntity
#endregion #endregion
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
[StringLength(1000)]
public string Value { get; set; } = string.Empty; public string Value { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty; public string Description { get; set; } = string.Empty;
@ -23,6 +24,7 @@ public class SystemBasicData : BaseFullAuditEntity
public string Code { get; set; } = string.Empty; public string Code { get; set; } = string.Empty;
public Guid? ParentId { get; set; } public Guid? ParentId { get; set; }
[StringLength(1000)]
public string ValueCN { get; set; } = string.Empty; public string ValueCN { get; set; } = string.Empty;
public bool IsEnable { get; set; } public bool IsEnable { get; set; }

View File

@ -51,7 +51,7 @@ public class QCChallenge : BaseAddAuditEntity
public string ClosedUser { get; set; } = string.Empty; public string ClosedUser { get; set; } = string.Empty;
public QCChallengeCloseEnum CloseResonEnum { get; set; } public QCChallengeCloseEnum CloseResonEnum { get; set; }
[StringLength(1000)] [StringLength(1200)]
public string Content { get; set; } = string.Empty; public string Content { get; set; } = string.Empty;
[StringLength(1000)] [StringLength(1000)]