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 running
Details
continuous-integration/drone/push Build is running
Details
commit
0781496c69
|
@ -64,7 +64,7 @@ public static class ExcelExportHelper
|
|||
foreach (var key in dic.Keys)
|
||||
{
|
||||
//是数组 那么找到对应的属性 进行翻译
|
||||
if (dic[key]!=null && dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||
if (dic[key] != null && dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||
{
|
||||
|
||||
var newObjList = new List<object>();
|
||||
|
@ -255,9 +255,13 @@ public static class ExcelExportHelper
|
|||
/// </summary>
|
||||
public int AutoColumnTitleRowIndex { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 模板列最后的索引
|
||||
/// </summary>
|
||||
public int TempalteLastColumnIndex { get; set; }
|
||||
|
||||
public List<string> CDISCList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 动态的列名
|
||||
/// </summary>
|
||||
|
@ -421,7 +425,7 @@ public static class ExcelExportHelper
|
|||
workbook.RemoveSheetAt(1);
|
||||
}
|
||||
|
||||
//中文替换项目术语
|
||||
#region 中文替换项目术语
|
||||
if (data.TrialObjectNameList?.Count > 0)
|
||||
{
|
||||
var replaceObjectList = data.TrialObjectNameList;
|
||||
|
@ -457,6 +461,9 @@ public static class ExcelExportHelper
|
|||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
if (dynamicColumnConfig != null)
|
||||
{
|
||||
|
@ -468,6 +475,7 @@ public static class ExcelExportHelper
|
|||
//动态移除列的数量
|
||||
var dynamicRemoveColunmCount = dynamicColumnConfig.RemoveColunmIndexList.Count();
|
||||
|
||||
//在动态列开始前移除的数量
|
||||
var beforeDynamicRemoveCount = dynamicColumnConfig.RemoveColunmIndexList.Where(t => t < dynamicColumnConfig.AutoColumnStartIndex).Count();
|
||||
|
||||
//动态添加列的数量
|
||||
|
@ -635,6 +643,311 @@ public static class ExcelExportHelper
|
|||
}
|
||||
|
||||
|
||||
public static async Task<(MemoryStream, string)> CDISC_DataExport_Async(string code, ExcelExportInfo data, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null, DynamicColumnConfig? dynamicColumnConfig = null)
|
||||
{
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
//判断是否有字典翻译
|
||||
|
||||
object translateData = data;
|
||||
|
||||
Dictionary<string, object> translatedDic = default;
|
||||
|
||||
if (_dictionaryService != null && translateType != null)
|
||||
{
|
||||
|
||||
//一个值 对应不同的字典翻译
|
||||
var needTranslatePropertyList = translateType.GetProperties().Where(t => t.IsDefined(typeof(DictionaryTranslateAttribute), true))
|
||||
.SelectMany(c =>
|
||||
c.GetCustomAttributes(typeof(DictionaryTranslateAttribute), false).Select(f => (DictionaryTranslateAttribute?)f).Where(t => t.CriterionType == criterionType || t.CriterionType == null)
|
||||
.Select(k => new { c.Name, k.DicParentCode, k.IsTranslateDenpendOtherProperty, k.DependPropertyName, k.DependPropertyValueStr })
|
||||
).ToList();
|
||||
|
||||
|
||||
|
||||
//字典表查询出所有需要翻译的数据
|
||||
|
||||
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
|
||||
|
||||
var dic = data.ConvertToDictionary();
|
||||
//var dic = (JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull())).IfNullThrowException();
|
||||
|
||||
foreach (var key in dic.Keys)
|
||||
{
|
||||
//是数组 那么找到对应的属性 进行翻译
|
||||
if (dic[key] != null && dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||
//if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
||||
{
|
||||
|
||||
var newObjList = new List<object>();
|
||||
var no = 1;
|
||||
foreach (var item in dic[key] as IList)
|
||||
//foreach (var item in dic[key] as JArray)
|
||||
{
|
||||
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
{
|
||||
if (itemDic.Keys.Any(t => t == needTranslateProperty.Name))
|
||||
{
|
||||
//翻译的属性依赖其他属性
|
||||
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
||||
{
|
||||
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||
{
|
||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
}
|
||||
}
|
||||
//普通翻译 或者某一标准翻译
|
||||
else
|
||||
{
|
||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||
|
||||
|
||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
itemDic.Add("No", no++);
|
||||
newObjList.Add(itemDic);
|
||||
}
|
||||
|
||||
dic[key] = newObjList;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//data = dic;
|
||||
translateData = dic;
|
||||
translatedDic = dic;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var (physicalPath, fileName) = await FileStoreHelper.GetCommonDocPhysicalFilePathAsync(_hostEnvironment, _commonDocumentRepository, code);
|
||||
|
||||
|
||||
//模板路径
|
||||
var tplPath = physicalPath;
|
||||
|
||||
#region 根据中英文 删除模板sheet
|
||||
|
||||
// 打开模板文件
|
||||
var templateFile = new FileStream(tplPath, FileMode.Open, FileAccess.Read);
|
||||
|
||||
// 获取文件流
|
||||
var templateStream = new MemoryStream();
|
||||
templateFile.CopyTo(templateStream);
|
||||
templateStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
var workbook = new XSSFWorkbook(templateStream);
|
||||
|
||||
int sheetCount = workbook.NumberOfSheets;
|
||||
|
||||
if (sheetCount == 2)
|
||||
{
|
||||
if (isEn_US)
|
||||
{
|
||||
workbook.RemoveSheetAt(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
workbook.RemoveSheetAt(1);
|
||||
}
|
||||
|
||||
if (dynamicColumnConfig != null)
|
||||
{
|
||||
var sheet = workbook.GetSheetAt(0);
|
||||
|
||||
|
||||
var cdicsRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex - 1);
|
||||
var titelRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex);
|
||||
var templateRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex + 1);
|
||||
|
||||
//动态移除列的数量
|
||||
var dynamicRemoveColunmCount = dynamicColumnConfig.RemoveColunmIndexList.Count();
|
||||
|
||||
//在动态列开始前移除的数量
|
||||
var beforeDynamicRemoveCount = dynamicColumnConfig.RemoveColunmIndexList.Where(t => t < dynamicColumnConfig.AutoColumnStartIndex).Count();
|
||||
|
||||
//动态添加列的数量
|
||||
var needAddCount = dynamicColumnConfig.ColumnNameList.Count;
|
||||
|
||||
//原始表 最终索引
|
||||
var originTotalEndIndex = dynamicColumnConfig.TempalteLastColumnIndex;
|
||||
|
||||
//减去动态移除后原始结束索引
|
||||
var originRemoveEndIndex = originTotalEndIndex - dynamicRemoveColunmCount;
|
||||
|
||||
//最终表 动态列开始索引
|
||||
var dynamicColunmStartIndex = dynamicColumnConfig.AutoColumnStartIndex - beforeDynamicRemoveCount;
|
||||
|
||||
//最终表 动态列的终止索引
|
||||
var dynamicColunmEndIndex = dynamicColunmStartIndex + needAddCount - 1;
|
||||
|
||||
//最终表 最终索引
|
||||
var totalColunmEndIndex = originTotalEndIndex + needAddCount - dynamicRemoveColunmCount;
|
||||
|
||||
|
||||
//动态列后需要移动的数量
|
||||
var backMoveCount = totalColunmEndIndex - dynamicColunmEndIndex;
|
||||
|
||||
//删除需要动态删除的列 从大到小移除,否则索引会变
|
||||
foreach (var removeIndex in dynamicColumnConfig.RemoveColunmIndexList.OrderByDescending(t => t))
|
||||
{
|
||||
//将后面的列向前移动
|
||||
for (var i = 0; i < originTotalEndIndex - removeIndex; i++)
|
||||
{
|
||||
Console.WriteLine(titelRow.GetCell(removeIndex + i + 1).StringCellValue);
|
||||
titelRow.GetCell(removeIndex + i).SetCellValue(titelRow.GetCell(removeIndex + i + 1).StringCellValue);
|
||||
templateRow.GetCell(removeIndex + i).SetCellValue(templateRow.GetCell(removeIndex + i + 1).StringCellValue);
|
||||
|
||||
//后面的数据要清空
|
||||
titelRow.GetCell(removeIndex + i + 1).SetCellValue("");
|
||||
templateRow.GetCell(removeIndex + i + 1).SetCellValue("");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//创建新的列
|
||||
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
|
||||
{
|
||||
cdicsRow.CreateCell(i + 1);
|
||||
titelRow.CreateCell(i + 1);
|
||||
templateRow.CreateCell(i + 1);
|
||||
}
|
||||
//移动Title 和下面的模板标识
|
||||
|
||||
var gap = totalColunmEndIndex - originRemoveEndIndex;
|
||||
|
||||
for (int i = totalColunmEndIndex; i > dynamicColunmEndIndex; i--)
|
||||
{
|
||||
|
||||
titelRow.GetCell(i).SetCellValue(titelRow.GetCell(i - gap).StringCellValue);
|
||||
|
||||
templateRow.GetCell(i).SetCellValue(templateRow.GetCell(i - gap).StringCellValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//设置动态Tilte
|
||||
|
||||
for (int i = dynamicColunmStartIndex; i < dynamicColunmStartIndex + needAddCount; i++)
|
||||
{
|
||||
var name = dynamicColumnConfig.ColumnNameList[i - dynamicColunmStartIndex];
|
||||
|
||||
var cdicsCode= dynamicColumnConfig.CDISCList[i - dynamicColunmStartIndex];
|
||||
|
||||
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
||||
titelRow.GetCell(i).SetCellValue(name);
|
||||
templateRow.GetCell(i).SetCellValue("");
|
||||
}
|
||||
}
|
||||
|
||||
using (var memoryStream2 = new MemoryStream())
|
||||
{
|
||||
workbook.Write(memoryStream2, true);
|
||||
|
||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
templateStream = memoryStream2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region MiniExcel
|
||||
|
||||
var memoryStream = new MemoryStream();
|
||||
|
||||
var config = new OpenXmlConfiguration()
|
||||
{
|
||||
IgnoreTemplateParameterMissing = true,
|
||||
};
|
||||
|
||||
await MiniExcel.SaveAsByTemplateAsync(memoryStream, templateStream.ToArray(), translateData, config);
|
||||
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
if (dynamicColumnConfig != null)
|
||||
{
|
||||
var dynamicTranslateDataList = await _dictionaryService.GetBasicDataSelect(dynamicColumnConfig.TranslateDicNameList.ToArray());
|
||||
|
||||
// 使用NPOI 进行二次处理
|
||||
var wb = new XSSFWorkbook(memoryStream);
|
||||
var sheet = wb.GetSheetAt(0);
|
||||
|
||||
var list = translatedDic["List"] as IList;
|
||||
|
||||
foreach (var itemResult in list)
|
||||
{
|
||||
var index = list.IndexOf(itemResult);
|
||||
|
||||
//从第四行开始处理动态列
|
||||
var row = sheet.GetRow(index + dynamicColumnConfig.AutoColumnTitleRowIndex + 1);
|
||||
|
||||
var itemDic = itemResult.ToDictionary();
|
||||
|
||||
var itemList = itemDic[dynamicColumnConfig.DynamicListName] as IList;
|
||||
|
||||
//这个数组是动态的,有的多,有的少,所以在此对比Title 一致才赋值
|
||||
foreach (var itemObj in itemList)
|
||||
{
|
||||
|
||||
var iteObjDic = itemObj.ToDictionary();
|
||||
|
||||
var itemDicName = iteObjDic[dynamicColumnConfig.DynamicItemDicName]?.ToString();
|
||||
var itemValue = iteObjDic[dynamicColumnConfig.DynamicItemValueName]?.ToString();
|
||||
|
||||
//var writeIndex = itemList.IndexOf(itemObj) + dynamicColumnConfig.AutoColumnStartIndex;
|
||||
|
||||
var writeIndex = dynamicColumnConfig.ColumnNameList.IndexOf(iteObjDic[dynamicColumnConfig.DynamicItemTitleName].ToString()) + dynamicColumnConfig.AutoColumnStartIndex;
|
||||
|
||||
if (itemDicName.IsNotNullOrEmpty())
|
||||
{
|
||||
|
||||
var translatedItemData = dynamicTranslateDataList[itemDicName].Where(t => t.Code.ToLower() == itemValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||
|
||||
row.GetCell(writeIndex).SetCellValue(translatedItemData);
|
||||
}
|
||||
else
|
||||
{
|
||||
row.GetCell(writeIndex).SetCellValue(itemValue);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var memoryStream2 = new MemoryStream();
|
||||
wb.Write(memoryStream2, true);
|
||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
memoryStream = memoryStream2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return (memoryStream, fileName);
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出文件模板
|
||||
/// </summary>
|
||||
|
|
|
@ -67,6 +67,11 @@
|
|||
动态列开始的行index 从0开始
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.ExcelExportHelper.DynamicColumnConfig.TempalteLastColumnIndex">
|
||||
<summary>
|
||||
模板列最后的索引
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.ExcelExportHelper.DynamicColumnConfig.ColumnNameList">
|
||||
<summary>
|
||||
动态的列名
|
||||
|
@ -974,7 +979,7 @@
|
|||
InternationalizationService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.InternationalizationService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Internationalization},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,ZiggyCreatures.Caching.Fusion.IFusionCache)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.InternationalizationService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Internationalization},AutoMapper.IMapper,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.PublishLog},Microsoft.Extensions.Localization.IStringLocalizer,ZiggyCreatures.Caching.Fusion.IFusionCache)">
|
||||
<summary>
|
||||
InternationalizationService
|
||||
</summary>
|
||||
|
@ -12909,6 +12914,13 @@
|
|||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialMaintenanceService.TrialUserSendJoinEmail(IRaCIS.Application.Contracts.TrialUserSendJoinEmailCommand,IRaCIS.Core.Application.Service.IMailVerificationService)">
|
||||
<summary>
|
||||
项目人员 邮件过期 重新发送邀请邮件
|
||||
</summary>
|
||||
<param name="incommand"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialMaintenanceService.GetTrialUserScreeningList(IRaCIS.Application.Contracts.TrialUserQuery)">
|
||||
<summary> Setting页面 项目参与人员勾选列表 </summary>
|
||||
</member>
|
||||
|
@ -15292,11 +15304,6 @@
|
|||
组件一致性和原Arm2是否有差异
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.CommonLessionExport.LessionAnswerList">
|
||||
<summary>
|
||||
最终导出的病灶信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.GetNextCRCChallengeInDto.QCChallengeId">
|
||||
<summary>
|
||||
QCChallengeId
|
||||
|
|
|
@ -1837,6 +1837,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
var export_Template = StaticData.Export.TrialSelfAnalysisList_Export;
|
||||
|
||||
#region 自身一致性分析和组间一致性分析
|
||||
|
||||
if (inQuery.ReadingExportType == ExportResult.DetailedTableOfIntraReaderAnalysisResults)
|
||||
{
|
||||
//找到非一致性分析的任务
|
||||
|
@ -1918,6 +1920,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var columNameList = list.SelectMany(t => t.QuestionAnswerList).Where(t => t.QuestionName.IsNotNullOrEmpty()).Select(t => t.QuestionName).Distinct().ToList();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
|
@ -1925,6 +1929,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
var dynamicColumnConfig = new DynamicColumnConfig()
|
||||
{
|
||||
//可读的列表名行索引,不是{{}} 模板行索引
|
||||
AutoColumnTitleRowIndex = 2,
|
||||
AutoColumnStartIndex = 5,
|
||||
TempalteLastColumnIndex = 4,
|
||||
|
@ -1984,6 +1989,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
{
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.OCT_ReadingLession_Export, ExportCatogory = ExportResult.OCT_ReadingLession_Export });
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.SelfDefine)
|
||||
{
|
||||
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CDISC_Reading_Export, ExportCatogory = ExportResult.CDISC });
|
||||
}
|
||||
|
||||
switch (criterion.ArbitrationRule)
|
||||
{
|
||||
|
@ -2086,7 +2095,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
inQuery.ReadingExportType == ExportResult.DetailedTableOfLesions ||
|
||||
inQuery.ReadingExportType == ExportResult.TableOfAssessmentResults)
|
||||
{
|
||||
removeColumnIndexList = new List<int>() { 6, 7, 8 };
|
||||
if (!criterion.IsArbitrationReading)
|
||||
{
|
||||
//仲裁阅片 才有裁判阅片明细表 同时要把模板里面的三列给去掉
|
||||
removeColumnIndexList = new List<int>() { 6, 7, 8 };
|
||||
}
|
||||
}
|
||||
|
||||
var export_Template = StaticData.Export.CommonReading_Export;
|
||||
|
@ -2111,12 +2124,25 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
{
|
||||
//病灶明细表
|
||||
export_Template = StaticData.Export.ReadingLession_Export;
|
||||
|
||||
}
|
||||
else if (inQuery.ReadingExportType == ExportResult.OCT_ReadingLession_Export)
|
||||
{
|
||||
//OCT
|
||||
export_Template = StaticData.Export.OCT_ReadingLession_Export;
|
||||
}
|
||||
else
|
||||
{
|
||||
//CDISC
|
||||
export_Template = StaticData.Export.CDISC_Reading_Export;
|
||||
}
|
||||
|
||||
|
||||
//病灶明细表 需要单独处理
|
||||
if (inQuery.ReadingExportType != ExportResult.DetailedTableOfLesions && inQuery.ReadingExportType != ExportResult.OCT_ReadingLession_Export)
|
||||
|
||||
if (inQuery.ReadingExportType == ExportResult.TableOfAssessmentResults ||
|
||||
inQuery.ReadingExportType == ExportResult.DetailedTableOfAssessmentResults ||
|
||||
inQuery.ReadingExportType == ExportResult.DetailedTableOfAdjudicationResults
|
||||
)
|
||||
|
||||
{
|
||||
//其他可以统一处理
|
||||
list = await query.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider,
|
||||
|
@ -2129,13 +2155,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
isEn_Us = _userInfo.IsEn_Us
|
||||
}).ToListAsync();
|
||||
}
|
||||
else
|
||||
//病灶明细表 斑块表 需要单独处理
|
||||
else if (inQuery.ReadingExportType == ExportResult.DetailedTableOfLesions ||
|
||||
inQuery.ReadingExportType == ExportResult.OCT_ReadingLession_Export)
|
||||
{
|
||||
//病灶明细表
|
||||
if (inQuery.ReadingExportType == ExportResult.OCT_ReadingLession_Export)
|
||||
{
|
||||
export_Template = StaticData.Export.OCT_ReadingLession_Export;
|
||||
}
|
||||
|
||||
var taskList = await query.ProjectTo<CommonLessionExport>(_mapper.ConfigurationProvider,
|
||||
new
|
||||
|
@ -2174,7 +2197,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
var dynamicLessionTitleList = lessionAnserList.Select(t => new DymamicQuestionInfo { QuestionMark = t.QuestionMark, QuestionName = t.QuestionName, TranslateDicName = t.TranslateDicName }).Distinct();
|
||||
var dynamicTitleList = dynamicExtraAddTitleList.Union(dynamicLessionTitleList).ToList();
|
||||
|
||||
//最终的病灶列表 要把裁判的也要加进去
|
||||
//最终的病灶列表 要把裁判的也要加进去,需要处理裁判标记
|
||||
list = new List<CommonEvaluationExport>();
|
||||
|
||||
|
||||
|
@ -2230,6 +2253,64 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (inQuery.ReadingExportType == ExportResult.CDISC)
|
||||
{
|
||||
// 配置在外层问题 或者表格问题上
|
||||
var taskList = await query.ProjectTo<CommonLessionExport>(_mapper.ConfigurationProvider,
|
||||
new
|
||||
{
|
||||
readingExportType = inQuery.ReadingExportType,
|
||||
criterionType = criterion.CriterionType,
|
||||
arbitrationRule = criterion.ArbitrationRule,
|
||||
trialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
||||
isEn_Us = _userInfo.IsEn_Us
|
||||
}).ToListAsync();
|
||||
|
||||
//动态列,以不同的病灶配置的问题取并集
|
||||
var lessionAnserList = taskList.Where(t => t.LesionList.Count() > 0).FirstOrDefault()?.LesionList.FirstOrDefault()?.LessionAnswerList ?? new List<CommonLessionQuestionAnswerInfo>();
|
||||
|
||||
//通过问题标识取并集
|
||||
|
||||
var dynamicTitleList = lessionAnserList.Select(t => new DymamicQuestionInfo { QuestionMark = t.QuestionMark, QuestionName = t.QuestionName, TranslateDicName = t.TranslateDicName }).Distinct();
|
||||
|
||||
//最终的病灶列表 要把裁判的也要加进去,需要处理裁判标记
|
||||
list = new List<CommonEvaluationExport>();
|
||||
|
||||
foreach (var item in taskList.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum))
|
||||
{
|
||||
if (item.LesionList.Count > 0)
|
||||
{
|
||||
foreach (var lession in item.LesionList.OrderBy(t => t.LessionType).ThenBy(t => t.LessionCode))
|
||||
{
|
||||
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode });
|
||||
|
||||
|
||||
//有三部分组成 外层问题+ 没有配置病灶编号和类型+ 动态的表格问题
|
||||
var dynamicLessionInfoList = item.QuestionAnswerList.Union(dynamicPartialLessionInfoList).ToList();
|
||||
|
||||
//OCT 多个表格,但是只导出一个表格,有的问题答案就是空的
|
||||
if (dynamicLessionInfoList.Count > 0)
|
||||
{
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//要把裁判任务加进去 裁判任务上没有病灶
|
||||
|
||||
list.Add(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2239,111 +2320,160 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, criterion.IsGlobalReading, list);
|
||||
|
||||
//合并之前获取翻译的字典名,否则有的没法翻译
|
||||
var translateDicNameList = list.SelectMany(t => t.QuestionAnswerList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Distinct().ToList();
|
||||
|
||||
|
||||
if (inQuery.ReadingExportType != ExportResult.CDISC)
|
||||
{
|
||||
#region 系统标准处理整体肿瘤评估合并
|
||||
|
||||
//针对1.1 整体肿瘤评估 有的两列要合并一列
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB || criterion.CriterionType == CriterionType.IRECIST1Point1)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
//处理合并表头
|
||||
|
||||
var questionType = item.IsBaseline == true ? QuestionType.ExistDisease : QuestionType.Tumor;
|
||||
|
||||
var findItem = item.QuestionAnswerList.Where(t => t.QuestionType == questionType).FirstOrDefault();
|
||||
|
||||
if (findItem != null)
|
||||
{
|
||||
findItem.QuestionName = _userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估";
|
||||
}
|
||||
|
||||
|
||||
if (item.IsBaseline == true)
|
||||
{
|
||||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.Tumor).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ExistDisease).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
//处理合并表头
|
||||
|
||||
var questionType = item.IsBaseline == true ? QuestionType.ExistDisease : QuestionType.ImgOncology;
|
||||
|
||||
var findItem = item.QuestionAnswerList.Where(t => t.QuestionType == questionType).FirstOrDefault();
|
||||
|
||||
if (findItem != null)
|
||||
{
|
||||
findItem.QuestionName = _userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估";
|
||||
}
|
||||
|
||||
if (item.IsBaseline == true)
|
||||
{
|
||||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ImgOncology).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ExistDisease).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (export_Template == StaticData.Export.CommonJudgeReadingDetail_Export)
|
||||
{
|
||||
//裁判产生标记为空的数据过滤掉
|
||||
list = list.Where(t => t.IsTrigerJudge != null).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
exportInfo.CriterionName = criterion.CriterionName;
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, criterion.IsGlobalReading, list);
|
||||
|
||||
|
||||
#region 系统标准处理整体肿瘤评估合并
|
||||
|
||||
var translateDicNameList = list.SelectMany(t => t.QuestionAnswerList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Distinct().ToList();
|
||||
|
||||
|
||||
//针对1.1 整体肿瘤评估 有的两列要合并一列
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB || criterion.CriterionType == CriterionType.IRECIST1Point1)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
//处理合并表头
|
||||
|
||||
var questionType = item.IsBaseline == true ? QuestionType.ExistDisease : QuestionType.Tumor;
|
||||
|
||||
var findItem = item.QuestionAnswerList.Where(t => t.QuestionType == questionType).FirstOrDefault();
|
||||
|
||||
if (findItem != null)
|
||||
{
|
||||
findItem.QuestionName = _userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估";
|
||||
}
|
||||
|
||||
|
||||
if (item.IsBaseline == true)
|
||||
{
|
||||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.Tumor).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ExistDisease).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
//处理合并表头
|
||||
|
||||
var questionType = item.IsBaseline == true ? QuestionType.ExistDisease : QuestionType.ImgOncology;
|
||||
|
||||
var findItem = item.QuestionAnswerList.Where(t => t.QuestionType == questionType).FirstOrDefault();
|
||||
|
||||
if (findItem != null)
|
||||
{
|
||||
findItem.QuestionName = _userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估";
|
||||
}
|
||||
|
||||
if (item.IsBaseline == true)
|
||||
{
|
||||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ImgOncology).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ExistDisease).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
var columNameList = list.SelectMany(t => t.QuestionAnswerList).Where(t => t.QuestionName.IsNotNullOrEmpty()).Select(t => t.QuestionName).Distinct().ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
if (export_Template == StaticData.Export.CommonJudgeReadingDetail_Export)
|
||||
{
|
||||
//裁判产生标记为空的数据过滤掉
|
||||
list = list.Where(t => t.IsTrigerJudge != null).ToList();
|
||||
}
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
var dynamicColumnConfig = new DynamicColumnConfig()
|
||||
var dynamicColumnConfig = new DynamicColumnConfig();
|
||||
|
||||
if (inQuery.ReadingExportType != ExportResult.CDISC)
|
||||
{
|
||||
AutoColumnTitleRowIndex = 2,
|
||||
AutoColumnStartIndex = 6,
|
||||
TempalteLastColumnIndex = 8,
|
||||
DynamicItemDicName = "TranslateDicName",
|
||||
DynamicItemValueName = "QuestionValue",
|
||||
DynamicItemTitleName = "QuestionName",
|
||||
DynamicListName = "QuestionAnswerList",
|
||||
RemoveColunmIndexList = removeColumnIndexList,
|
||||
ColumnNameList = columNameList ?? new List<string>(),
|
||||
TranslateDicNameList = translateDicNameList ?? new List<string>()
|
||||
};
|
||||
|
||||
//合并之后获取最后的列名
|
||||
var columNameList = list.SelectMany(t => t.QuestionAnswerList).Where(t => t.QuestionName.IsNotNullOrEmpty()).Select(t => t.QuestionName).Distinct().ToList();
|
||||
|
||||
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(export_Template, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
|
||||
dynamicColumnConfig = new DynamicColumnConfig()
|
||||
{
|
||||
AutoColumnTitleRowIndex = 2,
|
||||
AutoColumnStartIndex = 6,
|
||||
TempalteLastColumnIndex = 8,
|
||||
DynamicItemDicName = "TranslateDicName",
|
||||
DynamicItemValueName = "QuestionValue",
|
||||
DynamicItemTitleName = "QuestionName",
|
||||
DynamicListName = "QuestionAnswerList",
|
||||
RemoveColunmIndexList = removeColumnIndexList,
|
||||
ColumnNameList = columNameList ?? new List<string>(),
|
||||
TranslateDicNameList = translateDicNameList ?? new List<string>()
|
||||
};
|
||||
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(export_Template, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
|
||||
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
{
|
||||
FileDownloadName = $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}_{fileName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
|
||||
};
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
FileDownloadName = $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}_{fileName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
|
||||
};
|
||||
|
||||
var nameList = list.SelectMany(t => t.QuestionAnswerList).Where(t => t.QuestionName.IsNotNullOrEmpty() && t.CDISCCode.IsNotNullOrEmpty()).Select(t => new { t.QuestionName, t.CDISCCode }).Distinct().ToList();
|
||||
|
||||
var columNameList = nameList.Select(t => t.QuestionName).Distinct().ToList();
|
||||
var cdiscCodeList = nameList.Select(t => t.CDISCCode).Distinct().ToList();
|
||||
|
||||
dynamicColumnConfig = new DynamicColumnConfig()
|
||||
{
|
||||
AutoColumnTitleRowIndex = 1,
|
||||
AutoColumnStartIndex = 6,
|
||||
TempalteLastColumnIndex = 10,
|
||||
DynamicItemDicName = "TranslateDicName",
|
||||
DynamicItemValueName = "QuestionValue",
|
||||
DynamicItemTitleName = "QuestionName",
|
||||
DynamicListName = "QuestionAnswerList",
|
||||
RemoveColunmIndexList = removeColumnIndexList,
|
||||
ColumnNameList = columNameList ?? new List<string>(),
|
||||
CDISCList = cdiscCodeList,
|
||||
TranslateDicNameList = translateDicNameList ?? new List<string>()
|
||||
};
|
||||
|
||||
var (memoryStream, fileName) = await ExcelExportHelper.CDISC_DataExport_Async(export_Template, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
|
||||
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
{
|
||||
FileDownloadName = $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}_{fileName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class InternationalizationService(IRepository<Internationalization> _internationalizationRepository,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IInternationalizationService
|
||||
IMapper _mapper, IRepository<PublishLog> _publishLogRepository, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IInternationalizationService
|
||||
{
|
||||
|
||||
|
||||
|
@ -61,6 +61,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> BatchAddOrUpdateFrontInternationalization(List<BatchInternationalizationDto> batchList)
|
||||
{
|
||||
var result = (await _publishLogRepository.Where(t => t.IsCurrentVersion == true).ProjectTo<PublishLogView>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
foreach (var item in batchList)
|
||||
{
|
||||
var find = await _internationalizationRepository.FirstOrDefaultAsync(t => t.Code == item.Code && t.Description == item.Description && t.InternationalizationType == 0);
|
||||
|
@ -77,7 +79,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
// 0 是预翻译 1是已确认 2是后端废弃
|
||||
mapItem.State = 0;
|
||||
|
||||
await _internationalizationRepository.AddAsync(mapItem);
|
||||
find = await _internationalizationRepository.AddAsync(mapItem);
|
||||
}
|
||||
|
||||
if (find.PublishLogId == null || find.PublishLogId == Guid.Empty)
|
||||
{
|
||||
find.PublishLogId = result.Id;
|
||||
}
|
||||
}
|
||||
await _internationalizationRepository.SaveChangesAsync();
|
||||
|
|
|
@ -147,7 +147,8 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
var isInternal = _userInfo.IsZhiZhun;
|
||||
|
||||
var query = from sysDoc in _systemDocumentRepository.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
var query = from sysDoc in _systemDocumentRepository.AsQueryable(true)
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
//外部人员 只签署 文档类型枚举值有值的
|
||||
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
||||
|
@ -181,7 +182,10 @@ namespace IRaCIS.Core.Application.Services
|
|||
//UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
||||
};
|
||||
|
||||
var list = await query.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
||||
var list = await query
|
||||
//过滤掉删除的,并且没有签名的
|
||||
.Where(t => !(t.IsDeleted == true && t.ConfirmTime == null))
|
||||
.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null)
|
||||
.ToPagedListAsync(inQuery);
|
||||
|
||||
|
|
|
@ -430,7 +430,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
|
||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.CountAsync();
|
||||
|
||||
|
@ -587,7 +587,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
#endregion
|
||||
|
||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.CountAsync();
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Medallion.Threading;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
@ -58,7 +59,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
|
||||
[UnitOfWork]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput<NoneDicomStudyAddReturnDto>> AddOrUpdateNoneDicomStudy(NoneDicomStudyAddOrEdit addOrEditNoneDicomStudy)
|
||||
{
|
||||
|
||||
|
@ -70,6 +71,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
NoneDicomStudy? optEntity = null;
|
||||
var @lock = _distributedLockProvider.CreateLock($"NoneDicomCode");
|
||||
|
||||
|
@ -85,6 +88,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
optEntity = await _noneDicomStudyRepository.InsertFromDTOAsync(addOrEditNoneDicomStudy);
|
||||
|
||||
optEntity.StudyCode = AppSettings.GetCodeStr(optEntity.Code, nameof(NoneDicomStudy));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -105,7 +109,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
[HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{noneDicomStudyId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteNoneDicomStudy(Guid noneDicomStudyId, Guid subjectVisitId)
|
||||
{
|
||||
|
@ -128,7 +132,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
|
||||
[HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{noneDicomStudyFileId:guid}")]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> DeleteNoneDicomStudyFile(Guid noneDicomStudyFileId, Guid subjectVisitId)
|
||||
{
|
||||
//提交了 但是IQC同意的时候 是可以删除的 | 普通提交后也不能删除
|
||||
|
@ -155,7 +159,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public async Task<List<NoneDicomStudyFileView>> GetNoneDicomStudyFileList(Guid noneDicomStudyId)
|
||||
{
|
||||
return await _noneDicomStudyFileRepository.Where(t => t.NoneDicomStudyId == noneDicomStudyId)
|
||||
.ProjectTo<NoneDicomStudyFileView>(_mapper.ConfigurationProvider).OrderBy(t=>t.CreateTime).ToListAsync();
|
||||
.ProjectTo<NoneDicomStudyFileView>(_mapper.ConfigurationProvider).OrderBy(t => t.CreateTime).ToListAsync();
|
||||
}
|
||||
|
||||
[HttpGet("{subjectVisitId:guid}")]
|
||||
|
|
|
@ -254,6 +254,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
}
|
||||
}
|
||||
|
||||
findStudy = addStudy;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -321,15 +323,19 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
}
|
||||
|
||||
|
||||
#region 只配置单个部位自动赋值
|
||||
//项目配置的影像部位
|
||||
var trialBodyPartList = _trialRepository.Where(t => t.Id == trialId).SelectMany(t => t.TrialBodyPartList).ToList();
|
||||
var trialBodyParts = _trialRepository.Where(t => t.Id == trialId).Select(t => t.BodyPartTypes).FirstOrDefault();
|
||||
|
||||
var trialBodyPartList = trialBodyParts.Split('|', StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (trialBodyPartList.Count() == 1)
|
||||
{
|
||||
var first = trialBodyPartList.First();
|
||||
findStudy.BodyPartForEdit = first.Code;
|
||||
findStudy.BodyPartForEdit = first;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
var @lock2 = _distributedLockProvider.CreateLock($"StudyCommit");
|
||||
|
||||
|
|
|
@ -230,6 +230,15 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
|
||||
public class NewUserSendEmailCommand
|
||||
{
|
||||
public Guid IdentityUserId { get; set; }
|
||||
public string BaseUrl { get; set; } = string.Empty;
|
||||
public string RouteUrl { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public class IdentityUserTypeDTO : UserAddUserType
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
@ -312,6 +321,8 @@ namespace IRaCIS.Application.Contracts
|
|||
{
|
||||
//public bool CanEditUserType { get; set; }
|
||||
|
||||
public bool IsFirstAdd { get; set; }
|
||||
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
|
|
@ -582,6 +582,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddNewUserSendEmail(NewUserSendEmailCommand incommand)
|
||||
{
|
||||
await _mailVerificationService.AddUserSendEmailAsync(incommand.IdentityUserId, incommand.BaseUrl, incommand.RouteUrl);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新用户
|
||||
/// </summary>
|
||||
|
|
|
@ -302,18 +302,20 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string LatestReplyUserName { get; set; } = String.Empty;
|
||||
|
||||
public string Content { get; set; } = string.Empty;
|
||||
public string ContentReplaced {
|
||||
public string ContentReplaced
|
||||
{
|
||||
|
||||
get {
|
||||
|
||||
var msg= Content.Replace("<div style='margin-left:20px'>", "").Replace("</div>", "");
|
||||
get
|
||||
{
|
||||
|
||||
var msg = Content.Replace("<div style='margin-left:20px'>", "").Replace("</div>", "");
|
||||
|
||||
string[] substrings = msg.Split(new string[] { "<br>", "<br/>" }, StringSplitOptions.None);
|
||||
|
||||
return string.Join("\n\n", substrings);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[DictionaryTranslateAttribute("ChallengeIsClosed")]
|
||||
public bool IsClosed { get; set; }
|
||||
|
@ -1168,6 +1170,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string QuestionValue { get; set; }
|
||||
|
||||
public string TranslateDicName { get; set; }
|
||||
|
||||
public string CDISCCode { get; set; }
|
||||
}
|
||||
public class CommonEvaluationExport
|
||||
{
|
||||
|
@ -1215,14 +1219,28 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string JudgeNote { get; set; } = string.Empty;
|
||||
|
||||
public string VisitNote { get; set; }
|
||||
|
||||
#region CDISC_阅片结果表
|
||||
|
||||
public string TrialCode { get; set; }
|
||||
|
||||
public string TrialSiteSubjectCode => TrialSiteCode + SubjectCode;
|
||||
|
||||
//最晚拍片日期
|
||||
public DateTime? LatestScanDate { get; set; }
|
||||
|
||||
//阅片完成时间
|
||||
public DateTime? SignTime { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class CommonLessionExport : CommonEvaluationExport
|
||||
{
|
||||
/// <summary>
|
||||
/// 最终导出的病灶信息
|
||||
/// </summary>
|
||||
public List<CommonLessionQuestionAnswerInfo> LessionAnswerList { get; set; }
|
||||
///// <summary>
|
||||
///// 最终导出的病灶信息
|
||||
///// </summary>
|
||||
//public List<CommonLessionQuestionAnswerInfo> LessionAnswerList { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
|
@ -1255,6 +1273,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string QuestionValue { get; set; }
|
||||
|
||||
public string TranslateDicName { get; set; }
|
||||
|
||||
public string CDISCCode { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
@ -1720,6 +1740,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
public string CreateUserFullName { get; set; } = String.Empty;
|
||||
|
||||
public string CreateUserName { get; set; } = String.Empty;
|
||||
|
||||
//public bool NeedReUpload { get; set; }
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum))
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
||||
.ForMember(d => d.SubjectStatus, u => u.MapFrom(s => s.Subject.Status))
|
||||
|
||||
|
||||
.ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.FullName))
|
||||
.ForMember(d => d.ClinicalInformationTransmissionEnum, u => u.MapFrom(s => s.Trial.ClinicalInformationTransmissionEnum))
|
||||
|
||||
|
@ -242,7 +242,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
QuestionType = c.ReadingQuestionTrial.QuestionType,
|
||||
QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName,
|
||||
QuestionValue = c.IsGlobalChange ? c.GlobalChangeAnswer : c.Answer,
|
||||
TranslateDicName = c.ReadingQuestionTrial.DictionaryCode
|
||||
TranslateDicName = c.ReadingQuestionTrial.DictionaryCode,
|
||||
CDISCCode = c.ReadingQuestionTrial.CDISCCode
|
||||
})))
|
||||
;
|
||||
|
||||
|
@ -255,15 +256,18 @@ namespace IRaCIS.Core.Application.Service
|
|||
(arbitrationRule == ArbitrationRule.Reading ?
|
||||
u.Subject.SubjectVisitTaskList.Any(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Judge && t.TrialReadingCriterionId == trialReadingCriterionId && u.VisitTaskNum < t.VisitTaskNum) :
|
||||
false)))
|
||||
.ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.ReadingCategory==ReadingCategory.Judge? u.JudgeResultRemark : u.JudgeVisitTask.JudgeResultRemark))
|
||||
.ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.ReadingCategory == ReadingCategory.Judge ? u.JudgeResultRemark : u.JudgeVisitTask.JudgeResultRemark))
|
||||
.ForMember(o => o.VisitNote, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).FirstOrDefault()!.Answer))
|
||||
//.ForMember(o => o.IsSubjectHaveReadingPeriod, t => t.MapFrom(u => arbitrationRule == ArbitrationRule.Reading ?
|
||||
//u.Subject.ReadModuleList.Any(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.ReadingSetType == ReadingSetType.ImageReading) : false))
|
||||
|
||||
|
||||
.ForMember(o => o.SubjectCriterionReadingPeriodVisitNumList, t => t.MapFrom(u =>
|
||||
u.Subject.ReadModuleList.Where(t=>t.TrialReadingCriterionId == trialReadingCriterionId && t.ReadingSetType == ReadingSetType.ImageReading).Select(c=>c.SubjectVisit.VisitNum)))
|
||||
|
||||
.ForMember(o => o.SubjectCriterionReadingPeriodVisitNumList, t => t.MapFrom(u =>
|
||||
u.Subject.ReadModuleList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.ReadingSetType == ReadingSetType.ImageReading).Select(c => c.SubjectVisit.VisitNum)))
|
||||
|
||||
.ForMember(o => o.TrialCode, t => t.MapFrom(u => u.Trial.TrialCode))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.LatestScanDate, t => t.MapFrom(u => u.SourceSubjectVisit.LatestScanDate))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
|
||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||
.ForMember(o => o.QuestionAnswerList, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList
|
||||
|
@ -273,8 +277,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
QuestionType = c.ReadingQuestionTrial.QuestionType,
|
||||
QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName,
|
||||
QuestionValue = c.IsGlobalChange?c.GlobalChangeAnswer: c.Answer,
|
||||
TranslateDicName = c.ReadingQuestionTrial.DictionaryCode
|
||||
QuestionValue = c.IsGlobalChange ? c.GlobalChangeAnswer : c.Answer,
|
||||
TranslateDicName = c.ReadingQuestionTrial.DictionaryCode,
|
||||
CDISCCode = c.ReadingQuestionTrial.CDISCCode
|
||||
})))
|
||||
;
|
||||
|
||||
|
@ -292,6 +297,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(o => o.QuestionMark, t => t.MapFrom(u => u.ReadingTableQuestionTrial.QuestionMark))
|
||||
.ForMember(o => o.QuestionName, t => t.MapFrom(u => isEn_Us ? u.ReadingTableQuestionTrial.QuestionEnName : u.ReadingTableQuestionTrial.QuestionName))
|
||||
.ForMember(o => o.QuestionValue, t => t.MapFrom(u => u.Answer))
|
||||
.ForMember(o => o.CDISCCode, t => t.MapFrom(u => u.ReadingTableQuestionTrial.CDISCCode))
|
||||
.ForMember(o => o.TranslateDicName, t => t.MapFrom(u => u.ReadingTableQuestionTrial.DictionaryCode))
|
||||
;
|
||||
|
||||
|
@ -555,7 +561,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
//一致性核查 质疑对话
|
||||
CreateMap<CheckChallengeDialog, CheckChanllengeDialogDTO>()
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUserRole.IdentityUser.UserName))
|
||||
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(t => t.CreateUserRole.FullName));
|
||||
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(t => t.CreateUserRole.IdentityUser.FullName));
|
||||
|
||||
CreateMap<SubjectVisit, CheckDialogDTO>()
|
||||
.ForMember(d => d.SubjectVisitCheck, u => u.MapFrom(t => t))
|
||||
|
@ -586,13 +592,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
// 临床数据上传 路径拼接返回
|
||||
|
||||
CreateMap<PreviousHistory, PreviousHistoryView>()
|
||||
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
||||
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.FullName))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
CreateMap<PreviousOther, PreviousOtherView>()
|
||||
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
||||
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.FullName))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
CreateMap<PreviousSurgery, PreviousSurgeryView>()
|
||||
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
||||
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.FullName))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
|
||||
|
||||
|
@ -624,7 +630,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<QCChallenge, ChallengeAndDialog>()
|
||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.FullName))
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUserRole.FullName))
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUserRole.UserName))
|
||||
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(t => t.CreateUserRole.FullName))
|
||||
.ForMember(d => d.CurrentActionUserId, u => u.MapFrom(t => t.SubjectVisit.CurrentActionUserId))
|
||||
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(t => t.SubjectVisit.CurrentActionUser.FullName))
|
||||
|
||||
|
@ -666,10 +673,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.BlindName, u => u.MapFrom(s => s.SubjectVisit.BlindName))
|
||||
//.ForMember(d => d.ClosedUserUserName, u => u.MapFrom(s => s.ClosedUser.UserName))
|
||||
.ForMember(d => d.IsQCConfirmedReupload, u => u.MapFrom(s => s.SubjectVisit.IsQCConfirmedReupload))
|
||||
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.FullName))
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.UserName))
|
||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
||||
.ForMember(d => d.LatestReplyUserFullName, u => u.MapFrom(t => t.LatestReplyUser.FullName))
|
||||
|
||||
|
||||
.ForMember(d => d.ChallengeCode, u => u.MapFrom(s => s.ChallengeCode)); //排序的时候有坑 把这个带到sql 中去了
|
||||
//.AfterMap((src, dest) => dest.ChallengeCode = "Q" + src.ChallengeCode.ToString("D5"));//实测没有效果
|
||||
|
||||
|
@ -707,7 +715,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
Guid? visiTaskId = null;
|
||||
CreateMap<NoneDicomStudy, TaskDicomStudyView>()
|
||||
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ?
|
||||
s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).Where(t => !t.FileType.Contains(StaticData.FileType.Zip)).OrderBy(t => t.CreateTime).ThenBy(t=>t.FileName)
|
||||
s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).Where(t => !t.FileType.Contains(StaticData.FileType.Zip)).OrderBy(t => t.CreateTime).ThenBy(t => t.FileName)
|
||||
: s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).OrderBy(t => t.CreateTime).ThenBy(t => t.FileName)))
|
||||
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
|
||||
|
||||
|
|
|
@ -683,8 +683,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
private async Task UnlockSyncSiteUserAsync(Guid trialId, Guid siteId, Guid trialSiteSurveyId, List<TrialSiteUserSurvey> userList)
|
||||
{
|
||||
//获取调研表用户的数据
|
||||
var existList = await _trialSiteUserSurveyRepository.Where(t => t.IsHistoryUser && t.TrialSiteSurvey.TrialId == trialId && t.TrialSiteSurvey.TrialSiteId == siteId, true).ToListAsync();
|
||||
|
||||
//遍历中心用户最新的状态
|
||||
foreach (var item in userList)
|
||||
{
|
||||
var find = existList.FirstOrDefault(t => t.SystemUserId == item.SystemUserId);
|
||||
|
@ -692,11 +694,13 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
//不存在就加入
|
||||
if (find == null)
|
||||
{
|
||||
//中心用户不在调研表里面,那么就添加到历史人员里面
|
||||
item.TrialSiteSurveyId = trialSiteSurveyId;
|
||||
await _trialSiteUserSurveyRepository.AddAsync(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
//中心用户在调研表里面,那么就更新调研表用户的状态
|
||||
find.IsHistoryUserOriginDeleted = item.IsHistoryUserOriginDeleted;
|
||||
}
|
||||
}
|
||||
|
@ -864,6 +868,9 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
var existSysUser = await _identityUserRepository.Where(t => t.EMail == userEmail, true).Include(t => t.UserRoleList).FirstOrDefaultAsync();
|
||||
|
||||
#region 人员生成
|
||||
|
||||
|
||||
if (existSysUser != null)
|
||||
{
|
||||
|
||||
|
@ -941,11 +948,14 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
await _identityUserRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
var identityUserId = existSysUser.Id;
|
||||
|
||||
#region 项目加入
|
||||
|
||||
var findTrialUser = await _trialIdentityUserRepository.Where(t => t.TrialId == trialId && t.IdentityUserId == identityUserId, true, true).Include(t => t.TrialUserRoleList).ThenInclude(t => t.UserRole).FirstOrDefaultAsync();
|
||||
|
||||
|
@ -988,7 +998,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
foreach (var userTypeId in userTypeIdList)
|
||||
{
|
||||
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserRole.UserTypeId == userTypeId).FirstOrDefault();
|
||||
//userRole 可能为null
|
||||
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserRole?.UserTypeId == userTypeId).FirstOrDefault();
|
||||
|
||||
if (findTrialUserRole == null)
|
||||
{
|
||||
|
@ -1010,6 +1021,29 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 中心加入
|
||||
|
||||
foreach (var userTypeId in userTypeIdList)
|
||||
{
|
||||
var findUserRole = existSysUser.UserRoleList.Where(t => t.UserTypeId == userTypeId).FirstOrDefault();
|
||||
|
||||
var findTrialSiteUserRole = await _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId && t.UserId == findUserRole.Id, true, true).FirstOrDefaultAsync();
|
||||
|
||||
if (findTrialSiteUserRole != null)
|
||||
{
|
||||
findTrialSiteUserRole.IsDeleted = false;
|
||||
findTrialSiteUserRole.DeletedTime = null;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
await _trialSiteUserRoleRepository.AddAsync(new TrialSiteUserRole() { TrialId = trialId, TrialSiteId = trialSiteId, UserId = findUserRole.Id });
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if (isNeedSendEmail)
|
||||
{
|
||||
|
@ -1193,7 +1227,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
foreach (var userTypeId in userTypeIdList)
|
||||
{
|
||||
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserRole.UserTypeId == userTypeId).FirstOrDefault();
|
||||
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserRole?.UserTypeId == userTypeId).FirstOrDefault();
|
||||
|
||||
if (findTrialUserRole == null)
|
||||
{
|
||||
|
|
|
@ -531,6 +531,18 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
public class TrialUserSendJoinEmailCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid IdentityUserId { get; set; }
|
||||
|
||||
public string BaseUrl { get; set; } = string.Empty;
|
||||
public string RouteUrl { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
public class UpdateTrialUserRoleCommand
|
||||
{
|
||||
public List<Guid> IdList { get; set; }
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
return await _trialRepository
|
||||
.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() > 0)
|
||||
.ProjectTo<TrialSiteSurveyStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.UserRoleId })
|
||||
|
@ -70,7 +70,7 @@ namespace IRaCIS.Core.Application
|
|||
else
|
||||
{
|
||||
var trialDocStat = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.WhereIf(!_userInfo.IsAdmin, c => c.TrialDocumentList.Where(t => t.IsDeleted == false &&
|
||||
t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
|
||||
&& !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null)).Count() > 0
|
||||
|
@ -103,7 +103,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
var query = _trialRepository
|
||||
.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new CheckToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -124,11 +124,11 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync();
|
||||
|
||||
var totalToBeRepliedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng &&
|
||||
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).CountAsync();
|
||||
|
||||
|
@ -150,7 +150,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed)
|
||||
.GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId })
|
||||
.Select(g => new ReReadingApplyToBeDoneDto()
|
||||
|
@ -171,7 +171,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeApprovalCount = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount });
|
||||
|
@ -192,7 +192,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new ReviewerSelectToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -210,7 +210,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
|
||||
|
||||
return ResponseOutput.Ok(result, new { ToBeApprovalCount = toBeApprovalCount }); ;
|
||||
|
@ -228,7 +228,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new GetPMClinicalDataToBeDoneListOutDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -248,7 +248,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var all = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new GetPMClinicalDataToBeDoneListOutDto()
|
||||
{
|
||||
|
||||
|
@ -277,7 +277,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new ReviewerSelectToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -296,7 +296,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount }); ;
|
||||
|
@ -317,7 +317,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
{
|
||||
var query = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
.GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId })
|
||||
.Select(g => new ReReadingApprovalToBeDoneDto()
|
||||
|
@ -338,7 +338,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeApprovalCount = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount });
|
||||
|
@ -365,7 +365,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
//.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||
.Select(t => new ImageClinicalDataToBeDoneDto()
|
||||
{
|
||||
|
@ -407,7 +407,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
//.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||
.Select(t => new ImageClinicalDataToBeDoneDto()
|
||||
{
|
||||
|
@ -468,7 +468,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new ImageQuestionToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -493,7 +493,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count();
|
||||
|
@ -516,7 +516,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new ImageCheckQuestionToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -539,7 +539,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count();
|
||||
|
||||
|
@ -562,7 +562,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new ImageReUploadToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -585,7 +585,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount });
|
||||
|
@ -609,7 +609,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||
.Select(t => new ImageSubmittedToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -635,7 +635,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count();
|
||||
|
||||
|
@ -665,7 +665,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t=>t.UserRole.UserTypeId==_userInfo.UserTypeId)))
|
||||
.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit)
|
||||
.Select(t => new ImageQualityToBeDoneDto()
|
||||
{
|
||||
|
@ -695,12 +695,13 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeClaimedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId) && t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed && t.AuditState != AuditStateEnum.QCFailed)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId))
|
||||
&& t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed && t.AuditState != AuditStateEnum.QCFailed)
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.UserRoleId && u.ReviewAuditUserId == null))).Count();
|
||||
|
||||
|
||||
var toBeReviwedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId).Count();
|
||||
|
||||
|
||||
|
@ -723,7 +724,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(t => new ImageQuestionToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
@ -744,7 +745,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count();
|
||||
|
||||
|
@ -777,7 +778,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
|
||||
var newQuery = _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
var newQuery = _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Select(c => new IRImageReadingToBeDoneDto()
|
||||
{
|
||||
TrialId = c.TrialId,
|
||||
|
@ -887,7 +888,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await newQuery.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var toBeDealedCount = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.SelectMany(t => t.VisitTaskList)
|
||||
.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect && t.TrialReadingCriterion.IsSigned == true && t.TrialReadingCriterion.IsConfirm == true)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
|
@ -915,7 +916,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.VisitTask.DoctorUserId == _userInfo.UserRoleId)
|
||||
.GroupBy(t => new
|
||||
{
|
||||
|
@ -959,7 +960,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.DoctorUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM)
|
||||
//.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM)
|
||||
|
@ -992,7 +993,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
#region 废弃不能对包含聚合或子查询的表达式执行聚合函数
|
||||
var query = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.GroupBy(t => new
|
||||
{
|
||||
|
@ -1030,7 +1031,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeReplyedQuery = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing);
|
||||
|
||||
|
@ -1038,7 +1039,7 @@ namespace IRaCIS.Core.Application
|
|||
var toBeReplyedCount = toBeReplyedQuery.Count();
|
||||
|
||||
var tobeReviewedCount = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count();
|
||||
|
||||
|
@ -1091,7 +1092,7 @@ namespace IRaCIS.Core.Application
|
|||
if (!_userInfo.IsAdmin)
|
||||
{
|
||||
var list = await _trialRepository.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.WhereIf(!_userInfo.IsAdmin, c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) &&
|
||||
!t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId && t.ConfirmTime != null)).Count() > 0)
|
||||
.Select(t => t.Id).ToListAsync();
|
||||
|
@ -1117,11 +1118,11 @@ namespace IRaCIS.Core.Application
|
|||
var isInternal = _userInfo.IsZhiZhun;
|
||||
|
||||
var needSignTrialCount = await _trialRepository.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
|
||||
&& !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null)).Count() > 0).CountAsync();
|
||||
|
||||
var needSignSysDocCont = await _systemDocumentRepository
|
||||
var needSignSysDocCont = await _systemDocumentRepository.AsQueryable(true)
|
||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null))
|
||||
//外部人员 只签署 文档类型枚举值有值的
|
||||
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
||||
|
@ -1129,18 +1130,18 @@ namespace IRaCIS.Core.Application
|
|||
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId);
|
||||
|
||||
var signedTrialCount = await _trialDocumentRepository.AsQueryable(true)
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.Where(t => t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null)).CountAsync();
|
||||
|
||||
var signedSysDocCont = await _systemDocumentRepository
|
||||
.Where(t => t.IsDeleted == false && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null))
|
||||
var signedSysDocCont = await _systemDocumentRepository.AsQueryable(true)
|
||||
.Where(t => t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null))
|
||||
.SelectMany(t => t.NeedConfirmedUserTypeList)
|
||||
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId);
|
||||
|
||||
|
||||
var siteSurveyCount = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() > 0)
|
||||
.CountAsync();
|
||||
|
@ -1189,16 +1190,16 @@ namespace IRaCIS.Core.Application
|
|||
PM_SiteSurveryCount = isPM ? siteSurveyCount : 0,
|
||||
|
||||
PM_CheckCount = isPM ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(u => u.SubjectVisitList.Any(t => t.CheckState == CheckStateEnum.ToCheck || (t.CheckState == CheckStateEnum.CVIng &&
|
||||
t.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator))).CountAsync() : 0,
|
||||
|
||||
PM_ReviewerSelectCount = isPM ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count() > 0).CountAsync() : 0,
|
||||
|
||||
PM_ReReadingApprovalCount = isPM ? await _visitTaskReReadingRepository
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed)
|
||||
.GroupBy(t => t.OriginalReReadingTask.TrialId)
|
||||
.Select(g => new ReReadingApplyToBeDoneDto()
|
||||
|
@ -1209,7 +1210,7 @@ namespace IRaCIS.Core.Application
|
|||
}).Where(x => x.ToBeApprovalCount > 0).CountAsync() : 0,
|
||||
|
||||
PM_ClinicalDataCount = isPM ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.ReadModuleList.Where(u => u.IsCRCConfirm && !u.IsPMConfirm).Count() > 0).CountAsync() : 0,
|
||||
|
||||
#endregion
|
||||
|
@ -1217,34 +1218,34 @@ namespace IRaCIS.Core.Application
|
|||
#region CRC
|
||||
|
||||
CRC_ImageSubmitCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||
.Where(t => t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId)).Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
||||
CRC_ImageQuestionCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId)).SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
||||
|
||||
CRC_CheckQuestionCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() > 0).CountAsync() : 0,
|
||||
|
||||
CRC_ImageReUploadCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.SubjectVisitList
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count() > 0).CountAsync() : 0,
|
||||
|
||||
CRC_ClinicalDataTobeDoneCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count() > 0).CountAsync() : 0,
|
||||
|
||||
CRC_ClinialDataTobeConfirmCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.ReadModuleList.Where(x => !x.IsCRCConfirm).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
||||
|
@ -1258,11 +1259,11 @@ namespace IRaCIS.Core.Application
|
|||
SPM_SiteSurveryCount = isSPMOrCPM ? siteSurveyCount : 0,
|
||||
|
||||
SPM_ReviewerApprovalCount = isSPMOrCPM ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() > 0).CountAsync() : 0,
|
||||
|
||||
SPM_ReReadingApprovalCount = isSPMOrCPM ? await _visitTaskReReadingRepository
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
.GroupBy(t => t.OriginalReReadingTask.TrialId)
|
||||
.Select(g => new ReReadingApplyToBeDoneDto()
|
||||
|
@ -1279,7 +1280,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
IQC_IamgeQCCount = isIQC ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit)
|
||||
.Select(t => new
|
||||
{
|
||||
|
@ -1293,7 +1294,7 @@ namespace IRaCIS.Core.Application
|
|||
}).Where(x => x.ToBeClaimedCount + x.ToBeReviewedCount > 0).CountAsync() : 0,
|
||||
|
||||
IQC_QCQuestionCount = isIQC ? await _trialRepository
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
@ -1317,7 +1318,7 @@ namespace IRaCIS.Core.Application
|
|||
// .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count()>0).CountAsync() : 0,
|
||||
|
||||
|
||||
await _trialReadingCriterionRepository.Where(t => t.IsSigned == true && t.IsConfirm == true && t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
await _trialReadingCriterionRepository.Where(t => t.IsSigned == true && t.IsConfirm == true && t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(c => c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
|
@ -1330,7 +1331,7 @@ namespace IRaCIS.Core.Application
|
|||
: 0,
|
||||
|
||||
|
||||
IR_MedicalReviewCount = isIR ? await _taskMedicalReviewRepository.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
IR_MedicalReviewCount = isIR ? await _taskMedicalReviewRepository.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.VisitTask.DoctorUserId == _userInfo.UserRoleId)
|
||||
.GroupBy(t => new { t.TrialId, t.VisitTask.TrialReadingCriterionId })
|
||||
.Where(g => g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM && u.AuditState == MedicalReviewAuditState.Auditing).Count() > 0).CountAsync() : 0,
|
||||
|
@ -1341,7 +1342,7 @@ namespace IRaCIS.Core.Application
|
|||
#region MIM
|
||||
|
||||
MIM_MedicalReviewCount = isMIM ? await _taskMedicalReviewRepository
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.GroupBy(t => new { t.TrialId, t.VisitTask.TrialReadingCriterionId })
|
||||
.Select(g => new
|
||||
|
|
|
@ -1362,12 +1362,14 @@ namespace IRaCIS.Core.Application
|
|||
[AllowAnonymous]
|
||||
public async Task<TrialExtraConfig> GetTrialExtralConfig(Guid trialId)
|
||||
{
|
||||
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr, t.TrialObjectNameList }).FirstOrDefault();
|
||||
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr, t.TrialObjectNameList, t.CollectImagesEnum }).FirstOrDefault();
|
||||
|
||||
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig();
|
||||
|
||||
extralConfig.TrialObjectNameList = extralObj.TrialObjectNameList;
|
||||
|
||||
extralConfig.CollectImagesEnum = extralObj.CollectImagesEnum;
|
||||
|
||||
return extralConfig;
|
||||
}
|
||||
/// <summary>
|
||||
|
|
|
@ -360,7 +360,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
foreach (var userTypeId in userTypeIdList)
|
||||
{
|
||||
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserRole.UserTypeId == userTypeId).FirstOrDefault();
|
||||
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserRole?.UserTypeId == userTypeId).FirstOrDefault();
|
||||
|
||||
if (findTrialUserRole == null)
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@ using IRaCIS.Application.Contracts;
|
|||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Contracts.DTO;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using MassTransit.Serialization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
@ -118,6 +119,25 @@ namespace IRaCIS.Core.Application.Service
|
|||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目人员 邮件过期 重新发送邀请邮件
|
||||
/// </summary>
|
||||
/// <param name="incommand"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> TrialUserSendJoinEmail(TrialUserSendJoinEmailCommand incommand, [FromServices] IMailVerificationService _mailVerificationService)
|
||||
{
|
||||
|
||||
var userTypeList = _trialIdentityUserRepository.Where(t => t.TrialId == incommand.TrialId && t.IdentityUserId == incommand.IdentityUserId).SelectMany(t => t.TrialUserRoleList).Select(t => t.UserRole.UserTypeRole.UserTypeName).ToList();
|
||||
|
||||
var usertyps = string.Join(',', userTypeList);
|
||||
|
||||
await _mailVerificationService.ExternalUserJoinEmail(incommand.TrialId, incommand.IdentityUserId, usertyps, incommand.BaseUrl, incommand.RouteUrl);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary> Setting页面 项目参与人员勾选列表 </summary>
|
||||
[HttpPost]
|
||||
|
|
|
@ -628,7 +628,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inQuery.Expedited != null, o => o.Expedited == inQuery.Expedited)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Indication), o => o.Indication.Contains(inQuery.Indication))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.UserRoleId, isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
|
||||
|
|
|
@ -442,7 +442,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
}
|
||||
|
||||
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserRole.UserTypeId == userRoleId).FirstOrDefault();
|
||||
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserRole?.UserTypeId == userRoleId).FirstOrDefault();
|
||||
|
||||
if (findTrialUserRole == null)
|
||||
{
|
||||
|
|
|
@ -42,10 +42,13 @@ public class TrialSiteUserSurvey : BaseFullAuditEntity
|
|||
/// </summary>
|
||||
public bool IsHistoryUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 调研设置用户退出
|
||||
/// </summary>
|
||||
public bool? IsHistoryUserDeleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中心人员删除了
|
||||
/// 中心人员设置退出了
|
||||
/// </summary>
|
||||
public bool? IsHistoryUserOriginDeleted { get; set; }
|
||||
}
|
||||
|
|
|
@ -280,7 +280,7 @@ public static class StaticData
|
|||
|
||||
public const string OCT_ReadingLession_Export = "OCT_ReadingLession_Export";
|
||||
|
||||
|
||||
public const string CDISC_Reading_Export = "CDISC_Reading_Export";
|
||||
|
||||
|
||||
public const string IVUSTheMeasuredValueOfEachMatchedFragment = "IVUS_TheMeasuredValueOfEachMatchedFragment";
|
||||
|
|
Loading…
Reference in New Issue