Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
7476f8a8e9
|
@ -254,6 +254,24 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// CRC确认临床数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="opt"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost, Route("Inspection/ClinicalAnswer/CRCConfirmClinical")]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
|
|
||||||
|
[UnitOfWork]
|
||||||
|
public async Task<IResponseOutput> CRCConfirmClinical(DataInspectionDto<CRCConfirmClinicalInDto> opt)
|
||||||
|
{
|
||||||
|
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||||
|
var result = await _clinicalAnswerService.CRCConfirmClinical(opt.Data);
|
||||||
|
await _inspectionService.CompletedSign(singid, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CRC撤销临床数据
|
/// CRC撤销临床数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -146,6 +146,13 @@
|
||||||
<param name="opt"></param>
|
<param name="opt"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCConfirmClinical(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCConfirmClinicalInDto})">
|
||||||
|
<summary>
|
||||||
|
CRC确认临床数据
|
||||||
|
</summary>
|
||||||
|
<param name="opt"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCCancelConfirmClinical(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCCancelConfirmClinicalInDto})">
|
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCCancelConfirmClinical(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCCancelConfirmClinicalInDto})">
|
||||||
<summary>
|
<summary>
|
||||||
CRC撤销临床数据
|
CRC撤销临床数据
|
||||||
|
|
|
@ -2786,6 +2786,16 @@
|
||||||
模块名称
|
模块名称
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CRCConfirmClinicalInDto.IsClinicalDataComplete">
|
||||||
|
<summary>
|
||||||
|
临床数据是否完整
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CRCConfirmClinicalInDto.IsClinicalDataBlind">
|
||||||
|
<summary>
|
||||||
|
临床数据是否盲化
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CRCClinicalForm.SubjectId">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CRCClinicalForm.SubjectId">
|
||||||
<summary>
|
<summary>
|
||||||
受试者Id
|
受试者Id
|
||||||
|
|
|
@ -1167,8 +1167,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
}
|
}
|
||||||
|
|
||||||
//基线 且配置了临床数据
|
//基线 且配置了临床数据
|
||||||
if (trialConfig.ClinicalInformationTransmissionEnum != 0 /*&& dbSubjectVisit.IsBaseLine*//*&&dbSubjectVisit.ClinicalDataSignUserId==null*/)
|
//if (trialConfig.ClinicalInformationTransmissionEnum != 0 /*&& dbSubjectVisit.IsBaseLine*//*&&dbSubjectVisit.ClinicalDataSignUserId==null*/)
|
||||||
{
|
//{
|
||||||
|
|
||||||
|
|
||||||
////找到需要确认的PDF 临床数据 如果没有CRC 没有上传 那么就添加一条没有文件的记录
|
////找到需要确认的PDF 临床数据 如果没有CRC 没有上传 那么就添加一条没有文件的记录
|
||||||
|
@ -1231,7 +1231,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//return ResponseOutput.NotOk("没有签名临床数据,不允许提交");
|
//return ResponseOutput.NotOk("没有签名临床数据,不允许提交");
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -225,6 +225,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var clinicalData= _readingClinicalDataRepository.Where(x=>x.TrialId == inDto.TrialId&&x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC&&x.ClinicalDataTrialSet.ClinicalDataLevel!= ClinicalLevel.SubjectVisit)
|
var clinicalData= _readingClinicalDataRepository.Where(x=>x.TrialId == inDto.TrialId&&x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC&&x.ClinicalDataTrialSet.ClinicalDataLevel!= ClinicalLevel.SubjectVisit)
|
||||||
.Where(x=>!x.IsSign)
|
.Where(x=>!x.IsSign)
|
||||||
|
.WhereIf(inDto.SubjectId!=null,x=>x.SubjectId==inDto.SubjectId)
|
||||||
|
.WhereIf(inDto.SubjectCode != null, x => x.Subject.Code.Contains(inDto.SubjectCode??string.Empty))
|
||||||
|
.Where(x=> x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject)
|
||||||
.Include(x=>x.ClinicalDataTrialSet).Select(x=>new GetCRCSubjectClinicalOutDto() {
|
.Include(x=>x.ClinicalDataTrialSet).Select(x=>new GetCRCSubjectClinicalOutDto() {
|
||||||
SubjectId=x.SubjectId,
|
SubjectId=x.SubjectId,
|
||||||
SubjectCode=x.Subject.Code,
|
SubjectCode=x.Subject.Code,
|
||||||
|
@ -266,7 +269,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
result.AnswerList = new List<Dictionary<string, string>>();
|
result.AnswerList = new List<Dictionary<string, string>>();
|
||||||
result.QuestionList=await _trialClinicalQuestionRepository.Where(x=>x.TrialClinicalId==inDto.ClinicalDataTrialSetId
|
result.QuestionList=await _trialClinicalQuestionRepository.Where(x=>x.TrialClinicalId==inDto.ClinicalDataTrialSetId
|
||||||
&&x.ClinicalQuestionType!= ReadingQestionType.Group
|
&&x.ClinicalQuestionType!= ReadingQestionType.Group
|
||||||
&& x.ClinicalQuestionType != ReadingQestionType.Table).OrderBy(x=>x.ShowOrder)
|
&& x.ClinicalQuestionType != ReadingQestionType.Table).OrderByDescending(x=>x.IsCheckDate).ThenBy(x=>x.ShowOrder)
|
||||||
.ProjectTo<TrialClinicalQuestionDto>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<TrialClinicalQuestionDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
var answers = await _clinicalQuestionAnswerRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
var answers = await _clinicalQuestionAnswerRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||||
|
@ -515,16 +518,25 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
|
public async Task<PageOutput<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
|
||||||
{
|
{
|
||||||
|
if (inDto.ReadModuleId != null)
|
||||||
|
{
|
||||||
|
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync();
|
||||||
|
inDto.TrialReadingCriterionId = readModule.TrialReadingCriterionId;
|
||||||
|
}
|
||||||
var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||||
.WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId)
|
.WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId)
|
||||||
.WhereIf(inDto.IsCRCConfirm != null, x => x.IsCRCConfirm == inDto.IsCRCConfirm)
|
.WhereIf(inDto.IsCRCConfirm != null, x => x.IsCRCConfirm == inDto.IsCRCConfirm)
|
||||||
.WhereIf(inDto.IsPMConfirm != null, x => x.IsPMConfirm == inDto.IsPMConfirm)
|
.WhereIf(inDto.IsPMConfirm != null, x => x.IsPMConfirm == inDto.IsPMConfirm)
|
||||||
|
.WhereIf(inDto.SubjectCode != null, x => x.Subject.Code.Contains(inDto.SubjectCode??string.Empty))
|
||||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId)
|
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId)
|
||||||
.WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId)
|
.WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId)
|
||||||
.Select(x => new GetCRCConfirmListOutDto()
|
.WhereIf(inDto.StartTime != null, x => x.SubjectVisit.LatestScanDate >= inDto.StartTime)
|
||||||
|
.WhereIf(inDto.EndTime != null, x => x.SubjectVisit.LatestScanDate <= inDto.EndTime)
|
||||||
|
.Select(x => new GetCRCConfirmListOutDto()
|
||||||
{
|
{
|
||||||
|
|
||||||
SubjectId = x.SubjectId,
|
SubjectId = x.SubjectId,
|
||||||
|
IsNotNeedPMConfirm=x.IsNotNeedPMConfirm,
|
||||||
IsCRCConfirm = x.IsCRCConfirm,
|
IsCRCConfirm = x.IsCRCConfirm,
|
||||||
IsCRCApplicationRevoke=x.IsCRCApplicationRevoke,
|
IsCRCApplicationRevoke=x.IsCRCApplicationRevoke,
|
||||||
VisitBlindName=x.SubjectVisit.BlindName,
|
VisitBlindName=x.SubjectVisit.BlindName,
|
||||||
|
@ -757,12 +769,16 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
SubjectId= readModule.SubjectId,
|
SubjectId= readModule.SubjectId,
|
||||||
ReadModuleId= inDto.ReadModuleId,
|
IsCRCConfirm=false,
|
||||||
TrialReadingCriterionId = readModule.TrialReadingCriterionId,
|
TrialReadingCriterionId = readModule.TrialReadingCriterionId,
|
||||||
PageIndex=1,
|
ReadModuleId = inDto.ReadModuleId,
|
||||||
|
PageIndex =1,
|
||||||
PageSize=9999,
|
PageSize=9999,
|
||||||
})).CurrentPageData;
|
})).CurrentPageData.ToList();
|
||||||
|
|
||||||
|
var presentData = confirmlist.Where(x => x.ReadModuleId == inDto.ReadModuleId).First();
|
||||||
|
|
||||||
|
confirmlist = confirmlist.Where(x => x.LatestScanDate <= presentData.LatestScanDate).ToList();
|
||||||
|
|
||||||
await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== inDto.ReadModuleId);
|
await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== inDto.ReadModuleId);
|
||||||
List<ReadModuleCriterionFrom> needAddList = new List<ReadModuleCriterionFrom>()
|
List<ReadModuleCriterionFrom> needAddList = new List<ReadModuleCriterionFrom>()
|
||||||
|
@ -783,16 +799,21 @@ namespace IRaCIS.Core.Application.Service
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var readModuleIds = confirmlist.Select(x => x.ReadModuleId).ToList();
|
foreach (var item in confirmlist)
|
||||||
|
{
|
||||||
|
await _readModuleRepository.UpdatePartialFromQueryAsync(x =>x.Id==item.ReadModuleId , x => new ReadModule()
|
||||||
|
{
|
||||||
|
IsCRCConfirm = true,
|
||||||
|
IsPMConfirm=item.ClinicalFormList.Count()==0?true:false,
|
||||||
|
IsNotNeedPMConfirm= item.ClinicalFormList.Count() == 0 ? true : false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await _readModuleRepository.UpdatePartialFromQueryAsync(x => readModuleIds.Contains(x.Id),x=>new ReadModule() {
|
|
||||||
IsCRCConfirm=true
|
|
||||||
});
|
|
||||||
await _readModuleCriterionFromRepository.AddRangeAsync(needAddList);
|
await _readModuleCriterionFromRepository.AddRangeAsync(needAddList);
|
||||||
|
|
||||||
await _readModuleCriterionFromRepository.SaveChangesAsync();
|
await _readModuleCriterionFromRepository.SaveChangesAsync();
|
||||||
|
await _iReadingClinicalDataService.DealVisiTaskClinicalDataSignedAsync(inDto.TrialId, inDto.SubjectId, inDto.ReadModuleId, false, readModule.TrialReadingCriterionId);
|
||||||
return ResponseOutput.Ok(true);
|
return ResponseOutput.Ok(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -816,7 +837,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var presentData = dataList.Where(x => x.ReadModuleId == inDto.ReadModuleId).First();
|
var presentData = dataList.Where(x => x.ReadModuleId == inDto.ReadModuleId).First();
|
||||||
|
|
||||||
if (dataList.Any(x => x.IsPMConfirm && x.LatestScanDate > presentData.LatestScanDate && x.ReadingSetType == presentData.ReadingSetType))
|
if (dataList.Any(x => x.IsCRCConfirm && x.LatestScanDate > presentData.LatestScanDate && x.ReadingSetType == presentData.ReadingSetType))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("当前数据并非最后一条确认信息,无法取消!");
|
throw new BusinessValidationFailedException("当前数据并非最后一条确认信息,无法取消!");
|
||||||
}
|
}
|
||||||
|
@ -826,17 +847,28 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException("PM已确认,无法取消!");
|
throw new BusinessValidationFailedException("PM已确认,无法取消!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (presentData.IsNotNeedPMConfirm)
|
||||||
|
{
|
||||||
|
await _readModuleRepository.UpdatePartialFromQueryAsync(x => presentData.ReadModuleId == x.Id, x => new ReadModule()
|
||||||
|
{
|
||||||
|
IsPMConfirm = false,
|
||||||
|
IsCRCConfirm = false,
|
||||||
|
IsNotNeedPMConfirm = false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await _readModuleRepository.UpdatePartialFromQueryAsync(x => presentData.ReadModuleId == x.Id, x => new ReadModule()
|
||||||
|
{
|
||||||
|
IsCRCApplicationRevoke = true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await _readModuleRepository.UpdatePartialFromQueryAsync(x => presentData.ReadModuleId==x.Id, x => new ReadModule()
|
|
||||||
{
|
|
||||||
IsCRCApplicationRevoke = true
|
|
||||||
});
|
|
||||||
|
|
||||||
//await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== presentData.ReadModuleId);
|
//await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== presentData.ReadModuleId);
|
||||||
|
|
||||||
await _readModuleCriterionFromRepository.SaveChangesAsync();
|
await _readModuleCriterionFromRepository.SaveChangesAsync();
|
||||||
|
return ResponseOutput.Ok(true);
|
||||||
return ResponseOutput.Ok(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -868,7 +900,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
await _readModuleRepository.UpdatePartialFromQueryAsync(x => inDto.ReadModuleId == x.Id, x => new ReadModule()
|
await _readModuleRepository.UpdatePartialFromQueryAsync(x => inDto.ReadModuleId == x.Id, x => new ReadModule()
|
||||||
{
|
{
|
||||||
IsPMConfirm = true
|
IsPMConfirm = true,
|
||||||
|
IsClinicalDataBlind=inDto.IsClinicalDataBlind,
|
||||||
|
IsClinicalDataComplete=inDto.IsClinicalDataComplete,
|
||||||
});
|
});
|
||||||
await _readModuleRepository.SaveChangesAsync();
|
await _readModuleRepository.SaveChangesAsync();
|
||||||
await _iReadingClinicalDataService.DealVisiTaskClinicalDataSignedAsync(inDto.TrialId, inDto.SubjectId, inDto.ReadModuleId, false, readModuleData.TrialReadingCriterionId);
|
await _iReadingClinicalDataService.DealVisiTaskClinicalDataSignedAsync(inDto.TrialId, inDto.SubjectId, inDto.ReadModuleId, false, readModuleData.TrialReadingCriterionId);
|
||||||
|
@ -880,7 +914,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IsCRCConfirm = false,
|
IsCRCConfirm = false,
|
||||||
IsCRCApplicationRevoke=false,
|
IsCRCApplicationRevoke=false,
|
||||||
});
|
});
|
||||||
await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== x.Id);
|
await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== inDto.ReadModuleId);
|
||||||
|
|
||||||
await _readModuleRepository.SaveChangesAsync();
|
await _readModuleRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
|
@ -229,6 +229,10 @@ namespace IRaCIS.Application.Services
|
||||||
//---存在同类型的临床数据,操作失败
|
//---存在同类型的临床数据,操作失败
|
||||||
return ResponseOutput.NotOk(_localizer["ClinicalDataSet_DupTypeFail"]);
|
return ResponseOutput.NotOk(_localizer["ClinicalDataSet_DupTypeFail"]);
|
||||||
}
|
}
|
||||||
|
if (indto.Id != null && indto.IsApply == null)
|
||||||
|
{
|
||||||
|
indto.IsApply = await _clinicalDataTrialSetRepository.Where(x => x.Id == indto.Id).Select(x => x.IsApply).FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
//indto.CriterionEnumListStr = $"|{String.Join('|', indto.CriterionEnumList)}|";
|
//indto.CriterionEnumListStr = $"|{String.Join('|', indto.CriterionEnumList)}|";
|
||||||
|
|
||||||
|
|
|
@ -118,10 +118,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetSystemClinicalQuestionPreview(GetSystemClinicalQuestionPreviewDto inDto)
|
public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetSystemClinicalQuestionPreview(GetSystemClinicalQuestionPreviewDto inDto)
|
||||||
{
|
{
|
||||||
var questions = await _systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
|
var questions = await _systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
|
||||||
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
var tableQuestions= await _systemClinicalTableQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
|
var tableQuestions= await _systemClinicalTableQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
|
||||||
.ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
|
var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
|
||||||
|
@ -144,13 +144,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetTrialClinicalQuestionPreview(GetTrialClinicalQuestionPreviewDto inDto)
|
public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetTrialClinicalQuestionPreview(GetTrialClinicalQuestionPreviewDto inDto)
|
||||||
{
|
{
|
||||||
var questions = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
|
var questions = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
|
||||||
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
var tableQuestions = await _trialClinicalTableQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
|
var tableQuestions = await _trialClinicalTableQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
|
||||||
.ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
|
var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).OrderBy(x => x.ShowOrder).ToList();
|
||||||
|
|
||||||
result.ForEach(x =>
|
result.ForEach(x =>
|
||||||
{
|
{
|
||||||
|
@ -170,7 +170,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="tableQuestions"></param>
|
/// <param name="tableQuestions"></param>
|
||||||
public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions,List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers)
|
public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions,List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers)
|
||||||
{
|
{
|
||||||
item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).ToList();
|
item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).OrderBy(x => x.ShowOrder).ToList();
|
||||||
|
|
||||||
item.RelationQuestions = questions.Where(x => x.RelevanceId == item.Id).ToList();
|
item.RelationQuestions = questions.Where(x => x.RelevanceId == item.Id).ToList();
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).ToList();
|
item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).OrderBy(x => x.ShowOrder).ToList();
|
||||||
|
|
||||||
item.RelationQuestions.ForEach(x => {
|
item.RelationQuestions.ForEach(x => {
|
||||||
this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers);
|
this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers);
|
||||||
|
@ -228,11 +228,16 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateTrialClinicalQuestion(TrialClinicalQuestionDto inDto)
|
public async Task<IResponseOutput> AddOrUpdateTrialClinicalQuestion(TrialClinicalQuestionDto inDto)
|
||||||
{
|
{
|
||||||
if (await _trialClinicalQuestionRepository.AnyAsync(x =>x.TrialClinicalId==inDto.TrialClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
if (inDto.IsVerify)
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
|
if (await _trialClinicalQuestionRepository.AnyAsync(x => x.TrialClinicalId == inDto.TrialClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"],string.Empty,ApiResponseCodeEnum.NeedTips);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (await _trialClinicalQuestionRepository.AnyAsync(x => x.TrialClinicalId == inDto.TrialClinicalId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
|
if (await _trialClinicalQuestionRepository.AnyAsync(x => x.TrialClinicalId == inDto.TrialClinicalId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("问题序号存在重复!");
|
return ResponseOutput.NotOk("问题序号存在重复!");
|
||||||
|
@ -322,11 +327,15 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<IResponseOutput> AddOrUpdateSystemClinicalQuestion(SystemClinicalQuestionDto inDto)
|
public async Task<IResponseOutput> AddOrUpdateSystemClinicalQuestion(SystemClinicalQuestionDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (await _systemClinicalQuestionRepository.AnyAsync(x => x.SystemClinicalId == inDto.SystemClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
if (inDto.IsVerify)
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
|
if (await _systemClinicalQuestionRepository.AnyAsync(x => x.SystemClinicalId == inDto.SystemClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"], string.Empty, ApiResponseCodeEnum.NeedTips);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (await _systemClinicalQuestionRepository.AnyAsync(x => x.SystemClinicalId == inDto.SystemClinicalId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
|
if (await _systemClinicalQuestionRepository.AnyAsync(x => x.SystemClinicalId == inDto.SystemClinicalId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("问题序号存在重复!");
|
return ResponseOutput.NotOk("问题序号存在重复!");
|
||||||
|
@ -416,9 +425,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateSystemClinicalTableQuestion(SystemClinicalTableQuestionDto inDto)
|
public async Task<IResponseOutput> AddOrUpdateSystemClinicalTableQuestion(SystemClinicalTableQuestionDto inDto)
|
||||||
{
|
{
|
||||||
if (await _systemClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
if (inDto.IsVerify)
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
|
if (await _systemClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"], string.Empty, ApiResponseCodeEnum.NeedTips);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await _systemClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
|
if (await _systemClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
|
||||||
|
@ -476,9 +488,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateTrialClinicalTableQuestion(TrialClinicalTableQuestionDto inDto)
|
public async Task<IResponseOutput> AddOrUpdateTrialClinicalTableQuestion(TrialClinicalTableQuestionDto inDto)
|
||||||
{
|
{
|
||||||
if (await _trialClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
if (inDto.IsVerify)
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
|
if (await _trialClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"], string.Empty, ApiResponseCodeEnum.NeedTips);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await _trialClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
|
if (await _trialClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
|
||||||
|
|
|
@ -400,6 +400,13 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCritrialId && t.SouceReadModuleId == readingId, u => new VisitTask()
|
||||||
|
{
|
||||||
|
IsClinicalDataSign = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public class GetCRCSubjectClinicalInDto:PageInput
|
public class GetCRCSubjectClinicalInDto:PageInput
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public Guid? SubjectId { get; set; }
|
||||||
|
|
||||||
|
public string? SubjectCode { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -145,10 +149,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public Guid? SubjectId { get; set; }
|
public Guid? SubjectId { get; set; }
|
||||||
|
|
||||||
public Guid TrialId { get; set; }
|
public DateTime? StartTime { get; set; }
|
||||||
|
public DateTime? EndTime { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
public Guid? ReadModuleId { get; set; }
|
public Guid? ReadModuleId { get; set; }
|
||||||
}
|
|
||||||
|
public string? SubjectCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CRCCancelConfirmClinicalInDto
|
public class CRCCancelConfirmClinicalInDto
|
||||||
{
|
{
|
||||||
|
@ -222,6 +231,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public Guid ReadModuleId { get; set; }
|
public Guid ReadModuleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床数据是否完整
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsClinicalDataComplete { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床数据是否盲化
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsClinicalDataBlind { get; set; }
|
||||||
|
|
||||||
public bool IsConfirm { get; set; }
|
public bool IsConfirm { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -260,7 +279,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// 受试者ID
|
/// 受试者ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid SubjectId { get; set; }
|
public Guid SubjectId { get; set; }
|
||||||
public Guid ReadModuleId { get; set; }
|
|
||||||
|
public bool IsNotNeedPMConfirm { get; set; } = false;
|
||||||
|
public Guid ReadModuleId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模块名称
|
/// 模块名称
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否应用
|
/// 是否应用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsApply { get; set; } = false;
|
public bool? IsApply { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
|
|
|
@ -156,6 +156,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsVerify { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 问题名称
|
/// 问题名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -365,6 +368,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
public bool IsVerify { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 问题名称
|
/// 问题名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -17,6 +17,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Interface
|
||||||
|
|
||||||
Task<IResponseOutput> SubmitClinicalForm(SubmitClinicalFormInDto inDto);
|
Task<IResponseOutput> SubmitClinicalForm(SubmitClinicalFormInDto inDto);
|
||||||
|
|
||||||
|
Task<IResponseOutput> CRCConfirmClinical(CRCConfirmClinicalInDto inDto);
|
||||||
|
|
||||||
Task<IResponseOutput> CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto);
|
Task<IResponseOutput> CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,6 +256,12 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public int? UrgentCount { get; set; }
|
public int? UrgentCount { get; set; }
|
||||||
|
|
||||||
public int? ToBeDealedCount { get; set; }
|
public int? ToBeDealedCount { get; set; }
|
||||||
|
|
||||||
|
public int? ToAllCount { get; set; }
|
||||||
|
|
||||||
|
public int? ToBeVisitCount { get; set; }
|
||||||
|
|
||||||
|
public int? ReadModuleCount { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialToBeDoneQuery : PageInput
|
public class TrialToBeDoneQuery : PageInput
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
|
ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
|
||||||
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
|
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
|
||||||
});
|
}).Where(x => x.ToBeRepliedCount > 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ namespace IRaCIS.Core.Application
|
||||||
UrgentCount = g.Where(u => u.OriginalReReadingTask.IsUrgent == true).Count(),
|
UrgentCount = g.Where(u => u.OriginalReReadingTask.IsUrgent == true).Count(),
|
||||||
ToBeApprovalCount = g.Count(),
|
ToBeApprovalCount = g.Count(),
|
||||||
|
|
||||||
});
|
}).Where(x => x.ToBeApprovalCount > 0);
|
||||||
|
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApplyToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApplyToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
@ -286,7 +286,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
|
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
|
||||||
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count()
|
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count()
|
||||||
});
|
}).Where(x => x.ToBeApprovalCount > 0);
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
|
|
||||||
ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm&&!u.IsPMConfirm).Count()
|
ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm&&!u.IsPMConfirm).Count()
|
||||||
});
|
}).Where(x => x.ToBeApprovalCount > 0);
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
|
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
|
||||||
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count()
|
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count()
|
||||||
});
|
}).Where(x => x.ToBeApprovalCount > 0) ;
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ namespace IRaCIS.Core.Application
|
||||||
UrgentCount = g.Where(u => u.OriginalReReadingTask.IsUrgent == true).Count(),
|
UrgentCount = g.Where(u => u.OriginalReReadingTask.IsUrgent == true).Count(),
|
||||||
ToBeApprovalCount = g.Count(),
|
ToBeApprovalCount = g.Count(),
|
||||||
|
|
||||||
});
|
}).Where(x => x.ToBeApprovalCount > 0);
|
||||||
|
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApprovalToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApprovalToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
@ -441,9 +441,50 @@ namespace IRaCIS.Core.Application
|
||||||
ExperimentName = t.ExperimentName,
|
ExperimentName = t.ExperimentName,
|
||||||
TrialCode = t.TrialCode,
|
TrialCode = t.TrialCode,
|
||||||
UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(),
|
UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(),
|
||||||
ToBeDealedCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count(),
|
ToBeDealedCount = t.ReadingClinicalDataList.Where(x=>!x.IsSign&& x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.SubjectVisit&& x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject).Count(),
|
||||||
|
ToBeVisitCount= t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Count(),
|
||||||
|
ToAllCount= t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC ).Count(),
|
||||||
|
ReadModuleCount =t.ReadModuleList.Where(x=>!x.IsPMConfirm).Count(),
|
||||||
|
}).Where(x=>x.ToBeDealedCount > 0);
|
||||||
|
|
||||||
});
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageClinicalDataToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
var toBeDealedCount = _subjectVisitRepository
|
||||||
|
//.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||||
|
.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(result, new { TotalToBeDealedCount = toBeDealedCount });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床数据 --CRC 待确认
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inQuery"></param>
|
||||||
|
/// <param name="_subjectVisitRepository"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput<PageOutput<ImageClinicalDataToBeDoneDto>>> GetImageClinicalDataToBeConfirmList(ImageClinicalDataToBeDoneQuery inQuery,
|
||||||
|
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
|
[FromServices] IRepository<Trial> _trialRepository)
|
||||||
|
{
|
||||||
|
|
||||||
|
var query = _trialRepository
|
||||||
|
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||||
|
//.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||||
|
.Select(t => new ImageClinicalDataToBeDoneDto()
|
||||||
|
{
|
||||||
|
TrialId = t.Id,
|
||||||
|
ResearchProgramNo = t.ResearchProgramNo,
|
||||||
|
ExperimentName = t.ExperimentName,
|
||||||
|
TrialCode = t.TrialCode,
|
||||||
|
UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(),
|
||||||
|
ToBeDealedCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.SubjectVisit && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject).Count(),
|
||||||
|
ToBeVisitCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Count(),
|
||||||
|
ToAllCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count(),
|
||||||
|
ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(),
|
||||||
|
}).Where(x => x.ReadModuleCount > 0);
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageClinicalDataToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageClinicalDataToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -490,7 +531,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(),
|
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(),
|
||||||
|
|
||||||
});
|
}).Where(x => x.ToBeDealedCount > 0); ;
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -531,7 +572,7 @@ namespace IRaCIS.Core.Application
|
||||||
ToBeReplyedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
ToBeReplyedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count()
|
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count()
|
||||||
|
|
||||||
});
|
}).Where(x => x.ToBeReplyedCount > 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -577,7 +618,7 @@ namespace IRaCIS.Core.Application
|
||||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||||
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(),
|
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(),
|
||||||
|
|
||||||
});
|
}).Where(x => x.ToBeReUploadCount > 0);
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageReUploadToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageReUploadToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -621,7 +662,7 @@ namespace IRaCIS.Core.Application
|
||||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||||
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(),
|
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(),
|
||||||
|
|
||||||
});
|
}).Where(x => x.ToBeDealedCount > 0); ;
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageSubmittedToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageSubmittedToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -674,7 +715,7 @@ namespace IRaCIS.Core.Application
|
||||||
//待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
|
//待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
|
||||||
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
|
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
|
||||||
|
|
||||||
});
|
}).Where(x => x.UrgentCount > 0);
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQualityToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQualityToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -719,7 +760,7 @@ namespace IRaCIS.Core.Application
|
||||||
ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
|
ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
|
||||||
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
|
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
|
||||||
|
|
||||||
});
|
}).Where(x => x.ToBeDealedCount > 0); ;
|
||||||
|
|
||||||
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
@ -791,9 +832,9 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
&& t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||||
})
|
}).Where(x => x.UnReadCount > 0);
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
#region 废弃
|
#region 废弃
|
||||||
//var query = _trialRepository
|
//var query = _trialRepository
|
||||||
|
|
|
@ -75,7 +75,14 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public ClinicalDataTrialSet ClinicalDataTrialSet { get; set; }
|
public ClinicalDataTrialSet ClinicalDataTrialSet { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
[ForeignKey("TrialId")]
|
||||||
|
|
||||||
|
public Trial Trial { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
[ForeignKey("ReadingId")]
|
[ForeignKey("ReadingId")]
|
||||||
|
|
||||||
public SubjectVisit SubjectVisit { get; set; }
|
public SubjectVisit SubjectVisit { get; set; }
|
||||||
|
|
|
@ -80,29 +80,41 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public bool IsPMConfirm { get; set; } = false;
|
public bool IsPMConfirm { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
public bool IsNotNeedPMConfirm { get; set; } = false;
|
||||||
/// CRC是否正在申请撤回
|
|
||||||
/// </summary>
|
/// <summary>
|
||||||
public bool IsCRCApplicationRevoke { get; set; } = false;
|
/// CRC是否正在申请撤回
|
||||||
|
/// </summary>
|
||||||
|
public bool IsCRCApplicationRevoke { get; set; } = false;
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
|
|
||||||
public DateTime? DeletedTime { get; set; }
|
public DateTime? DeletedTime { get; set; }
|
||||||
|
|
||||||
public Guid? DeleteUserId { get; set; }
|
public Guid? DeleteUserId { get; set; }
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
/////
|
/// 临床数据是否完整
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public decimal VisitNum { get; set; }
|
public bool? IsClinicalDataComplete { get; set; }
|
||||||
|
|
||||||
// [JsonIgnore]
|
/// <summary>
|
||||||
///// <summary>
|
/// 临床数据是否盲化
|
||||||
///// 对应
|
/// </summary>
|
||||||
///// </summary>
|
public bool? IsClinicalDataBlind { get; set; }
|
||||||
//[ForeignKey("ReadModuleId")]
|
|
||||||
//public ReadModule ReadModuleModel { get; set; }
|
|
||||||
|
|
||||||
[JsonIgnore]
|
///// <summary>
|
||||||
|
/////
|
||||||
|
///// </summary>
|
||||||
|
//public decimal VisitNum { get; set; }
|
||||||
|
|
||||||
|
// [JsonIgnore]
|
||||||
|
///// <summary>
|
||||||
|
///// 对应
|
||||||
|
///// </summary>
|
||||||
|
//[ForeignKey("ReadModuleId")]
|
||||||
|
//public ReadModule ReadModuleModel { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 受试者
|
/// 受试者
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -85,8 +85,8 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public virtual ICollection<TrialStatusDetail> ClinicalTrialProjectDetails { get; set; }
|
public virtual ICollection<TrialStatusDetail> ClinicalTrialProjectDetails { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual ICollection<TrialDictionary> TrialDicList { get; set; }
|
public virtual ICollection<TrialDictionary> TrialDicList { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<ReadingClinicalData> ReadingClinicalDataList { get; set; }
|
||||||
|
|
||||||
[StringLength(100)]
|
[StringLength(100)]
|
||||||
public string TrialCode { get; set; } = string.Empty;
|
public string TrialCode { get; set; } = string.Empty;
|
||||||
|
|
Loading…
Reference in New Issue