Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
d10c936003
|
@ -311,7 +311,7 @@ namespace IRaCIS.Api.Controllers
|
|||
{
|
||||
var token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo()
|
||||
{
|
||||
Id = Guid.Empty,
|
||||
Id = Guid.NewGuid(),
|
||||
IsReviewer = false,
|
||||
IsAdmin = false,
|
||||
RealName = "Share001",
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
"CompanyShortName": "Extensive Imaging",
|
||||
"CompanyShortNameCN": "展影医疗",
|
||||
"IsEnv_US": false,
|
||||
"IsOpenErrorNoticeEmail": true,
|
||||
"IsOpenErrorNoticeEmail": false,
|
||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
||||
},
|
||||
"SystemPacsConfig": {
|
||||
|
|
|
@ -64,7 +64,7 @@ public static class ExcelExportHelper
|
|||
foreach (var key in dic.Keys)
|
||||
{
|
||||
//是数组 那么找到对应的属性 进行翻译
|
||||
if (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>();
|
||||
|
@ -74,14 +74,15 @@ public static class ExcelExportHelper
|
|||
{
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
//处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
foreach (var itemValuePair in itemDic)
|
||||
{
|
||||
if (DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
{
|
||||
itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
}
|
||||
}
|
||||
////处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
//foreach (var itemValuePair in itemDic)
|
||||
//{
|
||||
// // 临床数据 1,1 会变成2024-01-01
|
||||
// if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
// {
|
||||
// itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
|
@ -165,7 +166,7 @@ public static class ExcelExportHelper
|
|||
}
|
||||
|
||||
//中文替换项目术语
|
||||
if (data.TrialObjectNameList.Count > 0)
|
||||
if (data.TrialObjectNameList?.Count > 0)
|
||||
{
|
||||
var replaceObjectList = data.TrialObjectNameList;
|
||||
|
||||
|
@ -322,7 +323,7 @@ public static class ExcelExportHelper
|
|||
foreach (var key in dic.Keys)
|
||||
{
|
||||
//是数组 那么找到对应的属性 进行翻译
|
||||
if (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<>)))
|
||||
//if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
||||
{
|
||||
|
||||
|
@ -334,14 +335,14 @@ public static class ExcelExportHelper
|
|||
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
//处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
foreach (var itemValuePair in itemDic)
|
||||
{
|
||||
if (DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
{
|
||||
itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
}
|
||||
}
|
||||
////处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
//foreach (var itemValuePair in itemDic)
|
||||
//{
|
||||
// if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
// {
|
||||
// itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
// }
|
||||
//}
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
{
|
||||
|
@ -421,7 +422,7 @@ public static class ExcelExportHelper
|
|||
}
|
||||
|
||||
//中文替换项目术语
|
||||
if (data.TrialObjectNameList.Count > 0)
|
||||
if (data.TrialObjectNameList?.Count > 0)
|
||||
{
|
||||
var replaceObjectList = data.TrialObjectNameList;
|
||||
|
||||
|
|
|
@ -933,7 +933,7 @@
|
|||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonJudgeRatioList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonJudgeRatioList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
裁判一致率导出
|
||||
</summary>
|
||||
|
@ -1139,13 +1139,20 @@
|
|||
<param name="indto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.DoctorService.UpdateGneralSituation(IRaCIS.Application.Contracts.UpdateGneralSituationDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.DoctorService.AddOrUpdateGneralSituation(IRaCIS.Application.Contracts.SummarizeInfoDto)">
|
||||
<summary>
|
||||
修改概述
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.DoctorService.DeleteSummarizeInfo(IRaCIS.Application.Contracts.DeleteSummarizeInfoInDto)">
|
||||
<summary>
|
||||
删除概述
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.DoctorService.GetSummarizeInfo(IRaCIS.Application.Contracts.GetSummarizeInfoInDto)">
|
||||
<summary>
|
||||
获取概述
|
||||
|
@ -2342,6 +2349,21 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.HIRActivateService.GetAuthorizationCodeInfo(System.String,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Application.Contracts.SystemHospitalOption})">
|
||||
<summary>
|
||||
获取授权码明文信息
|
||||
</summary>
|
||||
<param name="authorizationCode"></param>
|
||||
<param name="_hospitalOption"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.HIRActivateService.GetTrialActivationCode(IRaCIS.Core.Application.Service.TrialAuthorizationInfo,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption})">
|
||||
<summary>
|
||||
获取项目激活码
|
||||
</summary>
|
||||
<param name="_basicSystemConfigConfig"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.OAuthService.TestClientCredentialsAsync">
|
||||
<summary>
|
||||
测试客户端凭证代码
|
||||
|
@ -5708,6 +5730,13 @@
|
|||
影像阅片临床数据签名
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingClinicalDataService.GetVisitClinicalDataName(IRaCIS.Core.Application.Service.Reading.Dto.GetVisitClinicalDataNameInDto)">
|
||||
<summary>
|
||||
获取访视临床数据名称
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingClinicalDataService.GetTrialClinicalDataSelect(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialClinicalDataSelectIndto)">
|
||||
<summary>
|
||||
获取下拉菜单
|
||||
|
@ -7261,6 +7290,11 @@
|
|||
上传时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.Reading.Dto.GetVisitClinicalDataNameInDto">
|
||||
<summary>
|
||||
获取临床数据名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetTrialClinicalDataSelectIndto.TrialId">
|
||||
<summary>
|
||||
项目ID
|
||||
|
@ -12882,8 +12916,12 @@
|
|||
暂时不用
|
||||
<summary> 获取项目访视计划</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.VisitPlanService.GetVisitStageList(System.Guid)">
|
||||
<summary> 根据项目Id,获取项目访视计划(不分页)[New]</summary>
|
||||
<member name="M:IRaCIS.Core.Application.Service.VisitPlanService.GetVisitStageList(IRaCIS.Application.Contracts.GetVisitStageListInDto)">
|
||||
<summary>
|
||||
根据项目Id,获取项目访视计划
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.VisitPlanService.GetTrialVisitStageSelect(System.Guid)">
|
||||
<summary>
|
||||
|
@ -15323,6 +15361,13 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.UseEmialGetDoctorInfo(IRaCIS.Core.Application.Contracts.UseEmialGetDoctorInfoInDto)">
|
||||
<summary>
|
||||
根据邮箱获取DoctorId 没有的话创建一个
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.VerifyEmialGetDoctorInfo(IRaCIS.Core.Application.Contracts.VerifyEmialGetDoctorInfoInDto)">
|
||||
<summary>
|
||||
验证邮箱验证码 获取医生信息Id
|
||||
|
@ -17226,16 +17271,56 @@
|
|||
银行手机号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.Summarize">
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.DoctorId">
|
||||
<summary>
|
||||
医生Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.Summarize">
|
||||
<summary>
|
||||
概述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.SummarizeEn">
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.SummarizeEn">
|
||||
<summary>
|
||||
概述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.IsMain">
|
||||
<summary>
|
||||
是否是主模板
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.Indication">
|
||||
<summary>
|
||||
适应症
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.IndicationEn">
|
||||
<summary>
|
||||
适应症
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.TrialId">
|
||||
<summary>
|
||||
项目Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:IRaCIS.Application.Contracts.SaveSummarizeInfo.SaveSelf">
|
||||
<summary>
|
||||
保存自己
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:IRaCIS.Application.Contracts.SaveSummarizeInfo.SaveAndCover">
|
||||
<summary>
|
||||
保存并覆盖
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:IRaCIS.Application.Contracts.SaveSummarizeInfo.SaveAndAdd">
|
||||
<summary>
|
||||
保存并新增
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.EmploymentInfo.WorkPartTime">
|
||||
<summary>
|
||||
工作兼职
|
||||
|
|
|
@ -110,7 +110,7 @@ public class UserSiteSurveySubmitedEventConsumer(
|
|||
return (topicStr, htmlBodyStr);
|
||||
};
|
||||
|
||||
var scenario = _trialSiteSurveyRepository.Any(t => t.Id != trialSiteSurveyId && t.TrialId == siteSurveyInfo.TrialId && t.TrialSiteId == siteSurveyInfo.TrialSiteId) ?
|
||||
var scenario = _trialSiteSurveyRepository.Where(t => t.Id != trialSiteSurveyId && t.TrialId == siteSurveyInfo.TrialId && t.TrialSiteId == siteSurveyInfo.TrialSiteId).IgnoreQueryFilters().Any() ?
|
||||
EmailBusinessScenario.Approval_UpdateSiteSurvey : EmailBusinessScenario.Approval_SubmitSiteSurvey;
|
||||
|
||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, scenario, messageToSend, emailConfigFunc);
|
||||
|
|
|
@ -8,13 +8,16 @@ using IRaCIS.Core.Application.ViewModel;
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using IRaCIS.Core.Infra.EFCore.Migrations;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.POIFS.Properties;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using static IRaCIS.Core.Application.Service.ExcelExportHelper;
|
||||
using IDictionaryService = IRaCIS.Application.Interfaces.IDictionaryService;
|
||||
|
||||
|
@ -1473,7 +1476,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
|
||||
|
||||
public List<T> DealJudgeMark<T>(ArbitrationRule arbitrationRule, IEnumerable<T> list) where T : CommonEvaluationExport
|
||||
public List<T> DealJudgeMark<T>(ArbitrationRule arbitrationRule, bool isGlobalReading, IEnumerable<T> list) where T : CommonEvaluationExport
|
||||
{
|
||||
//处理访视任务的裁判标记
|
||||
var resultExceptJudgeList = list.Where(t => t.ReadingCategory != ReadingCategory.Judge).ToList();
|
||||
|
@ -1493,6 +1496,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
if (findJudge.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
{
|
||||
item.IsJudgeSelect = findJudge.JudgeArmEnum == item.ArmEnum ? true : false;
|
||||
|
||||
item.JudgeNote = findJudge.JudgeArmEnum == item.ArmEnum ? findJudge.JudgeNote : string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1502,6 +1507,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
//两个人都做了
|
||||
if (resultExceptJudgeList.Count(t => t.VisitTaskNum == item.VisitTaskNum && t.SubjectCode == item.SubjectCode) == 2)
|
||||
{
|
||||
|
@ -1521,11 +1527,13 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
item.IsTrigerJudge = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (arbitrationRule == ArbitrationRule.Reading)
|
||||
else if (arbitrationRule == ArbitrationRule.Reading)
|
||||
{
|
||||
//处理访视裁判标记
|
||||
foreach (var visitItem in resultExceptJudgeList.Where(t => t.ReadingCategory == ReadingCategory.Visit))
|
||||
|
@ -1533,104 +1541,168 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
////默认设置为false 只处理为true 和 空的情况
|
||||
//visitItem.IsJudgeSelect = false;
|
||||
|
||||
if (judegeList.Count > 0)
|
||||
var subjectJudgeList = judegeList.Where(t => t.SubjectCode == visitItem.SubjectCode).ToList();
|
||||
|
||||
//阅片期访视号
|
||||
var subjectReadingPeriondVisitNumList = resultExceptJudgeList.Where(t => t.SubjectCode == visitItem.SubjectCode).FirstOrDefault()?.SubjectCriterionReadingPeriodVisitNumList;
|
||||
|
||||
//两个人完成最大得任务号(访视+全局)
|
||||
var subjectMaxFinishedTaskNum = resultExceptJudgeList.Where(t => t.SubjectCode == visitItem.SubjectCode)
|
||||
.GroupBy(t => t.VisitTaskNum).Where(g => g.Count() == 2).Select(g => g.Key).DefaultIfEmpty().Max();
|
||||
|
||||
var addReadingPeriodNum = isGlobalReading ? ReadingCommon.TaskNumDic[ReadingCategory.Global] : 0;
|
||||
|
||||
var finishedGlobalCount = 0;
|
||||
|
||||
//没有配置阅片期
|
||||
if (subjectReadingPeriondVisitNumList == null)
|
||||
{
|
||||
|
||||
var maxFinishedJudge = judegeList.Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned).OrderByDescending(t => t.VisitTaskNum).FirstOrDefault();
|
||||
|
||||
var maxNotFinishedJudge = judegeList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned).OrderByDescending(t => t.VisitTaskNum).FirstOrDefault();
|
||||
|
||||
|
||||
//n个裁判任务都未完成
|
||||
if (maxFinishedJudge == null && maxNotFinishedJudge != null)
|
||||
{
|
||||
if (visitItem.VisitTaskNum < maxNotFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsJudgeSelect = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
//大于当前未完成的全局裁判 后续 肯定是未知的
|
||||
visitItem.IsTrigerJudge = null;
|
||||
visitItem.IsJudgeSelect = null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//n个全局裁判都完成了,那么以最后一次裁判选择的为准
|
||||
else if (maxFinishedJudge != null && maxNotFinishedJudge == null)
|
||||
{
|
||||
if (visitItem.ArmEnum == maxFinishedJudge.JudgeArmEnum && visitItem.VisitTaskNum < maxFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsJudgeSelect = true;
|
||||
visitItem.JudgeNote = maxFinishedJudge.JudgeNote;
|
||||
}
|
||||
//裁判没选择的人设置为false
|
||||
else if (visitItem.VisitTaskNum < maxFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsJudgeSelect = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//裁判都完成的后续 没有其他裁判任务 肯定也是未知的
|
||||
visitItem.IsTrigerJudge = null;
|
||||
visitItem.IsJudgeSelect = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//两个都不为null 肯定是不同的裁判
|
||||
|
||||
//在未完成裁判之后的
|
||||
if (visitItem.VisitTaskNum > maxNotFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsTrigerJudge = null;
|
||||
visitItem.IsJudgeSelect = null;
|
||||
}
|
||||
//完成裁判之后的 ,和未完成裁判之前的
|
||||
else if (visitItem.VisitTaskNum < maxNotFinishedJudge.VisitTaskNum && visitItem.VisitTaskNum > maxFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsTrigerJudge = true;
|
||||
visitItem.IsJudgeSelect = null;
|
||||
}
|
||||
else if (visitItem.ArmEnum == maxFinishedJudge.JudgeArmEnum && visitItem.VisitTaskNum < maxFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsJudgeSelect = true;
|
||||
visitItem.JudgeNote = maxFinishedJudge.JudgeNote;
|
||||
}
|
||||
else if (visitItem.VisitTaskNum < maxFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsJudgeSelect = false;
|
||||
}
|
||||
|
||||
}
|
||||
finishedGlobalCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//没有产生裁判 有可能一个人没做完,也有可能做完了没产生裁判
|
||||
//两个人都做了
|
||||
if (resultExceptJudgeList.Count(t => t.VisitTaskNum == visitItem.VisitTaskNum && t.SubjectCode == visitItem.SubjectCode) == 2)
|
||||
//已完成的全局数量
|
||||
finishedGlobalCount = resultExceptJudgeList.Where(t => t.SubjectCode == visitItem.SubjectCode && subjectReadingPeriondVisitNumList.Any(c => (c + addReadingPeriodNum) == t.VisitTaskNum)
|
||||
/*&& t.ReadingCategory == ReadingCategory.Global*/)
|
||||
.GroupBy(t => t.VisitTaskNum).Where(g => g.Count() == 2).Select(g => g.Key).Count();
|
||||
}
|
||||
|
||||
|
||||
visitItem.IsJudgeSelect = null;
|
||||
visitItem.IsTrigerJudge = null;
|
||||
|
||||
if (finishedGlobalCount != 0)
|
||||
{
|
||||
//最大的全局是否产生裁判
|
||||
|
||||
var subjectMaxFinishedGlobalTaskNum = resultExceptJudgeList.Where(t => t.SubjectCode == visitItem.SubjectCode && subjectReadingPeriondVisitNumList.Any(c => (c + addReadingPeriodNum) == t.VisitTaskNum)
|
||||
/*&& t.ReadingCategory == ReadingCategory.Global*/)
|
||||
.GroupBy(t => t.VisitTaskNum).Where(g => g.Count() == 2).Select(g => g.Key).DefaultIfEmpty().Max();
|
||||
|
||||
//最大的完成的全局是否产生裁判
|
||||
if (subjectJudgeList.Any(t => t.VisitTaskNum == (subjectMaxFinishedGlobalTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge])))
|
||||
{
|
||||
//不存在裁判 将R1设置
|
||||
if (visitItem.ArmEnum == Arm.DoubleReadingArm1)
|
||||
|
||||
var maxJudge = subjectJudgeList.FirstOrDefault(t => t.VisitTaskNum == (subjectMaxFinishedGlobalTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge]));
|
||||
|
||||
//最大裁判完成了
|
||||
if (maxJudge.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
{
|
||||
visitItem.IsJudgeSelect = true;
|
||||
if (visitItem.VisitTaskNum < maxJudge.VisitTaskNum)
|
||||
{
|
||||
//触发裁判
|
||||
visitItem.IsTrigerJudge = true;
|
||||
|
||||
if (visitItem.ArmEnum == maxJudge.JudgeArmEnum)
|
||||
{
|
||||
visitItem.IsJudgeSelect = true;
|
||||
visitItem.JudgeNote = maxJudge.JudgeNote;
|
||||
}
|
||||
//裁判没选择的人设置为false
|
||||
else
|
||||
{
|
||||
visitItem.IsJudgeSelect = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//后续访视 未知 默认都是null
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
visitItem.IsJudgeSelect = false;
|
||||
//找到当前未阅最大裁判之前的已完成的最大裁判任务
|
||||
var maxFinishedJudge = subjectJudgeList.Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned).OrderByDescending(t => t.VisitTaskNum).FirstOrDefault();
|
||||
|
||||
if (maxFinishedJudge == null)
|
||||
{
|
||||
// 为空 裁判选择标记默认就是null 不用处理
|
||||
|
||||
if (visitItem.VisitTaskNum < maxJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsTrigerJudge = true;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (visitItem.VisitTaskNum < maxFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsTrigerJudge = true;
|
||||
|
||||
if (visitItem.ArmEnum == maxFinishedJudge.JudgeArmEnum)
|
||||
{
|
||||
visitItem.IsJudgeSelect = true;
|
||||
visitItem.JudgeNote = maxFinishedJudge.JudgeNote;
|
||||
}
|
||||
//裁判没选择的人设置为false
|
||||
else
|
||||
{
|
||||
visitItem.IsJudgeSelect = false;
|
||||
}
|
||||
}
|
||||
else if (visitItem.VisitTaskNum > maxFinishedJudge.VisitTaskNum && visitItem.VisitTaskNum < maxJudge.VisitTaskNum)
|
||||
{
|
||||
//完成裁判 和未完成裁判之间的 裁判选择标记默认是null
|
||||
|
||||
visitItem.IsTrigerJudge = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//在未完成全局裁判之后的访视 未知 默认都是null
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
visitItem.IsJudgeSelect = null;
|
||||
visitItem.IsTrigerJudge = null;
|
||||
//最大的完成的全局未产生裁判
|
||||
|
||||
if (visitItem.VisitTaskNum <= subjectMaxFinishedGlobalTaskNum)
|
||||
{
|
||||
visitItem.IsTrigerJudge = false;
|
||||
|
||||
if (visitItem.ArmEnum == Arm.DoubleReadingArm1)
|
||||
{
|
||||
visitItem.IsJudgeSelect = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
visitItem.IsJudgeSelect = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//未产生裁判的全局之后的访视 两个标记都是null (后续可能还有全局,但是全局两个人没做完)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var visitItem in resultExceptJudgeList.Where(t => t.ReadingCategory == ReadingCategory.Visit))
|
||||
{
|
||||
visitItem.IsJudgeSelect = null;
|
||||
visitItem.IsTrigerJudge = null;
|
||||
}
|
||||
|
||||
}
|
||||
return resultExceptJudgeList;
|
||||
}
|
||||
|
||||
|
@ -1976,7 +2048,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
//每次查询必须是单标准的
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.IsGlobalReading, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||
|
@ -2092,11 +2164,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
list = new List<CommonEvaluationExport>();
|
||||
|
||||
|
||||
foreach (var item in taskList)
|
||||
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)
|
||||
foreach (var lession in item.LesionList.OrderBy(t => t.LessionType).ThenBy(t => t.LessionCode))
|
||||
{
|
||||
var firstLessionAnser = lession.LessionAnswerList.FirstOrDefault() ?? new CommonLessionQuestionAnswerInfo();
|
||||
|
||||
|
@ -2158,7 +2230,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
exportInfo.CriterionName = criterion.CriterionName;
|
||||
|
||||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, list);
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, criterion.IsGlobalReading, list);
|
||||
|
||||
|
||||
#region 系统标准处理整体肿瘤评估合并
|
||||
|
@ -2228,7 +2300,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
#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);
|
||||
|
@ -2272,10 +2348,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
public async Task<IActionResult> GetCommonJudgeRatioList_Export(VisitTaskQuery inQuery,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<SubjectUser> _subjectUserRepository,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
//每次查询必须是单标准的
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule, t.IsGlobalReading }).FirstNotNullAsync();
|
||||
|
||||
|
||||
|
||||
|
@ -2298,6 +2375,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.GroupBy(t => new { t.SubjectId, t.SourceSubjectVisitId })
|
||||
.Where(g => g.Count() == 2).Select(g => g.Key.SourceSubjectVisitId).Distinct().Count();
|
||||
|
||||
//裁判不需要完成阅片
|
||||
exportInfo.JudgeVisitCount = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingCategory == ReadingCategory.Judge).Count();
|
||||
|
||||
//3、裁判认同数M:触发裁判的受试者访视中,阅片人被裁判认同的访视数量;
|
||||
|
@ -2311,10 +2389,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
UserName = g.Key.UserName,
|
||||
FullName = g.Key.FullName,
|
||||
|
||||
//访视产生裁判的访视数量
|
||||
//一致率这边裁判需要完成阅片
|
||||
TotalJudgeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
JudgeAgreeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.JudgeResultTaskId == t.Id).Count(),
|
||||
JudgeAgreeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.JudgeResultTaskId == t.Id && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
|
||||
}).ToList();
|
||||
|
@ -2331,53 +2409,207 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
exportInfo.CriterionName = criterion.CriterionName;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
var isGlobalReading = criterion.IsGlobalReading;
|
||||
var addReadingPeriodNum = isGlobalReading ? ReadingCommon.TaskNumDic[ReadingCategory.Global] : 0;
|
||||
|
||||
#region 按照受试者维度统计
|
||||
//1、裁判量M:所有完成阅片病例(至少一个阅片期)里面触发裁判的受试者数量;
|
||||
// 有阅片期没有全局 和有阅片期有全局,主要变化点在于 t.ReadingCategory == ReadingCategory.Global 变成了 t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId==trialReadingCriterionId)
|
||||
// 或者使用 isGlobalReading ? t.ReadModule.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) : t.SourceSubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum)
|
||||
|
||||
#region 患者统计部分
|
||||
|
||||
//1、裁判量M:所有完成阅片病例 最后一个阅片期触发裁判的受试者数量;
|
||||
//2、总样本量N:R1,R2均完成阅片(至少一个阅片期)的受试者数量;
|
||||
exportInfo.SubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.Where(t => t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
//找到两个人完成的阅片期
|
||||
.Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
.GroupBy(t => new { t.SubjectId, t.VisitTaskNum })
|
||||
.Where(g => g.Count() == 2).Any())
|
||||
.Count();
|
||||
|
||||
exportInfo.SubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId).Where(t =>
|
||||
t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Any(t => t.ReadingCategory == ReadingCategory.Global && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
).Count();
|
||||
#region 废弃
|
||||
////最后一个已完成的全局 没产生裁判 (之前有裁判),不算入裁判量
|
||||
//exportInfo.judgeSubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
// .Where(t => t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
// .GroupBy(t => new { t.SubjectId, t.VisitTaskNum })
|
||||
// .Where(g => g.Count() == 2 )
|
||||
// .Any(g => g.Any(t => t.JudgeVisitTaskId != null)))
|
||||
// .Count();
|
||||
|
||||
exportInfo.judgeSubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId).Where(t =>
|
||||
t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Any(t => t.ReadingCategory == ReadingCategory.Global && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
&& t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Any(t => t.ReadingCategory == ReadingCategory.Judge)
|
||||
).Count();
|
||||
//exportInfo.judgeSubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
// .Where(t => t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
// .GroupBy(t => new { t.SubjectId, t.VisitTaskNum })
|
||||
// .Where(g => g.Count() == 2)
|
||||
// .Any(g => g.OrderByDescending(c => c.VisitTaskNum).FirstOrDefault().JudgeVisitTaskId != null)
|
||||
// )
|
||||
// .Count();
|
||||
|
||||
var doctorList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
.GroupBy(t => new { t.DoctorUserId, t.DoctorUser.UserName, t.DoctorUser.FullName })
|
||||
.Select(g => new DoctorJudgeRatio()
|
||||
//exportInfo.DoctorSubjectStatList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// //筛选全局 已完成的任务
|
||||
// .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
// .GroupBy(t => new { t.DoctorUserId, t.DoctorUser.UserName, t.DoctorUser.FullName })
|
||||
// .Select(g => new DoctorJudgeRatio()
|
||||
// {
|
||||
// DoctorUserId = g.Key.DoctorUserId,
|
||||
// UserName = g.Key.UserName,
|
||||
// FullName = g.Key.FullName,
|
||||
|
||||
// //最后一个阅片期触发裁判 且裁判已阅
|
||||
// TotalJudgeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// .Max(t => t.VisitTaskNum))
|
||||
// .Select(t => t.SubjectId).Distinct().Count(),
|
||||
|
||||
// // G-2 G-4 可能选择的是不同的医生,要以最后一次选择的为准
|
||||
// JudgeAgreeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// .Max(t => t.VisitTaskNum))
|
||||
// .Where(t => t.JudgeVisitTask.JudgeResultTaskId == t.Id)
|
||||
// .Select(t => t.SubjectId).Distinct().Count(),
|
||||
|
||||
// }).ToList();
|
||||
#endregion
|
||||
|
||||
// subject(G1 产生裁判 G2 不产生裁判 那么该患者不计入总量)
|
||||
var subjectReadingPeriodList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
.Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
.GroupBy(t => new { t.SubjectId, t.VisitTaskNum, t.JudgeVisitTaskId })
|
||||
.Where(g => g.Count() == 2)
|
||||
.Select(g => new { g.Key.SubjectId, g.Key.VisitTaskNum, g.Key.JudgeVisitTaskId })
|
||||
.ToList();
|
||||
|
||||
exportInfo.judgeSubjectCount = subjectReadingPeriodList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组
|
||||
.Select(g => g.OrderByDescending(x => x.VisitTaskNum).First()) // 每组取 VisitTaskNum 最大的记录
|
||||
.Where(t => t.JudgeVisitTaskId != null)
|
||||
.Count();
|
||||
|
||||
var subjectReadingPeriodDoctorList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
.Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
.GroupBy(t => new { t.SubjectId, t.VisitTaskNum })
|
||||
.Where(g => g.Count() == 2)
|
||||
.Select(g => new
|
||||
{
|
||||
g.Key.SubjectId,
|
||||
g.Key.VisitTaskNum,
|
||||
|
||||
GlobalList = g.Select(t => new
|
||||
{
|
||||
t.Id,
|
||||
t.VisitTaskNum,
|
||||
t.DoctorUserId,
|
||||
t.DoctorUser.UserName,
|
||||
t.DoctorUser.FullName,
|
||||
t.JudgeVisitTaskId,
|
||||
t.ReadingTaskState,
|
||||
t.JudgeVisitTask.JudgeResultTaskId,
|
||||
JudgeTaskState = (ReadingTaskState?)t.JudgeVisitTask.ReadingTaskState
|
||||
}).ToList()
|
||||
})
|
||||
.ToList();
|
||||
|
||||
#region 调试注释
|
||||
//var cc = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组
|
||||
|
||||
// .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null))
|
||||
|
||||
// .ToList();
|
||||
|
||||
//var ss = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组
|
||||
// //最后一个全局没有产生裁判的subject要过滤掉 过滤后
|
||||
// .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null))
|
||||
|
||||
// .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).FirstOrDefault())
|
||||
|
||||
// .ToList();
|
||||
|
||||
|
||||
//var kk = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组
|
||||
// //最后一个全局没有产生裁判的subject要过滤掉 过滤后
|
||||
// .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null))
|
||||
// // 存在 已完成的全局裁判
|
||||
// .Where(subg => subg.Any(t => t.GlobalList.Any(c => c.JudgeTaskState == ReadingTaskState.HaveSigned)))
|
||||
// .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).FirstOrDefault())
|
||||
|
||||
// .ToList();
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
var filteredList = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组
|
||||
//最后一个全局没有产生裁判的subject要过滤掉 过滤后
|
||||
.Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null))
|
||||
// subject 存在 已完成的全局裁判
|
||||
.Where(subg => subg.Any(t => t.GlobalList.Any(c => c.JudgeTaskState == ReadingTaskState.HaveSigned)))
|
||||
//找到最大完成裁判的阅片期 // 每个subject 仅仅留最后一个已完成的全局
|
||||
.Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).FirstOrDefault())
|
||||
.SelectMany(t => t.GlobalList.Select(u => new
|
||||
{
|
||||
t.SubjectId,
|
||||
t.VisitTaskNum,
|
||||
u.JudgeVisitTaskId,
|
||||
u.DoctorUserId,
|
||||
u.UserName,
|
||||
u.FullName,
|
||||
u.JudgeResultTaskId,
|
||||
VisitTaskId = u.Id
|
||||
}))
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
//找到该标准的阅片人
|
||||
var armList = new List<Arm>() { Arm.SingleReadingArm, Arm.DoubleReadingArm1, Arm.DoubleReadingArm2 };
|
||||
|
||||
exportInfo.DoctorSubjectStatList = _subjectUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && armList.Contains(t.ArmEnum))
|
||||
.Select(t => new DoctorJudgeRatio()
|
||||
{
|
||||
DoctorUserId = g.Key.DoctorUserId,
|
||||
UserName = g.Key.UserName,
|
||||
FullName = g.Key.FullName,
|
||||
DoctorUserId = t.DoctorUserId,
|
||||
UserName = t.DoctorUser.UserName,
|
||||
FullName = t.DoctorUser.FullName,
|
||||
|
||||
//触发裁判的受试者数量
|
||||
TotalJudgeCount = g.Where(t => t.ReadingCategory == ReadingCategory.Global && t.JudgeVisitTaskId != null).Select(t => t.SubjectId).Distinct().Count(),
|
||||
TotalJudgeCount = 0,
|
||||
|
||||
JudgeAgreeCount = g.Where(t => t.ReadingCategory == ReadingCategory.Global && t.JudgeVisitTaskId != null && t.JudgeVisitTask.JudgeResultTaskId == t.Id).Select(t => t.SubjectId).Distinct().Count(),
|
||||
JudgeAgreeCount = 0
|
||||
|
||||
}).ToList();
|
||||
}).Distinct().ToList();
|
||||
|
||||
foreach (var doctor in exportInfo.DoctorSubjectStatList)
|
||||
{
|
||||
if (filteredList.Any(t => t.DoctorUserId == doctor.DoctorUserId))
|
||||
{
|
||||
doctor.TotalJudgeCount= filteredList.Where(t=>t.DoctorUserId==doctor.DoctorUserId).Count();
|
||||
|
||||
doctor.JudgeAgreeCount= filteredList.Where(t => t.DoctorUserId == doctor.DoctorUserId).Count(t => t.JudgeResultTaskId == t.VisitTaskId);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 按照阅片期维度统计
|
||||
//、裁判量J:所有完成阅片(R1和R2均完成)的阅片期里面触发裁判的阅片期数量;
|
||||
//2、总样本量Q:R1,R2均完成阅片的阅片期数量;
|
||||
#region 阅片期部分
|
||||
|
||||
exportInfo.ReadingPeriodCount = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingCategory == ReadingCategory.Global && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
.GroupBy(t => new { t.SubjectId, t.SouceReadModuleId })
|
||||
.Where(g => g.Count() == 2).Select(g => g.Key.SouceReadModuleId).Distinct().Count();
|
||||
exportInfo.ReadingPeriodCount = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
//找到阅片期已阅片完
|
||||
.Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
.GroupBy(t => new { t.SubjectId, t.VisitTaskNum })
|
||||
.Where(g => g.Count() == 2)
|
||||
.Select(g => new { g.Key.SubjectId, g.Key.VisitTaskNum }).Distinct().Count();
|
||||
|
||||
exportInfo.judgeReadingPeriodCount = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
//找到阅片期已阅片完
|
||||
.Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
.GroupBy(t => new { t.SubjectId, t.VisitTaskNum })
|
||||
//裁判不要求做完
|
||||
.Where(g => g.Count() == 2 && g.Any(c => c.JudgeVisitTaskId != null))
|
||||
.Select(g => new { g.Key.SubjectId, g.Key.VisitTaskNum }).Distinct().Count();
|
||||
|
||||
exportInfo.judgeReadingPeriodCount = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingCategory == ReadingCategory.Global && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
.GroupBy(t => new { t.SubjectId, t.SouceReadModuleId })
|
||||
.Where(g => g.Count() == 2 && g.Any(c => c.JudgeVisitTaskId != null)).Select(g => g.Key.SouceReadModuleId).Distinct().Count();
|
||||
|
||||
//3、裁判认同数J:触发裁判的阅片期中,阅片人被裁判认同的阅片期数量;
|
||||
//4、总裁判数Q:阅片人完成阅片的阅片期中,触发裁判的阅片期数量;
|
||||
|
||||
var doctor2List = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
exportInfo.DoctorPeriodStatList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
.Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && t.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
.GroupBy(t => new { t.DoctorUserId, t.DoctorUser.UserName, t.DoctorUser.FullName })
|
||||
//有全局裁判
|
||||
//.Where(g => g.Any(t => t.ReadingCategory == ReadingCategory.Global && t.JudgeVisitTaskId != null))
|
||||
|
@ -2387,24 +2619,22 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
UserName = g.Key.UserName,
|
||||
FullName = g.Key.FullName,
|
||||
|
||||
//触发裁判的阅片期的数量
|
||||
TotalJudgeCount = g.Where(t => t.ReadingCategory == ReadingCategory.Global && t.SouceReadModuleId != null && t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned).Select(t => t.SouceReadModuleId).Distinct().Count(),
|
||||
//触发裁判的阅片期的数量 并且裁判要求做完
|
||||
TotalJudgeCount = g
|
||||
.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
.Select(t => new { t.SubjectId, t.VisitTaskNum }).Distinct().Count(),
|
||||
|
||||
JudgeAgreeCount = g.Where(t => t.ReadingCategory == ReadingCategory.Global && t.JudgeVisitTaskId != null && t.JudgeVisitTask.JudgeResultTaskId == t.Id)
|
||||
.Select(t => t.SouceReadModuleId).Distinct().Count(),
|
||||
JudgeAgreeCount = g
|
||||
.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
.Where(t => t.JudgeVisitTask.JudgeResultTaskId == t.Id)
|
||||
.Select(t => new { t.SubjectId, t.VisitTaskNum }).Distinct().Count(),
|
||||
|
||||
}).ToList();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
exportInfo.DoctorSubjectStatList = doctorList;
|
||||
|
||||
exportInfo.DoctorPeriodStatList = doctor2List;
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.ReadingPeriodJudgeRatio_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -174,6 +174,8 @@ namespace IRaCIS.Application.Contracts
|
|||
public class SelectionReviewerDTO : DoctorDTO
|
||||
{
|
||||
public int DoctorTrialState { get; set; }
|
||||
|
||||
public bool IsEnroll { get; set; } = false;
|
||||
public string OptUserName { get; set; } = string.Empty;
|
||||
public DateTime? OptTime { get; set; }
|
||||
public string? OptTimeStr => OptTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
@ -308,6 +310,8 @@ namespace IRaCIS.Application.Contracts
|
|||
public string WeChat { get; set; } = String.Empty;
|
||||
public int Nation { get; set; }
|
||||
|
||||
public string? BlindPublications { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工作兼职
|
||||
/// </summary>
|
||||
|
@ -324,7 +328,7 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class SendEmailInDto
|
||||
{
|
||||
public string Email { get; set; }
|
||||
public List<string> Email { get; set; }
|
||||
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
@ -361,18 +365,26 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
public class DeleteSummarizeInfoInDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
public class GetSummarizeInfoInDto
|
||||
{
|
||||
public Guid DoctorId { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
public Guid? TrialId { get; set; } = null;
|
||||
}
|
||||
|
||||
public class UpdateGneralSituationDto
|
||||
public class SummarizeInfoDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 医生Id
|
||||
/// </summary>
|
||||
public Guid DoctorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 概述
|
||||
|
@ -383,6 +395,52 @@ namespace IRaCIS.Application.Contracts
|
|||
/// 概述
|
||||
/// </summary>
|
||||
public string SummarizeEn { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是主模板
|
||||
/// </summary>
|
||||
public bool IsMain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 适应症
|
||||
/// </summary>
|
||||
public string Indication { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 适应症
|
||||
/// </summary>
|
||||
public string IndicationEn { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 项目Id
|
||||
/// </summary>
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
public SaveSummarizeInfo SaveSummarizeInfoType { get; set; } = SaveSummarizeInfo.SaveSelf;
|
||||
}
|
||||
|
||||
public enum SaveSummarizeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 保存自己
|
||||
/// </summary>
|
||||
SaveSelf = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 保存并覆盖
|
||||
/// </summary>
|
||||
SaveAndCover = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 保存并新增
|
||||
/// </summary>
|
||||
SaveAndAdd = 2,
|
||||
|
||||
}
|
||||
|
||||
public class UpdateGneralSituationDto
|
||||
{
|
||||
public List<SummarizeInfoDto> SummarizeList { get; set; }
|
||||
}
|
||||
|
||||
public class BasicInfoAndEmploymentDto: DoctorBasicInfoCommand
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
var query = _doctorRepository.AsQueryable()
|
||||
.Where(x=>x.TrialId==null)
|
||||
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
|
||||
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
|
||||
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
|
||||
|
@ -77,6 +78,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/
|
||||
.Where(x=>x.TrialId==null)
|
||||
|
||||
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
|
||||
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
|
||||
.WhereIf(trialConfig.TrialType == TrialType.NoneOfficial, t => t.IsVirtual == true)
|
||||
|
@ -102,6 +104,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
var doctorStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
|
||||
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var doctorEnrollList =await _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
|
||||
.ToListAsync();
|
||||
result.CurrentPageData.ToList().ForEach(doctor =>
|
||||
{
|
||||
//简历申请列表 --处理已经申请的
|
||||
|
@ -109,6 +113,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
if (doctorState != null)
|
||||
{
|
||||
doctor.DoctorTrialState = (int)EnrollStatus.HasApplyDownloadResume;
|
||||
doctor.IsEnroll = doctorEnrollList.Any(x => x.DoctorId == doctor.Id);
|
||||
doctor.OptTime = doctorState.OptTime;
|
||||
doctor.OptUserName = doctorState.OptUserName;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
using IRaCIS.Application.Contracts;
|
||||
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.MassTransit.Consumer;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MimeKit;
|
||||
|
@ -13,7 +15,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class DoctorService(IRepository<Doctor> _doctorRepository,
|
||||
IRepository<DoctorDictionary> _doctorDictionaryRepository,
|
||||
IRepository<DoctorSummarize> _doctorSummarizeRepository,
|
||||
IRepository<Enroll> _enrollRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<Attachment> _attachmentRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IRepository<DoctorCriterionFile> _doctorCriterionFileRepository,
|
||||
|
@ -69,6 +73,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
//插入中间表
|
||||
basicInfoModel.TitleIds.ForEach(titleId => doctor.DoctorDicRelationList.Add(new DoctorDictionary() { DoctorId = doctor.Id, KeyName = StaticData.Title, DictionaryId = titleId }));
|
||||
|
||||
// 新增给默认值
|
||||
doctor.CooperateStatus = ContractorStatusEnum.Noncooperation;
|
||||
doctor.ReviewStatus = ReviewerInformationConfirmStatus.ConfirmRefuse;
|
||||
doctor.AcceptingNewTrial = false;
|
||||
doctor.ActivelyReading = false;
|
||||
doctor.IsVirtual = false;
|
||||
|
||||
|
||||
await _doctorRepository.AddAsync(doctor);
|
||||
//_doctorRepository.Add(doctor);
|
||||
|
@ -218,41 +229,120 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<bool> UpdateGneralSituation(UpdateGneralSituationDto inDto)
|
||||
public async Task<DoctorSummarize> AddOrUpdateGneralSituation(SummarizeInfoDto inDto)
|
||||
{
|
||||
if (inDto.TrialId != null)
|
||||
if (inDto.TrialId != null&&inDto.Id==null)
|
||||
{
|
||||
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.DoctorId == inDto.Id&&x.TrialId==inDto.TrialId.Value, x => new Doctor()
|
||||
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
|
||||
if (systemCount == 0)
|
||||
{
|
||||
Summarize = inDto.Summarize,
|
||||
SummarizeEn = inDto.SummarizeEn,
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new Doctor()
|
||||
{
|
||||
Summarize = inDto.Summarize,
|
||||
SummarizeEn = inDto.SummarizeEn,
|
||||
});
|
||||
var trialinfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).FirstNotNullAsync();
|
||||
var dictionery = await _dictionaryRepository.Where(x => x.Parent.Code == "Indication" && x.Code == trialinfo.IndicationEnum.ToString()).FirstNotNullAsync();
|
||||
inDto.IndicationEn = dictionery.Value;
|
||||
inDto.Indication = dictionery.ValueCN;
|
||||
var system= inDto.Clone();
|
||||
system.TrialId = null;
|
||||
system.IsMain = true;
|
||||
await _doctorSummarizeRepository.InsertOrUpdateAsync(system, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (inDto.TrialId == null)
|
||||
{
|
||||
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
|
||||
if (systemCount == 0)
|
||||
{
|
||||
inDto.IsMain = true;
|
||||
|
||||
}
|
||||
if (inDto.Indication.IsNullOrEmpty() && inDto.IndicationEn.IsNullOrEmpty())
|
||||
{
|
||||
inDto.Indication = "默认";
|
||||
inDto.IndicationEn = "Default";
|
||||
}
|
||||
var exists = await _doctorSummarizeRepository
|
||||
.Where( x => x.IndicationEn == inDto.IndicationEn|| x.Indication == inDto.Indication)
|
||||
|
||||
.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null&&x.Id!=inDto.Id);
|
||||
if (exists)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType!= SaveSummarizeInfo.SaveSelf)
|
||||
{
|
||||
switch (inDto.SaveSummarizeInfoType)
|
||||
{
|
||||
case SaveSummarizeInfo.SaveAndCover:
|
||||
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x =>
|
||||
x.DoctorId == inDto.DoctorId && x.TrialId == null &&
|
||||
x.IndicationEn == inDto.IndicationEn && x.Indication == inDto.Indication, x => new DoctorSummarize()
|
||||
{
|
||||
Summarize = inDto.Summarize,
|
||||
SummarizeEn = inDto.SummarizeEn
|
||||
});
|
||||
break;
|
||||
case SaveSummarizeInfo.SaveAndAdd:
|
||||
|
||||
|
||||
var exists = await _doctorSummarizeRepository
|
||||
.WhereIf(_userInfo.IsEn_Us, x => x.IndicationEn == inDto.IndicationEn)
|
||||
.WhereIf(!_userInfo.IsEn_Us, x => x.Indication == inDto.Indication)
|
||||
.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null);
|
||||
if (exists)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
|
||||
}
|
||||
await _doctorSummarizeRepository.BatchDeleteNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId);
|
||||
|
||||
|
||||
var needData = inDto.Clone();
|
||||
needData.TrialId = null;
|
||||
await _doctorSummarizeRepository.InsertOrUpdateAsync(needData, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (inDto.TrialId == null && inDto.IsMain)
|
||||
{
|
||||
|
||||
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null,
|
||||
x => new DoctorSummarize()
|
||||
{
|
||||
IsMain = false
|
||||
});
|
||||
}
|
||||
|
||||
var success= await _doctorRepository.SaveChangesAsync();
|
||||
return success;
|
||||
|
||||
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(inDto, true);
|
||||
return entity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除概述
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<bool> DeleteSummarizeInfo(DeleteSummarizeInfoInDto inDto)
|
||||
{
|
||||
var result = await _doctorSummarizeRepository.DeleteFromQueryAsync(x=>x.Id==inDto.Id);
|
||||
return await _doctorSummarizeRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取概述
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<UpdateGneralSituationDto?> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
|
||||
[HttpPost]
|
||||
public async Task<UpdateGneralSituationDto> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
|
||||
{
|
||||
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == inDto.DoctorId)
|
||||
.ProjectTo<UpdateGneralSituationDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
if (inDto.TrialId != null)
|
||||
{
|
||||
var doctorInfo = await trialExperienceService.GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
||||
|
@ -261,15 +351,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
DoctorId = inDto.DoctorId,
|
||||
});
|
||||
|
||||
doctorBasicInfo = new UpdateGneralSituationDto()
|
||||
{
|
||||
Summarize = doctorInfo.Summarize,
|
||||
SummarizeEn = doctorInfo.SummarizeEn,
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
return doctorBasicInfo;
|
||||
var result = await _doctorSummarizeRepository.Where(t => t.DoctorId == inDto.DoctorId && t.TrialId == inDto.TrialId)
|
||||
.ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
return new UpdateGneralSituationDto() {
|
||||
SummarizeList= result
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -283,7 +370,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
messageToSend.To.Add(new MailboxAddress(String.Empty, inDto.Email));
|
||||
foreach (var item in inDto.Email)
|
||||
{
|
||||
messageToSend.To.Add(new MailboxAddress(String.Empty, item));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
|
|
|
@ -8,6 +8,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class TrialExperienceService(IRepository<TrialExperience> _trialExperienceRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<DoctorSummarize> _doctorSummarizeRepository,
|
||||
IRepository<TrialExperienceCriteria> _trialExperienceCriteriaRepository,
|
||||
IRepository<Attachment> _attachmentRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialExperienceService
|
||||
{
|
||||
|
@ -85,11 +86,59 @@ namespace IRaCIS.Core.Application.Service
|
|||
TrialId = inDto.TrialId,
|
||||
OtherClinicalExperience = systemInfoDcotor.OtherClinicalExperience,
|
||||
OtherClinicalExperienceCN = systemInfoDcotor.OtherClinicalExperienceCN,
|
||||
Summarize = systemInfoDcotor.Summarize,
|
||||
SummarizeEn = systemInfoDcotor.SummarizeEn,
|
||||
};
|
||||
|
||||
#region 概述
|
||||
///没有就加
|
||||
var summarizeCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId).CountAsync();
|
||||
if (summarizeCount == 0)
|
||||
{
|
||||
var main = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.IsMain && x.TrialId == null).ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
if (main != null)
|
||||
{
|
||||
main.Id = null;
|
||||
main.TrialId = inDto.TrialId;
|
||||
main.IsMain = false;
|
||||
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(main, true);
|
||||
}
|
||||
|
||||
}
|
||||
doctorInfo = await _doctorRepository.AddAsync(doctor, true);
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 临床试验
|
||||
|
||||
var trialExperienceList = await _trialExperienceRepository.Where(o => o.DoctorId == inDto.DoctorId)
|
||||
.Where(x=>x.TrialId==null||x.TrialId!=inDto.TrialId)
|
||||
.Where(x => x.ExperienceDataType == ExperienceDataType.System || x.ExperienceDataType == ExperienceDataType.SystemAuto).Include(x => x.ExperienceCriteriaList).ToListAsync();
|
||||
List<TrialExperienceCriteria> criteriaList = new List<TrialExperienceCriteria>();
|
||||
foreach (var item in trialExperienceList)
|
||||
{
|
||||
item.Trial = null;
|
||||
item.TrialId = inDto.TrialId;
|
||||
item.ExperienceDataType = ExperienceDataType.Trial;
|
||||
item.Id = NewId.NextGuid();
|
||||
item.ExperienceCriteriaList.ForEach(x => {
|
||||
|
||||
criteriaList.Add(new TrialExperienceCriteria()
|
||||
{
|
||||
DoctorId = item.DoctorId,
|
||||
EvaluationCriteriaId = x.EvaluationCriteriaId,
|
||||
TrialExperienceId = item.Id
|
||||
});
|
||||
});
|
||||
item.ExperienceCriteriaList = new List<TrialExperienceCriteria>();
|
||||
}
|
||||
await _trialExperienceCriteriaRepository.AddRangeAsync(criteriaList);
|
||||
await _trialExperienceRepository.AddRangeAsync(trialExperienceList);
|
||||
await _trialExperienceRepository.SaveChangesAsync();
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
return doctorInfo;
|
||||
|
@ -108,23 +157,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
else
|
||||
{
|
||||
// 当前项目没有则复制
|
||||
if (!(await _trialExperienceRepository.AnyAsync(x => x.TrialId == inDto.TrialId &&x.ExperienceDataType== ExperienceDataType.Trial)))
|
||||
// 先添加
|
||||
await GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
||||
{
|
||||
var trialExperienceList = await _trialExperienceRepository.Where(o => o.DoctorId == inDto.DoctorId)
|
||||
.Where(x => x.ExperienceDataType == ExperienceDataType.System || x.ExperienceDataType == ExperienceDataType.SystemAuto).ToListAsync();
|
||||
foreach (var item in trialExperienceList)
|
||||
{
|
||||
item.Trial = null;
|
||||
item.TrialId = inDto.TrialId;
|
||||
item.ExperienceDataType = ExperienceDataType.Trial;
|
||||
item.Id = NewId.NextGuid();
|
||||
}
|
||||
|
||||
await _trialExperienceRepository.AddRangeAsync(trialExperienceList);
|
||||
await _trialExperienceRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
DoctorId = inDto.DoctorId,
|
||||
TrialId = inDto.TrialId.Value,
|
||||
});
|
||||
var doctorClinicalTrialExperienceList = await _trialExperienceRepository
|
||||
.Where(o => o.DoctorId == inDto.DoctorId)
|
||||
.Where(x => x.ExperienceDataType == ExperienceDataType.Trial|| x.ExperienceDataType == ExperienceDataType.TrialAuto)
|
||||
|
|
|
@ -78,6 +78,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<Doctor, PaymentModeDto>();
|
||||
|
||||
CreateMap<DoctorSummarize, SummarizeInfoDto>();
|
||||
CreateMap<SummarizeInfoDto, DoctorSummarize>();
|
||||
|
||||
CreateMap<PaymentModeDto, Doctor>();
|
||||
|
||||
CreateMap<Doctor, TrialExperienceModel>();
|
||||
|
|
|
@ -1244,7 +1244,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
var trialConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.IsEnrollementQualificationConfirm, t.IsPDProgressView }).First();
|
||||
|
||||
var emailNoticeConfigQueryable = _emailNoticeConfigRepository.Where(t=>t.BusinessLevelEnum==BusinessLevel.Trial)
|
||||
var emailNoticeConfigQueryable = _emailNoticeConfigRepository.Where(t => t.BusinessLevelEnum == BusinessLevel.Trial)
|
||||
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
||||
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||
|
@ -1348,6 +1348,19 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _trialEmailNoticeConfigRepository.SaveChangesAsync();
|
||||
|
||||
//处理定时任务
|
||||
var taskInfoList = await _trialEmailNoticeConfigRepository.Where(t => t.TrialId== trialId && t.EmailCron != string.Empty && t.IsAutoSend)
|
||||
.Select(t => new { t.Id, t.Code, TrialCode = t.Trial.TrialCode, t.EmailCron, t.BusinessScenarioEnum, t.TrialId })
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var task in taskInfoList)
|
||||
{
|
||||
//利用主键作为任务Id
|
||||
var jobId = $"{task.TrialId}({task.TrialCode})_({task.BusinessScenarioEnum})";
|
||||
|
||||
HangfireJobHelper.AddOrUpdateTrialCronJob(jobId, trialId, task.BusinessScenarioEnum, task.EmailCron);
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
|
||||
|
@ -1453,7 +1466,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _trialEmailNoticeConfigRepository.SaveChangesAsync();
|
||||
|
||||
var jobId = $"{addOrEditTrialEmailNoticeConfig.TrialId}_{id}";
|
||||
var cronInfo = await _trialEmailNoticeConfigRepository.Where(t => t.Id == addOrEditTrialEmailNoticeConfig.Id)
|
||||
.Select(t => new { t.Id, t.Code, TrialCode = t.Trial.TrialCode, t.EmailCron, t.BusinessScenarioEnum, t.TrialId })
|
||||
.FirstAsync();
|
||||
|
||||
var jobId = $"{cronInfo.TrialId}({cronInfo.TrialCode})_({cronInfo.BusinessScenarioEnum})";
|
||||
|
||||
|
||||
if (addOrEditTrialEmailNoticeConfig.IsAutoSend)
|
||||
{
|
||||
|
@ -1575,8 +1593,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpDelete("{trialEmailNoticeConfigId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteTrialEmailNoticeConfig(Guid trialEmailNoticeConfigId)
|
||||
{
|
||||
var trialId = await _trialEmailNoticeConfigRepository.Where(t => t.Id == trialEmailNoticeConfigId).Select(t => t.TrialId).FirstOrDefaultAsync();
|
||||
var jobId = $"{trialId}_{trialEmailNoticeConfigId}";
|
||||
|
||||
var cronInfo = await _trialEmailNoticeConfigRepository.Where(t => t.Id == trialEmailNoticeConfigId)
|
||||
.Select(t => new { t.Id, t.Code, TrialCode = t.Trial.TrialCode, t.EmailCron, t.BusinessScenarioEnum, t.TrialId })
|
||||
.FirstAsync();
|
||||
|
||||
var jobId = $"{cronInfo.TrialId}({cronInfo.TrialCode})_({cronInfo.BusinessScenarioEnum})";
|
||||
|
||||
HangfireJobHelper.RemoveCronJob(jobId);
|
||||
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure.Encryption;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
|
||||
public class HIRActivateService : ServiceBase
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取授权码明文信息
|
||||
/// </summary>
|
||||
/// <param name="authorizationCode"></param>
|
||||
/// <param name="_hospitalOption"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> GetAuthorizationCodeInfo(string authorizationCode, [FromServices] IOptionsMonitor<SystemHospitalOption> _hospitalOption)
|
||||
{
|
||||
// 解密 Base64 编码后的数据
|
||||
byte[] base64DecodedBytes = Convert.FromBase64String(authorizationCode);
|
||||
string decodedText = System.Text.Encoding.UTF8.GetString(base64DecodedBytes);
|
||||
|
||||
|
||||
var authInfo = JsonConvert.DeserializeObject<TrialAuthorizationInfo>(decodedText);
|
||||
|
||||
if (authInfo == null)
|
||||
{
|
||||
return ResponseOutput.NotOk("不能解析该项目授权码");
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(decodedText);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目激活码
|
||||
/// </summary>
|
||||
/// <param name="_basicSystemConfigConfig"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[RoutePattern(HttpMethod = "get")]
|
||||
public async Task<IResponseOutput> GetTrialActivationCode(TrialAuthorizationInfo authorizationInfo, [FromServices] IOptionsMonitor<ServiceVerifyConfigOption> _basicSystemConfigConfig)
|
||||
{
|
||||
|
||||
|
||||
if (authorizationInfo != null)
|
||||
{
|
||||
//一周内激活
|
||||
authorizationInfo.ActiveDeadLineDate = DateTime.Now.Date.AddDays(8).AddSeconds(-1);
|
||||
|
||||
var info = AesEncryption.Encrypt($"{JsonConvert.SerializeObject(authorizationInfo)}", "HIR_System_AES_Key_Info", "Trial_AuthorizationEncrypt");
|
||||
|
||||
Console.WriteLine("HIR_System_AES_Key_Info".PadRight(32, '0').Substring(0, 32) + " " + "Trial_AuthorizationEncrypt".PadRight(16, '0').Substring(0, 16));
|
||||
|
||||
//var dd = AesEncryption.Decrypt(info, "HIR_System_AES_Key_Info", "Trial_AuthorizationEncrypt");
|
||||
|
||||
return ResponseOutput.Ok(info);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ResponseOutput.NotOk("激活码解密文本信息有误");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class TrialAuthorizationInfo
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public string TrialCode { get; set; }
|
||||
|
||||
public string HospitalName { get; set; }
|
||||
|
||||
public string HospitalCode { get; set; }
|
||||
|
||||
public int PurchaseDuration { get; set; }
|
||||
|
||||
|
||||
|
||||
public List<CriterionType> CriterionTypeList { get; set; }
|
||||
|
||||
public DateTime? AuthorizationDeadLineDate { get; set; }
|
||||
|
||||
public DateTime? ActiveDeadLineDate { get; set; }
|
||||
|
||||
public DateTime? ActiveTime { get; set; }
|
||||
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||
|
||||
public class QCChallengeWithUser : QCChallengeCommand
|
||||
{
|
||||
|
||||
public bool IsBaseLine { get; set; }
|
||||
public string VisitName { get; set; }
|
||||
public string BlindName { get; set; } = string.Empty;
|
||||
public string SubjectCode { get; set; }
|
||||
|
|
|
@ -226,6 +226,9 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
[DictionaryTranslateAttribute("Subject_Visit_Status")]
|
||||
public SubjectStatus SubjectStatus { get; set; }
|
||||
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
|
||||
public DateTime? EarliestScanDate { get; set; }
|
||||
|
@ -296,7 +299,18 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string LatestReplyUserName { get; set; } = String.Empty;
|
||||
|
||||
public string Content { get; set; } = string.Empty;
|
||||
public string ContentReplaced => Content.Replace("<br>", "").Replace("<br/>", "").Replace("<div style='margin-left:20px'>", "").Replace("</div>", "");
|
||||
public string ContentReplaced {
|
||||
|
||||
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; }
|
||||
|
@ -1156,6 +1170,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public List<CommonQuesionInfo> QuestionAnswerList { get; set; }
|
||||
|
||||
public List<decimal> SubjectCriterionReadingPeriodVisitNumList { get; set; }
|
||||
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
|
|
|
@ -154,6 +154,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent) + " desc", nameof(QCCRCChallengeViewModel.CreateTime) });
|
||||
|
||||
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
config.IsHaveSubjectClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.Subject) && x.UploadRole == UploadRole.CRC);
|
||||
config.IsHaveVisitClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.SubjectVisit) && x.UploadRole == UploadRole.CRC);
|
||||
return ResponseOutput.Ok(pageList, config);
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.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))
|
||||
|
||||
|
@ -47,7 +49,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<QCChallengeDialog, DialogInfo>()
|
||||
.ForMember(d => d.CreateTime, u => u.MapFrom(s => s.CreateTime))
|
||||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName))
|
||||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.FullName))
|
||||
.ForMember(d => d.Content, u => u.MapFrom(s => s.TalkContent));
|
||||
|
||||
CreateMap<QCChallenge, QCChanllengeExportDto>()
|
||||
|
@ -122,7 +124,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<CheckChallengeDialog, DialogInfo>()
|
||||
.ForMember(d => d.CreateTime, u => u.MapFrom(s => s.CreateTime))
|
||||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName))
|
||||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.FullName))
|
||||
.ForMember(d => d.Content, u => u.MapFrom(s => s.TalkContent));
|
||||
|
||||
CreateMap<SubjectVisit, PMKCheckEXportDTO>()
|
||||
|
@ -253,8 +255,14 @@ 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.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.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
|
||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||
|
@ -610,6 +618,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.SubjectVisit.Subject.Code))
|
||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName))
|
||||
.ForMember(d => d.IsBaseLine, u => u.MapFrom(s => s.SubjectVisit.IsBaseLine))
|
||||
.ForMember(d => d.BlindName, u => u.MapFrom(s => s.SubjectVisit.BlindName));
|
||||
|
||||
|
||||
|
@ -625,6 +634,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.SubjectVisit.Subject.Code))
|
||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName))
|
||||
.ForMember(d => d.IsBaseLine, u => u.MapFrom(s => s.SubjectVisit.IsBaseLine))
|
||||
.ForMember(d => d.BlindName, u => u.MapFrom(s => s.SubjectVisit.BlindName))
|
||||
|
||||
;
|
||||
|
@ -691,14 +701,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
|
||||
CreateMap<NoneDicomStudy, NoneDicomStudyView>()
|
||||
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.NoneDicomFileList.Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.NoneDicomFileList))
|
||||
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.NoneDicomFileList.Where(t => !t.FileType.Contains(StaticData.FileType.Zip)).OrderBy(t => t.FileType).ThenBy(t => t.FileName) : s.NoneDicomFileList.OrderBy(t => t.FileType).ThenBy(t => t.FileName)))
|
||||
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
|
||||
|
||||
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))
|
||||
: s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true)))
|
||||
s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).Where(t => !t.FileType.Contains(StaticData.FileType.Zip)).OrderBy(t => t.FileType).ThenBy(t=>t.FileName)
|
||||
: s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).OrderBy(t => t.FileType).ThenBy(t => t.FileName)))
|
||||
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
|
||||
|
||||
}
|
||||
|
|
|
@ -336,10 +336,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
}).ToListAsync();
|
||||
|
||||
var questions = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == formInfo.ClinicalDataTrialSetId)
|
||||
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
|
||||
var tableQuestions = await _trialClinicalTableQuestionRepository.Where(x => x.TrialClinicalId == formInfo.ClinicalDataTrialSetId)
|
||||
.ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
.ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
|
||||
questions.ForEach(x => x.CreateTime = formInfo.CreateTime);
|
||||
var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
|
||||
|
|
|
@ -36,6 +36,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
#region 临床数据基本增删改
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增或者修改
|
||||
/// </summary>
|
||||
|
@ -605,6 +607,25 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
#region 临床数据相关查询
|
||||
|
||||
/// <summary>
|
||||
/// 获取访视临床数据名称
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<GetVisitClinicalDataNameOutDto> GetVisitClinicalDataName(GetVisitClinicalDataNameInDto inDto)
|
||||
{
|
||||
var clinicalDataNames = await _readingClinicalDataRepository.Where(x => x.ReadingId == inDto.Id).Select(x =>
|
||||
_userInfo.IsEn_Us ? x.ClinicalDataTrialSet.ClinicalDataSetEnName : x.ClinicalDataTrialSet.ClinicalDataSetName).Distinct().ToListAsync();
|
||||
|
||||
return new GetVisitClinicalDataNameOutDto()
|
||||
{
|
||||
ClinicalDataName = string.Join(_userInfo.IsEn_Us? ", ":",", clinicalDataNames),
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取下拉菜单
|
||||
/// </summary>
|
||||
|
@ -701,23 +722,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
var readingIds = result.Select(x => x.ReadingId).ToList();
|
||||
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => readingIds.Contains(x.SubjectVisitId)).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousOtherList = await _previousOtherRepository.Where(x => readingIds.Contains(x.SubjectVisitId)).ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousSurgeryList = await _previousSurgeryRepository.Where(x => readingIds.Contains(x.SubjectVisitId)).ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
foreach (var item in result)
|
||||
{
|
||||
item.ClinicalTableData = new ClinicalDataTable()
|
||||
{
|
||||
PreviousHistoryList = previousHistoryList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
PreviousOtherList = previousOtherList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
PreviousSurgeryList = previousSurgeryList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Dictionary<ClinicalLevel, int> keys = new Dictionary<ClinicalLevel, int>() {
|
||||
{ClinicalLevel.SubjectVisit,0 },
|
||||
{ClinicalLevel.ImageRead,2 },
|
||||
|
@ -809,6 +813,27 @@ namespace IRaCIS.Core.Application.Service
|
|||
isSelfAnalysis = true;
|
||||
}
|
||||
}
|
||||
|
||||
//下面改用readingIdList筛选 不然
|
||||
List<Guid> readingIdList = new List<Guid>() {};
|
||||
if (inDto.VisitTaskId!=null)
|
||||
{
|
||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == inDto.ReadingId.Value).FirstOrDefaultAsync();
|
||||
if (subjectVisit != null && !subjectVisit.IsBaseLine)
|
||||
{
|
||||
var baseId = await _subjectVisitRepository.Where(x => x.SubjectId == subjectVisit.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
readingIdList.Add(baseId);
|
||||
}
|
||||
|
||||
var readModuleInfo = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId.Value).FirstOrDefaultAsync();
|
||||
if (readModuleInfo != null && readModuleInfo.ReadingSetType == ReadingSetType.ImageReading)
|
||||
{
|
||||
var baseId = await _subjectVisitRepository.Where(x => x.SubjectId == readModuleInfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
readingIdList.Add(baseId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 一致性分析
|
||||
if (isSelfAnalysis)
|
||||
{
|
||||
|
@ -817,7 +842,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inDto.ReadingClinicalDataId != null, x => x.Id == inDto.ReadingClinicalDataId)
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||
.WhereIf(inDto.SelectIsSign, x => x.IsSign == true)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId||(readingIdList.Contains(x.ReadingId)&&x.ClinicalDataTrialSet.ClinicalDataLevel== ClinicalLevel.Subject))
|
||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
{
|
||||
|
@ -858,7 +883,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inDto.ReadingClinicalDataId != null, x => x.Id == inDto.ReadingClinicalDataId)
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||
.WhereIf(inDto.SelectIsSign, x => x.IsSign == true)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId || (readingIdList.Contains(x.ReadingId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject))
|
||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||
.Where(x => x.ClinicalDataTrialSet.ClinicalUploadType != ClinicalUploadType.PDF || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Study)
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
|
@ -901,7 +926,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inDto.ReadingClinicalDataId != null, x => x.Id == inDto.ReadingClinicalDataId)
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||
.WhereIf(inDto.SelectIsSign, x => x.IsSign == true)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId || (readingIdList.Contains(x.ReadingId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject))
|
||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
{
|
||||
|
@ -1061,17 +1086,17 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
}
|
||||
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousOtherList = await _previousOtherRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousSurgeryList = await _previousSurgeryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId || (readingIdList.Contains(x.SubjectVisitId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject)).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousOtherList = await _previousOtherRepository.Where(x => x.SubjectVisitId == inDto.ReadingId || (readingIdList.Contains(x.SubjectVisitId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject)).ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousSurgeryList = await _previousSurgeryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId || (readingIdList.Contains(x.SubjectVisitId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject)).ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
foreach (var item in result)
|
||||
{
|
||||
item.ClinicalTableData = new ClinicalDataTable()
|
||||
{
|
||||
PreviousHistoryList = previousHistoryList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
PreviousOtherList = previousOtherList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
PreviousSurgeryList = previousSurgeryList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
PreviousHistoryList = previousHistoryList.Where(x => x.SubjectVisitId == item.ReadingId).ToList(),
|
||||
PreviousOtherList = previousOtherList.Where(x => x.SubjectVisitId == item.ReadingId).ToList(),
|
||||
PreviousSurgeryList = previousSurgeryList.Where(x => x.SubjectVisitId == item.ReadingId).ToList(),
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -556,6 +556,18 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取临床数据名称
|
||||
/// </summary>
|
||||
public class GetVisitClinicalDataNameInDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
|
||||
public class GetVisitClinicalDataNameOutDto
|
||||
{
|
||||
public string ClinicalDataName { get; set; }
|
||||
}
|
||||
|
||||
public class GetTrialClinicalDataSelectIndto
|
||||
{
|
||||
|
|
|
@ -626,6 +626,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
{
|
||||
throw new BusinessValidationFailedException(_localizer["IVUS_UploadVisitTaskError"]);
|
||||
}
|
||||
var digitPlaces = taskinfo.TrialReadingCriterion.DigitPlaces ?? 0;
|
||||
decimal getdecimalData(string value)
|
||||
{
|
||||
return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
||||
};
|
||||
|
||||
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
||||
|
||||
|
@ -638,8 +643,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
iVUSMeasuredValue = new IVUSMeasuredValue()
|
||||
{
|
||||
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||
Emm = decimal.Parse(dataTable.Rows[i]["B"].ToString()),
|
||||
Lumen = decimal.Parse(dataTable.Rows[i]["C"].ToString()),
|
||||
Emm = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||
Lumen = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
||||
};
|
||||
}
|
||||
catch (Exception)
|
||||
|
@ -703,7 +708,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
||||
{
|
||||
var digitPlaces= taskinfo.TrialReadingCriterion.DigitPlaces??0;
|
||||
|
||||
emm = decimal.Round(decimal.Parse(emm ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||
lumen = decimal.Round(decimal.Parse(lumen ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||
emmSubtractionLumen = decimal.Round(decimal.Parse(emmSubtractionLumen ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||
|
@ -742,6 +747,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
RowIndex = maxnum,
|
||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.ElasticAreaDiffValue).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
|
||||
// 添加其他问题答案
|
||||
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||
{
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = string.Empty,
|
||||
QuestionId = questionInfo.Id,
|
||||
TrialId = taskinfo.TrialId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
RowId = newRowId,
|
||||
RowIndex = maxnum,
|
||||
TableQuestionId = otherQuestion.Id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -924,6 +945,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
RowIndex = item,
|
||||
TableQuestionId = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.EEMSubtractLumenSum).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 添加其他问题答案
|
||||
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||
{
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = string.Empty,
|
||||
QuestionId = questionInfo!.QuestionId,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = otherQuestion.Id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => (x.QuestionId == questionInfo.QuestionId || x.QuestionId == pAVquestionInfo.QuestionId) && x.VisitTaskId == inDto.VisitTaskId);
|
||||
|
|
|
@ -609,6 +609,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
RowIndex = maxnum,
|
||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
|
||||
// 添加其他问题答案
|
||||
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||
{
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = string.Empty,
|
||||
QuestionId = questionInfo.Id,
|
||||
TrialId = taskinfo.TrialId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
RowId = newRowId,
|
||||
RowIndex = maxnum,
|
||||
TableQuestionId = otherQuestion.Id,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
|
@ -768,7 +785,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
RowId = newRowId,
|
||||
RowIndex = maxnum,
|
||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
});
|
||||
|
||||
// 添加其他问题答案
|
||||
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||
{
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = string.Empty,
|
||||
QuestionId = questionInfo.Id,
|
||||
TrialId = taskinfo.TrialId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
RowId = newRowId,
|
||||
RowIndex = maxnum,
|
||||
TableQuestionId = otherQuestion.Id,
|
||||
});
|
||||
}
|
||||
}
|
||||
await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
|
@ -1070,6 +1102,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
});
|
||||
|
||||
|
||||
// 添加其他问题答案
|
||||
foreach (var otherQuestion in patchDataTableQuestion.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||
{
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = string.Empty,
|
||||
QuestionId = patchDataStatisticsInfo.Id,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = otherQuestion.Id,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x =>x.QuestionId== patchDataStatisticsInfo.Id && x.VisitTaskId == inDto.VisitTaskId);
|
||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == patchDataStatisticsInfo.Id && x.VisitTaskId == inDto.VisitTaskId);
|
||||
|
|
|
@ -223,6 +223,18 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
public class UseEmialGetDoctorInfoOutDto
|
||||
{
|
||||
public Guid DoctorId { get; set; }
|
||||
}
|
||||
|
||||
public class UseEmialGetDoctorInfoInDto
|
||||
{
|
||||
public string EmailOrPhone { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
public class VerifyEmialGetDoctorInfoInDto
|
||||
{
|
||||
public string VerificationCode { get; set; }
|
||||
|
|
|
@ -20,6 +20,7 @@ using Newtonsoft.Json;
|
|||
using System.Text.RegularExpressions;
|
||||
using static MassTransit.ValidationResultExtensions;
|
||||
using DocumentFormat.OpenXml.Vml.Spreadsheet;
|
||||
using IdentityModel.OidcClient;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
|
@ -114,6 +115,56 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据邮箱获取DoctorId 没有的话创建一个
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<UseEmialGetDoctorInfoOutDto> UseEmialGetDoctorInfo(UseEmialGetDoctorInfoInDto inDto)
|
||||
{
|
||||
var dockerInfo = await _doctorRepository.Where(t => t.EMail == inDto.EmailOrPhone || t.Phone == inDto.EmailOrPhone).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
|
||||
if (dockerInfo != null)
|
||||
{
|
||||
return new UseEmialGetDoctorInfoOutDto()
|
||||
{
|
||||
DoctorId = dockerInfo.Id
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var isVirtual = true;
|
||||
|
||||
if (inDto.TrialId != null)
|
||||
{
|
||||
isVirtual = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => x.TrialType != TrialType.OfficialTrial).FirstNotNullAsync();
|
||||
}
|
||||
|
||||
Doctor doctor = new Doctor()
|
||||
{
|
||||
EMail = inDto.EmailOrPhone,
|
||||
IsVirtual = isVirtual,
|
||||
AcceptingNewTrial = false,
|
||||
ActivelyReading =false,
|
||||
ResumeStatus = ResumeStatusEnum.Pass,
|
||||
CooperateStatus = ContractorStatusEnum.Noncooperation,
|
||||
|
||||
ReviewStatus = ReviewerInformationConfirmStatus.ConfirmRefuse
|
||||
};
|
||||
|
||||
var info = await _doctorRepository.AddAsync(doctor, true);
|
||||
|
||||
return new UseEmialGetDoctorInfoOutDto()
|
||||
{
|
||||
DoctorId = info.Id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证邮箱验证码 获取医生信息Id
|
||||
/// </summary>
|
||||
|
@ -184,7 +235,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
result.ReviewStatus = info.ReviewStatus;
|
||||
}
|
||||
|
||||
result.Token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo()));
|
||||
result.Token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo() { Id= Guid.NewGuid() }));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,13 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
public class GetVisitStageListInDto:PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
public class VisitPlanView
|
||||
{
|
||||
public List<VisitStageDTO> VisitPlanList = new List<VisitStageDTO>();
|
||||
public PageOutput<VisitStageDTO> VisitPlanList { get; set; }
|
||||
|
||||
public decimal TimePointsPerPatient { get; set; }
|
||||
public bool VisitPlanConfirmed { get; set; }
|
||||
|
|
|
@ -12,6 +12,6 @@ namespace IRaCIS.Application.Interfaces
|
|||
Task<List<VisitPlanInfluenceSubjectVisitStatDTO>> GetInfluenceHistoryList(Guid trialId, [FromServices] IRepository<VisitPlanInfluenceStat> _influnceStatRepository);
|
||||
Task<PageOutput<VisitStageDTO>> GetTrialVisitStageList(VisitPlanQueryDTO param);
|
||||
Task<IEnumerable<VisitStageSelectDTO>> GetTrialVisitStageSelect(Guid trialId);
|
||||
Task<VisitPlanView> GetVisitStageList(Guid trialId);
|
||||
Task<VisitPlanView> GetVisitStageList(GetVisitStageListInDto inDto);
|
||||
}
|
||||
}
|
|
@ -34,16 +34,23 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
}
|
||||
|
||||
/// <summary> 根据项目Id,获取项目访视计划(不分页)[New]</summary>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<VisitPlanView> GetVisitStageList(Guid trialId)
|
||||
/// <summary>
|
||||
/// 根据项目Id,获取项目访视计划
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<VisitPlanView> GetVisitStageList(GetVisitStageListInDto inDto)
|
||||
{
|
||||
var query = _visitStageRepository.AsQueryable(true).Where(u => u.TrialId == trialId)
|
||||
var query = _visitStageRepository.AsQueryable(true).Where(u => u.TrialId == inDto.TrialId)
|
||||
.ProjectTo<VisitStageDTO>(_mapper.ConfigurationProvider).OrderBy(t => t.VisitNum);
|
||||
var list = await query.ToListAsync();
|
||||
var trial = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId)).IfNullThrowException();
|
||||
var list = await query.ToPagedListAsync(inDto);
|
||||
var trial = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == inDto.TrialId)).IfNullThrowException();
|
||||
|
||||
var isHaveGeneratedTask = (await _visitTaskRepository.AnyAsync(t => t.TrialId == trialId));
|
||||
|
||||
|
||||
|
||||
var isHaveGeneratedTask = (await _visitTaskRepository.AnyAsync(t => t.TrialId == inDto.TrialId));
|
||||
return new VisitPlanView()
|
||||
{
|
||||
VisitPlanList = list,
|
||||
|
|
|
@ -472,11 +472,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
IndicationTypeId= trial.IndicationTypeId,
|
||||
ExperienceDataType = dataType,
|
||||
TrialId = trial.Id,
|
||||
OtherCriterion= item.CriterionType.GetEnumInt()=="0"? item.CriterionName:string.Empty,
|
||||
VisitReadingCount = 0,
|
||||
ExperienceCriteriaList = new List<TrialExperienceCriteria>() {
|
||||
|
||||
new TrialExperienceCriteria()
|
||||
{
|
||||
DoctorId=doctorId,
|
||||
EvaluationCriteriaId=criterionTypeList.Where(x=>x.Code==item.CriterionType.GetEnumInt()).Select(x=>x.Id).FirstOrDefault()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,12 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
{
|
||||
var user = context.Entity;
|
||||
|
||||
await _userLogReposiotry.AddAsync(new UserLog() { OptType = UserOptType.AddUser, OptUserId = user.Id, LoginUserId = _userInfo.Id, IP = _userInfo.IP });
|
||||
if (context.ChangeType == ChangeType.Added)
|
||||
{
|
||||
await _userLogReposiotry.AddAsync(new UserLog() { OptType = UserOptType.AddUser, OptUserId = user.Id, LoginUserId = _userInfo.Id, IP = _userInfo.IP });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ public class Doctor : BaseFullAuditEntity
|
|||
/// <summary>
|
||||
/// GCP机构
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string GCPAgencies { get; set; }
|
||||
|
||||
public Guid GCPId { get; set; }
|
||||
|
@ -185,11 +186,13 @@ public class Doctor : BaseFullAuditEntity
|
|||
/// <summary>
|
||||
/// 工作兼职
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string WorkPartTime { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 工作兼职En
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string WorkPartTimeEn { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
|
@ -213,6 +216,7 @@ public class Doctor : BaseFullAuditEntity
|
|||
/// <summary>
|
||||
/// 银行名称
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string BankName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("医生 - 概述")]
|
||||
[Table("DoctorSummarize")]
|
||||
public class DoctorSummarize : BaseFullAuditEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 医生Id
|
||||
/// </summary>
|
||||
public Guid DoctorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 概述
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string Summarize { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 概述
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string SummarizeEn { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是主模板
|
||||
/// </summary>
|
||||
public bool IsMain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 适应症
|
||||
/// </summary>
|
||||
public string Indication { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 适应症
|
||||
/// </summary>
|
||||
public string IndicationEn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目Id
|
||||
/// </summary>
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
}
|
|
@ -7,6 +7,11 @@ public class PreviousHistory : BaseAddAuditEntity
|
|||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public SubjectVisit SubjectVisit { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ClinicalDataTrialSetId")]
|
||||
|
||||
public ClinicalDataTrialSet ClinicalDataTrialSet { get; set; }
|
||||
#endregion
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
|
|
|
@ -8,6 +8,11 @@ public class PreviousOther : BaseAddAuditEntity
|
|||
|
||||
[JsonIgnore]
|
||||
public SubjectVisit SubjectVisit { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ClinicalDataTrialSetId")]
|
||||
|
||||
public ClinicalDataTrialSet ClinicalDataTrialSet { get; set; }
|
||||
#endregion
|
||||
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
|
|
@ -6,10 +6,14 @@ public class PreviousSurgery : BaseAddAuditEntity
|
|||
{
|
||||
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ClinicalDataTrialSetId")]
|
||||
|
||||
public ClinicalDataTrialSet ClinicalDataTrialSet { get; set; }
|
||||
#endregion
|
||||
public DateTime? OperationTime { get; set; }
|
||||
|
||||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public bool IsSubjectLevel { get; set; }
|
||||
|
|
|
@ -272,6 +272,8 @@ public class IRaCISDBContext : DbContext
|
|||
public virtual DbSet<Dictionary> Dictionary { get; set; }
|
||||
public virtual DbSet<Doctor> Doctor { get; set; }
|
||||
|
||||
public virtual DbSet<DoctorSummarize> DoctorSummarize { get; set; }
|
||||
|
||||
public virtual DbSet<DoctorCriterionFile> DoctorCriterionFile { get; set; }
|
||||
public virtual DbSet<DoctorDictionary> DoctorDictionary { get; set; }
|
||||
public virtual DbSet<Postgraduate> Postgraduate { get; set; }
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class doctors : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DoctorSummarize",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DoctorId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Summarize = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
SummarizeEn = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
IsMain = table.Column<bool>(type: "bit", nullable: false),
|
||||
Indication = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
IndicationEn = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
TrialId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DoctorSummarize", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DoctorSummarize_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "医生 - 概述");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DoctorSummarize_CreateUserId",
|
||||
table: "DoctorSummarize",
|
||||
column: "CreateUserId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DoctorSummarize");
|
||||
}
|
||||
}
|
||||
}
|
18171
IRaCIS.Core.Infra.EFCore/Migrations/20241122095846_WorkPartTime.Designer.cs
generated
Normal file
18171
IRaCIS.Core.Infra.EFCore/Migrations/20241122095846_WorkPartTime.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,54 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class WorkPartTime : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WorkPartTimeEn",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WorkPartTime",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WorkPartTimeEn",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WorkPartTime",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
}
|
||||
}
|
||||
}
|
18204
IRaCIS.Core.Infra.EFCore/Migrations/20241125080659_trialExperience.Designer.cs
generated
Normal file
18204
IRaCIS.Core.Infra.EFCore/Migrations/20241125080659_trialExperience.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,92 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class trialExperience : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAddTrialExperienceToTrial",
|
||||
table: "Doctor",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PreviousSurgery_ClinicalDataTrialSetId",
|
||||
table: "PreviousSurgery",
|
||||
column: "ClinicalDataTrialSetId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PreviousOther_ClinicalDataTrialSetId",
|
||||
table: "PreviousOther",
|
||||
column: "ClinicalDataTrialSetId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PreviousHistory_ClinicalDataTrialSetId",
|
||||
table: "PreviousHistory",
|
||||
column: "ClinicalDataTrialSetId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PreviousHistory_ClinicalDataTrialSet_ClinicalDataTrialSetId",
|
||||
table: "PreviousHistory",
|
||||
column: "ClinicalDataTrialSetId",
|
||||
principalTable: "ClinicalDataTrialSet",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PreviousOther_ClinicalDataTrialSet_ClinicalDataTrialSetId",
|
||||
table: "PreviousOther",
|
||||
column: "ClinicalDataTrialSetId",
|
||||
principalTable: "ClinicalDataTrialSet",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PreviousSurgery_ClinicalDataTrialSet_ClinicalDataTrialSetId",
|
||||
table: "PreviousSurgery",
|
||||
column: "ClinicalDataTrialSetId",
|
||||
principalTable: "ClinicalDataTrialSet",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PreviousHistory_ClinicalDataTrialSet_ClinicalDataTrialSetId",
|
||||
table: "PreviousHistory");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PreviousOther_ClinicalDataTrialSet_ClinicalDataTrialSetId",
|
||||
table: "PreviousOther");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PreviousSurgery_ClinicalDataTrialSet_ClinicalDataTrialSetId",
|
||||
table: "PreviousSurgery");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PreviousSurgery_ClinicalDataTrialSetId",
|
||||
table: "PreviousSurgery");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PreviousOther_ClinicalDataTrialSetId",
|
||||
table: "PreviousOther");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PreviousHistory_ClinicalDataTrialSetId",
|
||||
table: "PreviousHistory");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAddTrialExperienceToTrial",
|
||||
table: "Doctor");
|
||||
}
|
||||
}
|
||||
}
|
18202
IRaCIS.Core.Infra.EFCore/Migrations/20241125083643_MaxLength.Designer.cs
generated
Normal file
18202
IRaCIS.Core.Infra.EFCore/Migrations/20241125083643_MaxLength.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,54 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MaxLength : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "GCPAgencies",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "BankName",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "GCPAgencies",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "BankName",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
}
|
||||
}
|
||||
}
|
18199
IRaCIS.Core.Infra.EFCore/Migrations/20241125085235_doctorino.Designer.cs
generated
Normal file
18199
IRaCIS.Core.Infra.EFCore/Migrations/20241125085235_doctorino.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,29 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class doctorino : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAddTrialExperienceToTrial",
|
||||
table: "Doctor");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAddTrialExperienceToTrial",
|
||||
table: "Doctor",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1325,8 +1325,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.Property<string>("BankName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("BankNum")
|
||||
.IsRequired()
|
||||
|
@ -1399,8 +1398,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.Property<string>("GCPAgencies")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("GCPId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
@ -1584,13 +1582,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.Property<string>("WorkPartTime")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("WorkPartTimeEn")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
|
@ -1706,6 +1702,60 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.DoctorSummarize", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("DoctorId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indication")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<string>("IndicationEn")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<bool>("IsMain")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Summarize")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SummarizeEn")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("TrialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.ToTable("DoctorSummarize", t =>
|
||||
{
|
||||
t.HasComment("医生 - 概述");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.Education", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
@ -3579,6 +3629,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClinicalDataTrialSetId");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("SubjectVisitId");
|
||||
|
@ -3636,6 +3688,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClinicalDataTrialSetId");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("SubjectVisitId");
|
||||
|
@ -3744,6 +3798,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClinicalDataTrialSetId");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("SubjectVisitId");
|
||||
|
@ -14164,6 +14220,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Navigation("Doctor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.DoctorSummarize", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.User", "CreateUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.Education", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.User", "CreateUser")
|
||||
|
@ -14535,6 +14602,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.PreviousHistory", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.ClinicalDataTrialSet", "ClinicalDataTrialSet")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClinicalDataTrialSetId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.User", "CreateUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
|
@ -14547,6 +14620,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ClinicalDataTrialSet");
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
|
||||
b.Navigation("SubjectVisit");
|
||||
|
@ -14554,6 +14629,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.PreviousOther", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.ClinicalDataTrialSet", "ClinicalDataTrialSet")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClinicalDataTrialSetId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.User", "CreateUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
|
@ -14566,6 +14647,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ClinicalDataTrialSet");
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
|
||||
b.Navigation("SubjectVisit");
|
||||
|
@ -14592,6 +14675,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.PreviousSurgery", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.ClinicalDataTrialSet", "ClinicalDataTrialSet")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClinicalDataTrialSetId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.User", "CreateUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
|
@ -14604,6 +14693,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ClinicalDataTrialSet");
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
});
|
||||
|
||||
|
|
|
@ -89,17 +89,17 @@ namespace IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson
|
|||
|
||||
var needDealTime = dateTime.Value;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(clientZoneId))
|
||||
{
|
||||
needDealTime = TimeZoneInfo.ConvertTime(needDealTime, TimeZoneInfo.Local, TimeZoneInfo.FindSystemTimeZoneById(clientZoneId));
|
||||
}
|
||||
|
||||
if (needDealTime.Hour == 0 && needDealTime.Minute == 0 && needDealTime.Second == 0 && needDealTime.Millisecond==0)
|
||||
{
|
||||
return needDealTime.ToString("yyyy-MM-dd");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(clientZoneId))
|
||||
{
|
||||
needDealTime = TimeZoneInfo.ConvertTime(needDealTime, TimeZoneInfo.Local, TimeZoneInfo.FindSystemTimeZoneById(clientZoneId));
|
||||
}
|
||||
|
||||
if (isEn_US)
|
||||
{
|
||||
//暂时保持一致,等需求确认,修改英文要展示的日期格式
|
||||
|
|
|
@ -44,10 +44,18 @@ public class AesEncryption
|
|||
}
|
||||
|
||||
// AES 加密(带 IV)
|
||||
/// <summary>
|
||||
/// AES 密钥的长度必须是以下之一:128 位(16 字节)192 位(24 字节)256 位(32 字节)
|
||||
/// IV must be 16 bytes
|
||||
/// </summary>
|
||||
/// <param name="plainText"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="iv"></param>
|
||||
/// <returns></returns>
|
||||
public static string Encrypt(string plainText, string key, string iv)
|
||||
{
|
||||
var keyBytes = Encoding.UTF8.GetBytes(key);
|
||||
var ivBytes = Encoding.UTF8.GetBytes(iv);
|
||||
var keyBytes = Encoding.UTF8.GetBytes(key.PadRight(32, '0').Substring(0, 32));
|
||||
var ivBytes = Encoding.UTF8.GetBytes(iv.PadRight(16, '0').Substring(0, 16));
|
||||
|
||||
// 使用 AES 引擎 + PKCS7 填充 + CBC 模式
|
||||
var engine = new AesEngine();
|
||||
|
@ -64,8 +72,8 @@ public class AesEncryption
|
|||
// AES 解密(带 IV)
|
||||
public static string Decrypt(string encryptedText, string key, string iv)
|
||||
{
|
||||
var keyBytes = Encoding.UTF8.GetBytes(key);
|
||||
var ivBytes = Encoding.UTF8.GetBytes(iv);
|
||||
var keyBytes = Encoding.UTF8.GetBytes(key.PadRight(32, '0').Substring(0, 32));
|
||||
var ivBytes = Encoding.UTF8.GetBytes(iv.PadRight(16, '0').Substring(0, 16));
|
||||
var cipherBytes = Convert.FromBase64String(encryptedText);
|
||||
|
||||
// 使用 AES 引擎 + PKCS7 填充 + CBC 模式
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
@ -8,29 +9,29 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
|||
public static class ObjectExtension
|
||||
{
|
||||
|
||||
public static T Clone<T>(this T source)
|
||||
{
|
||||
// Don't serialize a null object, simply return the default for that object
|
||||
if (Object.ReferenceEquals(source, null))
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
public static T Clone<T>(this T source)
|
||||
{
|
||||
// Don't serialize a null object, simply return the default for that object
|
||||
if (Object.ReferenceEquals(source, null))
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
|
||||
var deserializeSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace };
|
||||
var serializeSettings = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore };
|
||||
return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(source, serializeSettings), deserializeSettings);
|
||||
}
|
||||
var deserializeSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace };
|
||||
var serializeSettings = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore };
|
||||
return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(source, serializeSettings), deserializeSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将对象序列化成稽查需要的Json字符串
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public static string ToJsonStr(this object obj)
|
||||
{
|
||||
|
||||
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Ignore });
|
||||
}
|
||||
/// <summary>
|
||||
/// 将对象序列化成稽查需要的Json字符串
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public static string ToJsonStr(this object obj)
|
||||
{
|
||||
|
||||
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Ignore });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过类型参数反序列化 JSON 字符串为指定类型的对象
|
||||
|
@ -55,12 +56,12 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
|||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public static string ToJsonNotIgnoreNull(this object obj)
|
||||
{
|
||||
{
|
||||
|
||||
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", Formatting = Formatting.Indented, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Include });
|
||||
}
|
||||
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", Formatting = Formatting.Indented, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Include });
|
||||
}
|
||||
|
||||
public static Dictionary<string, object> ConvertToDictionary(this object obj)
|
||||
public static Dictionary<string, object> ConvertToDictionary(this object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
|
@ -77,10 +78,19 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
|||
string propertyName = property.Name;
|
||||
object propertyValue = property.GetValue(obj);
|
||||
// 如果属性的类型是枚举,将其值保留为整数
|
||||
if (property.PropertyType.IsEnum || (Nullable.GetUnderlyingType(property.PropertyType)?.IsEnum == true && propertyValue!=null) )
|
||||
if (property.PropertyType.IsEnum || (Nullable.GetUnderlyingType(property.PropertyType)?.IsEnum == true && propertyValue != null))
|
||||
{
|
||||
dictionary.Add(propertyName, (int)propertyValue);
|
||||
}
|
||||
// 检查属性是否是时间类型
|
||||
else if (property.PropertyType == typeof(DateTime) ||
|
||||
property.PropertyType == typeof(DateTime?) && propertyValue != null)
|
||||
{
|
||||
DateTime.TryParse(propertyValue.ToString(), out DateTime result);
|
||||
var dt = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
// 如果需要,可以对时间值进行特定的处理
|
||||
dictionary.Add(propertyName, dt);
|
||||
}
|
||||
else
|
||||
{
|
||||
dictionary.Add(propertyName, propertyValue);
|
||||
|
|
Loading…
Reference in New Issue