Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
This commit is contained in:
@@ -333,6 +333,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
// 有可能在任务生成之前 就签名完了临床数据
|
||||
private bool IsClinicalDataSign(ReadingCategory readingCategory, bool isbaseLine, CriterionType criterionType, List<ClinicalDataTrialSet> trialClinicalDataSetList, Guid readingId, Guid trialId)
|
||||
{
|
||||
|
||||
//不需要签名的 直接返回
|
||||
if (IsNeedClinicalDataSign(readingCategory, isbaseLine, criterionType, trialClinicalDataSetList) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var isClinicalDataSign = false;
|
||||
|
||||
var needSignCount = 0;
|
||||
@@ -383,6 +391,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return isClinicalDataSign;
|
||||
}
|
||||
|
||||
|
||||
@@ -1012,7 +1012,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
IsFrontTaskNeedSignButNotSign=u.IsFrontTaskNeedSignButNotSign
|
||||
})
|
||||
.ToList(),
|
||||
}).Where(x => x.UnReadTaskCount > 0).OrderBy(x => x.UnReadCanReadTaskCount);
|
||||
}).Where(x => x.UnReadCanReadTaskCount > 0).OrderBy(x => x.UnReadCanReadTaskCount);
|
||||
// 有序阅片需要找到最小需要
|
||||
|
||||
|
||||
@@ -1910,9 +1910,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == task.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
if (task.TaskState != TaskState.Effect || task.ReadingCategory != ReadingCategory.Visit || task.ReadingTaskState == ReadingTaskState.HaveSigned || task.TaskAllocationState == TaskAllocationState.NotAllocate)
|
||||
if (task.TaskState != TaskState.Effect || task.ReadingCategory != ReadingCategory.Visit || task.ReadingTaskState == ReadingTaskState.HaveSigned )
|
||||
{
|
||||
return ResponseOutput.NotOk("仅仅允许针对已分配、生效、未完成的访视任务进行退回操作,请刷新页面数据");
|
||||
return ResponseOutput.NotOk("仅仅允许针对生效、未完成的访视任务进行退回操作,请刷新页面数据");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string ValueCN { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
public async Task<Dictionary<string, List<SystemBasicDataSelect>>> GetBasicDataSelect(string[] searchArray)
|
||||
{
|
||||
|
||||
var searchList = await _systemBasicDataRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null).ProjectTo<SystemBasicDataSelect>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var searchList = await _systemBasicDataRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null).ProjectTo<SystemBasicDataSelect>(_mapper.ConfigurationProvider,new { _userInfo.IsEn_Us}).ToListAsync();
|
||||
|
||||
return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.ToList());
|
||||
|
||||
|
||||
@@ -25,8 +25,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<SystemBasicData, SystemBasicDataView>();
|
||||
|
||||
var isEn_Us = false;
|
||||
CreateMap<SystemBasicData, SystemBasicDataSelect>()
|
||||
.ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code));
|
||||
.ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code))
|
||||
.ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us? u.Value:u.ValueCN));
|
||||
|
||||
CreateMap<SystemBasicDataAddOrEdit, SystemBasicData>().ReverseMap();
|
||||
|
||||
@@ -40,7 +42,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<Dictionary, BasicDicSelect>()
|
||||
.ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum))
|
||||
|
||||
.ForMember(o => o.Value, t => t.MapFrom(u => u.MappedValue))
|
||||
.ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code));
|
||||
|
||||
var token = "";
|
||||
|
||||
@@ -887,8 +887,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
|
||||
.WhereIf(challengeQuery.SubjectCode != null, t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode!))
|
||||
.WhereIf(challengeQuery.VisitPlanArray != null && challengeQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
//.WhereIf(!string.IsNullOrEmpty(challengeQuery.VisitPlanInfo), challengeQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(challengeQuery.VisitPlanInfo))
|
||||
.WhereIf(challengeQuery.IsOverTime != null, t => DateTime.Now > t.DeadlineTime)
|
||||
//.WhereIf(!string.IsNullOrEmpty(challengeQuery.VisitPlanInfo), challengeQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(challengeQuery.VisitPlanInfo))
|
||||
.WhereIf(challengeQuery.IsOverTime != null && challengeQuery.IsOverTime == true, t => t.IsClosed ? t.ClosedTime > t.DeadlineTime : DateTime.Now > t.DeadlineTime)
|
||||
.WhereIf(challengeQuery.IsOverTime != null && challengeQuery.IsOverTime == false, t => t.IsClosed ? t.ClosedTime < t.DeadlineTime : DateTime.Now < t.DeadlineTime)
|
||||
.WhereIf(challengeQuery.IsUrgent != null, t => t.SubjectVisit.IsUrgent == challengeQuery.IsUrgent)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
|
||||
|
||||
@@ -1078,10 +1078,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
return ResponseOutput.NotOk($"在提交当前访视后,请尽快处理尚未提交的前序访视:{string.Join('、', nameList)}。", 0, ApiResponseCodeEnum.NeedTips);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//同时要根据项目有没有配置Subject 级别临床数据
|
||||
|
||||
+14
-12
@@ -123,7 +123,7 @@ namespace IRaCIS.Application.Services
|
||||
ReadingClinicalDataId = entity.Id,
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
_mapper.Map(indto, entity);
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
List<GetCRCClinicalDataOutDto> cRCClinicalDataList = await _readingClinicalDataRepository.Where(x => x.ReadingId == inDto.SubjectVisitId)
|
||||
.WhereIf(inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject|| x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||
.WhereIf(inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||
.WhereIf(!inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||
.Where(x => x.ClinicalDataTrialSet.TrialId == inDto.TrialId && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC)
|
||||
.Select(x => new GetCRCClinicalDataOutDto()
|
||||
@@ -241,7 +241,7 @@ namespace IRaCIS.Application.Services
|
||||
private async Task AddCRCClinicalData(GetCRCClinicalDataInDto inDto)
|
||||
{
|
||||
var cRCClinicalDataIds = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.UploadRole == UploadRole.CRC && x.IsConfirm)
|
||||
.WhereIf(inDto.IsBaseline, x=>x.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataLevel == ClinicalLevel.SubjectVisit )
|
||||
.WhereIf(inDto.IsBaseline, x => x.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||
.WhereIf(!inDto.IsBaseline, x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||
.Select(x => x.Id).ToListAsync();
|
||||
|
||||
@@ -274,13 +274,13 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
public async Task<IResponseOutput> ReadClinicalDataSign(ReadingClinicalDataSignIndto inDto)
|
||||
{
|
||||
|
||||
|
||||
|
||||
var data = await _readingClinicalDataRepository.FirstOrDefaultAsync(t => t.Id == inDto.ReadingClinicalDataId);
|
||||
|
||||
if (data.ReadingClinicalDataState != ReadingClinicalDataStatus.HaveChecked)
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前临床数据状态不是已核查状态,不允许签名!");
|
||||
throw new BusinessValidationFailedException("当前临床数据状态不是已核查状态,不允许签名!");
|
||||
}
|
||||
data.IsSign = true;
|
||||
data.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned;
|
||||
@@ -345,7 +345,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -385,7 +385,8 @@ namespace IRaCIS.Application.Services
|
||||
//维护 IsFrontTaskNeedSignButNotSign 在添加任务哪里用触发器也维护了
|
||||
var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
|
||||
//小于自己任务号的任务 存在需要签名 但是没签名
|
||||
.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum && t.IsFrontTaskNeedSignButNotSign==false))
|
||||
.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
|
||||
&& t.IsFrontTaskNeedSignButNotSign == false )
|
||||
.Select(t => t.Id);
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable.Contains(t.Id), u => new VisitTask()
|
||||
@@ -395,9 +396,10 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
|
||||
var visitTaskIdQueryable2= _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
|
||||
//小于自己任务号的任务 存在需要签名 但是没签名
|
||||
.Where(t =>! t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum && t.IsFrontTaskNeedSignButNotSign == true))
|
||||
var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
|
||||
//小于自己任务号的任务 存在需要签名 但是没签名
|
||||
.Where(t => !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
|
||||
&& t.IsFrontTaskNeedSignButNotSign == true )
|
||||
.Select(t => t.Id);
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask()
|
||||
@@ -670,11 +672,11 @@ namespace IRaCIS.Application.Services
|
||||
var criterionType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => x.CriterionType).FirstNotNullAsync();
|
||||
|
||||
|
||||
var resultQuery = _readingClinicalDataRepository.Where(x => x.SubjectId == inDto.SubjectId).Include(x => x.ClinicalDataTrialSet)
|
||||
var resultQuery = _readingClinicalDataRepository.Where(x => x.SubjectId == inDto.SubjectId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId || (x.SubjectId == inDto.SubjectId && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject))
|
||||
//.WhereIf(inDto.UploadRole == UploadRole.CRC, x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC)
|
||||
|
||||
.Where(x => x.ClinicalDataTrialSet.CriterionEnumListStr.Contains($"{((int)criterionType).ToString()}"))
|
||||
.Where(x => x.ClinicalDataTrialSet.CriterionEnumListStr.Contains($"|{((int)criterionType).ToString()}|"))
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
{
|
||||
ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel,
|
||||
|
||||
Reference in New Issue
Block a user