Merge branch 'Test_IRC_Net10' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net10
commit
28e367eb88
|
|
@ -1,32 +1,28 @@
|
||||||
{
|
{
|
||||||
// 日志信息
|
|
||||||
"Logging": {
|
"Logging": {
|
||||||
// 日志等级
|
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
// 默认日志等级
|
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
// 调试日志等级
|
|
||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
// ASP.NET Core 日志等级
|
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 数据库链接字符串
|
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
// 本地数据库链接字符串
|
|
||||||
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
// Hangfire 定时任务数据库链接字符串
|
|
||||||
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
"WeComNoticeConfig": {
|
"WeComNoticeConfig": {
|
||||||
"IsOpenWeComNotice": true,
|
"IsOpenWeComNotice": true,
|
||||||
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
|
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449",
|
||||||
"APINoticeUserList": [ "u", "wait..." ],
|
"APINoticeUserList": [
|
||||||
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ]
|
"u",
|
||||||
|
"wait..."
|
||||||
|
],
|
||||||
|
"VueNoticeUserList": [
|
||||||
|
"wangxiaoshuang",
|
||||||
|
"6b7717a31647293621b97b96f74e6f3d"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
// 对象存储服务配置
|
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
// 使用的对象存储服务类型
|
|
||||||
"ObjectStoreUse": "AliyunOSS",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
"IsOpenStoreSync": true,
|
"IsOpenStoreSync": true,
|
||||||
"ApiDeployRegion": "CN",
|
"ApiDeployRegion": "CN",
|
||||||
|
|
@ -48,168 +44,88 @@
|
||||||
"IsOpenSync": true
|
"IsOpenSync": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// 阿里云对象存储服务的配置
|
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
// 阿里云 OSS 的 Region ID
|
|
||||||
"RegionId": "cn-shanghai",
|
"RegionId": "cn-shanghai",
|
||||||
// 阿里云 OSS 的内部访问端点
|
|
||||||
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
// 阿里云 OSS 的外部访问端点
|
|
||||||
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
// 阿里云 OSS 的访问密钥 ID
|
|
||||||
"AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm",
|
"AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm",
|
||||||
// 阿里云 OSS 的访问密钥 Secret
|
|
||||||
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
|
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
|
||||||
// 阿里云 OSS 的角色 ARN
|
|
||||||
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
|
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
|
||||||
// 阿里云 OSS 的Bucket名称
|
|
||||||
"BucketName": "zy-irc-test-store",
|
"BucketName": "zy-irc-test-store",
|
||||||
// 阿里云 OSS 的访问端点
|
|
||||||
"ViewEndpoint": "https://zy-irc-test-dev-cache.oss-cn-shanghai.aliyuncs.com",
|
"ViewEndpoint": "https://zy-irc-test-dev-cache.oss-cn-shanghai.aliyuncs.com",
|
||||||
// 阿里云 OSS 的预览端点
|
|
||||||
"Region": "oss-cn-shanghai",
|
"Region": "oss-cn-shanghai",
|
||||||
// 阿里云 OSS 的临时访问凭证有效时间(秒)
|
|
||||||
"DurationSeconds": 7200,
|
"DurationSeconds": 7200,
|
||||||
// 阿里云 OSS 的预览端点
|
|
||||||
"PreviewEndpoint": "https://test-oss.test.extimaging.com"
|
"PreviewEndpoint": "https://test-oss.test.extimaging.com"
|
||||||
},
|
},
|
||||||
// MinIO 对象存储服务的配置
|
|
||||||
"MinIO": {
|
"MinIO": {
|
||||||
// MinIO 的访问端点
|
|
||||||
"EndPoint": "hir-oss.test.extimaging.com",
|
"EndPoint": "hir-oss.test.extimaging.com",
|
||||||
// MinIO 的端口
|
|
||||||
"Port": "443",
|
"Port": "443",
|
||||||
// 是否使用 SSL
|
|
||||||
"UseSSL": true,
|
"UseSSL": true,
|
||||||
// MinIO 的角色 ARN
|
|
||||||
"AccessKey": "fbStsVYCIPKHQneeqMwD",
|
"AccessKey": "fbStsVYCIPKHQneeqMwD",
|
||||||
// MinIO 的访问密钥
|
|
||||||
"SecretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
"SecretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
||||||
// MinIO 的BucketName
|
|
||||||
"BucketName": "irc-test",
|
"BucketName": "irc-test",
|
||||||
// MinIO 的访问端点
|
|
||||||
"ViewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
|
"ViewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
|
||||||
},
|
},
|
||||||
// AWS S3 对象存储服务的配置
|
|
||||||
"AWS": {
|
"AWS": {
|
||||||
// AWS S3 的Region
|
|
||||||
"Region": "us-east-1",
|
"Region": "us-east-1",
|
||||||
// AWS S3 的内部访问端点
|
|
||||||
"EndPoint": "s3.us-east-1.amazonaws.com",
|
"EndPoint": "s3.us-east-1.amazonaws.com",
|
||||||
// 是否使用 SSL
|
|
||||||
"UseSSL": true,
|
"UseSSL": true,
|
||||||
// AWS S3 的角色 ARN
|
|
||||||
"RoleArn": "arn:aws:iam::471112624751:role/uat_s3_access",
|
"RoleArn": "arn:aws:iam::471112624751:role/uat_s3_access",
|
||||||
// AWS S3 的访问密钥 ID
|
|
||||||
"AccessKeyId": "AKIAW3MEAFJX7IPXISP4",
|
"AccessKeyId": "AKIAW3MEAFJX7IPXISP4",
|
||||||
// AWS S3 的访问密钥 Secret
|
|
||||||
"SecretAccessKey": "Pgrg3le5jPxZQ7MR1yYNS30J0XRyJeKVyIIjElXc",
|
"SecretAccessKey": "Pgrg3le5jPxZQ7MR1yYNS30J0XRyJeKVyIIjElXc",
|
||||||
// AWS S3 的Bucket名称
|
|
||||||
"BucketName": "ei-med-s3-lili-uat-store",
|
"BucketName": "ei-med-s3-lili-uat-store",
|
||||||
// AWS S3 的访问端点
|
|
||||||
"ViewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com",
|
"ViewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com",
|
||||||
// AWS S3 的持续数秒
|
|
||||||
"DurationSeconds": 7200
|
"DurationSeconds": 7200
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 系统配置
|
|
||||||
"BasicSystemConfig": {
|
"BasicSystemConfig": {
|
||||||
// 启用质控风险控制功能
|
|
||||||
"QCRiskControl": true,
|
"QCRiskControl": true,
|
||||||
// 打开用户复杂密码
|
|
||||||
"OpenUserComplexPassword": false,
|
"OpenUserComplexPassword": false,
|
||||||
// 是否在开始工作前强制签署电子知情同意书
|
|
||||||
"OpenSignDocumentBeforeWork": false,
|
"OpenSignDocumentBeforeWork": false,
|
||||||
// 是否启用登录失败次数限制(防暴力破解)
|
|
||||||
"OpenLoginLimit": false,
|
"OpenLoginLimit": false,
|
||||||
// 连续登录失败多少次后触发锁定
|
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
// 触发锁定后账号锁定时长(分钟)
|
|
||||||
"LoginFailLockMinutes": 1,
|
"LoginFailLockMinutes": 1,
|
||||||
// 无操作自动登出的超时时间(分钟)
|
|
||||||
"AutoLoginOutMinutes": 10,
|
"AutoLoginOutMinutes": 10,
|
||||||
// 是否启用多因子登录认证(MFA)
|
|
||||||
"OpenLoginMFA": false,
|
"OpenLoginMFA": false,
|
||||||
// 连续阅片的最长工作时间(分钟),超时后强制休息
|
|
||||||
"ContinuousReadingTimeMin": 120,
|
"ContinuousReadingTimeMin": 120,
|
||||||
// 强制休息时长(分钟)
|
|
||||||
"ReadingRestTimeMin": 10,
|
"ReadingRestTimeMin": 10,
|
||||||
// 是否强制用户定期修改密码
|
|
||||||
"IsNeedChangePassWord": true,
|
"IsNeedChangePassWord": true,
|
||||||
// 密码有效期(天),到期后必须修改
|
|
||||||
"ChangePassWordDays": 90,
|
"ChangePassWordDays": 90,
|
||||||
// 模板类型 1 Elevate(LiLi) 2 Extensive(展影)
|
|
||||||
"TemplateType": 2,
|
"TemplateType": 2,
|
||||||
// 是否打开项目关联删除
|
"OpenTrialRelationDelete": false,
|
||||||
"OpenTrialRelationDelete": true,
|
|
||||||
// 转换PDF服务配置
|
|
||||||
"ThirdPdfUrl": "http://106.14.89.110:30088/api/v1/convert/file/pdf",
|
"ThirdPdfUrl": "http://106.14.89.110:30088/api/v1/convert/file/pdf",
|
||||||
//MFA免验证发送天数
|
|
||||||
"UserMFAVerifyMinutes": 1440
|
"UserMFAVerifyMinutes": 1440
|
||||||
},
|
},
|
||||||
// 邮件服务配置(用于系统通知、找回密码、错误报警等)
|
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
|
|
||||||
// 企业邮箱SMTP服务器地址
|
|
||||||
"Host": "smtp.qiye.aliyun.com",
|
"Host": "smtp.qiye.aliyun.com",
|
||||||
// SMTP端口
|
|
||||||
"Port": 465,
|
"Port": 465,
|
||||||
|
|
||||||
"Imap": "imap.qiye.aliyun.com",
|
"Imap": "imap.qiye.aliyun.com",
|
||||||
"ImapPort": 993,
|
"ImapPort": 993,
|
||||||
|
|
||||||
// 发件人邮箱地址
|
|
||||||
"FromEmail": "test@extimaging.com",
|
"FromEmail": "test@extimaging.com",
|
||||||
// 发件人显示名称
|
|
||||||
"FromName": "Test EIC Imaging System",
|
"FromName": "Test EIC Imaging System",
|
||||||
// SMTP授权码
|
|
||||||
"AuthorizationCode": "SHzyyl2021",
|
"AuthorizationCode": "SHzyyl2021",
|
||||||
// 系统对外访问地址
|
|
||||||
"SiteUrl": "http://irc.test.extimaging.com/login",
|
"SiteUrl": "http://irc.test.extimaging.com/login",
|
||||||
|
|
||||||
|
|
||||||
// 系统简称 - 一致性核查使用
|
|
||||||
"SystemShortName": "IRC",
|
"SystemShortName": "IRC",
|
||||||
// 组织英文名称-添加用户默认值
|
|
||||||
"OrganizationName": "ExtImaging",
|
"OrganizationName": "ExtImaging",
|
||||||
// 组织中文名称
|
|
||||||
"OrganizationNameCN": "ExtImaging",
|
"OrganizationNameCN": "ExtImaging",
|
||||||
|
|
||||||
"PlatformName": "EICS",
|
"PlatformName": "EICS",
|
||||||
"PlatformNameCN": "展影云平台",
|
"PlatformNameCN": "展影云平台",
|
||||||
// 公司英文全称
|
|
||||||
"CompanyName": "Extensive Imaging",
|
"CompanyName": "Extensive Imaging",
|
||||||
// 公司中文全称
|
|
||||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
// 公司英文简称
|
|
||||||
"CompanyShortName": "Extensive Imaging",
|
"CompanyShortName": "Extensive Imaging",
|
||||||
// 公司中文简称
|
|
||||||
"CompanyShortNameCN": "展影医疗",
|
"CompanyShortNameCN": "展影医疗",
|
||||||
|
|
||||||
// 是否为国际版环境 方便前端区分,用于区分lili 还是irc 做一些事情
|
|
||||||
"IsEnv_US": false,
|
"IsEnv_US": false,
|
||||||
// 邮箱格式校验正则表达式
|
|
||||||
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
||||||
|
|
||||||
//后端周期性邮件默认语言
|
|
||||||
"CronEmailDefaultCulture": "zh-CN"
|
"CronEmailDefaultCulture": "zh-CN"
|
||||||
},
|
},
|
||||||
// PACS 连接配置
|
|
||||||
"SystemPacsConfig": {
|
"SystemPacsConfig": {
|
||||||
// PACS服务器端口
|
|
||||||
"Port": "11113",
|
"Port": "11113",
|
||||||
// PACS服务器IP地址
|
|
||||||
"IP": "106.14.89.110"
|
"IP": "106.14.89.110"
|
||||||
},
|
},
|
||||||
// 重复请求配置
|
|
||||||
"RequestDuplicationOptions": {
|
"RequestDuplicationOptions": {
|
||||||
// 是否启用重复请求检测
|
|
||||||
"IsEnabled": true,
|
"IsEnabled": true,
|
||||||
// 重复请求时间窗口(毫秒)
|
|
||||||
"DuplicationWindowMs": 500,
|
"DuplicationWindowMs": 500,
|
||||||
// 缓存请求时间(秒)
|
|
||||||
"CacheTimeSeconds": 5,
|
"CacheTimeSeconds": 5,
|
||||||
"ExcludedPaths": [
|
"ExcludedPaths": []
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,8 @@ public static class CacheKeys
|
||||||
//项目缓存
|
//项目缓存
|
||||||
public static string Trial(string trialIdStr) => $"TrialId:{trialIdStr}";
|
public static string Trial(string trialIdStr) => $"TrialId:{trialIdStr}";
|
||||||
|
|
||||||
|
public static string TrialVisitTaskMaxCode(Guid trialId) => $"TrialVisitTaskMaxCode:{trialId}";
|
||||||
|
|
||||||
//检查编号递增锁
|
//检查编号递增锁
|
||||||
public static string TrialStudyMaxCode(Guid trialId) => $"TrialStudyMaxCode:{trialId}";
|
public static string TrialStudyMaxCode(Guid trialId) => $"TrialStudyMaxCode:{trialId}";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -337,6 +337,12 @@
|
||||||
<param name="taskId"></param>
|
<param name="taskId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.GenerateTaskNo">
|
||||||
|
<summary>
|
||||||
|
从 NewId 的后 3 个字节(24 位)生成一个 6 位十六进制字符串
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.GetIsClinicalDataSignTest(System.Guid)">
|
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.GetIsClinicalDataSignTest(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
获取GetIsClinicalDataSignTest
|
获取GetIsClinicalDataSignTest
|
||||||
|
|
@ -17537,17 +17543,17 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question">
|
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question">
|
||||||
<summary>
|
<summary>
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
质疑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency">
|
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency">
|
||||||
<summary>
|
<summary>
|
||||||
һ<EFBFBD><EFBFBD><EFBFBD>Ժ˲<EFBFBD>
|
一致性核查
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto">
|
<member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto">
|
||||||
<summary>
|
<summary>
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
复制
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView">
|
<member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView">
|
||||||
|
|
|
||||||
|
|
@ -439,6 +439,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public string TaskName { get; set; } = String.Empty;
|
public string TaskName { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public string TaskBlindName { get; set; } = String.Empty;
|
||||||
|
|
||||||
public Guid? DoctorUserId { get; set; }
|
public Guid? DoctorUserId { get; set; }
|
||||||
|
|
||||||
public ReadingCategory? ReadingCategory { get; set; }
|
public ReadingCategory? ReadingCategory { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,45 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region 获取随机编号
|
||||||
|
/// <summary>
|
||||||
|
/// 从 NewId 的后 3 个字节(24 位)生成一个 6 位十六进制字符串
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GenerateTaskNo()
|
||||||
|
{
|
||||||
|
var bytes = NewId.Next().ToByteArray();
|
||||||
|
|
||||||
|
uint value =
|
||||||
|
BitConverter.ToUInt32(bytes, 0)
|
||||||
|
^ BitConverter.ToUInt32(bytes, 4)
|
||||||
|
^ BitConverter.ToUInt32(bytes, 8)
|
||||||
|
^ BitConverter.ToUInt32(bytes, 12);
|
||||||
|
|
||||||
|
return (value & 0xFFFFFF).ToString("X6");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<string> GetRandomTaskName(Guid trialId, List<string> existList)
|
||||||
|
{
|
||||||
|
var taskName = GenerateTaskNo();
|
||||||
|
|
||||||
|
while (existList.Any(t => t == taskName))
|
||||||
|
{
|
||||||
|
taskName = GenerateTaskNo();
|
||||||
|
}
|
||||||
|
|
||||||
|
while (await _visitTaskRepository.AnyAsync(t => t.TaskBlindName == taskName && t.TrialId == trialId))
|
||||||
|
{
|
||||||
|
taskName = GenerateTaskNo();
|
||||||
|
}
|
||||||
|
|
||||||
|
existList.Add(taskName);
|
||||||
|
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
//基于标准签名 产生任务 (或者手动选择某些访视生成该标准的任务)
|
//基于标准签名 产生任务 (或者手动选择某些访视生成该标准的任务)
|
||||||
public async Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId, bool? isManualSelectVisit = null, List<Guid>? subjectVisitIdList = null)
|
public async Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId, bool? isManualSelectVisit = null, List<Guid>? subjectVisitIdList = null)
|
||||||
|
|
@ -151,11 +190,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||||
|
|
||||||
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(trialId));
|
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialVisitTaskMaxCode(trialId));
|
||||||
|
|
||||||
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
|
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
|
||||||
|
|
||||||
|
var randomTaskBlindNameList = new List<string>();
|
||||||
|
|
||||||
foreach (var subjectGroup in needGenerateVisit.GroupBy(t => t.SubjectId).Select(g => new { SubjectId = g.Key, SubjectVisitList = g.ToList() }))
|
foreach (var subjectGroup in needGenerateVisit.GroupBy(t => t.SubjectId).Select(g => new { SubjectId = g.Key, SubjectVisitList = g.ToList() }))
|
||||||
{
|
{
|
||||||
|
|
@ -173,6 +212,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var blindTaskName = string.Empty;
|
var blindTaskName = string.Empty;
|
||||||
|
|
||||||
|
var isRandom = false;
|
||||||
|
|
||||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||||
{
|
{
|
||||||
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0 && subjectVisit.VisitNum == 0)
|
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0 && subjectVisit.VisitNum == 0)
|
||||||
|
|
@ -185,6 +226,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.Random)
|
||||||
|
{
|
||||||
|
blindTaskName = await GetRandomTaskName(trialId, randomTaskBlindNameList);
|
||||||
|
|
||||||
|
isRandom = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
blindTaskName = "Timepoint";
|
blindTaskName = "Timepoint";
|
||||||
|
|
@ -258,12 +305,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
|
|
||||||
|
var blindTaskName2 = isRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : blindTaskName;
|
||||||
|
|
||||||
task2 = await _visitTaskRepository.AddAsync(new VisitTask()
|
task2 = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
SubjectId = subjectVisit.SubjectId,
|
SubjectId = subjectVisit.SubjectId,
|
||||||
IsUrgent = subjectVisit.IsUrgent,
|
IsUrgent = subjectVisit.IsUrgent,
|
||||||
TaskBlindName = blindTaskName,
|
TaskBlindName = blindTaskName2,
|
||||||
TaskName = subjectVisit.VisitName,
|
TaskName = subjectVisit.VisitName,
|
||||||
TaskUrgentType = taskUrgentType,
|
TaskUrgentType = taskUrgentType,
|
||||||
IsCanEditUrgentState = isCanEditUrgentState,
|
IsCanEditUrgentState = isCanEditUrgentState,
|
||||||
|
|
@ -283,7 +332,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -344,7 +393,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -590,11 +639,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||||
|
|
||||||
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(trialId));
|
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialVisitTaskMaxCode(trialId));
|
||||||
|
|
||||||
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
|
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
|
||||||
|
|
||||||
|
var randomTaskBlindNameList = new List<string>();
|
||||||
|
|
||||||
|
|
||||||
switch (generateTaskCommand.ReadingCategory)
|
switch (generateTaskCommand.ReadingCategory)
|
||||||
|
|
@ -654,7 +703,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var isFrontTaskNeedSignButNotSign = await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.VisitTaskNum < subjectVisit.VisitNum && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false);
|
var isFrontTaskNeedSignButNotSign = await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.VisitTaskNum < subjectVisit.VisitNum && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false);
|
||||||
|
|
||||||
|
|
||||||
var blindTaskName = string.Empty;
|
var blindTaskName = string.Empty;
|
||||||
|
var isFullRandom = false;
|
||||||
|
|
||||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||||
{
|
{
|
||||||
|
|
@ -668,6 +719,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.Random)
|
||||||
|
{
|
||||||
|
blindTaskName = await GetRandomTaskName(trialId, randomTaskBlindNameList);
|
||||||
|
isFullRandom = true;
|
||||||
|
}
|
||||||
|
//受试者随机
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
blindTaskName = "Timepoint";
|
blindTaskName = "Timepoint";
|
||||||
|
|
@ -721,11 +778,15 @@ namespace IRaCIS.Core.Application.Service
|
||||||
if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2))
|
if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2))
|
||||||
{
|
{
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
|
var blindTaskName2 = isFullRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : blindTaskName;
|
||||||
|
|
||||||
|
|
||||||
task2 = await _visitTaskRepository.AddAsync(new VisitTask()
|
task2 = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
SubjectId = subjectVisit.SubjectId,
|
SubjectId = subjectVisit.SubjectId,
|
||||||
TaskBlindName = blindTaskName,
|
TaskBlindName = blindTaskName2,
|
||||||
TaskName = subjectVisit.VisitName,
|
TaskName = subjectVisit.VisitName,
|
||||||
IsUrgent = subjectVisit.IsUrgent,
|
IsUrgent = subjectVisit.IsUrgent,
|
||||||
|
|
||||||
|
|
@ -747,7 +808,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
|
||||||
|
|
||||||
#region 分配
|
#region 分配
|
||||||
|
|
@ -920,7 +981,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -992,7 +1053,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1069,7 +1130,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
|
||||||
#region 分配
|
#region 分配
|
||||||
|
|
||||||
|
|
@ -1197,7 +1258,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1277,6 +1338,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var reReadingVisitTask = generateTaskCommand.ReReadingTask;
|
var reReadingVisitTask = generateTaskCommand.ReReadingTask;
|
||||||
|
|
||||||
|
|
||||||
Guid? subjectVisitId = Guid.Empty;
|
Guid? subjectVisitId = Guid.Empty;
|
||||||
|
|
||||||
if (reReadingVisitTask.SourceSubjectVisitId == null)
|
if (reReadingVisitTask.SourceSubjectVisitId == null)
|
||||||
|
|
@ -1317,6 +1379,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//&& t.TrialReadingCriterionId == reReadingVisitTask.TrialReadingCriterionId && t.TaskState == TaskState.Effect
|
//&& t.TrialReadingCriterionId == reReadingVisitTask.TrialReadingCriterionId && t.TaskState == TaskState.Effect
|
||||||
// && t.SourceSubjectVisitId == reReadingVisitTask.SourceSubjectVisitId && t.ArmEnum == reReadingVisitTask.ArmEnum && t.DoctorUserId == reReadingVisitTask.DoctorUserId).FirstOrDefault();
|
// && t.SourceSubjectVisitId == reReadingVisitTask.SourceSubjectVisitId && t.ArmEnum == reReadingVisitTask.ArmEnum && t.DoctorUserId == reReadingVisitTask.DoctorUserId).FirstOrDefault();
|
||||||
|
|
||||||
|
var isRandomReading = trialReadingCriterionConfigList.FirstOrDefault(t => t.TrialReadingCriterionId == reReadingVisitTask.TrialReadingCriterionId)?.IsReadingTaskViewInOrder == ReadingOrder.Random;
|
||||||
|
|
||||||
|
var taskBlindName = isRandomReading ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : reReadingVisitTask.TaskBlindName;
|
||||||
|
|
||||||
|
|
||||||
var newTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
var newTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
{
|
{
|
||||||
|
|
@ -1325,7 +1391,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
SubjectId = reReadingVisitTask.SubjectId,
|
SubjectId = reReadingVisitTask.SubjectId,
|
||||||
ArmEnum = reReadingVisitTask.ArmEnum,
|
ArmEnum = reReadingVisitTask.ArmEnum,
|
||||||
TaskName = reReadingVisitTask.TaskName,
|
TaskName = reReadingVisitTask.TaskName,
|
||||||
TaskBlindName = reReadingVisitTask.TaskBlindName,
|
TaskBlindName = taskBlindName,
|
||||||
|
|
||||||
IsUrgent = reReadingVisitTask.IsAnalysisCreate ? false : subjectVisitUrgentInfo.IsUrgent,
|
IsUrgent = reReadingVisitTask.IsAnalysisCreate ? false : subjectVisitUrgentInfo.IsUrgent,
|
||||||
TaskUrgentType = reReadingVisitTask.IsAnalysisCreate ? null : taskUrgent,
|
TaskUrgentType = reReadingVisitTask.IsAnalysisCreate ? null : taskUrgent,
|
||||||
|
|
@ -1386,7 +1452,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
@ -1491,7 +1557,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
@ -1538,7 +1604,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
@ -1548,6 +1614,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm && x.IsConfirmed && x.TrialReadingCriterionId == firstTask.TrialReadingCriterionId).FirstOrDefaultAsync();
|
var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm && x.IsConfirmed && x.TrialReadingCriterionId == firstTask.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var isRandom = trialReadingCriterionConfigList.FirstOrDefault(t => t.TrialReadingCriterionId == firstTask.TrialReadingCriterionId)?.IsReadingTaskViewInOrder == ReadingOrder.Random;
|
||||||
|
|
||||||
|
var blindName = isRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : firstTask.TaskBlindName;
|
||||||
|
|
||||||
VisitTask visitTask = new VisitTask()
|
VisitTask visitTask = new VisitTask()
|
||||||
{
|
{
|
||||||
ArmEnum = Arm.JudgeArm,
|
ArmEnum = Arm.JudgeArm,
|
||||||
|
|
@ -1564,7 +1635,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
SouceReadModuleId = firstTask.SouceReadModuleId,
|
SouceReadModuleId = firstTask.SouceReadModuleId,
|
||||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||||
TaskState = TaskState.Effect,
|
TaskState = TaskState.Effect,
|
||||||
TaskBlindName = firstTask.TaskBlindName,
|
TaskBlindName = blindName,
|
||||||
DoctorUserId = subjectUser == null ? null : subjectUser.DoctorUserId,
|
DoctorUserId = subjectUser == null ? null : subjectUser.DoctorUserId,
|
||||||
TaskAllocationState = subjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated,
|
TaskAllocationState = subjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated,
|
||||||
AllocateTime = subjectUser == null ? null : DateTime.Now,
|
AllocateTime = subjectUser == null ? null : DateTime.Now,
|
||||||
|
|
@ -1576,7 +1647,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
await _visitTaskRepository.AddAsync(visitTask);
|
await _visitTaskRepository.AddAsync(visitTask);
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id), x => new VisitTask()
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id), x => new VisitTask()
|
||||||
{
|
{
|
||||||
|
|
@ -1637,7 +1708,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
});
|
});
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1707,7 +1778,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
TrialId = originalTaskInfo.TrialId
|
TrialId = originalTaskInfo.TrialId
|
||||||
});
|
});
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -854,7 +854,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
/// <param name="inQuery"></param>
|
/// <param name="inQuery"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<ReReadingTaskView>> GetIRReReadingTaskList(VisitTaskQuery inQuery)
|
public async Task<IResponseOutput<PageOutput<ReReadingTaskView>>> GetIRReReadingTaskList(VisitTaskQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
var visitTaskQueryable = _visitTaskReReadingRepository
|
var visitTaskQueryable = _visitTaskReReadingRepository
|
||||||
|
|
@ -878,6 +878,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(inQuery.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskName))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(inQuery.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskName))
|
||||||
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskBlindName), t => t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskBlindName))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
|
||||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > inQuery.BeginAllocateDate)
|
.WhereIf(inQuery.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > inQuery.BeginAllocateDate)
|
||||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
.WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
||||||
|
|
@ -889,7 +890,11 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||||
|
|
||||||
return pageList;
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
|
||||||
|
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(pageList, criterionInfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1242,7 +1247,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
/// <param name="inQuery"></param>
|
/// <param name="inQuery"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<IRHaveReadView>> GetIRHaveReadTaskList(VisitTaskQuery inQuery)
|
public async Task<IResponseOutput<PageOutput<IRHaveReadView>>> GetIRHaveReadTaskList(VisitTaskQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1261,6 +1266,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||||
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskBlindName), t => t.TaskBlindName.Contains(inQuery.TaskBlindName))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
|
||||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
||||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
||||||
|
|
@ -1270,7 +1276,10 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||||
|
|
||||||
return pageList;
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
|
||||||
|
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(pageList, criterionInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2267,7 +2276,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
_ = _taskSeriesRepository.AddAsync(newSeries).Result;
|
_ = _taskSeriesRepository.AddAsync(newSeries).Result;
|
||||||
|
|
||||||
|
|
||||||
var studyInstanceList = taskInstanceList.Where(t => t.StudyId == taskStudy.Id).ToList();
|
var studyInstanceList = taskInstanceList.Where(t => t.StudyId == taskStudy.Id && t.SeriesId == series.Id).ToList();
|
||||||
|
|
||||||
foreach (var instance in studyInstanceList)
|
foreach (var instance in studyInstanceList)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using Medallion.Threading;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
@ -16,7 +17,7 @@ using System.Threading.Tasks;
|
||||||
namespace IRaCIS.Core.Application.Service.Common;
|
namespace IRaCIS.Core.Application.Service.Common;
|
||||||
|
|
||||||
[ApiExplorerSettings(GroupName = "Common")]
|
[ApiExplorerSettings(GroupName = "Common")]
|
||||||
public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _distributedLockProvider, IUserInfo _userInfo, IWebHostEnvironment _hostEnvironment, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService
|
public class DeployConfigService(IMapper _mapper, IConfiguration _configuration, IDistributedLockProvider _distributedLockProvider, IUserInfo _userInfo, IWebHostEnvironment _hostEnvironment, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -26,7 +27,18 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ServiceVerifyConfigOption> GetSystemBasicConfigInfo([FromServices] IOptionsMonitor<ServiceVerifyConfigOption> options)
|
public async Task<ServiceVerifyConfigOption> GetSystemBasicConfigInfo([FromServices] IOptionsMonitor<ServiceVerifyConfigOption> options)
|
||||||
{
|
{
|
||||||
return options.CurrentValue;
|
//var config = _configuration.GetSection("BasicSystemConfig").Get<ServiceVerifyConfigOption>();
|
||||||
|
//return config;
|
||||||
|
|
||||||
|
|
||||||
|
var path = Path.Combine( _hostEnvironment.ContentRootPath,$"appsettings.{_hostEnvironment.EnvironmentName}.json");
|
||||||
|
|
||||||
|
var json = File.ReadAllText(path);
|
||||||
|
|
||||||
|
var obj = JObject.Parse(json);
|
||||||
|
|
||||||
|
return obj["BasicSystemConfig"]!.ToObject<ServiceVerifyConfigOption>()!;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -37,7 +49,8 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> UpdateSystemBasicConfig(ServiceVerifyConfigOption basicSystemConfigOption)
|
public async Task<IResponseOutput> UpdateSystemBasicConfig(ServiceVerifyConfigOption basicSystemConfigOption)
|
||||||
{
|
{
|
||||||
var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
|
//var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
|
||||||
|
var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
|
||||||
|
|
||||||
|
|
||||||
var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
|
var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
|
||||||
|
|
@ -73,6 +86,7 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
|
||||||
// 重新写入appsettings.json
|
// 重新写入appsettings.json
|
||||||
string result = obj.ToString();
|
string result = obj.ToString();
|
||||||
System.IO.File.WriteAllText(path, result);
|
System.IO.File.WriteAllText(path, result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -86,7 +100,18 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<SystemEmailSendConfig> GetEmailConfigInfo([FromServices] IOptionsMonitor<SystemEmailSendConfig> options)
|
public async Task<SystemEmailSendConfig> GetEmailConfigInfo([FromServices] IOptionsMonitor<SystemEmailSendConfig> options)
|
||||||
{
|
{
|
||||||
return options.CurrentValue;
|
//两种方式都有问题
|
||||||
|
//var config = _configuration.GetSection("BasicSystemConfig").Get<SystemEmailSendConfig>();
|
||||||
|
//return config;
|
||||||
|
//return options.CurrentValue;
|
||||||
|
|
||||||
|
var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
|
||||||
|
|
||||||
|
var json = File.ReadAllText(path);
|
||||||
|
|
||||||
|
var obj = JObject.Parse(json);
|
||||||
|
|
||||||
|
return obj["SystemEmailSendConfig"]!.ToObject<SystemEmailSendConfig>()!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -98,7 +123,8 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> UpdateSystemEmailConfig(SystemEmailSendConfig emailConfig)
|
public async Task<IResponseOutput> UpdateSystemEmailConfig(SystemEmailSendConfig emailConfig)
|
||||||
{
|
{
|
||||||
var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
|
var path = Path.Combine(_hostEnvironment.ContentRootPath,$"appsettings.{_hostEnvironment.EnvironmentName}.json");
|
||||||
|
//var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
|
||||||
|
|
||||||
var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
|
var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
|
||||||
|
|
||||||
|
|
@ -139,6 +165,7 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
|
||||||
string result = obj.ToString();
|
string result = obj.ToString();
|
||||||
System.IO.File.WriteAllText(path, result);
|
System.IO.File.WriteAllText(path, result);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
//subject 随机阅片 或者无序 有上传 才处理任务编号
|
//subject 随机阅片 或者无序 有上传 才处理任务编号
|
||||||
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId &&
|
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId &&
|
||||||
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom ||
|
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom
|
||||||
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageDownloadEnum != ReadingImageDownload.None))))
|
//||(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageDownloadEnum != ReadingImageDownload.None)
|
||||||
|
)))
|
||||||
{
|
{
|
||||||
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
||||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
||||||
|
|
|
||||||
|
|
@ -246,9 +246,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
|
var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
|
||||||
{
|
{
|
||||||
Answer = x.Answer,
|
Answer = x.Answer,
|
||||||
Unit=x.ReadingQuestionTrial.Unit,
|
Unit = x.ReadingQuestionTrial.Unit,
|
||||||
ValueType=x.ReadingQuestionTrial.ValueType,
|
ValueType = x.ReadingQuestionTrial.ValueType,
|
||||||
CustomUnit=x.ReadingQuestionTrial.CustomUnit,
|
CustomUnit = x.ReadingQuestionTrial.CustomUnit,
|
||||||
VisitTaskId = x.VisitTaskId,
|
VisitTaskId = x.VisitTaskId,
|
||||||
DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
|
DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
|
||||||
ShowOrder = x.ReadingQuestionTrial.ShowOrder,
|
ShowOrder = x.ReadingQuestionTrial.ShowOrder,
|
||||||
|
|
@ -643,8 +643,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<string> TestGetJointMedicalReviewDialog(Guid id)
|
public async Task<string> TestGetJointMedicalReviewDialog(Guid id)
|
||||||
{
|
{
|
||||||
var dialog = await _readingMedicalReviewDialogRepository.Where(x => x.Id == id)
|
var dialog = await _readingMedicalReviewDialogRepository.Where(x => x.Id == id)
|
||||||
.ProjectTo<GetMedicalReviewDialogOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
.ProjectTo<GetMedicalReviewDialogOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
Dictionary<string, string> i18NKeys = new Dictionary<string, string>()
|
Dictionary<string, string> i18NKeys = new Dictionary<string, string>()
|
||||||
|
|
@ -661,11 +661,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
};
|
};
|
||||||
|
|
||||||
var i18Values = i18NKeys.Select(x => x.Value).ToList();
|
var i18Values = i18NKeys.Select(x => x.Value).ToList();
|
||||||
var i18nList=await _internationalizationRepository.Where(x => i18Values.Contains(x.Code))
|
var i18nList = await _internationalizationRepository.Where(x => i18Values.Contains(x.Code))
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
Code= x.Code,
|
Code = x.Code,
|
||||||
Value= _userInfo.IsEn_Us?x.Value:x.ValueCN
|
Value = _userInfo.IsEn_Us ? x.Value : x.ValueCN
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
List<string> dictionaryCodeList = new List<string>()
|
List<string> dictionaryCodeList = new List<string>()
|
||||||
|
|
@ -676,11 +676,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
"YesOrNo",
|
"YesOrNo",
|
||||||
};
|
};
|
||||||
|
|
||||||
var dictionadParents=await _dictionaryRepository.Where(x=> dictionaryCodeList.Contains(x.Parent.Code))
|
var dictionadParents = await _dictionaryRepository.Where(x => dictionaryCodeList.Contains(x.Parent.Code))
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
ParentCode = x.Parent.Code,
|
ParentCode = x.Parent.Code,
|
||||||
Code=x.Code,
|
Code = x.Code,
|
||||||
Value = _userInfo.IsEn_Us ? x.Value : x.ValueCN
|
Value = _userInfo.IsEn_Us ? x.Value : x.ValueCN
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
@ -706,7 +706,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return await JointMedicalReviewDialog(dialog,i18N);
|
return await JointMedicalReviewDialog(dialog, i18N);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -910,7 +910,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<GetIRMedicalFeedbackListOutDto> GetNextIRMedicalFeedback(GetNextIRMedicalFeedbackInDto inDto)
|
public async Task<GetIRMedicalFeedbackListOutDto> GetNextIRMedicalFeedback(GetNextIRMedicalFeedbackInDto inDto)
|
||||||
{
|
{
|
||||||
var list = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
|
var responseOutput = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
|
||||||
{
|
{
|
||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
|
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
|
||||||
|
|
@ -919,6 +919,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
PageSize = 99999,
|
PageSize = 99999,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var list = responseOutput.Data;
|
||||||
|
|
||||||
var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId);
|
var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId);
|
||||||
|
|
||||||
var result = new GetIRMedicalFeedbackListOutDto() { };
|
var result = new GetIRMedicalFeedbackListOutDto() { };
|
||||||
|
|
@ -949,12 +951,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<GetIRMedicalFeedbackListOutDto>> GetIRMedicalFeedbackList(GetIRMedicalFeedbackListInDto inDto)
|
public async Task<IResponseOutput<PageOutput<GetIRMedicalFeedbackListOutDto>>> GetIRMedicalFeedbackList(GetIRMedicalFeedbackListInDto inDto)
|
||||||
{
|
{
|
||||||
var taskMedicalReviewquery = _taskMedicalReviewRepository.Where(x => x.TrialId == inDto.TrialId).Include(x => x.VisitTask)
|
var taskMedicalReviewquery = _taskMedicalReviewRepository.Where(x => x.TrialId == inDto.TrialId).Include(x => x.VisitTask)
|
||||||
.Where(x => x.VisitTask.DoctorUserId == _userInfo.UserRoleId)
|
.Where(x => x.VisitTask.DoctorUserId == _userInfo.UserRoleId)
|
||||||
.Where(x => x.IsHaveQuestion)
|
.Where(x => x.IsHaveQuestion)
|
||||||
.WhereIf(!inDto.TaskBlindName.IsNullOrEmpty(), x => x.VisitTask.TaskBlindName == inDto.TaskBlindName)
|
.WhereIf(!inDto.TaskBlindName.IsNullOrEmpty(), x => x.VisitTask.TaskBlindName.Contains(inDto.TaskBlindName))
|
||||||
.WhereIf(inDto.SubjectId != null, x => x.VisitTask.SubjectId == inDto.SubjectId!)
|
.WhereIf(inDto.SubjectId != null, x => x.VisitTask.SubjectId == inDto.SubjectId!)
|
||||||
.WhereIf(inDto.IsUrgent != null, x => x.VisitTask.IsUrgent == inDto.IsUrgent!)
|
.WhereIf(inDto.IsUrgent != null, x => x.VisitTask.IsUrgent == inDto.IsUrgent!)
|
||||||
.WhereIf(inDto.AuditState != null, x => x.AuditState == inDto.AuditState!)
|
.WhereIf(inDto.AuditState != null, x => x.AuditState == inDto.AuditState!)
|
||||||
|
|
@ -1004,7 +1006,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var result = await taskMedicalReviewquery.ToPagedListAsync(inDto, nameof(GetIRMedicalFeedbackListOutDto.AuditState));
|
var result = await taskMedicalReviewquery.ToPagedListAsync(inDto, nameof(GetIRMedicalFeedbackListOutDto.AuditState));
|
||||||
|
|
||||||
return result;
|
var criterionInfo = await _readingQuestionCriterionTrial.Where(t => t.Id == inDto.TrialReadingCriterionId)
|
||||||
|
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(result, criterionInfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -920,7 +920,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault();
|
var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault();
|
||||||
|
|
||||||
foreach (var item in needGenerateList.GroupBy(t => t.Email))
|
foreach (var item in needSendEmailList.GroupBy(t => t.Email))
|
||||||
{
|
{
|
||||||
var addUserRoleList = item.ToList();
|
var addUserRoleList = item.ToList();
|
||||||
|
|
||||||
|
|
@ -1137,23 +1137,26 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => userJoinIdList.Contains(t.Id), u => new TrialSiteUserSurvey() { IsJoin = true, SystemUserId = existSysUser.Id });
|
await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => userJoinIdList.Contains(t.Id), u => new TrialSiteUserSurvey() { IsJoin = true, SystemUserId = existSysUser.Id });
|
||||||
|
|
||||||
//中心调研设置用户角色退出
|
|
||||||
var needQuitUserList = item.Where(t => t.IsHistoryUser && t.IsHistoryUserOriginDeleted == false && t.IsHistoryUserDeleted == true).ToList();
|
|
||||||
|
|
||||||
var queitUserTypeIdList = needQuitUserList.Select(t => t.UserTypeId).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId && queitUserTypeIdList.Contains(t.UserRole.UserTypeId), c => new TrialSiteUserRole()
|
|
||||||
{
|
|
||||||
IsDeleted = true,
|
|
||||||
DeletedTime = DateTime.Now,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
await _trialSiteUserRoleRepository.SaveChangesAsync();
|
await _trialSiteUserRoleRepository.SaveChangesAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//中心调研设置用户角色退出
|
||||||
|
var needQuitUserList = allUserList.Where(t => t.IsHistoryUser && t.IsHistoryUserOriginDeleted == false && t.IsHistoryUserDeleted == true).ToList();
|
||||||
|
|
||||||
|
var queitUserTypeIdList = needQuitUserList.Select(t => t.UserTypeId).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId && queitUserTypeIdList.Contains(t.UserRole.UserTypeId), c => new TrialSiteUserRole()
|
||||||
|
{
|
||||||
|
IsDeleted = true,
|
||||||
|
DeletedTime = DateTime.Now,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.UserRoleId, ReviewerTime = DateTime.Now });
|
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.UserRoleId, ReviewerTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue