Compare commits
148 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 06ac8f114a | |||
| 78bc09d71a | |||
| d2bca834ed | |||
| 34c50858c9 | |||
| a7441c8c78 | |||
| 125846e6b2 | |||
| d35b9a6f6f | |||
| 6b592cbda7 | |||
| f8e498b2e1 | |||
| 8ff23af18c | |||
| 828bd38eab | |||
| a9f22897e9 | |||
| b14f3fb251 | |||
| 91cde3f944 | |||
| fcffa32e06 | |||
| e2e03e30ef | |||
| bdb12a7df3 | |||
| e456f8684c | |||
| 81b56c03b7 | |||
| a92fa86809 | |||
| 745ab5cb25 | |||
| 8cee47a9f7 | |||
| b174a72709 | |||
| aebc9446ba | |||
| 6e7b77af00 | |||
| e147c2a370 | |||
| 30f41ba270 | |||
| 468a124841 | |||
| 33a15676b5 | |||
| a8b614e2a5 | |||
| 57d9a8665d | |||
| 2d03635ec4 | |||
| 5e34a41902 | |||
| 6b02c03f7f | |||
| 1c0547f3ff | |||
| 4b3e1ba5c0 | |||
| eb77fcfa2f | |||
| 86692d220a | |||
| 1417277cb1 | |||
| f40a48265c | |||
| 04e4b0ac34 | |||
| 6526e03d2c | |||
| 1fb09d05a3 | |||
| 6eefbb1745 | |||
| effd6fee41 | |||
| 84ba0bc4a9 | |||
| 7cf9bd4a81 | |||
| ba8a457688 | |||
| 848e33edb8 | |||
| 47eaed78ed | |||
| 137f77cdc5 | |||
| a2cfec6553 | |||
| da2209cf95 | |||
| ce8611e138 | |||
| 948c0d32ab | |||
| c2ed06061a | |||
| b610143e33 | |||
| fa0e4f7326 | |||
| 393bce5f5c | |||
| 004f73b24d | |||
| e53b56f0d4 | |||
| 7dbf99e1c8 | |||
| 2f77c0ecef | |||
| 2ce0306311 | |||
| 79ff873607 | |||
| 9827ffa0f2 | |||
| f81cf9c2f2 | |||
| 456e6f3035 | |||
| 25c3a6518d | |||
| 53a33c956f | |||
| c9daa09a0b | |||
| 156db9f6c5 | |||
| 1b9eeba5ba | |||
| a1588273e8 | |||
| 38b661da01 | |||
| 017babde86 | |||
| 74da92bc72 | |||
| 281b5d2177 | |||
| a9a435ee0f | |||
| 6f784a1054 | |||
| 90412c5817 | |||
| ecb0ab07d2 | |||
| 522e056f3c | |||
| 92ca6a9a34 | |||
| 93f660a2ca | |||
| 7997e8c408 | |||
| eb363fd564 | |||
| 04e4e786b0 | |||
| 12449325a9 | |||
| 3b48685a07 | |||
| 1adb7e6e2a | |||
| 46e1da667a | |||
| c5aaa08326 | |||
| e7193be3d7 | |||
| 56f27189f1 | |||
| 69bfecca9c | |||
| bc68271a2a | |||
| 27314a139d | |||
| 8ebaface32 | |||
| 408e03d02f | |||
| 8415d848c7 | |||
| 6ded64d830 | |||
| 00f6e3dc29 | |||
| 7fad0345cf | |||
| 4fa9dafdd8 | |||
| 819dfe9b68 | |||
| d0828ddf0e | |||
| c7d9e02b8d | |||
| 1bec318440 | |||
| cd6c57cec8 | |||
| f3942b507c | |||
| 888be6430a | |||
| c5e5ac4e45 | |||
| ece6832bb8 | |||
| 6c434e2ace | |||
| c08bad2fec | |||
| 5cafbdeaca | |||
| 70b99d56a4 | |||
| 66f91986bc | |||
| 8eff23a8f2 | |||
| 9bd0a23734 | |||
| e3622cb86f | |||
| eaf3d5e3e8 | |||
| d7bce4802a | |||
| 99c594acac | |||
| 5844b28983 | |||
| 26c2e917d9 | |||
| 07a2f19cf5 | |||
| 085213f920 | |||
| 985250e25c | |||
| 1c6acff8d7 | |||
| dd77dc43b6 | |||
| c7b86954fa | |||
| 13c55be759 | |||
| ce8e842823 | |||
| e5508e9b0c | |||
| 67e526893c | |||
| efcb3cf168 | |||
| ed8f24a3ad | |||
| 98947b0609 | |||
| 09d7a34c97 | |||
| 50667bddfb | |||
| 655ef79754 | |||
| 9d3e1edd61 | |||
| aba0101b01 | |||
| 7ca007b6fa | |||
| 007f8eddc9 | |||
| b94bc8eff1 |
@@ -12,18 +12,18 @@
|
||||
"RegionId": "cn-shanghai",
|
||||
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm",
|
||||
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
|
||||
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
|
||||
"BucketName": "zy-irc-uat-store",
|
||||
"ViewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"AccessKeyId": "LTAI5tFUCCmz5TwghZHsj45Y",
|
||||
"AccessKeySecret": "8evrBy1fVfzJG25i67Jm0xqn9Xcw2T",
|
||||
"RoleArn": "acs:ram::1078130221702011:role/uat-oss-access",
|
||||
"BucketName": "tl-med-irc-uat-store",
|
||||
"ViewEndpoint": "https://tl-med-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"Region": "oss-cn-shanghai",
|
||||
"DurationSeconds": 7200
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=47.117.164.182,1434;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=47.117.164.182,1434;Database=Uat_IRC.Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
"RemoteNew": "Server=101.132.253.119,1435;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server101.132.253.119,1435;Database=Uat_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
},
|
||||
"DicomSCPServiceConfig": {
|
||||
"CalledAEList": [
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=47.117.164.182,1434;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=47.117.164.182,1434;Database=Uat_IRC.Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
"RemoteNew": "Server=101.132.253.119,1435;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=101.132.253.119,1435;Database=Uat_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
},
|
||||
"ObjectStoreService": {
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
"RegionId": "cn-shanghai",
|
||||
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm",
|
||||
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
|
||||
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
|
||||
"BucketName": "zy-irc-uat-store",
|
||||
"ViewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"AccessKeyId": "LTAI5tFUCCmz5TwghZHsj45Y",
|
||||
"AccessKeySecret": "8evrBy1fVfzJG25i67Jm0xqn9Xcw2T",
|
||||
"RoleArn": "acs:ram::1078130221702011:role/uat-oss-access",
|
||||
"BucketName": "tl-med-irc-uat-store",
|
||||
"ViewEndpoint": "https://tl-med-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"Region": "oss-cn-shanghai",
|
||||
"DurationSeconds": 7200
|
||||
},
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System.Text.RegularExpressions;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
using static IRaCIS.Core.Domain.Share.StaticData;
|
||||
|
||||
namespace IRaCIS.Core.Application.Filter;
|
||||
|
||||
/// <summary>
|
||||
/// 主要为了 处理项目结束 锁库,不允许操作
|
||||
/// </summary>
|
||||
public class TrialResourceFilter : Attribute, IAsyncResourceFilter
|
||||
{
|
||||
private readonly IUserInfo _userInfo;
|
||||
private readonly IFusionCache _fusionCache;
|
||||
public IStringLocalizer _localizer;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly List<string> _trialOptList = new List<string>();
|
||||
|
||||
|
||||
public TrialResourceFilter(IFusionCache fusionCache, IRepository<Trial> trialRepository, IStringLocalizer localizer, IUserInfo userInfo, string trialOpt = null, string trialOpt2 = null, string trialOpt3 = null)
|
||||
{
|
||||
_fusionCache = fusionCache;
|
||||
_userInfo = userInfo;
|
||||
_localizer = localizer;
|
||||
_trialRepository = trialRepository;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(trialOpt)) _trialOptList.Add(trialOpt.Trim());
|
||||
if (!string.IsNullOrWhiteSpace(trialOpt2)) _trialOptList.Add(trialOpt2.Trim());
|
||||
if (!string.IsNullOrWhiteSpace(trialOpt3)) _trialOptList.Add(trialOpt3.Trim());
|
||||
|
||||
}
|
||||
|
||||
//优先选择异步的方法
|
||||
public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
|
||||
{
|
||||
// var typeFilter = context.ActionDescriptor.EndpointMetadata.Where(t => t.GetType() == typeof(TypeFilterAttribute)).Select(t => (TypeFilterAttribute)t).ToList().FirstOrDefault();
|
||||
//var _trialOptList= typeFilter.Arguments.Select(t => t.ToString()).ToList();
|
||||
|
||||
// 获取当前请求的 Host 信息
|
||||
var requestHost = context.HttpContext.Request.Host;
|
||||
|
||||
// 检查请求是否来自 localhost:6100
|
||||
if (requestHost.Host == "localhost" && (requestHost.Port == 6100|| requestHost.Port==3305))
|
||||
{
|
||||
await next.Invoke();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#region 处理新的用户类型,不能操作项目相关接口
|
||||
|
||||
// 后期列举出具体的类型,其他任何用户类型,都不允许操作
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA && _userInfo.RequestUrl.ToLower() != "TrialDocument/userConfirm".ToLower())
|
||||
{
|
||||
//---对不起,您的账户没有操作权限。
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_NoAccessPermission"]));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
//TrialId 传递的途径多种,可能在path 可能在body 可能在数组中,也可能在对象中,可能就在url
|
||||
var trialIdStr = string.Empty;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(context.HttpContext.Request.Query["trialId"]))
|
||||
{
|
||||
trialIdStr = context.HttpContext.Request.Query["trialId"];
|
||||
}
|
||||
|
||||
//先尝试从path中取TrialId
|
||||
else if (context.RouteData.Values.Keys.Any(t => t.Contains("trialId")))
|
||||
{
|
||||
var index = context.RouteData.Values.Keys.ToList().IndexOf("trialId");
|
||||
trialIdStr = context.RouteData.Values.Values.ToList()[index] as string;
|
||||
}
|
||||
else if (context.HttpContext.Request.Headers["Referer"].ToString().Contains("trialId"))
|
||||
{
|
||||
var headerStr = context.HttpContext.Request.Headers["Referer"].ToString();
|
||||
|
||||
var trialIdIndex = headerStr.IndexOf("trialId");
|
||||
|
||||
|
||||
var matchResult = Regex.Match(headerStr.Substring(trialIdIndex), @"[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}");
|
||||
|
||||
if (matchResult.Success)
|
||||
{
|
||||
trialIdStr = matchResult.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
#region body 中取数据
|
||||
|
||||
//设置可以多次读
|
||||
context.HttpContext.Request.EnableBuffering();
|
||||
var reader = new StreamReader(context.HttpContext.Request.Body);
|
||||
var contentFromBody = await reader.ReadToEndAsync();
|
||||
//读取后,流的位置还原
|
||||
context.HttpContext.Request.Body.Seek(0, SeekOrigin.Begin);
|
||||
//context.HttpContext.Request.Body.Position = 0;
|
||||
|
||||
//找到参数位置在字符串中的索引
|
||||
var trialIdIndex = contentFromBody.IndexOf("\"TrialId\"", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (trialIdIndex > -1)
|
||||
{
|
||||
// (?<="trialId" *: *").*?(?=",)
|
||||
|
||||
//使用正则 [0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}
|
||||
|
||||
var matchResult = Regex.Match(contentFromBody.Substring(trialIdIndex), @"[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}");
|
||||
|
||||
if (matchResult.Success)
|
||||
{
|
||||
//有可能匹配错误 "trialId":"","documentId":"b8180000-3e2c-0016-9fe0-08da33f96236" 从缓存里面验证下
|
||||
|
||||
trialIdStr = matchResult.Value;
|
||||
|
||||
var trialStatusStr = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(trialStatusStr))
|
||||
{
|
||||
|
||||
//数据库 检查该项目Id不对
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//使用字符串取 如果是swagger 可能有时取的不对 因为空格的原因
|
||||
//trialIdStr = contentFromBody.Substring(trialIdIndex + "TrialId".Length + 4, 3
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//通过path 或者body 找到trialId 了
|
||||
if (!string.IsNullOrWhiteSpace(trialIdStr))
|
||||
{
|
||||
var trialStatusStr = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
|
||||
// 这里是统一拦截 项目有关的操作允许情况(特殊的地方,比如项目配置(有的在多种状态(初始化,ongoing)都可以操作,有的仅仅在Initializing)还有 项目添加和更新,不走这里,特殊处理,不然在这里显得很乱,判断是哪个接口)
|
||||
if (trialStatusStr == StaticData.TrialState.TrialOngoing || _trialOptList.Any(t => t == TrialOpt.BeforeOngoingCantOpt))
|
||||
{
|
||||
|
||||
await next.Invoke();
|
||||
|
||||
}
|
||||
// 项目停止、或者完成 不允许操作
|
||||
else
|
||||
{
|
||||
//---本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_InterceptedProjectStatusRule"]));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//添加项目 签名系统文档的时候 不做拦截 但是更新项目 签名项目文档的时候需要拦截
|
||||
else if (_trialOptList.Any(t => t == TrialOpt.AddOrUpdateTrial || t == TrialOpt.SignSystemDocNoTrialId))
|
||||
{
|
||||
await next.Invoke();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//如果项目相关接口没有传递trialId 会来到这里,提醒,以便修改
|
||||
|
||||
//---该接口参数中,没有传递项目编号,请核对。
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_MissingProjectNumber"]));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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 (isEn_US == false && data.TrialObjectNameList.Count > 0)
|
||||
if (data.TrialObjectNameList?.Count > 0)
|
||||
{
|
||||
var replaceObjectList = data.TrialObjectNameList;
|
||||
|
||||
@@ -176,24 +177,30 @@ public static class ExcelExportHelper
|
||||
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
|
||||
{
|
||||
var row = sheet.GetRow(rowIndex);
|
||||
var colums = row.LastCellNum;
|
||||
|
||||
for (int colIndex = 0; colIndex < colums; colIndex++)
|
||||
if (row != null)
|
||||
{
|
||||
var cell = row.GetCell(colIndex);
|
||||
|
||||
// 只处理字符串类型的单元格
|
||||
if (cell != null)
|
||||
var colums = row.LastCellNum;
|
||||
|
||||
for (int colIndex = 0; colIndex < colums; colIndex++)
|
||||
{
|
||||
var cellValue = cell.StringCellValue;
|
||||
var cell = row.GetCell(colIndex);
|
||||
|
||||
var find = replaceObjectList.FirstOrDefault(t => t.Name == cellValue);
|
||||
if (find != null)
|
||||
// 只处理字符串类型的单元格
|
||||
if (cell != null)
|
||||
{
|
||||
cell.SetCellValue(find.TrialName);
|
||||
var cellValue = cell.StringCellValue;
|
||||
|
||||
var find = replaceObjectList.FirstOrDefault(t => t.Name == cellValue);
|
||||
if (find != null)
|
||||
{
|
||||
cell.SetCellValue(find.TrialName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,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)))
|
||||
{
|
||||
|
||||
@@ -328,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)
|
||||
{
|
||||
@@ -415,7 +422,7 @@ public static class ExcelExportHelper
|
||||
}
|
||||
|
||||
//中文替换项目术语
|
||||
if (isEn_US == false && data.TrialObjectNameList.Count > 0)
|
||||
if (data.TrialObjectNameList?.Count > 0)
|
||||
{
|
||||
var replaceObjectList = data.TrialObjectNameList;
|
||||
|
||||
@@ -426,21 +433,25 @@ public static class ExcelExportHelper
|
||||
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
|
||||
{
|
||||
var row = sheet.GetRow(rowIndex);
|
||||
var colums = row.LastCellNum;
|
||||
|
||||
for (int colIndex = 0; colIndex < colums; colIndex++)
|
||||
if (row != null)
|
||||
{
|
||||
var cell = row.GetCell(colIndex);
|
||||
|
||||
// 只处理字符串类型的单元格
|
||||
if (cell != null)
|
||||
var colums = row.LastCellNum;
|
||||
|
||||
for (int colIndex = 0; colIndex < colums; colIndex++)
|
||||
{
|
||||
var cellValue = cell.StringCellValue;
|
||||
var cell = row.GetCell(colIndex);
|
||||
|
||||
var find = replaceObjectList.FirstOrDefault(t => t.Name == cellValue);
|
||||
if (find != null)
|
||||
// 只处理字符串类型的单元格
|
||||
if (cell != null)
|
||||
{
|
||||
cell.SetCellValue(find.TrialName);
|
||||
var cellValue = cell.StringCellValue;
|
||||
|
||||
var find = replaceObjectList.FirstOrDefault(t => t.Name == cellValue);
|
||||
if (find != null)
|
||||
{
|
||||
cell.SetCellValue(find.TrialName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -13038,11 +13076,6 @@
|
||||
参考处理链接: https://learn.microsoft.com/zh-cn/aspnet/core/fundamentals/error-handling?view=aspnetcore-8.0
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Filter.TrialResourceFilter">
|
||||
<summary>
|
||||
主要为了 处理项目结束 锁库,不允许操作
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Helper.CacheKeys.UserLoginError(System.String)">
|
||||
<summary>
|
||||
用户登录错误 限制登录
|
||||
@@ -15328,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
|
||||
@@ -17231,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,10 +110,10 @@ 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, EmailBusinessScenario.Approval_SubmitSiteSurvey, messageToSend, emailConfigFunc);
|
||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, scenario, messageToSend, emailConfigFunc);
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||
|
||||
@@ -174,7 +174,7 @@ public class SiteSurveySPMSubmitedEventConsumer(
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
|
||||
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||
toUserName,
|
||||
siteInfo.TrialSiteCode,
|
||||
@@ -274,7 +274,7 @@ public class SiteSurverRejectedEventConsumer(
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
|
||||
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||
toUserName,
|
||||
trialInfo.TrialCode,
|
||||
|
||||
@@ -73,12 +73,17 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
||||
}
|
||||
});
|
||||
|
||||
foreach (var userinfo in userinfoList)
|
||||
{
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
||||
|
||||
|
||||
foreach (var userinfo in userinfoList)
|
||||
{
|
||||
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
||||
}
|
||||
|
||||
var userNames = userinfoList.Select(x => x.FullName).ToList();
|
||||
|
||||
foreach (var pm in pmandAPm)
|
||||
{
|
||||
@@ -95,7 +100,7 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
||||
var htmlBodyStr = string.Format(
|
||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||
userinfo.FullName, // 用户名 {0}
|
||||
string.Join(',', userNames), // 用户名 {0}
|
||||
trialInfo.ExperimentName, // 项目 {1}
|
||||
subjectCode, // 受试者 {2}
|
||||
subjectVisit.VisitName, // 访视 {3}
|
||||
@@ -113,7 +118,7 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
||||
messageToSend, emailConfigFunc);
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public UserTypeEnum? CopyUserType { get; set; }
|
||||
|
||||
|
||||
public BusinessLevel? BusinessLevelEnum { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,13 +25,14 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
||||
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
||||
.WhereIf(inQuery.BusinessLevelEnum != null, t => t.BusinessLevelEnum == inQuery.BusinessLevelEnum)
|
||||
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
|
||||
.WhereIf(inQuery.BusinessModuleEnum != null, t => t.BusinessModuleEnum == inQuery.BusinessModuleEnum)
|
||||
.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)
|
||||
.WhereIf(inQuery.EmailUrgentEnum != null, t => t.EmailUrgentEnum == inQuery.EmailUrgentEnum)
|
||||
.WhereIf(inQuery.ToUserType != null, t => t.EmailNoticeUserTypeList.Any(t=>t.UserType==inQuery.ToUserType && t.EmailUserType==EmailUserType.To) )
|
||||
.WhereIf(inQuery.ToUserType != null, t => t.EmailNoticeUserTypeList.Any(t => t.UserType == inQuery.ToUserType && t.EmailUserType == EmailUserType.To))
|
||||
.WhereIf(inQuery.CopyUserType != null, t => t.EmailNoticeUserTypeList.Any(t => t.UserType == inQuery.CopyUserType && t.EmailUserType == EmailUserType.Copy))
|
||||
.ProjectTo<EmailNoticeConfigView>(_mapper.ConfigurationProvider);
|
||||
|
||||
@@ -43,9 +44,10 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
|
||||
{
|
||||
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum,
|
||||
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.CriterionTypeEnum== addOrEditEmailNoticeConfig.CriterionTypeEnum,
|
||||
|
||||
VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
|
||||
|
||||
};
|
||||
|
||||
// 匹配所有占位符的正则表达式,允许包含空格的占位符
|
||||
|
||||
@@ -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,16 +1507,33 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
}
|
||||
else
|
||||
{
|
||||
//如果没有产生裁判,默认选择R1
|
||||
if (item.ArmEnum == Arm.DoubleReadingArm1)
|
||||
|
||||
//两个人都做了
|
||||
if (resultExceptJudgeList.Count(t => t.VisitTaskNum == item.VisitTaskNum && t.SubjectCode == item.SubjectCode) == 2)
|
||||
{
|
||||
item.IsJudgeSelect = true;
|
||||
//如果没有产生裁判,默认选择R1
|
||||
if (item.ArmEnum == Arm.DoubleReadingArm1)
|
||||
{
|
||||
item.IsJudgeSelect = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.IsJudgeSelect = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
item.IsJudgeSelect = null;
|
||||
item.IsTrigerJudge = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (arbitrationRule == ArbitrationRule.Reading)
|
||||
else if (arbitrationRule == ArbitrationRule.Reading)
|
||||
{
|
||||
//处理访视裁判标记
|
||||
foreach (var visitItem in resultExceptJudgeList.Where(t => t.ReadingCategory == ReadingCategory.Visit))
|
||||
@@ -1519,66 +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).FirstOrDefault();
|
||||
|
||||
//仅有一个未完成的全局裁判,那么都是null
|
||||
if (maxFinishedJudge == null && maxNotFinishedJudge != null)
|
||||
{
|
||||
if (visitItem.VisitTaskNum < maxNotFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
visitItem.IsJudgeSelect = null;
|
||||
}
|
||||
}
|
||||
//全局裁判都完成了,那么以最后一次裁判选择的为准
|
||||
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
|
||||
{
|
||||
//两个都不为null 肯定是不同的裁判
|
||||
|
||||
//在完成裁判之后的,和未完成裁判之前的
|
||||
if (/*visitItem.VisitTaskNum < maxNotFinishedJudge.VisitTaskNum &&*/ visitItem.VisitTaskNum > maxFinishedJudge.VisitTaskNum)
|
||||
{
|
||||
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
|
||||
{
|
||||
//不存在裁判 将R1设置
|
||||
if (visitItem.ArmEnum == Arm.DoubleReadingArm1)
|
||||
{
|
||||
visitItem.IsJudgeSelect = true;
|
||||
}
|
||||
//已完成的全局数量
|
||||
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])))
|
||||
{
|
||||
|
||||
var maxJudge = subjectJudgeList.FirstOrDefault(t => t.VisitTaskNum == (subjectMaxFinishedGlobalTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge]));
|
||||
|
||||
//最大裁判完成了
|
||||
if (maxJudge.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
{
|
||||
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
|
||||
{
|
||||
//找到当前未阅最大裁判之前的已完成的最大裁判任务
|
||||
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
|
||||
{
|
||||
//最大的完成的全局未产生裁判
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1924,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))
|
||||
@@ -2040,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();
|
||||
|
||||
@@ -2106,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 系统标准处理整体肿瘤评估合并
|
||||
@@ -2176,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);
|
||||
@@ -2220,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();
|
||||
|
||||
|
||||
|
||||
@@ -2246,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:触发裁判的受试者访视中,阅片人被裁判认同的访视数量;
|
||||
@@ -2259,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();
|
||||
@@ -2279,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))
|
||||
@@ -2335,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
|
||||
{
|
||||
|
||||
@@ -76,6 +76,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<Internationalization, InternationalizationAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<InternationalizationAddOrEdit, IRCGlobalInfoDTO>();
|
||||
|
||||
|
||||
CreateMap<Internationalization, BatchInternationalizationDto>().ReverseMap();
|
||||
|
||||
CreateMap<Internationalization, IRCGlobalInfoDTO>();
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace IRaCIS.Application.Contracts
|
||||
public string DepartmentOtherCN { get; set; } = String.Empty;
|
||||
|
||||
//增加的
|
||||
public Guid? SpecialityId { get; set; } = Guid.Empty;
|
||||
public Guid? SpecialityId { get; set; }
|
||||
public string SpecialityOther { get; set; } = string.Empty;
|
||||
public string SpecialityOtherCN { get; set; } = string.Empty;
|
||||
public string Speciality { get; set; } = string.Empty;
|
||||
@@ -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");
|
||||
@@ -209,7 +211,7 @@ namespace IRaCIS.Application.Contracts
|
||||
public string BlindName { get; set; }
|
||||
public string BlindNameCN { get; set; } = string.Empty;
|
||||
|
||||
public Guid? SpecialityId { get; set; } = Guid.Empty;
|
||||
public Guid? SpecialityId { get; set; }
|
||||
|
||||
public string SpecialityCN { get; set; } = string.Empty;
|
||||
public string Speciality { get; set; } = string.Empty;
|
||||
@@ -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,24 +395,70 @@ 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
|
||||
{
|
||||
//部门
|
||||
public Guid? DepartmentId { get; set; } = Guid.Empty;
|
||||
public Guid? DepartmentId { get; set; }
|
||||
public string DepartmentOther { get; set; } = string.Empty;
|
||||
public string DepartmentOtherCN { get; set; } = string.Empty;
|
||||
//职称
|
||||
public Guid? RankId { get; set; } = Guid.Empty;
|
||||
public Guid? RankId { get; set; }
|
||||
public string RankOther { get; set; } = string.Empty;
|
||||
public string RankOtherCN { get; set; } = string.Empty;
|
||||
//职位 主席 副主席
|
||||
public Guid? PositionId { get; set; } = Guid.Empty;
|
||||
public Guid? PositionId { get; set; }
|
||||
public string PositionOther { get; set; } = string.Empty;
|
||||
public string PositionOtherCN { get; set; } = string.Empty;
|
||||
|
||||
public Guid? HospitalId { get; set; } = Guid.Empty;
|
||||
public Guid? HospitalId { get; set; }
|
||||
|
||||
public Guid? PhysicianId { get; set; }
|
||||
public string Physician { get; set; } = string.Empty;
|
||||
@@ -580,19 +638,19 @@ namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
//部门
|
||||
public Guid? DepartmentId { get; set; } = Guid.Empty;
|
||||
public Guid? DepartmentId { get; set; }
|
||||
public string DepartmentOther { get; set; } = string.Empty;
|
||||
public string DepartmentOtherCN { get; set; } = string.Empty;
|
||||
//职称
|
||||
public Guid? RankId { get; set; } = Guid.Empty;
|
||||
public Guid? RankId { get; set; } = null;
|
||||
public string RankOther { get; set; } = string.Empty;
|
||||
public string RankOtherCN { get; set; } = string.Empty;
|
||||
//职位 主席 副主席
|
||||
public Guid? PositionId { get; set; } = Guid.Empty;
|
||||
public Guid? PositionId { get; set; }
|
||||
public string PositionOther { get; set; } = string.Empty;
|
||||
public string PositionOtherCN { get; set; } = string.Empty;
|
||||
|
||||
public Guid? HospitalId { get; set; } = Guid.Empty;
|
||||
public Guid? HospitalId { get; set; }
|
||||
|
||||
public Guid? PhysicianId { get; set; }
|
||||
public string Physician { get; set; } = string.Empty;
|
||||
@@ -735,7 +793,7 @@ namespace IRaCIS.Application.Contracts
|
||||
public string SubspecialityOther { get; set; } = string.Empty;
|
||||
public string SubspecialityOtherCN { get; set; } = string.Empty;
|
||||
|
||||
public Guid? SpecialityId { get; set; } = Guid.Empty;
|
||||
public Guid? SpecialityId { get; set; }
|
||||
public string SpecialityCN { get; set; } = string.Empty;
|
||||
public string SpecialityOther { get; set; } = string.Empty;
|
||||
public string SpecialityOtherCN { get; set; } = string.Empty;
|
||||
|
||||
@@ -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 =>
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.OrderBy(t => t.CreateTime).ProjectTo<EducationInfoViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var postgraduateList = await _postgraduateRepository.Where(o => o.DoctorId == doctorId)
|
||||
.OrderBy(t => t.CreateTime).ProjectTo<PostgraduateViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
.OrderBy(t => t.CreateTime).ProjectTo<PostgraduateViewModel>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
||||
|
||||
|
||||
return new DoctorEducationExperienceDTO()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
@@ -7,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
|
||||
{
|
||||
@@ -84,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;
|
||||
@@ -107,25 +157,20 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
else
|
||||
{
|
||||
// 当前项目没有则复制
|
||||
if (!(await _trialExperienceRepository.AnyAsync(x => x.TrialId == inDto.TrialId)))
|
||||
// 先添加
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
.Where(x => x.TrialId == inDto.TrialId.Value)
|
||||
.OrderBy(t => t.CreateTime)
|
||||
.ProjectTo<TrialExperienceListDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
return doctorClinicalTrialExperienceList;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
public DoctorConfig()
|
||||
{
|
||||
var isEn_Us = false;
|
||||
|
||||
// 从 DateTime 映射到 DateOnly
|
||||
CreateMap<DateTime, DateOnly>().ConvertUsing(dt => DateOnly.FromDateTime(dt));
|
||||
@@ -66,7 +67,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<Vacation, VacationCommand>();
|
||||
CreateMap<ResearchPublication, ResearchPublicationDTO>();
|
||||
CreateMap<Postgraduate, PostgraduateViewModel>();
|
||||
CreateMap<Postgraduate, PostgraduateViewModel>()
|
||||
.ForMember(t => t.Hospital, c => c.MapFrom(d => d.HospitalEnt.HospitalName))
|
||||
.ForMember(t => t.HospitalCN, c => c.MapFrom(d => d.HospitalEnt.HospitalNameCN));
|
||||
CreateMap<Attachment, AttachmentDTO>();
|
||||
CreateMap<Doctor, ResumeConfirmDTO>();
|
||||
|
||||
@@ -75,6 +78,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<Doctor, PaymentModeDto>();
|
||||
|
||||
CreateMap<DoctorSummarize, SummarizeInfoDto>();
|
||||
CreateMap<SummarizeInfoDto, DoctorSummarize>();
|
||||
|
||||
CreateMap<PaymentModeDto, Doctor>();
|
||||
|
||||
CreateMap<Doctor, TrialExperienceModel>();
|
||||
|
||||
@@ -1244,8 +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
|
||||
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||
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)
|
||||
@@ -1349,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();
|
||||
|
||||
|
||||
@@ -1454,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)
|
||||
{
|
||||
@@ -1576,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; }
|
||||
@@ -222,6 +222,8 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
||||
public bool IsClosed { get; set; }
|
||||
public DateTime? ReUploadedTime { get; set; }
|
||||
public string CreateUserName { get; set; } = String.Empty;
|
||||
public string CreateUserFullName { get; set; } = String.Empty;
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public bool IsOverTime => IsClosed ? ClosedTime > DeadlineTime : DateTime.Now > DeadlineTime;
|
||||
|
||||
@@ -226,11 +226,17 @@ 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; }
|
||||
public DateTime? LatestScanDate { get; set; }
|
||||
|
||||
public string EarliestScanDateStr => EarliestScanDate?.ToString("yyyy-MM-dd") ?? string.Empty;
|
||||
public string LatestScanDateStr => LatestScanDate?.ToString("yyyy-MM-dd") ?? string.Empty;
|
||||
|
||||
public DateTime? SubmitTime { get; set; }
|
||||
|
||||
|
||||
@@ -293,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; }
|
||||
@@ -740,6 +757,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public DateTime? LatestScanDate { get; set; }
|
||||
|
||||
public string LatestScanDateStr => LatestScanDate?.ToString("yyyy-MM-dd") ?? string.Empty;
|
||||
|
||||
public List<string> ModalityList { get; set; }
|
||||
|
||||
public string Modalitys => string.Join(',', ModalityList);
|
||||
@@ -1151,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;
|
||||
|
||||
@@ -1184,8 +1205,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
|
||||
//在当前访视触发裁判,或者在截止日期小于等于当前访视的阅片期触发裁判
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsTrigerJudge { get; set; }
|
||||
[DictionaryTranslateAttribute("YesOrNoAudit")]
|
||||
public bool? IsTrigerJudge { get; set; }
|
||||
|
||||
//(如果是访视点裁判,则仅在所选阅片人对应访视 显示;如果是阅片期裁判,则在所选阅片人 阅片期内的所有访视 显示此原因)
|
||||
public string JudgeNote { 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))
|
||||
@@ -600,24 +608,25 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(d => d.IsCurrentUser, u => u.MapFrom(s => s.CreateUserId == currentUserId));
|
||||
//质疑编号
|
||||
CreateMap<QCChallenge, QCChallengeWithUser>()
|
||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUser.UserName))
|
||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.FullName))
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUser.FullName))
|
||||
.ForMember(d => d.CurrentActionUserId, u => u.MapFrom(t => t.SubjectVisit.CurrentActionUserId))
|
||||
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(t => t.SubjectVisit.CurrentActionUser.UserName))
|
||||
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(t => t.SubjectVisit.CurrentActionUser.FullName))
|
||||
|
||||
.ForMember(d => d.SubjectId, u => u.MapFrom(t => t.SubjectVisit.SubjectId))
|
||||
.ForMember(d => d.ChallengeCode, u => u.MapFrom(s => s.ChallengeCode))
|
||||
|
||||
.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));
|
||||
|
||||
|
||||
CreateMap<QCChallenge, ChallengeAndDialog>()
|
||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUser.UserName))
|
||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.FullName))
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUser.FullName))
|
||||
.ForMember(d => d.CurrentActionUserId, u => u.MapFrom(t => t.SubjectVisit.CurrentActionUserId))
|
||||
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(t => t.SubjectVisit.CurrentActionUser.UserName))
|
||||
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(t => t.SubjectVisit.CurrentActionUser.FullName))
|
||||
|
||||
.ForMember(d => d.SubjectId, u => u.MapFrom(t => t.SubjectVisit.SubjectId))
|
||||
.ForMember(d => d.DialogList, u => u.MapFrom(t => t.DialogList.OrderBy(t => t.CreateTime)))
|
||||
@@ -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();
|
||||
|
||||
+51
-26
@@ -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
|
||||
{
|
||||
|
||||
+1
-1
@@ -244,7 +244,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingMedicineTrialQuestion(ReadingMedicineTrialQuestionAddOrEdit inDto)
|
||||
{
|
||||
var existsQuery = _readingMedicineTrialQuestionRepository
|
||||
|
||||
@@ -2580,8 +2580,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 验证访视提交
|
||||
/// </summary>
|
||||
@@ -2632,6 +2630,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_RequiredQuestion", string.Join(',', readingQuestionList.Select(x => x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)))]);
|
||||
}
|
||||
|
||||
// 各个标准不同
|
||||
await _readingCalculateService.VerifyVisitTaskQuestions(inDto);
|
||||
|
||||
var clinicalDataList = await _readingClinicalDataService.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto()
|
||||
|
||||
@@ -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);
|
||||
@@ -1120,6 +1168,29 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
/// <returns></returns>
|
||||
public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||
{
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
|
||||
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.PatchDataStatistics && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
|
||||
|
||||
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId== question.Id)
|
||||
.Where(x => x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show).ToListAsync();
|
||||
|
||||
var rowinfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == question.Id).Include(x=>x.ReadingQuestionTrial).OrderBy(x => x.RowIndex).ToListAsync();
|
||||
|
||||
var tableQuesionAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == question.Id).ToListAsync();
|
||||
|
||||
foreach (var item in rowinfoList)
|
||||
{
|
||||
foreach (var tq in tableQuestions)
|
||||
{
|
||||
var answer = tableQuesionAnswerList.Where(x => x.TableQuestionId == tq.Id && x.RowId == item.Id).FirstOrDefault();
|
||||
if (answer == null || answer.Answer.IsNullOrEmpty())
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["OCTTableRequired", item.ReadingQuestionTrial.OrderMark+ item.RowIndex.GetLesionMark()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -223,11 +223,25 @@ 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; }
|
||||
|
||||
public string EmailOrPhone { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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>
|
||||
@@ -155,9 +206,21 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
}
|
||||
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
|
||||
EMail = inDto.EmailOrPhone,
|
||||
IsVirtual = isVirtual,
|
||||
AcceptingNewTrial=false,
|
||||
ActivelyReading=false,
|
||||
CooperateStatus= ContractorStatusEnum.Noncooperation,
|
||||
|
||||
ReviewStatus= ReviewerInformationConfirmStatus.ConfirmRefuse
|
||||
};
|
||||
|
||||
var info=await _doctorRepository.AddAsync(doctor,true);
|
||||
@@ -172,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() }));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,11 +88,14 @@ namespace IRaCIS.Application.Contracts
|
||||
[ExcelFormat("yyyy-MM-dd")]
|
||||
public DateTime? RemoveTime { get; set; }
|
||||
|
||||
public string RemoveTimeStr=> RemoveTime?.ToString("yyyy-MM-dd") ?? string.Empty;
|
||||
|
||||
|
||||
//[ExporterHeader(Format = "yyyy-mm-DD")]
|
||||
[ExcelFormat("yyyy-MM-dd")]
|
||||
public DateTime? JoinTime { get; set; }
|
||||
|
||||
public string JoinTimeStr => JoinTime?.ToString("yyyy-MM-dd") ?? string.Empty;
|
||||
|
||||
//[ExporterHeader(Format = "yyyy-mm-DD hh:mm:ss")]
|
||||
[ExcelFormat("yyyy-MM-dd HH:mm:ss")]
|
||||
|
||||
@@ -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 });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class EmailNoticeConfig : BaseFullDeleteAuditEntity
|
||||
public string AttachPath { get; set; } = null!;
|
||||
|
||||
[Comment("业务级别")]
|
||||
public int BusinessLevelEnum { get; set; }
|
||||
public BusinessLevel BusinessLevelEnum { get; set; }
|
||||
|
||||
[Comment("业务模块")]
|
||||
public BusinessModule BusinessModuleEnum { get; set; }
|
||||
@@ -83,6 +83,21 @@ public class EmailNoticeUserType : Entity
|
||||
public EmailUserType EmailUserType { get; set; }
|
||||
}
|
||||
|
||||
public enum BusinessLevel
|
||||
{
|
||||
Default=0,
|
||||
|
||||
|
||||
System=1,
|
||||
|
||||
//需要手动添加到项目的邮件
|
||||
Trial=2,
|
||||
|
||||
//项目默认发送的邮件,不需要手动添加到项目
|
||||
TrialDefault=3
|
||||
}
|
||||
|
||||
|
||||
public enum BusinessModule
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -89,6 +89,7 @@ public class Doctor : BaseFullAuditEntity
|
||||
/// <summary>
|
||||
/// GCP机构
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string GCPAgencies { get; set; }
|
||||
|
||||
public Guid GCPId { get; set; }
|
||||
@@ -167,39 +168,43 @@ public class Doctor : BaseFullAuditEntity
|
||||
|
||||
public Guid? SpecialityId { get; set; }
|
||||
|
||||
|
||||
[MaxLength]
|
||||
public string SpecialityOther { get; set; } = string.Empty;
|
||||
|
||||
|
||||
[MaxLength]
|
||||
public string SpecialityOtherCN { get; set; } = string.Empty;
|
||||
|
||||
|
||||
[MaxLength]
|
||||
public string SubspecialityOther { get; set; } = string.Empty;
|
||||
|
||||
|
||||
[MaxLength]
|
||||
public string SubspecialityOtherCN { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
public string WeChat { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 工作兼职
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string WorkPartTime { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 工作兼职En
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string WorkPartTimeEn { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 概述
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string Summarize { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 概述
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string SummarizeEn { get; set; } = string.Empty;
|
||||
|
||||
|
||||
@@ -211,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; }
|
||||
|
||||
}
|
||||
@@ -5,7 +5,9 @@ namespace IRaCIS.Core.Domain.Models;
|
||||
public class Postgraduate : BaseFullAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("HospitalId")]
|
||||
public Hospital HospitalEnt { get; set; }
|
||||
#endregion
|
||||
|
||||
public Guid DoctorId { 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; }
|
||||
|
||||
@@ -230,6 +230,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; }
|
||||
|
||||
@@ -96,13 +96,16 @@ public static class DBContext_Ext
|
||||
{
|
||||
var businessEnum = subjectVisit.IsEnrollmentConfirm ? EmailBusinessScenario.EligibilityVerification_PendingImageQC : EmailBusinessScenario.PDVerification_PendingImageQC;
|
||||
|
||||
var delaySeconds = dbContext.TrialEmailNoticeConfig.Where(t => t.BusinessScenarioEnum == businessEnum)
|
||||
var delaySeconds = dbContext.TrialEmailNoticeConfig.Where(t => t.TrialId==subjectVisit.TrialId && t.BusinessScenarioEnum == businessEnum)
|
||||
.Select(t => t.EmailDelaySeconds).FirstOrDefault();
|
||||
|
||||
Console.WriteLine("qc领取任务:" + DateTime.Now.ToShortTimeString() + $"延时{delaySeconds}");
|
||||
|
||||
subjectVisit.AddDomainEvent(new QCClaimTaskEvent() { IsPd = subjectVisit.PDState == PDStateEnum.PDProgress, SubjectVisitId = subjectVisit.Id, DelaySeconds = delaySeconds, CurrentActionUserId = (Guid)subjectVisit.CurrentActionUserId });
|
||||
if (delaySeconds > 0)
|
||||
{
|
||||
subjectVisit.AddDomainEvent(new QCClaimTaskEvent() { IsPd = subjectVisit.PDState == PDStateEnum.PDProgress, SubjectVisitId = subjectVisit.Id, DelaySeconds = delaySeconds, CurrentActionUserId = (Guid)subjectVisit.CurrentActionUserId });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,210 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class doctor : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DeleteUserId",
|
||||
table: "User");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DeletedTime",
|
||||
table: "User");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsDeleted",
|
||||
table: "User");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "TrialObjectNameList",
|
||||
table: "Trial",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(2000)",
|
||||
oldMaxLength: 2000,
|
||||
oldComment: "项目术语配置Json字符串");
|
||||
|
||||
migrationBuilder.AddColumn<DateOnly>(
|
||||
name: "TestDate",
|
||||
table: "TestLength",
|
||||
type: "date",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SummarizeEn",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Summarize",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SubspecialityOtherCN",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SubspecialityOther",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SpecialityOtherCN",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SpecialityOther",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Postgraduate_HospitalId",
|
||||
table: "Postgraduate",
|
||||
column: "HospitalId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Postgraduate_Hospital_HospitalId",
|
||||
table: "Postgraduate",
|
||||
column: "HospitalId",
|
||||
principalTable: "Hospital",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Postgraduate_Hospital_HospitalId",
|
||||
table: "Postgraduate");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Postgraduate_HospitalId",
|
||||
table: "Postgraduate");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TestDate",
|
||||
table: "TestLength");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DeleteUserId",
|
||||
table: "User",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DeletedTime",
|
||||
table: "User",
|
||||
type: "datetime2",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsDeleted",
|
||||
table: "User",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "TrialObjectNameList",
|
||||
table: "Trial",
|
||||
type: "nvarchar(2000)",
|
||||
maxLength: 2000,
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
comment: "项目术语配置Json字符串",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SummarizeEn",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Summarize",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SubspecialityOtherCN",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SubspecialityOther",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SpecialityOtherCN",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SpecialityOther",
|
||||
table: "Doctor",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
}
|
||||
}
|
||||
}
|
||||
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
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
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
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)");
|
||||
}
|
||||
}
|
||||
}
|
||||
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");
|
||||
@@ -1546,33 +1544,27 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
|
||||
b.Property<string>("SpecialityOther")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SpecialityOtherCN")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SubspecialityOther")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SubspecialityOtherCN")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Summarize")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SummarizeEn")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("TrialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
@@ -1590,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");
|
||||
|
||||
@@ -1712,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")
|
||||
@@ -3531,6 +3575,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("HospitalId");
|
||||
|
||||
b.ToTable("Postgraduate", t =>
|
||||
{
|
||||
t.HasComment("医生 - 继续教育经历");
|
||||
@@ -3583,6 +3629,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClinicalDataTrialSetId");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("SubjectVisitId");
|
||||
@@ -3640,6 +3688,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClinicalDataTrialSetId");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("SubjectVisitId");
|
||||
@@ -3748,6 +3798,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClinicalDataTrialSetId");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("SubjectVisitId");
|
||||
@@ -10407,12 +10459,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
b.Property<DateTime?>("TrialFinishedTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("TrialObjectNameList")
|
||||
.IsRequired()
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)")
|
||||
.HasComment("项目术语配置Json字符串");
|
||||
|
||||
b.Property<string>("TrialStatusStr")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
@@ -12605,12 +12651,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("DeleteUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DeletedTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DepartmentName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
@@ -12635,9 +12675,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsFirstAdd")
|
||||
.HasColumnType("bit")
|
||||
.HasComment("首次登录需要修改密码");
|
||||
@@ -13758,6 +13795,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("nvarchar(1000)");
|
||||
|
||||
b.Property<DateOnly?>("TestDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<string>("TestEnumList")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
@@ -14180,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")
|
||||
@@ -14540,11 +14591,23 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.Hospital", "HospitalEnt")
|
||||
.WithMany()
|
||||
.HasForeignKey("HospitalId");
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
|
||||
b.Navigation("HospitalEnt");
|
||||
});
|
||||
|
||||
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")
|
||||
@@ -14557,6 +14620,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ClinicalDataTrialSet");
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
|
||||
b.Navigation("SubjectVisit");
|
||||
@@ -14564,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")
|
||||
@@ -14576,6 +14647,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ClinicalDataTrialSet");
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
|
||||
b.Navigation("SubjectVisit");
|
||||
@@ -14602,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")
|
||||
@@ -14614,6 +14693,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ClinicalDataTrialSet");
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
});
|
||||
|
||||
@@ -16565,6 +16646,38 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
.WithMany()
|
||||
.HasForeignKey("SponsorId");
|
||||
|
||||
b.OwnsMany("IRaCIS.Core.Domain.Models.TrialObjectNameConfig", "TrialObjectNameList", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("TrialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b1.Property<bool>("IsDefault")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b1.Property<string>("TrialName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b1.HasKey("TrialId", "Id");
|
||||
|
||||
b1.ToTable("Trial");
|
||||
|
||||
b1.ToJson("TrialObjectNameList");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("TrialId");
|
||||
});
|
||||
|
||||
b.Navigation("CRO");
|
||||
|
||||
b.Navigation("CreateUser");
|
||||
@@ -16578,6 +16691,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
b.Navigation("ReviewMode");
|
||||
|
||||
b.Navigation("Sponsor");
|
||||
|
||||
b.Navigation("TrialObjectNameList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialBodyPart", b =>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user