Compare commits
116 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0ef2dc8ab | |||
| ccf4bbdff9 | |||
| c3e36991b8 | |||
| 81f6c10f23 | |||
| 719ca071e1 | |||
| dad420a7e8 | |||
| d84aedf135 | |||
| 34f3b1607e | |||
| 7fa73e0054 | |||
| c146c2bfd2 | |||
| 2a1220899e | |||
| 874d36de28 | |||
| 0283052555 | |||
| effef5ad65 | |||
| 43d260e036 | |||
| 19708240b2 | |||
| 0999bae749 | |||
| e6bd35ae04 | |||
| 102e193ae8 | |||
| 20d557e795 | |||
| 593ab42882 | |||
| b56d256e10 | |||
| 614a3bd70e | |||
| 2eb3b04365 | |||
| 1fa3a5a181 | |||
| cd2007c4fd | |||
| 67e710eac0 | |||
| ef451d82ec | |||
| 899ebf2a30 | |||
| f233d27f96 | |||
| 9e8ab8acca | |||
| 2265387f47 | |||
| baf8f39bc6 | |||
| 3fa14d92ae | |||
| e6c577e68b | |||
| bb111dbbeb | |||
| 0df0b10a72 | |||
| 0a7ba9f0f5 | |||
| cd88990c32 | |||
| d53a1300fc | |||
| 07332ff3e1 | |||
| 8195a1cf3e | |||
| f5e5a47624 | |||
| 28608f3ecb | |||
| bb2da7ca81 | |||
| 713518a68c | |||
| bc448da297 | |||
| 8447878cb2 | |||
| 1b5a9673f6 | |||
| 27711f4184 | |||
| bb9bac1edf | |||
| 41ae2febc7 | |||
| c072c526e2 | |||
| d6bb98b84f | |||
| 42587ee59f | |||
| 62a964a3ea | |||
| 72447eb82f | |||
| 2f83c27fde | |||
| b219593f61 | |||
| 8521b0c28c | |||
| 26a62426f0 | |||
| 1246413e30 | |||
| f50b5819c0 | |||
| 6db8d61b7c | |||
| 58250fe993 | |||
| 6cae7a1ae4 | |||
| 73541efbf4 | |||
| f4bd891deb | |||
| a9831657cc | |||
| 500a9fbaca | |||
| 5f11c3a602 | |||
| 7680e90d65 | |||
| 06a57cd056 | |||
| 7626d17540 | |||
| 344b92c427 | |||
| 4719177009 | |||
| c1461633ce | |||
| 6be7aa1ad9 | |||
| 4da7c2f960 | |||
| 47a45df610 | |||
| 1a44e48b2d | |||
| c566a703eb | |||
| 001c248cb8 | |||
| 654462fe6b | |||
| ab6642ce33 | |||
| 946386ad43 | |||
| cf9c79a928 | |||
| 493e4e8dca | |||
| ecbe8434f3 | |||
| 644fe1bd3c | |||
| 870fca2e93 | |||
| 6207fb5006 | |||
| ae913d8213 | |||
| ce969822a0 | |||
| 4fc311d4a5 | |||
| 2b424ff45c | |||
| e5d9cfc50e | |||
| ac3552818b | |||
| c004741f95 | |||
| 2bdc0c7704 | |||
| 35d90d56dd | |||
| f14525ea95 | |||
| c2350f1418 | |||
| 4b8b02fa55 | |||
| 62102b8b03 | |||
| 0655318d2d | |||
| 0bd2a10091 | |||
| ce11788878 | |||
| 0cb74296c3 | |||
| def08b72ca | |||
| 1ef8d2913b | |||
| 7e18b1287e | |||
| fdcb6ad12f | |||
| 988bf0e92c | |||
| f6612286d9 | |||
| c21845c60d |
@@ -32,6 +32,7 @@ using IRaCIS.Core.Application.Contracts;
|
|||||||
using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
||||||
using DocumentFormat.OpenXml.Spreadsheet;
|
using DocumentFormat.OpenXml.Spreadsheet;
|
||||||
using AutoMapper.QueryableExtensions;
|
using AutoMapper.QueryableExtensions;
|
||||||
|
using NetTopologySuite.Algorithm;
|
||||||
|
|
||||||
namespace IRaCIS.Api.Controllers
|
namespace IRaCIS.Api.Controllers
|
||||||
{
|
{
|
||||||
@@ -108,7 +109,7 @@ namespace IRaCIS.Api.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
//MFA 邮箱验证 前端传递用户Id 和MFACode
|
//MFA 邮箱验证 前端传递用户Id 和MFACode
|
||||||
if (loginUser.UserId != null && _verifyConfig.CurrentValue.OpenLoginMFA)
|
if (loginUser.UserId != null && _verifyConfig.CurrentValue.OpenLoginMFA)
|
||||||
{
|
{
|
||||||
Guid userId = (Guid)loginUser.UserId;
|
Guid userId = (Guid)loginUser.UserId;
|
||||||
|
|
||||||
@@ -218,7 +219,7 @@ namespace IRaCIS.Api.Controllers
|
|||||||
{
|
{
|
||||||
//发版屏蔽
|
//发版屏蔽
|
||||||
|
|
||||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
//returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
||||||
|
|
||||||
//MFA 发送邮件
|
//MFA 发送邮件
|
||||||
|
|
||||||
@@ -226,23 +227,7 @@ namespace IRaCIS.Api.Controllers
|
|||||||
|
|
||||||
var email = returnModel.Data.BasicInfo.EMail;
|
var email = returnModel.Data.BasicInfo.EMail;
|
||||||
|
|
||||||
#region 隐藏Email
|
var hiddenEmail = EmailMaskHelper.MaskEmail(email);
|
||||||
// 找到 "@" 符号的位置
|
|
||||||
int atIndex = email.IndexOf('@');
|
|
||||||
|
|
||||||
// 替换 "@" 符号前的中间两位为星号
|
|
||||||
string visiblePart = email.Substring(0, atIndex);
|
|
||||||
|
|
||||||
int startIndex = (visiblePart.Length - 2) / 2;
|
|
||||||
|
|
||||||
// 替换中间两位字符为星号
|
|
||||||
string hiddenPartBeforeAt = visiblePart.Substring(0, startIndex) + "**" + visiblePart.Substring(startIndex + 2);
|
|
||||||
|
|
||||||
string afterAt = email.Substring(atIndex + 1);
|
|
||||||
|
|
||||||
// 组合隐藏和可见部分
|
|
||||||
string hiddenEmail = hiddenPartBeforeAt + "@" + afterAt;
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
returnModel.Data.BasicInfo.EMail = hiddenEmail;
|
returnModel.Data.BasicInfo.EMail = hiddenEmail;
|
||||||
|
|
||||||
|
|||||||
@@ -479,6 +479,8 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
public string FilePath { get; set; }
|
public string FilePath { get; set; }
|
||||||
public string FileName { get; set; }
|
public string FileName { get; set; }
|
||||||
public int FileFize { get; set; }
|
public int FileFize { get; set; }
|
||||||
|
|
||||||
|
public string FileType { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,7 +513,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
|
|
||||||
foreach (var item in incommand.UploadedFileList)
|
foreach (var item in incommand.UploadedFileList)
|
||||||
{
|
{
|
||||||
await _repository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId });
|
await _repository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType });
|
||||||
|
|
||||||
}
|
}
|
||||||
var uploadFinishedTime = DateTime.Now;
|
var uploadFinishedTime = DateTime.Now;
|
||||||
@@ -528,6 +530,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
studyMonitor.StudyCode = noneDicomStudy.StudyCode;
|
studyMonitor.StudyCode = noneDicomStudy.StudyCode;
|
||||||
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||||
studyMonitor.IP = _userInfo.IP;
|
studyMonitor.IP = _userInfo.IP;
|
||||||
|
studyMonitor.IsSuccess = true;
|
||||||
|
|
||||||
await _repository.SaveChangesAsync();
|
await _repository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,6 @@
|
|||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
||||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.3" />
|
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.3" />
|
||||||
<PackageReference Include="Serilog.Sinks.Email" Version="3.0.0" />
|
|
||||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.2" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Event_IRC"
|
"ASPNETCORE_ENVIRONMENT": "Event_IRC"
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:6101"
|
"applicationUrl": "http://localhost:6100"
|
||||||
},
|
},
|
||||||
"Docker": {
|
"Docker": {
|
||||||
"commandName": "Docker",
|
"commandName": "Docker",
|
||||||
@@ -54,11 +54,11 @@
|
|||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:6100"
|
"applicationUrl": "http://localhost:6100"
|
||||||
},
|
},
|
||||||
"IRaCIS.US_IRC": {
|
"IRaCIS.US_Uat_IRC": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "US_IRC"
|
"ASPNETCORE_ENVIRONMENT": "US_Uat_IRC"
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:6100"
|
"applicationUrl": "http://localhost:6100"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using Serilog.Sinks.Email;
|
//using Serilog.Sinks.Email;
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"ObjectStoreUse": "AliyunOSS",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
"regionId": "cn-shanghai",
|
"regionId": "cn-shanghai",
|
||||||
|
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
@@ -42,8 +43,11 @@
|
|||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 60
|
"AutoLoginOutMinutes": 60,
|
||||||
|
|
||||||
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
|
"ReadingRestTimeMin": 10
|
||||||
},
|
},
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
"Port": 465,
|
"Port": 465,
|
||||||
@@ -51,7 +55,11 @@
|
|||||||
"FromEmail": "uat@extimaging.com",
|
"FromEmail": "uat@extimaging.com",
|
||||||
"FromName": "UAT_IRC",
|
"FromName": "UAT_IRC",
|
||||||
"AuthorizationCode": "SHzyyl2021",
|
"AuthorizationCode": "SHzyyl2021",
|
||||||
"SiteUrl": "http://irc.event.extimaging.com/login"
|
"SiteUrl": "http://irc.event.extimaging.com/login",
|
||||||
|
"CompanyName": "Extensive Imaging",
|
||||||
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
|
"CompanyShortName": "Extensive Imaging",
|
||||||
|
"CompanyShortNameCN": "展影医疗"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
// "RemoteNew": "Server=47.117.165.18,1434;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
//"RemoteNew": "Server=101.132.193.237,1434;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||||
// "Hangfire": "Server=47.117.165.18,1434;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
//"Hangfire": "Server=101.132.193.237,1434;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
||||||
"RemoteNew": "Server=prod_mssql_standard,1433;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
"RemoteNew": "Server=prod_mssql_standard,1433;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=prod_mssql_standard,1433;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
"Hangfire": "Server=prod_mssql_standard,1433;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
"ObjectStoreUse": "AliyunOSS",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
"regionId": "cn-shanghai",
|
"regionId": "cn-shanghai",
|
||||||
|
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
@@ -36,14 +37,20 @@
|
|||||||
"BasicSystemConfig": {
|
"BasicSystemConfig": {
|
||||||
|
|
||||||
"OpenUserComplexPassword": true,
|
"OpenUserComplexPassword": true,
|
||||||
|
|
||||||
"OpenSignDocumentBeforeWork": true,
|
"OpenSignDocumentBeforeWork": true,
|
||||||
|
|
||||||
"OpenLoginLimit": true,
|
"OpenLoginLimit": true,
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 60
|
|
||||||
|
"AutoLoginOutMinutes": 360,
|
||||||
|
|
||||||
|
"OpenLoginMFA": false,
|
||||||
|
|
||||||
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
|
"ReadingRestTimeMin": 10
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
@@ -53,6 +60,8 @@
|
|||||||
"FromName": "IRC",
|
"FromName": "IRC",
|
||||||
"AuthorizationCode": "ExtImg@2022",
|
"AuthorizationCode": "ExtImg@2022",
|
||||||
"SiteUrl": "http://irc.extimaging.com/login",
|
"SiteUrl": "http://irc.extimaging.com/login",
|
||||||
|
"OrganizationName": "Extlmaging",
|
||||||
|
"OrganizationNameCN": "Extlmaging",
|
||||||
"CompanyName": "Extensive Imaging",
|
"CompanyName": "Extensive Imaging",
|
||||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
"CompanyShortName": "Extensive Imaging",
|
"CompanyShortName": "Extensive Imaging",
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
"regionId": "cn-shanghai",
|
"regionId": "cn-shanghai",
|
||||||
|
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
"endPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"endPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
@@ -26,15 +27,14 @@
|
|||||||
"viewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
"viewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||||
"region": "oss-cn-shanghai"
|
"region": "oss-cn-shanghai"
|
||||||
},
|
},
|
||||||
|
|
||||||
"MinIO": {
|
"MinIO": {
|
||||||
"endPoint": "192.168.3.68",
|
"endPoint": "hir-oss.test.extimaging.com",
|
||||||
"port": "8001",
|
"port": "443",
|
||||||
"useSSL": false,
|
"useSSL": true,
|
||||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
"accessKey": "fbStsVYCIPKHQneeqMwD",
|
||||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
"secretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
|
||||||
"bucketName": "test",
|
"bucketName": "irc-test",
|
||||||
"viewEndpoint": "http://192.168.3.68:8001/test/"
|
"viewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
|
||||||
},
|
},
|
||||||
|
|
||||||
"AWS": {
|
"AWS": {
|
||||||
@@ -63,7 +63,11 @@
|
|||||||
|
|
||||||
"AutoLoginOutMinutes": 1,
|
"AutoLoginOutMinutes": 1,
|
||||||
|
|
||||||
"OpenLoginMFA": false
|
"OpenLoginMFA": false,
|
||||||
|
|
||||||
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
|
"ReadingRestTimeMin": 10
|
||||||
},
|
},
|
||||||
|
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
@@ -75,6 +79,8 @@
|
|||||||
|
|
||||||
"SiteUrl": "http://irc.test.extimaging.com/login",
|
"SiteUrl": "http://irc.test.extimaging.com/login",
|
||||||
|
|
||||||
|
"OrganizationName": "Extlmaging",
|
||||||
|
"OrganizationNameCN": "Extlmaging",
|
||||||
"CompanyName": "Extensive Imaging",
|
"CompanyName": "Extensive Imaging",
|
||||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
"CompanyShortName": "Extensive Imaging",
|
"CompanyShortName": "Extensive Imaging",
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"RemoteNew": "Server=us-prod-mssql-service,1433;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
|
"Hangfire": "Server=us-prod-mssql-service,1433;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
|
//"RemoteNew": "Server=44.210.231.169,1435;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
|
//"Hangfire": "Server=44.210.231.169,1435;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
|
},
|
||||||
|
|
||||||
|
"ObjectStoreService": {
|
||||||
|
"ObjectStoreUse": "AWS",
|
||||||
|
"MinIO": {
|
||||||
|
"endPoint": "44.210.231.169",
|
||||||
|
"port": "9001",
|
||||||
|
"useSSL": false,
|
||||||
|
"accessKey": "e9bT1isTOqSAUxb6wd4n",
|
||||||
|
"secretKey": "b5TaDzNdQCBtCvfm8eZ3dR6yY7tfZu2JYze2Po1i",
|
||||||
|
"bucketName": "prod-irc-us",
|
||||||
|
"viewEndpoint": "http://44.210.231.169:9001/prod-irc-us/"
|
||||||
|
},
|
||||||
|
|
||||||
|
"AWS": {
|
||||||
|
"endPoint": "s3.us-east-1.amazonaws.com",
|
||||||
|
"useSSL": true,
|
||||||
|
"accessKey": "AKIAW3MEAFJX5P32P6NA",
|
||||||
|
"secretKey": "soKfYlzZE11Zi4RyTjXp0myXN0U3U+ka8rT49+B/",
|
||||||
|
"bucketName": "ei-med-s3-lili-store",
|
||||||
|
"viewEndpoint": "https://ei-med-s3-lili-store.s3.amazonaws.com/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"BasicSystemConfig": {
|
||||||
|
|
||||||
|
"OpenUserComplexPassword": false,
|
||||||
|
|
||||||
|
"OpenSignDocumentBeforeWork": false,
|
||||||
|
|
||||||
|
"OpenTrialRelationDelete": true,
|
||||||
|
|
||||||
|
"OpenLoginLimit": false,
|
||||||
|
|
||||||
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
|
"LoginFailLockMinutes": 30,
|
||||||
|
|
||||||
|
"AutoLoginOutMinutes": 60,
|
||||||
|
|
||||||
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
|
"ReadingRestTimeMin": 10,
|
||||||
|
|
||||||
|
"OpenLoginMFA": false
|
||||||
|
},
|
||||||
|
|
||||||
|
"SystemEmailSendConfig": {
|
||||||
|
"Port": 587,
|
||||||
|
"Host": "smtp-mail.outlook.com",
|
||||||
|
"FromEmail": "donotreply@elevateimaging.ai",
|
||||||
|
"FromName": "LiLi",
|
||||||
|
"AuthorizationCode": "Q#669869497420ul",
|
||||||
|
|
||||||
|
"OrganizationName": "Elevate Imaging",
|
||||||
|
"OrganizationNameCN": "Elevate Imaging",
|
||||||
|
"CompanyName": "Elevate Imaging Inc.",
|
||||||
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
|
"CompanyShortName": "Elevate Imaging",
|
||||||
|
"CompanyShortNameCN": "展影医疗",
|
||||||
|
"SiteUrl": "https://lili.elevateimaging.ai/login"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+33
-21
@@ -7,19 +7,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=us-mssql-service,1433;Database=Prod_US_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": "Server=us-mssql-service,1433;Database=Prod_US_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"
|
||||||
|
|
||||||
//"RemoteNew": "Server=44.218.11.19,1435;Database=Prod_US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
|
||||||
//"Hangfire": "Server=44.218.11.19,1435;Database=Prod_US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
|
|
||||||
"ObjectStoreUse": "AWS",
|
"ObjectStoreUse": "MinIO",
|
||||||
|
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
"regionId": "cn-shanghai",
|
"regionId": "cn-shanghai",
|
||||||
|
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
"endPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"endPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
@@ -30,13 +27,20 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"MinIO": {
|
"MinIO": {
|
||||||
"endPoint": "192.168.3.68",
|
//"endPoint": "hir-oss.uat.extimaging.com",
|
||||||
"port": "8001",
|
//"port": "443",
|
||||||
|
//"useSSL": true,
|
||||||
|
//"viewEndpoint": "https://hir-oss.uat.extimaging.com/hir-uat",
|
||||||
|
|
||||||
|
"endPoint": "47.117.164.182",
|
||||||
|
"port": "9001",
|
||||||
"useSSL": false,
|
"useSSL": false,
|
||||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
"viewEndpoint": "http://47.117.164.182:9001/test-irc-us",
|
||||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
|
||||||
"bucketName": "test",
|
"accessKey": "b9Ul0e98xPzt6PwRXA1Q",
|
||||||
"viewEndpoint": "http://192.168.3.68:8001/test/"
|
"secretKey": "DzMaU2L4OXl90uytwOmDXF2encN0Jf4Nxu2XkYqQ",
|
||||||
|
"bucketName": "test-irc-us"
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"AWS": {
|
"AWS": {
|
||||||
@@ -61,19 +65,27 @@
|
|||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 60
|
"AutoLoginOutMinutes": 60,
|
||||||
|
|
||||||
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
|
"ReadingRestTimeMin": 10
|
||||||
},
|
},
|
||||||
|
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
"Port": 465,
|
"Port": 587,
|
||||||
"Host": "smtp.qiye.aliyun.com",
|
"Host": "smtp-mail.outlook.com",
|
||||||
"FromEmail": "test@extimaging.com",
|
"FromEmail": "donotreply@elevateimaging.ai",
|
||||||
"FromName": "Test_IRC",
|
"FromName": "LiLi",
|
||||||
"AuthorizationCode": "SHzyyl2021",
|
"AuthorizationCode": "Q#669869497420ul",
|
||||||
"CompanyName": "Elevate Imaging",
|
|
||||||
|
"OrganizationName": "Elevate Imaging",
|
||||||
|
"OrganizationNameCN": "Elevate Imaging",
|
||||||
|
"CompanyName": "Elevate Imaging Inc.",
|
||||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
"CompanyShortName": "Elevate Imaging",
|
"CompanyShortName": "Elevate Imaging",
|
||||||
"CompanyShortNameCN": "展影医疗"
|
"CompanyShortNameCN": "展影医疗",
|
||||||
|
"SiteUrl": "https://lili.test.elevateimaging.ai/login"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"RemoteNew": "Server=us-mssql-service,1433;Database=US_Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
|
"Hangfire": "Server=us-mssql-service,1433;Database=US_Uat_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
|
|
||||||
|
//"RemoteNew": "Server=3.226.182.187,1435;Database=US_Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
|
//"Hangfire": "Server=3.226.182.187,1435;Database=US_Uat_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
|
},
|
||||||
|
|
||||||
|
"ObjectStoreService": {
|
||||||
|
|
||||||
|
"ObjectStoreUse": "AWS",
|
||||||
|
|
||||||
|
"MinIO": {
|
||||||
|
//"endPoint": "hir-minio.uat.elevateimaging.ai",
|
||||||
|
//"port": "443",
|
||||||
|
//"useSSL": true,
|
||||||
|
//"viewEndpoint": "https://hir-minio.uat.elevateimaging.ai/uat-irc-us",
|
||||||
|
|
||||||
|
"endPoint": "3.226.182.187",
|
||||||
|
"port": "9001",
|
||||||
|
"useSSL": false,
|
||||||
|
"viewEndpoint": "http://44.218.11.19:9001/uat-irc-us",
|
||||||
|
|
||||||
|
"accessKey": "lH8DkKskLuDqPaiubuSQ",
|
||||||
|
"secretKey": "pdPdicvvLeH7xAC5yFUrI7odMyBfOXxvVWMvKYV4",
|
||||||
|
"bucketName": "uat-irc-us"
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
"AWS": {
|
||||||
|
"endPoint": "s3.us-east-1.amazonaws.com",
|
||||||
|
"useSSL": true,
|
||||||
|
"accessKey": "AKIAW3MEAFJXUO6XYFYN",
|
||||||
|
"secretKey": "AeX5r4xHQH7tNJlTTFVv5/zBXie1Kj+mAayKrukp",
|
||||||
|
"bucketName": "ei-med-s3-lili-uat-store",
|
||||||
|
"viewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"BasicSystemConfig": {
|
||||||
|
|
||||||
|
"OpenUserComplexPassword": false,
|
||||||
|
|
||||||
|
"OpenSignDocumentBeforeWork": false,
|
||||||
|
|
||||||
|
"OpenTrialRelationDelete": true,
|
||||||
|
|
||||||
|
"OpenLoginLimit": false,
|
||||||
|
|
||||||
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
|
"LoginFailLockMinutes": 30,
|
||||||
|
"AutoLoginOutMinutes": 60,
|
||||||
|
|
||||||
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
|
"ReadingRestTimeMin": 10,
|
||||||
|
|
||||||
|
"OpenLoginMFA": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"SystemEmailSendConfig": {
|
||||||
|
"Port": 587,
|
||||||
|
"Host": "smtp-mail.outlook.com",
|
||||||
|
"FromEmail": "donotreply@elevateimaging.ai",
|
||||||
|
"FromName": "LiLi",
|
||||||
|
"AuthorizationCode": "Q#669869497420ul",
|
||||||
|
|
||||||
|
"OrganizationName": "Elevate Imaging",
|
||||||
|
"OrganizationNameCN": "Elevate Imaging",
|
||||||
|
"CompanyName": "Elevate Imaging Inc.",
|
||||||
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
|
"CompanyShortName": "Elevate Imaging",
|
||||||
|
"CompanyShortNameCN": "展影医疗",
|
||||||
|
"SiteUrl": "https://lili.test.elevateimaging.ai/login"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
"AliyunOSS": {
|
"AliyunOSS": {
|
||||||
"regionId": "cn-shanghai",
|
"regionId": "cn-shanghai",
|
||||||
|
"internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||||
@@ -26,12 +27,17 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"MinIO": {
|
"MinIO": {
|
||||||
"endpoint": "http://192.168.3.68",
|
"endPoint": "hir-oss.uat.extimaging.com",
|
||||||
"port": "8001",
|
//"port": "80",
|
||||||
"useSSL": false,
|
//"useSSL": false,
|
||||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
//"viewEndpoint": "http://hir-oss.uat.extimaging.com/irc-uat",
|
||||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
"port": "443",
|
||||||
"bucketName": "test"
|
"useSSL": true,
|
||||||
|
"viewEndpoint": "https://hir-oss.uat.extimaging.com/irc-uat",
|
||||||
|
"accessKey": "b9Ul0e98xPzt6PwRXA1Q",
|
||||||
|
"secretKey": "DzMaU2L4OXl90uytwOmDXF2encN0Jf4Nxu2XkYqQ",
|
||||||
|
"bucketName": "irc-uat"
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -45,7 +51,12 @@
|
|||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 60
|
"AutoLoginOutMinutes": 60,
|
||||||
|
"OpenLoginMFA": false,
|
||||||
|
|
||||||
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
|
"ReadingRestTimeMin": 10
|
||||||
|
|
||||||
},
|
},
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
@@ -55,6 +66,8 @@
|
|||||||
"FromName": "UAT_IRC",
|
"FromName": "UAT_IRC",
|
||||||
"AuthorizationCode": "SHzyyl2021",
|
"AuthorizationCode": "SHzyyl2021",
|
||||||
"SiteUrl": "http://irc.uat.extimaging.com/login",
|
"SiteUrl": "http://irc.uat.extimaging.com/login",
|
||||||
|
"OrganizationName": "Extlmaging",
|
||||||
|
"OrganizationNameCN": "Extlmaging",
|
||||||
"CompanyName": "Extensive Imaging",
|
"CompanyName": "Extensive Imaging",
|
||||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
"CompanyShortName": "Extensive Imaging",
|
"CompanyShortName": "Extensive Imaging",
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Application.Helper
|
||||||
|
{
|
||||||
|
public static class EmailMaskHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
//显示位数:3分之2的位数,向上取整
|
||||||
|
//取哪几个个值:最后一位和前面几位
|
||||||
|
//其他:3个***。
|
||||||
|
//比如:hlj23@126.com
|
||||||
|
//为:hlj***3@126.com
|
||||||
|
|
||||||
|
//he@126.com
|
||||||
|
//为:h*** e@126.com
|
||||||
|
|
||||||
|
public static string MaskEmail(string email)
|
||||||
|
{
|
||||||
|
|
||||||
|
// 找到 "@" 符号的位置
|
||||||
|
int atIndex = email.IndexOf('@');
|
||||||
|
|
||||||
|
string visiblePartBefore = email.Substring(0, atIndex);
|
||||||
|
|
||||||
|
string afterAt = email.Substring(atIndex + 1);
|
||||||
|
|
||||||
|
int visibleLength = (int)Math.Ceiling((double)visiblePartBefore.Length * 2 / 3);
|
||||||
|
|
||||||
|
// 替换中间两位字符为星号
|
||||||
|
string hiddenPartBeforeAt = visiblePartBefore.Substring(0, visibleLength - 1) + "***" + visiblePartBefore.Last();
|
||||||
|
|
||||||
|
|
||||||
|
// 组合隐藏和可见部分
|
||||||
|
string hiddenEmail = hiddenPartBeforeAt + "@" + afterAt;
|
||||||
|
|
||||||
|
return hiddenEmail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,6 +39,9 @@ namespace IRaCIS.Core.Application.Helper
|
|||||||
public string regionId { get; set; }
|
public string regionId { get; set; }
|
||||||
public string accessKeyId { get; set; }
|
public string accessKeyId { get; set; }
|
||||||
public string accessKeySecret { get; set; }
|
public string accessKeySecret { get; set; }
|
||||||
|
|
||||||
|
public string internalEndpoint { get; set; }
|
||||||
|
|
||||||
public string endPoint { get; set; }
|
public string endPoint { get; set; }
|
||||||
public string bucketName { get; set; }
|
public string bucketName { get; set; }
|
||||||
|
|
||||||
@@ -144,7 +147,7 @@ namespace IRaCIS.Core.Application.Helper
|
|||||||
{
|
{
|
||||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
var _ossClient = new OssClient(aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -220,7 +223,7 @@ namespace IRaCIS.Core.Application.Helper
|
|||||||
{
|
{
|
||||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
var _ossClient = new OssClient(aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||||
|
|
||||||
// 上传文件
|
// 上传文件
|
||||||
var result = _ossClient.PutObject(aliConfig.bucketName, ossRelativePath, localFilePath);
|
var result = _ossClient.PutObject(aliConfig.bucketName, ossRelativePath, localFilePath);
|
||||||
@@ -279,7 +282,7 @@ namespace IRaCIS.Core.Application.Helper
|
|||||||
{
|
{
|
||||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
var _ossClient = new OssClient(aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||||
|
|
||||||
// 上传文件
|
// 上传文件
|
||||||
var result = _ossClient.GetObject(aliConfig.bucketName, ossRelativePath);
|
var result = _ossClient.GetObject(aliConfig.bucketName, ossRelativePath);
|
||||||
@@ -351,7 +354,7 @@ namespace IRaCIS.Core.Application.Helper
|
|||||||
{
|
{
|
||||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
var _ossClient = new OssClient(aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret);
|
||||||
|
|
||||||
// 生成签名URL。
|
// 生成签名URL。
|
||||||
var req = new GeneratePresignedUriRequest(aliConfig.bucketName, ossRelativePath, SignHttpMethod.Get)
|
var req = new GeneratePresignedUriRequest(aliConfig.bucketName, ossRelativePath, SignHttpMethod.Get)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public static class SendEmailHelper
|
|||||||
|
|
||||||
//await smtp.AuthenticateAsync("zhou941003@qq.com", "sqfhlpfdvnexbcab");
|
//await smtp.AuthenticateAsync("zhou941003@qq.com", "sqfhlpfdvnexbcab");
|
||||||
|
|
||||||
await smtp.ConnectAsync(_systemEmailConfig.Host, _systemEmailConfig.Port, SecureSocketOptions.SslOnConnect);
|
await smtp.ConnectAsync(_systemEmailConfig.Host, _systemEmailConfig.Port, SecureSocketOptions.Auto);
|
||||||
|
|
||||||
await smtp.AuthenticateAsync(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
|
await smtp.AuthenticateAsync(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
|
||||||
|
|
||||||
@@ -40,11 +40,11 @@ public static class SendEmailHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception )
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
||||||
//---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员
|
//---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员
|
||||||
throw new Exception(StaticData.International("SendEmail_SendFail"));
|
throw new Exception(StaticData.International("SendEmail_SendFail"),new Exception(ex.Message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public static class SendEmailHelper
|
|||||||
using (var client = new MailKit.Net.Smtp.SmtpClient())
|
using (var client = new MailKit.Net.Smtp.SmtpClient())
|
||||||
{
|
{
|
||||||
|
|
||||||
await client.ConnectAsync(_systemEmailConfig.Host, _systemEmailConfig.Port, SecureSocketOptions.SslOnConnect);
|
await client.ConnectAsync(_systemEmailConfig.Host, _systemEmailConfig.Port, SecureSocketOptions.Auto);
|
||||||
|
|
||||||
await client.AuthenticateAsync(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
|
await client.AuthenticateAsync(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ public static class SendEmailHelper
|
|||||||
|
|
||||||
smtp.ServerCertificateValidationCallback = (s, c, h, e) => true;
|
smtp.ServerCertificateValidationCallback = (s, c, h, e) => true;
|
||||||
|
|
||||||
await smtp.ConnectAsync(sMTPEmailConfig.Host, sMTPEmailConfig.Port, SecureSocketOptions.SslOnConnect);
|
await smtp.ConnectAsync(sMTPEmailConfig.Host, sMTPEmailConfig.Port, SecureSocketOptions.Auto);
|
||||||
|
|
||||||
await smtp.AuthenticateAsync(sMTPEmailConfig.UserName, sMTPEmailConfig.AuthorizationCode);
|
await smtp.AuthenticateAsync(sMTPEmailConfig.UserName, sMTPEmailConfig.AuthorizationCode);
|
||||||
|
|
||||||
|
|||||||
@@ -78,9 +78,9 @@
|
|||||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.2" />
|
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.2" />
|
||||||
<PackageReference Include="fo-dicom.Codecs" Version="5.12.0" />
|
<PackageReference Include="fo-dicom.Codecs" Version="5.12.0" />
|
||||||
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
||||||
<PackageReference Include="MailKit" Version="4.5.0" />
|
<PackageReference Include="MailKit" Version="4.2.0" />
|
||||||
<PackageReference Include="MediatR" Version="12.2.0" />
|
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||||
<PackageReference Include="MimeKit" Version="4.5.0" />
|
<PackageReference Include="MimeKit" Version="4.2.0" />
|
||||||
<PackageReference Include="MiniExcel" Version="1.32.0" />
|
<PackageReference Include="MiniExcel" Version="1.32.0" />
|
||||||
<PackageReference Include="Minio" Version="6.0.2" />
|
<PackageReference Include="Minio" Version="6.0.2" />
|
||||||
<PackageReference Include="MiniWord" Version="0.8.0" />
|
<PackageReference Include="MiniWord" Version="0.8.0" />
|
||||||
|
|||||||
@@ -424,11 +424,11 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetOrderReadingIQueryable(IRaCIS.Core.Application.ViewModel.GetOrderReadingIQueryableInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetSubjectReadingIQueryable(IRaCIS.Core.Application.ViewModel.GetReadingIQueryableInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取有序阅片IQuery对象
|
获取subject有序 或者无序阅片IQuery对象
|
||||||
</summary>
|
</summary>
|
||||||
<param name="inDto"></param>
|
<param name="inQuery"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetIRHaveReadTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
|
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetIRHaveReadTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
|
||||||
@@ -13265,11 +13265,12 @@
|
|||||||
<param name="state"></param>
|
<param name="state"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.UserService.SendMFAEmail(System.Guid)">
|
<member name="M:IRaCIS.Application.Services.UserService.SendMFAEmail(System.Guid,System.Int32)">
|
||||||
<summary>
|
<summary>
|
||||||
发送MFA 验证邮件
|
发送MFA 验证邮件
|
||||||
</summary>
|
</summary>
|
||||||
<param name="userId"></param>
|
<param name="userId"></param>
|
||||||
|
<param name="mfaType"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.UserService.VerifyMFACodeAsync(System.Guid,System.String)">
|
<member name="M:IRaCIS.Application.Services.UserService.VerifyMFACodeAsync(System.Guid,System.String)">
|
||||||
@@ -13970,6 +13971,13 @@
|
|||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.ResetReadingTask(IRaCIS.Core.Application.Service.Reading.Dto.ResetReadingTaskInDto)">
|
||||||
|
<summary>
|
||||||
|
重置阅片任务
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.VerifyReadingRestTime">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.VerifyReadingRestTime">
|
||||||
<summary>
|
<summary>
|
||||||
验证阅片休息时间
|
验证阅片休息时间
|
||||||
|
|||||||
@@ -370,16 +370,16 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class GetOrderReadingIQueryableInDto
|
public class GetReadingIQueryableInDto:PageInput
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
public Guid TrialReadingCriterionId { get; set; }
|
public Guid? SubjectId { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
public string? SubjectCode { get; set; } = null;
|
public string? SubjectCode { get; set; } = null;
|
||||||
|
|
||||||
public PageInput? Page { get; set; } = null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class VisitTaskQuery : PageInput
|
public class VisitTaskQuery : PageInput
|
||||||
|
|||||||
@@ -16,6 +16,6 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
Task<IResponseOutput> ConfirmReReading(ConfirmReReadingCommand agreeReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService);
|
Task<IResponseOutput> ConfirmReReading(ConfirmReReadingCommand agreeReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService);
|
||||||
|
|
||||||
Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto);
|
Task<PageOutput<IRUnReadSubjectView>> GetSubjectReadingIQueryable(GetReadingIQueryableInDto inDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
|
||||||
|
|
||||||
var trialTaskConfig = _repository.Where<Trial>(t => t.Id == queryVisitTask.TrialId).Select(t => new { IsHaveDoubleReadCriterion=t.ReadingQuestionCriterionTrialList.Any(t=>t.IsSigned && t.IsConfirm && t.ReadingType==ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault();
|
var trialTaskConfig = _repository.Where<Trial>(t => t.Id == queryVisitTask.TrialId).Select(t => new { IsHaveDoubleReadCriterion=t.TrialReadingCriterionList.Any(t=>t.IsSigned && t.IsConfirm && t.ReadingType==ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault();
|
||||||
|
|
||||||
return ResponseOutput.Ok(pageList, trialTaskConfig);
|
return ResponseOutput.Ok(pageList, trialTaskConfig);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
|
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
|
||||||
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
|
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
|
||||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||||
|
|
||||||
return ResponseOutput.Ok(pageList, new
|
return ResponseOutput.Ok(pageList, new
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ using DocumentFormat.OpenXml.Bibliography;
|
|||||||
using Org.BouncyCastle.Crypto;
|
using Org.BouncyCastle.Crypto;
|
||||||
using IRaCIS.Core.Domain.Share.Reading;
|
using IRaCIS.Core.Domain.Share.Reading;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
using System.Reactive.Subjects;
|
||||||
|
using Subject = IRaCIS.Core.Domain.Models.Subject;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.Allocation
|
namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
{
|
{
|
||||||
@@ -957,61 +959,236 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
var readingTool = criterionConfig.ReadingTool;
|
var readingTool = criterionConfig.ReadingTool;
|
||||||
var isReadingTaskViewInOrder = criterionConfig.IsReadingTaskViewInOrder;
|
var isReadingTaskViewInOrder = criterionConfig.IsReadingTaskViewInOrder;
|
||||||
|
|
||||||
#region 按照Subject 维度
|
|
||||||
if (isReadingTaskViewInOrder == ReadingOrder.InOrder)
|
var result = new PageOutput<IRUnReadSubjectView>()
|
||||||
{
|
{
|
||||||
|
PageSize = inQuery.PageSize,
|
||||||
|
PageIndex = inQuery.PageIndex,
|
||||||
|
TotalCount = 0,
|
||||||
|
CurrentPageData = null,
|
||||||
|
};
|
||||||
|
|
||||||
|
IRUnReadOutDto iRUnReadOut = new IRUnReadOutDto();
|
||||||
|
|
||||||
var visitTaskListInfo = await GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
|
//subject 级别 有序 无序查询
|
||||||
|
if (isReadingTaskViewInOrder == ReadingOrder.InOrder || isReadingTaskViewInOrder == ReadingOrder.SubjectRandom)
|
||||||
|
{
|
||||||
|
result = await GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
TrialReadingCriterionId = trialReadingCriterionId,
|
TrialReadingCriterionId = trialReadingCriterionId,
|
||||||
SubjectCode = inQuery.SubjectCode,
|
SubjectCode = inQuery.SubjectCode,
|
||||||
Page = new PageInput()
|
|
||||||
{
|
|
||||||
PageIndex = inQuery.PageIndex,
|
|
||||||
PageSize = inQuery.PageSize,
|
|
||||||
Asc = inQuery.Asc,
|
|
||||||
SortField = inQuery.SortField,
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
PageIndex = inQuery.PageIndex,
|
||||||
|
PageSize = inQuery.PageSize,
|
||||||
|
Asc = inQuery.Asc,
|
||||||
|
SortField = inQuery.SortField,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
//随机阅片
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
||||||
|
// .Where(x=>x.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == x.SouceReadModuleId || c.ReadingId == x.SourceSubjectVisitId)))
|
||||||
|
.Where(x => !x.Subject.IsDeleted).Where(x => (x.IsNeedClinicalDataSign && x.IsClinicalDataSign) || !x.IsNeedClinicalDataSign);
|
||||||
|
|
||||||
var totalCount = visitTaskListInfo.Item1;
|
iRUnReadOut = new IRUnReadOutDto()
|
||||||
var currentPageData = visitTaskListInfo.Item2;
|
{
|
||||||
|
FinishJudgeTaskCount = await taskQuery.Where(x => x.ReadingCategory == ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).CountAsync(),
|
||||||
|
FinishTaskCount = await taskQuery.Where(x => x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).CountAsync(),
|
||||||
|
SuggesteFinishedTime = await taskQuery.Where(x => x.ReadingTaskState != ReadingTaskState.HaveSigned).MaxAsync(x => x.SuggesteFinishedTime),
|
||||||
|
UnReadJudgeTaskCount = await taskQuery.Where(x => x.ReadingCategory == ReadingCategory.Judge && x.ReadingTaskState != ReadingTaskState.HaveSigned).CountAsync(),
|
||||||
|
UnReadTaskCount = await taskQuery.Where(x => x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState != ReadingTaskState.HaveSigned).CountAsync(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(result, new
|
||||||
|
{
|
||||||
|
IsReadingTaskViewInOrder = isReadingTaskViewInOrder,
|
||||||
|
RandomReadInfo = iRUnReadOut,
|
||||||
|
ReadingTool = readingTool,
|
||||||
|
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
||||||
|
IsReadingShowSubjectInfo = criterionConfig.IsReadingShowSubjectInfo,
|
||||||
|
IsReadingShowPreviousResults = criterionConfig.IsReadingShowPreviousResults,
|
||||||
|
DigitPlaces = criterionConfig.DigitPlaces,
|
||||||
|
CriterionType = criterionConfig.CriterionType,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取subject有序 或者无序阅片IQuery对象
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inQuery"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<PageOutput<IRUnReadSubjectView>> GetSubjectReadingIQueryable(GetReadingIQueryableInDto inQuery)
|
||||||
|
{
|
||||||
|
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
|
||||||
|
var subjectCode = inQuery.SubjectCode;
|
||||||
|
var trialId = inQuery.TrialId;
|
||||||
|
var subjectId = inQuery.SubjectId;
|
||||||
|
|
||||||
|
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
||||||
|
|
||||||
|
if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||||
|
{
|
||||||
|
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||||
|
|
||||||
|
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||||
|
//前序 不存在 未生成任务的访视
|
||||||
|
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||||
|
|
||||||
|
// 前序 不存在 未一致性核查未通过的
|
||||||
|
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
||||||
|
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
||||||
|
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
||||||
|
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
||||||
|
//满足前序访视不存在 需要签署但是未签署 sql 相当复杂 同时想查询所有未读的统计数字 就无法统计 byzhouhang
|
||||||
|
//但是加字段 IsFrontTaskNeedSignButNotSign 那么签名临床数据的时候,要对该subject 该标准的有效的任务 这个字段需要在签名的时候维护 采取这种方式 统计数字灵活
|
||||||
|
//.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum))
|
||||||
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode!) && t.IsAnalysisCreate));
|
||||||
|
|
||||||
|
|
||||||
|
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||||
|
|
||||||
|
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
|
||||||
|
{
|
||||||
|
SubjectId = x.Key.SubjectId,
|
||||||
|
SubjectCode = x.Key.BlindSubjectCode == string.Empty ? x.Key.Code : x.Key.BlindSubjectCode,
|
||||||
|
|
||||||
|
SuggesteFinishedTime = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Min(x => x.SuggesteFinishedTime),
|
||||||
|
|
||||||
|
//未读任务量
|
||||||
|
UnReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
||||||
|
|
||||||
|
//未读 里可读任务量
|
||||||
|
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
||||||
|
//不能对包含聚合或子查询的表达式执行聚合函数
|
||||||
|
//&& !x.Any(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false && t.VisitTaskNum<y.VisitTaskNum )
|
||||||
|
).Count(),
|
||||||
|
|
||||||
|
|
||||||
|
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||||
|
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||||
|
.OrderBy(x => x.VisitTaskNum)
|
||||||
|
.Select(u => new IRUnreadTaskView()
|
||||||
|
{
|
||||||
|
Id = u.Id,
|
||||||
|
IsUrgent = u.IsUrgent,
|
||||||
|
VisitNum = u.VisitTaskNum,
|
||||||
|
TaskBlindName = u.TaskBlindName,
|
||||||
|
VisistId = u.SourceSubjectVisitId,
|
||||||
|
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
||||||
|
ReadingCategory = u.ReadingCategory,
|
||||||
|
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||||
|
ArmEnum = u.ArmEnum,
|
||||||
|
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||||
|
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||||
|
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||||
|
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||||
|
})
|
||||||
|
.ToList(),
|
||||||
|
|
||||||
|
|
||||||
|
UrgentCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||||
|
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||||
|
.Where(x => x.IsUrgent).Count(),
|
||||||
|
|
||||||
|
//已读任务量
|
||||||
|
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||||
|
|
||||||
|
ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed),
|
||||||
|
|
||||||
|
//查出所有未读的 未读的可读的 在这个列表基础上 过滤下 y.IsFrontTaskNeedSignButNotSign==false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true) 这样容易排错 确认这三个字段是否维护有误
|
||||||
|
UnReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).OrderBy(x => x.VisitTaskNum)
|
||||||
|
.Select(u => new IRUnreadTaskView()
|
||||||
|
{
|
||||||
|
Id = u.Id,
|
||||||
|
IsUrgent = u.IsUrgent,
|
||||||
|
VisitNum = u.VisitTaskNum,
|
||||||
|
TaskBlindName = u.TaskBlindName,
|
||||||
|
VisistId = u.SourceSubjectVisitId,
|
||||||
|
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
||||||
|
ReadingCategory = u.ReadingCategory,
|
||||||
|
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||||
|
ArmEnum = u.ArmEnum,
|
||||||
|
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||||
|
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||||
|
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||||
|
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||||
|
})
|
||||||
|
.ToList(),
|
||||||
|
}).Where(x => x.UnReadCanReadTaskCount > 0)/*.OrderBy(x => x.UnReadCanReadTaskCount)*/;
|
||||||
|
// 有序阅片需要找到最小需要
|
||||||
|
|
||||||
|
|
||||||
|
// 不这样写会有问题
|
||||||
|
var count = visitQuery.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||||
|
.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode }).Count();
|
||||||
|
|
||||||
|
var result = new List<IRUnReadSubjectView>();
|
||||||
|
|
||||||
|
var propName = string.IsNullOrWhiteSpace(inQuery!.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField;
|
||||||
|
|
||||||
|
var visitTaskOrderQuery = inQuery.Asc ? visitTaskQuery.OrderBy(propName) : visitTaskQuery.OrderBy(propName + " desc");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var result = new PageOutput<IRUnReadSubjectView>()
|
result = await visitTaskOrderQuery
|
||||||
|
.Skip((inQuery.PageIndex - 1) * inQuery.PageSize)
|
||||||
|
.Take(inQuery.PageSize).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
return new PageOutput<IRUnReadSubjectView>()
|
||||||
{
|
{
|
||||||
PageSize = inQuery.PageSize,
|
PageSize = inQuery.PageSize,
|
||||||
PageIndex = inQuery.PageIndex,
|
PageIndex = inQuery.PageIndex,
|
||||||
TotalCount = totalCount,
|
TotalCount = count,
|
||||||
CurrentPageData = currentPageData,
|
CurrentPageData = result,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 封装的方法有问题
|
|
||||||
//var result = await visitQuery.ToPagedListAsync(iRUnReadSubjectQuery.PageIndex, iRUnReadSubjectQuery.PageSize, String.IsNullOrEmpty(iRUnReadSubjectQuery.SortField) ? nameof(IRUnReadSubjectView.SubjectId) : iRUnReadSubjectQuery.SortField, iRUnReadSubjectQuery.Asc);
|
|
||||||
return ResponseOutput.Ok(result, new
|
|
||||||
{
|
|
||||||
RandomReadInfo = new IRUnReadOutDto(),
|
|
||||||
IsReadingTaskViewInOrder = isReadingTaskViewInOrder,
|
|
||||||
ReadingTool = readingTool,
|
|
||||||
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
|
||||||
IsReadingShowSubjectInfo = criterionConfig.IsReadingShowSubjectInfo,
|
|
||||||
IsReadingShowPreviousResults = criterionConfig.IsReadingShowPreviousResults,
|
|
||||||
DigitPlaces = criterionConfig.DigitPlaces,
|
|
||||||
CriterionType = criterionConfig.CriterionType,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else if(isReadingTaskViewInOrder == ReadingOrder.SubjectRandom)
|
else
|
||||||
{
|
{
|
||||||
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
|
||||||
|
if (subjectId != null)
|
||||||
|
{
|
||||||
|
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
||||||
|
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||||
|
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskBlindName == "Timepoint" && t.ReadingCategory == ReadingCategory.Visit
|
||||||
|
&& (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze), true).ToListAsync();
|
||||||
|
|
||||||
|
if (needDealTaskList.Count > 0)
|
||||||
|
{
|
||||||
|
//已完成的访视任务数量(包含重阅的)
|
||||||
|
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||||
|
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit);
|
||||||
|
|
||||||
|
//已经处理过的任务名称的数量
|
||||||
|
|
||||||
|
var haveDealedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||||
|
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit && t.TaskBlindName != "Timepoint");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
||||||
|
List<int> availableNumbers = Enumerable.Range(haveDealedTaskCount + haveFinishedTaskCount + 1, needDealTaskList.Count).ToList();
|
||||||
|
Random rng = new Random();
|
||||||
|
foreach (var visitTask in needDealTaskList)
|
||||||
|
{
|
||||||
|
int randomIndex = rng.Next(availableNumbers.Count);
|
||||||
|
|
||||||
|
visitTask.TaskBlindName = $"Timepoint Ran {availableNumbers[randomIndex]}";
|
||||||
|
|
||||||
|
availableNumbers.RemoveAt(randomIndex);
|
||||||
|
}
|
||||||
|
await _visitTaskRepository.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||||
|
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||||
.WhereIf(!string.IsNullOrEmpty(subjectCode), t => (t.Subject.Code.Contains(subjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(subjectCode!) && t.IsAnalysisCreate));
|
.WhereIf(!string.IsNullOrEmpty(subjectCode), t => (t.Subject.Code.Contains(subjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(subjectCode!) && t.IsAnalysisCreate));
|
||||||
|
|
||||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||||
@@ -1032,7 +1209,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||||
|
|
||||||
ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed),
|
ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed),
|
||||||
|
|
||||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||||
.OrderBy(x => x.VisitTaskNum)
|
.OrderBy(x => x.VisitTaskNum)
|
||||||
.Select(u => new IRUnreadTaskView()
|
.Select(u => new IRUnreadTaskView()
|
||||||
@@ -1054,189 +1231,11 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
.ToList()
|
.ToList()
|
||||||
}).Where(x => x.UnReadCanReadTaskCount > 0);
|
}).Where(x => x.UnReadCanReadTaskCount > 0);
|
||||||
|
|
||||||
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField)? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField, inQuery.Asc );
|
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField, inQuery.Asc);
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(pageList, new
|
|
||||||
{
|
|
||||||
RandomReadInfo = new IRUnReadOutDto(),
|
|
||||||
IsReadingTaskViewInOrder = isReadingTaskViewInOrder,
|
|
||||||
ReadingTool = readingTool,
|
|
||||||
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
|
||||||
IsReadingShowSubjectInfo = criterionConfig.IsReadingShowSubjectInfo,
|
|
||||||
IsReadingShowPreviousResults = criterionConfig.IsReadingShowPreviousResults,
|
|
||||||
DigitPlaces = criterionConfig.DigitPlaces,
|
|
||||||
CriterionType = criterionConfig.CriterionType,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
|
||||||
// .Where(x=>x.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == x.SouceReadModuleId || c.ReadingId == x.SourceSubjectVisitId)))
|
|
||||||
.Where(x => !x.Subject.IsDeleted).Where(x => (x.IsNeedClinicalDataSign && x.IsClinicalDataSign) || !x.IsNeedClinicalDataSign);
|
|
||||||
|
|
||||||
IRUnReadOutDto iRUnReadOut = new IRUnReadOutDto()
|
|
||||||
{
|
|
||||||
FinishJudgeTaskCount = await taskQuery.Where(x => x.ReadingCategory == ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).CountAsync(),
|
|
||||||
FinishTaskCount = await taskQuery.Where(x => x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).CountAsync(),
|
|
||||||
SuggesteFinishedTime = await taskQuery.Where(x => x.ReadingTaskState != ReadingTaskState.HaveSigned).MaxAsync(x => x.SuggesteFinishedTime),
|
|
||||||
UnReadJudgeTaskCount = await taskQuery.Where(x => x.ReadingCategory == ReadingCategory.Judge && x.ReadingTaskState != ReadingTaskState.HaveSigned).CountAsync(),
|
|
||||||
UnReadTaskCount = await taskQuery.Where(x => x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState != ReadingTaskState.HaveSigned).CountAsync(),
|
|
||||||
};
|
|
||||||
|
|
||||||
var result = new PageOutput<IRUnReadSubjectView>()
|
|
||||||
{
|
|
||||||
PageSize = inQuery.PageSize,
|
|
||||||
PageIndex = inQuery.PageIndex,
|
|
||||||
TotalCount = 0,
|
|
||||||
CurrentPageData = null,
|
|
||||||
};
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(result, new
|
|
||||||
{
|
|
||||||
IsReadingTaskViewInOrder = isReadingTaskViewInOrder,
|
|
||||||
RandomReadInfo = iRUnReadOut,
|
|
||||||
ReadingTool = readingTool,
|
|
||||||
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
|
||||||
IsReadingShowSubjectInfo = criterionConfig.IsReadingShowSubjectInfo,
|
|
||||||
IsReadingShowPreviousResults = criterionConfig.IsReadingShowPreviousResults,
|
|
||||||
DigitPlaces = criterionConfig.DigitPlaces,
|
|
||||||
CriterionType = criterionConfig.CriterionType,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
return pageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取有序阅片IQuery对象
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto)
|
|
||||||
{
|
|
||||||
var trialReadingCriterionId = inDto.TrialReadingCriterionId;
|
|
||||||
|
|
||||||
|
|
||||||
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
|
||||||
|
|
||||||
|
|
||||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
|
||||||
|
|
||||||
//前序 不存在 未生成任务的访视
|
|
||||||
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
|
||||||
|
|
||||||
// 前序 不存在 未一致性核查未通过的
|
|
||||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
|
||||||
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
|
||||||
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
|
||||||
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
|
||||||
//满足前序访视不存在 需要签署但是未签署 sql 相当复杂 同时想查询所有未读的统计数字 就无法统计 byzhouhang
|
|
||||||
//但是加字段 IsFrontTaskNeedSignButNotSign 那么签名临床数据的时候,要对该subject 该标准的有效的任务 这个字段需要在签名的时候维护 采取这种方式 统计数字灵活
|
|
||||||
//.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum))
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inDto.SubjectCode), t => (t.Subject.Code.Contains(inDto.SubjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inDto.SubjectCode!) && t.IsAnalysisCreate));
|
|
||||||
|
|
||||||
|
|
||||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
|
||||||
|
|
||||||
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
|
|
||||||
{
|
|
||||||
SubjectId = x.Key.SubjectId,
|
|
||||||
SubjectCode = x.Key.BlindSubjectCode == string.Empty ? x.Key.Code : x.Key.BlindSubjectCode,
|
|
||||||
|
|
||||||
SuggesteFinishedTime = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Min(x => x.SuggesteFinishedTime),
|
|
||||||
|
|
||||||
//未读任务量
|
|
||||||
UnReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
|
||||||
|
|
||||||
//未读 里可读任务量
|
|
||||||
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
|
||||||
//不能对包含聚合或子查询的表达式执行聚合函数
|
|
||||||
//&& !x.Any(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false && t.VisitTaskNum<y.VisitTaskNum )
|
|
||||||
).Count(),
|
|
||||||
|
|
||||||
|
|
||||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
|
||||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
|
||||||
.OrderBy(x => x.VisitTaskNum)
|
|
||||||
.Select(u => new IRUnreadTaskView()
|
|
||||||
{
|
|
||||||
Id = u.Id,
|
|
||||||
IsUrgent = u.IsUrgent,
|
|
||||||
VisitNum = u.VisitTaskNum,
|
|
||||||
TaskBlindName = u.TaskBlindName,
|
|
||||||
VisistId = u.SourceSubjectVisitId,
|
|
||||||
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
|
||||||
ReadingCategory = u.ReadingCategory,
|
|
||||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
|
||||||
ArmEnum = u.ArmEnum,
|
|
||||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
|
||||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
|
||||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
|
||||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
|
||||||
})
|
|
||||||
.ToList(),
|
|
||||||
|
|
||||||
|
|
||||||
UrgentCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
|
||||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
|
||||||
.Where(x => x.IsUrgent).Count(),
|
|
||||||
|
|
||||||
//已读任务量
|
|
||||||
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
|
||||||
|
|
||||||
ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed),
|
|
||||||
|
|
||||||
//查出所有未读的 未读的可读的 在这个列表基础上 过滤下 y.IsFrontTaskNeedSignButNotSign==false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true) 这样容易排错 确认这三个字段是否维护有误
|
|
||||||
UnReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).OrderBy(x => x.VisitTaskNum)
|
|
||||||
.Select(u => new IRUnreadTaskView()
|
|
||||||
{
|
|
||||||
Id = u.Id,
|
|
||||||
IsUrgent = u.IsUrgent,
|
|
||||||
VisitNum = u.VisitTaskNum,
|
|
||||||
TaskBlindName = u.TaskBlindName,
|
|
||||||
VisistId = u.SourceSubjectVisitId,
|
|
||||||
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
|
||||||
ReadingCategory = u.ReadingCategory,
|
|
||||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
|
||||||
ArmEnum = u.ArmEnum,
|
|
||||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
|
||||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
|
||||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
|
||||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
|
||||||
})
|
|
||||||
.ToList(),
|
|
||||||
}).Where(x => x.UnReadCanReadTaskCount > 0)/*.OrderBy(x => x.UnReadCanReadTaskCount)*/;
|
|
||||||
// 有序阅片需要找到最小需要
|
|
||||||
|
|
||||||
|
|
||||||
// 不这样写会有问题
|
|
||||||
var count = visitQuery.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
|
||||||
.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode }).Count();
|
|
||||||
|
|
||||||
var result = new List<IRUnReadSubjectView>();
|
|
||||||
|
|
||||||
var propName = string.IsNullOrWhiteSpace(inDto.Page!.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inDto.Page.SortField;
|
|
||||||
|
|
||||||
var visitTaskOrderQuery = inDto.Page.Asc ? visitTaskQuery.OrderBy(propName) : visitTaskQuery.OrderBy(propName + " desc");
|
|
||||||
if (inDto.Page != null)
|
|
||||||
{
|
|
||||||
result = await visitTaskOrderQuery
|
|
||||||
.Skip((inDto.Page.PageIndex - 1) * inDto.Page.PageSize)
|
|
||||||
.Take(inDto.Page.PageSize).ToListAsync();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = await visitTaskOrderQuery.ToListAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return (count, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1417,6 +1416,13 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
{
|
{
|
||||||
task.ReReadingApplyState = ReReadingApplyState.DocotorHaveApplyed;
|
task.ReReadingApplyState = ReReadingApplyState.DocotorHaveApplyed;
|
||||||
|
|
||||||
|
|
||||||
|
//在PM 的申请重阅的影响列表里也不能申请重阅
|
||||||
|
|
||||||
|
var pmApply = await _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.TrialId == task.TrialId && t.OriginalReReadingTask.SubjectId == task.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect && t.OriginalReReadingTask.ReadingCategory == ReadingCategory.Visit
|
||||||
|
&& t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.TrialGroupApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default).Include(t => t.OriginalReReadingTask).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
// 有序
|
// 有序
|
||||||
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||||
{
|
{
|
||||||
@@ -1430,10 +1436,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//在PM 的申请重阅的影响列表里也不能申请重阅
|
|
||||||
|
|
||||||
var pmApply = await _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.TrialId == task.TrialId && t.OriginalReReadingTask.SubjectId == task.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect && t.OriginalReReadingTask.ReadingCategory == ReadingCategory.Visit
|
|
||||||
&& t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.TrialGroupApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default).Include(t => t.OriginalReReadingTask).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
if (pmApply != null)
|
if (pmApply != null)
|
||||||
{
|
{
|
||||||
@@ -1462,13 +1464,13 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
throw new BusinessValidationFailedException(_localizer["VisitTask_LastReading"]);
|
throw new BusinessValidationFailedException(_localizer["VisitTask_LastReading"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task.ReadingCategory == ReadingCategory.Oncology && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Oncology)))
|
if (task.ReadingCategory == ReadingCategory.Oncology && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Oncology && t.ReadingTaskState==ReadingTaskState.HaveSigned)))
|
||||||
{
|
{
|
||||||
//---有序阅片,只允许申请该受试者阅片人最后一次完成肿瘤学任务重阅
|
//---有序阅片,只允许申请该受试者阅片人最后一次完成肿瘤学任务重阅
|
||||||
throw new BusinessValidationFailedException(_localizer["VisitTask_LastOncologistRecheck"]);
|
throw new BusinessValidationFailedException(_localizer["VisitTask_LastOncologistRecheck"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Judge)))
|
if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Judge && t.ReadingTaskState == ReadingTaskState.HaveSigned)))
|
||||||
{
|
{
|
||||||
//---有序阅片,只允许申请该受试者阅片人最后一次完成裁判的任务重阅
|
//---有序阅片,只允许申请该受试者阅片人最后一次完成裁判的任务重阅
|
||||||
throw new BusinessValidationFailedException(_localizer["VisitTask_LastAdjudicatorRecheck"]);
|
throw new BusinessValidationFailedException(_localizer["VisitTask_LastAdjudicatorRecheck"]);
|
||||||
@@ -1477,9 +1479,27 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (task.ReadingCategory != ReadingCategory.Visit && task.ReadingCategory != ReadingCategory.Global)
|
|
||||||
|
if (pmApply != null)
|
||||||
{
|
{
|
||||||
//---无序阅片,仅仅允许IR 申请 全局和访视类型类别的任务进行重阅
|
var originalTask = pmApply.OriginalReReadingTask;
|
||||||
|
|
||||||
|
//PM 无序影响列表
|
||||||
|
if (await _visitTaskRepository.Where(t => t.TrialId == originalTask.TrialId && t.SubjectId == originalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.IsAnalysisCreate == false && t.TrialReadingCriterionId == originalTask.TrialReadingCriterionId )
|
||||||
|
.Where(t=>t.Id==originalTask.Id||t.Id==originalTask.JudgeVisitTaskId)
|
||||||
|
.AnyAsync(t => t.VisitTaskNum == task.VisitTaskNum))
|
||||||
|
{
|
||||||
|
//---当前为无序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅
|
||||||
|
throw new BusinessValidationFailedException(_localizer["VisitTask_RandomInvalidRereading"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//也要支持裁判重阅240701
|
||||||
|
|
||||||
|
if (task.ReadingCategory != ReadingCategory.Visit && task.ReadingCategory != ReadingCategory.Judge)
|
||||||
|
{
|
||||||
|
//---无序阅片,仅仅允许IR 申请 访视、裁判类型类别的任务进行重阅
|
||||||
throw new BusinessValidationFailedException(_localizer["VisitTask_IRGlobalRecheck"]);
|
throw new BusinessValidationFailedException(_localizer["VisitTask_IRGlobalRecheck"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1607,8 +1627,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||||||
|
|
||||||
if ((origenalTask.TaskState != TaskState.Effect && origenalTask.TaskState != TaskState.Freeze))
|
if ((origenalTask.TaskState != TaskState.Effect && origenalTask.TaskState != TaskState.Freeze))
|
||||||
{
|
{
|
||||||
|
await _visitTaskReReadingRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new VisitTaskReReading() { RequestReReadingConfirmUserId = _userInfo.Id, RequestReReadingResultEnum = RequestReReadingResult.Invalid });
|
||||||
|
|
||||||
//---当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作
|
//---当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作
|
||||||
return ResponseOutput.NotOk(_localizer["VisitTask_ReapplyStatusConflict"]);
|
return ResponseOutput.Ok(string.Empty, msg:_localizer["VisitTask_ReapplyStatusConflict"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<TaskAllocationRule, TaskAllocationRuleDTO>()
|
CreateMap<TaskAllocationRule, TaskAllocationRuleDTO>()
|
||||||
.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.Enroll.DoctorUser))
|
.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.Enroll.DoctorUser))
|
||||||
.ForMember(o => o.CriterionReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId })))
|
.ForMember(o => o.CriterionReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId })))
|
||||||
.ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.ReadingQuestionCriterionTrialList.Where(t => t.IsConfirm)))
|
.ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.TrialReadingCriterionList.Where(t => t.IsConfirm)))
|
||||||
.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Where(t=>t.TrialReadingCriterionId== trialReadingCriterionId).OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList()))
|
.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Where(t=>t.TrialReadingCriterionId== trialReadingCriterionId).OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList()))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
Task SiteSurveyRejectEmail(MimeMessage messageToSend);
|
Task SiteSurveyRejectEmail(MimeMessage messageToSend);
|
||||||
|
|
||||||
Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode, UserMFAType mfaType = UserMFAType.Login);
|
||||||
|
|
||||||
Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ namespace IRaCIS.Application.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
//MFA
|
//MFA
|
||||||
public async Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode)
|
public async Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode, UserMFAType mfaType = UserMFAType.Login)
|
||||||
{
|
{
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
@@ -103,7 +103,7 @@ namespace IRaCIS.Application.Services
|
|||||||
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
||||||
//主题
|
//主题
|
||||||
//---[来自{0}] 关于MFA邮箱验证的提醒
|
//---[来自{0}] 关于MFA邮箱验证的提醒
|
||||||
messageToSend.Subject = _localizer["Mail_EmailMFATopic", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN];
|
messageToSend.Subject = _localizer[mfaType == UserMFAType.Login? "Mail_EmailMFALoginTopic":"Mail_EmailMFAUnlockTopic", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN];
|
||||||
|
|
||||||
var builder = new BodyBuilder();
|
var builder = new BodyBuilder();
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ namespace IRaCIS.Application.Services
|
|||||||
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
||||||
|
|
||||||
userName,
|
userName,
|
||||||
_localizer["Mail_MFAEmail"],
|
_localizer[mfaType == UserMFAType.Login ? "Mail_EmailMFALoginEmail": "Mail_EmailMFAUnlockEmail"],
|
||||||
verificationCode
|
verificationCode
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
||||||
"",
|
"Sir/Madam",
|
||||||
//---您正在进行邮箱重置密码操作
|
//---您正在进行邮箱重置密码操作
|
||||||
_localizer["Mail_ResettingPassword"],
|
_localizer["Mail_ResettingPassword"],
|
||||||
verificationCode
|
verificationCode
|
||||||
@@ -320,7 +320,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
||||||
"Sir or Madam",
|
"Sir/Madam",
|
||||||
//---您正在参与展影医疗IRC项目
|
//---您正在参与展影医疗IRC项目
|
||||||
_localizer["Mail_IRCProject", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN],
|
_localizer["Mail_IRCProject", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN],
|
||||||
verificationCode
|
verificationCode
|
||||||
@@ -387,7 +387,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
||||||
"Sir or Madam",
|
"Sir/Madam",
|
||||||
//---您正在参与展影医疗IRC项目中心调研工作
|
//---您正在参与展影医疗IRC项目中心调研工作
|
||||||
_localizer["Mail_CenterResearchReminder", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN],
|
_localizer["Mail_CenterResearchReminder", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN],
|
||||||
verificationCode
|
verificationCode
|
||||||
|
|||||||
@@ -46,12 +46,25 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
|||||||
|
|
||||||
|
|
||||||
//存放在instance 上面
|
//存放在instance 上面
|
||||||
public string WindowCenter { get; set; } = string.Empty;
|
public string? WindowCenter => InstanceInfoList.FirstOrDefault()?.WindowCenter;
|
||||||
public string WindowWidth { get; set; } = string.Empty;
|
public string? WindowWidth => InstanceInfoList.FirstOrDefault()?.WindowWidth;
|
||||||
|
|
||||||
public string ImageResizePath { get; set; }
|
public string ImageResizePath { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class StudyInstanceInfo
|
||||||
|
{
|
||||||
|
|
||||||
|
public int ShowOrder { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public decimal RowIndex { get; set; }
|
||||||
|
|
||||||
|
public Guid? SeriesId { get; set; }
|
||||||
|
|
||||||
|
public Guid? StudyId { get; set; }
|
||||||
|
public Guid? InstanceId { get; set; }
|
||||||
|
}
|
||||||
public class InstanceBasicInfo
|
public class InstanceBasicInfo
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
@@ -68,6 +81,10 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
|||||||
public int ShowOrder { get; set; }
|
public int ShowOrder { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public decimal RowIndex { get; set; }
|
public decimal RowIndex { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
|
public string WindowCenter { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
|
public string WindowWidth { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DicomSeriesWithLabelDTO : DicomSeriesDTO
|
public class DicomSeriesWithLabelDTO : DicomSeriesDTO
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ using IRaCIS.Core.Application.Helper;
|
|||||||
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
|
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using MathNet.Numerics;
|
using MathNet.Numerics;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@@ -17,12 +19,13 @@ using System.IO.Compression;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
public interface IDownloadAndUploadService
|
public interface IDownloadAndUploadService
|
||||||
{
|
{
|
||||||
Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isAnonymize = true);
|
Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true);
|
||||||
}
|
}
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class DownloadAndUploadService : BaseService, IDownloadAndUploadService
|
public class DownloadAndUploadService : BaseService, IDownloadAndUploadService
|
||||||
@@ -62,19 +65,25 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom))
|
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom))
|
||||||
{
|
{
|
||||||
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
||||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId==_userInfo.Id
|
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskBlindName == "Timepoint" && t.ReadingCategory == ReadingCategory.Visit
|
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskBlindName == "Timepoint" && t.ReadingCategory == ReadingCategory.Visit
|
||||||
&& (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze), true).ToListAsync();
|
&& (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze), true).ToListAsync();
|
||||||
|
|
||||||
if (needDealTaskList.Count>0)
|
if (needDealTaskList.Count > 0)
|
||||||
{
|
{
|
||||||
//已完成的访视任务数量(包含重阅的)
|
//已完成的访视任务数量(包含重阅的)
|
||||||
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false
|
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit);
|
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit);
|
||||||
|
|
||||||
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
//已经处理过的任务名称的数量
|
||||||
|
|
||||||
List<int> availableNumbers = Enumerable.Range(haveFinishedTaskCount + 1, needDealTaskList.Count).ToList();
|
var haveDealedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||||
|
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit && t.TaskBlindName != "Timepoint");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
||||||
|
List<int> availableNumbers = Enumerable.Range(haveDealedTaskCount + haveFinishedTaskCount + 1, needDealTaskList.Count).ToList();
|
||||||
Random rng = new Random();
|
Random rng = new Random();
|
||||||
foreach (var visitTask in needDealTaskList)
|
foreach (var visitTask in needDealTaskList)
|
||||||
{
|
{
|
||||||
@@ -85,7 +94,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
availableNumbers.RemoveAt(randomIndex);
|
availableNumbers.RemoveAt(randomIndex);
|
||||||
}
|
}
|
||||||
await _visitTaskRepository.SaveChangesAsync();
|
await _visitTaskRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
@@ -96,19 +105,18 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
/// <param name="subjectId"></param>
|
/// <param name="subjectId"></param>
|
||||||
/// <param name="trialReadingCriterionId"></param>
|
/// <param name="trialReadingCriterionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IResponseOutput<List<SubjectImageUploadDTO>>> GetSubjectImageUploadList(Guid subjectId,Guid trialReadingCriterionId)
|
public async Task<IResponseOutput<List<SubjectImageUploadDTO>>> GetSubjectImageUploadList(Guid subjectId, Guid trialReadingCriterionId)
|
||||||
{
|
{
|
||||||
await SubejctRandomReadingTaskNameDeal(subjectId, trialReadingCriterionId);
|
await SubejctRandomReadingTaskNameDeal(subjectId, trialReadingCriterionId);
|
||||||
|
|
||||||
var query = _repository.Where<VisitTask>(t => t.SubjectId == subjectId &&t.TrialReadingCriterionId== trialReadingCriterionId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id)
|
var query = _repository.Where<VisitTask>(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.SourceSubjectVisitId != null
|
||||||
|
&& t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||||
.Select(u => new SubjectImageUploadDTO()
|
.Select(u => new SubjectImageUploadDTO()
|
||||||
{
|
{
|
||||||
VisitTaskId = u.Id,
|
VisitTaskId = u.Id,
|
||||||
|
|
||||||
SubejctId = u.SubjectId,
|
SubejctId = u.SubjectId,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TrialSiteId = u.Subject.TrialSiteId,
|
TrialSiteId = u.Subject.TrialSiteId,
|
||||||
|
|
||||||
IsImageFilter = u.TrialReadingCriterion.IsImageFilter,
|
IsImageFilter = u.TrialReadingCriterion.IsImageFilter,
|
||||||
@@ -122,7 +130,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
SourceSubjectVisitId = u.SourceSubjectVisitId,
|
SourceSubjectVisitId = u.SourceSubjectVisitId,
|
||||||
PackState = u.SourceSubjectVisit.PackState,
|
PackState = u.SourceSubjectVisit.PackState,
|
||||||
|
|
||||||
OrginalStudyList = u.SourceSubjectVisit.StudyList.Select(t => new StudyBasicInfo()
|
OrginalStudyList = u.SourceSubjectVisit.StudyList
|
||||||
|
.Where(t => u.TrialReadingCriterion.IsImageFilter ? ("|" + u.TrialReadingCriterion.CriterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|") : true)
|
||||||
|
.Select(t => new StudyBasicInfo()
|
||||||
{
|
{
|
||||||
Id = t.Id,
|
Id = t.Id,
|
||||||
StudyInstanceUid = t.StudyInstanceUid,
|
StudyInstanceUid = t.StudyInstanceUid,
|
||||||
@@ -476,24 +486,51 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="trialId"></param>
|
/// <param name="trialId"></param>
|
||||||
/// <param name="subjectVisitId"></param>
|
/// <param name="subjectVisitId"></param>
|
||||||
|
/// <param name="isDicom"></param>
|
||||||
/// <param name="isAnonymize"></param>
|
/// <param name="isAnonymize"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
||||||
public async Task<IResponseOutput> RequestPackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isAnonymize = true)
|
public async Task<IResponseOutput> RequestPackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true)
|
||||||
{
|
{
|
||||||
var subjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
|
||||||
|
|
||||||
if (subjectVisit.PackState == PackState.WaitPack)
|
|
||||||
|
var extralConfig = _repository.Where<Trial>(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
|
||||||
|
|
||||||
|
var config = JsonConvert.DeserializeObject<TrialExtraConfig>(extralConfig) ?? new TrialExtraConfig();
|
||||||
|
|
||||||
|
if (config.IsSupportQCDownloadImage == false)
|
||||||
{
|
{
|
||||||
HangfireJobHelper.NotImmediatelyOnceOnlyJob<IDownloadAndUploadService>(t => t.PackageAndAnonymizImage(trialId, subjectVisitId, isAnonymize), TimeSpan.FromSeconds(1));
|
throw new BusinessValidationFailedException("该项目不支持QC下载影像");
|
||||||
|
|
||||||
subjectVisit.PackState = PackState.Packing;
|
|
||||||
|
|
||||||
await _subjectVisitRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResponseOutput.Ok(subjectVisit.VisitImageZipPath);
|
var subjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
||||||
|
|
||||||
|
var sujectCode = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => t.Subject.Code).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
var packState = isDicom ? subjectVisit.PackState : subjectVisit.NoDicomPackState;
|
||||||
|
|
||||||
|
if (packState == PackState.WaitPack)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (isDicom)
|
||||||
|
{
|
||||||
|
subjectVisit.PackState = PackState.Packing;
|
||||||
|
HangfireJobHelper.NotImmediatelyOnceOnlyJob<IDownloadAndUploadService>(t => t.PackageAndAnonymizImage(trialId, subjectVisitId, true, isAnonymize), TimeSpan.FromSeconds(1));
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
subjectVisit.NoDicomPackState = PackState.Packing;
|
||||||
|
|
||||||
|
HangfireJobHelper.NotImmediatelyOnceOnlyJob<IDownloadAndUploadService>(t => t.PackageAndAnonymizImage(trialId, subjectVisitId, false, isAnonymize), TimeSpan.FromSeconds(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
await _subjectVisitRepository.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(isDicom ? subjectVisit.VisitImageZipPath : subjectVisit.VisitNoDicomImageZipPath,
|
||||||
|
new { FileName = $"{sujectCode}_{subjectVisit.VisitName}_ImageStudy_{(isDicom ? "Dicom" : "NoneDicom")}.zip" });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -503,9 +540,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="trialId"></param>
|
/// <param name="trialId"></param>
|
||||||
/// <param name="subjectVisitId"></param>
|
/// <param name="subjectVisitId"></param>
|
||||||
|
/// <param name="isDicom"></param>
|
||||||
/// <param name="isAnonymize"></param>
|
/// <param name="isAnonymize"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isAnonymize = true)
|
public async Task PackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true)
|
||||||
{
|
{
|
||||||
|
|
||||||
var subjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
var subjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
||||||
@@ -549,6 +587,20 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}),
|
||||||
|
|
||||||
|
NoneDicomStudyList = sv.NoneDicomStudyList.Select(nd => new
|
||||||
|
{
|
||||||
|
nd.Modality,
|
||||||
|
nd.StudyCode,
|
||||||
|
nd.ImageDate,
|
||||||
|
|
||||||
|
FileList = nd.NoneDicomFileList.Select(file => new
|
||||||
|
{
|
||||||
|
file.FileName,
|
||||||
|
file.Path,
|
||||||
|
file.FileType
|
||||||
|
})
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -560,107 +612,146 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||||||
string tempFolderPath = Path.Combine(Directory.GetCurrentDirectory(), $"DownloadTemp_{NewId.NextGuid()}");
|
string tempFolderPath = Path.Combine(Directory.GetCurrentDirectory(), $"DownloadTemp_{NewId.NextGuid()}");
|
||||||
Directory.CreateDirectory(tempFolderPath);
|
Directory.CreateDirectory(tempFolderPath);
|
||||||
|
|
||||||
// 遍历查询结果
|
//dicom 处理
|
||||||
foreach (var studyInfo in info.StudyList)
|
|
||||||
|
if (isDicom)
|
||||||
{
|
{
|
||||||
// 遍历 Series
|
// 遍历查询结果
|
||||||
foreach (var seriesInfo in studyInfo.SeriesList)
|
foreach (var studyInfo in info.StudyList)
|
||||||
{
|
{
|
||||||
string studyFolderPath = Path.Combine(tempFolderPath, $"{info.SubjectCode}_{info.VisitName}", $"{studyInfo.StudyCode}_{studyInfo.StudyTime?.ToString("yyyy-MM-dd")}_{seriesInfo.Modality}");
|
// 遍历 Series
|
||||||
|
foreach (var seriesInfo in studyInfo.SeriesList)
|
||||||
// 创建 影像 文件夹
|
|
||||||
Directory.CreateDirectory(studyFolderPath);
|
|
||||||
|
|
||||||
// 遍历 InstancePathList
|
|
||||||
foreach (var instanceInfo in seriesInfo.InstancePathList)
|
|
||||||
{
|
{
|
||||||
// 复制文件到相应的文件夹
|
string studyDicomFolderPath = Path.Combine(tempFolderPath, "Dicom",/* $"{info.SubjectCode}_{info.VisitName}",*/ $"{studyInfo.StudyCode}_{studyInfo.StudyTime?.ToString("yyyy-MM-dd")}_{seriesInfo.Modality}");
|
||||||
string destinationPath = Path.Combine(studyFolderPath, Path.GetFileName(instanceInfo.Path));
|
|
||||||
|
|
||||||
//下载到当前目录
|
// 创建 影像 文件夹
|
||||||
await _oSSService.DownLoadFromOSSAsync(instanceInfo.Path, destinationPath);
|
Directory.CreateDirectory(studyDicomFolderPath);
|
||||||
|
|
||||||
#region 匿名化逻辑
|
// 遍历 InstancePathList
|
||||||
|
foreach (var instanceInfo in seriesInfo.InstancePathList)
|
||||||
|
|
||||||
if (isAnonymize)
|
|
||||||
{
|
{
|
||||||
//受试者随机阅片,需要匿名化检查时间
|
// 复制文件到相应的文件夹
|
||||||
DicomFile dicomFile = await DicomFile.OpenAsync(destinationPath, Encoding.Default);
|
string destinationPath = Path.Combine(studyDicomFolderPath, Path.GetFileName(instanceInfo.Path));
|
||||||
DicomDataset dataset = dicomFile.Dataset;
|
|
||||||
dataset.AddOrUpdate(DicomTag.StudyDate, string.Empty);
|
|
||||||
dataset.AddOrUpdate(DicomTag.StudyTime, string.Empty);
|
|
||||||
|
|
||||||
#region 前端已经匿名化,不需要做相关tag匿名化
|
//下载到当前目录
|
||||||
//DicomFile dicomFile = await DicomFile.OpenAsync(destinationPath, Encoding.Default);
|
await _oSSService.DownLoadFromOSSAsync(instanceInfo.Path, destinationPath);
|
||||||
|
|
||||||
//DicomDataset dataset = dicomFile.Dataset;
|
#region 匿名化逻辑
|
||||||
|
|
||||||
//foreach (var item in addOrUpdateFixedFieldList)
|
|
||||||
//{
|
|
||||||
|
|
||||||
// var dicomTag = new DicomTag(Convert.ToUInt16(item.Group, 16), Convert.ToUInt16(item.Element, 16));
|
if (isAnonymize)
|
||||||
|
{
|
||||||
|
//受试者随机阅片,需要匿名化检查时间
|
||||||
|
DicomFile dicomFile = await DicomFile.OpenAsync(destinationPath, Encoding.Default);
|
||||||
|
DicomDataset dataset = dicomFile.Dataset;
|
||||||
|
dataset.AddOrUpdate(DicomTag.StudyDate, string.Empty);
|
||||||
|
dataset.AddOrUpdate(DicomTag.StudyTime, string.Empty);
|
||||||
|
|
||||||
// dataset.AddOrUpdate(dicomTag, item.ReplaceValue);
|
#region 前端已经匿名化,不需要做相关tag匿名化
|
||||||
//}
|
//DicomFile dicomFile = await DicomFile.OpenAsync(destinationPath, Encoding.Default);
|
||||||
|
|
||||||
//foreach (var item in ircFieldList)
|
//DicomDataset dataset = dicomFile.Dataset;
|
||||||
//{
|
|
||||||
|
|
||||||
// var dicomTag = new DicomTag(Convert.ToUInt16(item.Group, 16), Convert.ToUInt16(item.Element, 16));
|
//foreach (var item in addOrUpdateFixedFieldList)
|
||||||
|
//{
|
||||||
|
|
||||||
// if (dicomTag == DicomTag.ClinicalTrialProtocolID)
|
// var dicomTag = new DicomTag(Convert.ToUInt16(item.Group, 16), Convert.ToUInt16(item.Element, 16));
|
||||||
// {
|
|
||||||
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialCode);
|
|
||||||
|
|
||||||
// }
|
// dataset.AddOrUpdate(dicomTag, item.ReplaceValue);
|
||||||
// if (dicomTag == DicomTag.ClinicalTrialSiteID)
|
//}
|
||||||
// {
|
|
||||||
// //dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialSiteCode);
|
|
||||||
|
|
||||||
// }
|
//foreach (var item in ircFieldList)
|
||||||
// if (dicomTag == DicomTag.ClinicalTrialSubjectID)
|
//{
|
||||||
// {
|
|
||||||
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.SubjectCode);
|
|
||||||
|
|
||||||
// }
|
// var dicomTag = new DicomTag(Convert.ToUInt16(item.Group, 16), Convert.ToUInt16(item.Element, 16));
|
||||||
// if (dicomTag == DicomTag.ClinicalTrialTimePointID)
|
|
||||||
// {
|
|
||||||
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.VisitNum.ToString());
|
|
||||||
|
|
||||||
// }
|
// if (dicomTag == DicomTag.ClinicalTrialProtocolID)
|
||||||
// if (dicomTag == DicomTag.PatientID)
|
// {
|
||||||
// {
|
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialCode);
|
||||||
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialCode + "_" + subjectAndVisitInfo.SubjectCode);
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
// if (dicomTag == DicomTag.ClinicalTrialSiteID)
|
||||||
|
// {
|
||||||
|
// //dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialSiteCode);
|
||||||
|
|
||||||
//}
|
// }
|
||||||
|
// if (dicomTag == DicomTag.ClinicalTrialSubjectID)
|
||||||
|
// {
|
||||||
|
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.SubjectCode);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// if (dicomTag == DicomTag.ClinicalTrialTimePointID)
|
||||||
|
// {
|
||||||
|
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.VisitNum.ToString());
|
||||||
|
|
||||||
|
// }
|
||||||
|
// if (dicomTag == DicomTag.PatientID)
|
||||||
|
// {
|
||||||
|
// dataset.AddOrUpdate(dicomTag, subjectAndVisitInfo.TrialCode + "_" + subjectAndVisitInfo.SubjectCode);
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
//}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var zipDicomPath = Path.Combine(Directory.GetCurrentDirectory(), $"{info.SubjectCode}_{info.VisitName}_ImageStudy_Dicom.zip");
|
||||||
|
ZipFile.CreateFromDirectory(Path.Combine(tempFolderPath, "Dicom"), zipDicomPath);
|
||||||
|
//上传到Oss
|
||||||
|
var relativeDicomPath = await _oSSService.UploadToOSSAsync(zipDicomPath, $"download_zip", false);
|
||||||
|
|
||||||
|
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { PackState = PackState.Packed, VisitImageZipPath = relativeDicomPath });
|
||||||
|
|
||||||
|
|
||||||
|
File.Delete(zipDicomPath);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var relativeNoneDicomPath = string.Empty;
|
||||||
|
|
||||||
var zipPath = Path.Combine(Directory.GetCurrentDirectory(), $"{info.SubjectCode}_{info.VisitName}_ImageStudy.zip");
|
if (info.NoneDicomStudyList.Count() == 1 && info.NoneDicomStudyList.SelectMany(t => t.FileList).Count() == 1)
|
||||||
|
{
|
||||||
|
relativeNoneDicomPath = info.NoneDicomStudyList.First().FileList.First().Path;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//非dicom 处理
|
||||||
|
|
||||||
ZipFile.CreateFromDirectory(tempFolderPath, zipPath);
|
foreach (var noneDicomStudy in info.NoneDicomStudyList)
|
||||||
|
{
|
||||||
|
string studyNoneDicomFolderPath = Path.Combine(tempFolderPath, "NoneDicom", /*$"{info.SubjectCode}_{info.VisitName}",*/ $"{noneDicomStudy.StudyCode}_{noneDicomStudy.ImageDate.ToString("yyyy-MM-dd")}_{noneDicomStudy.Modality}");
|
||||||
|
|
||||||
//上传到Oss
|
Directory.CreateDirectory(studyNoneDicomFolderPath);
|
||||||
var relativePath = await _oSSService.UploadToOSSAsync(zipPath, $"download_zip", false);
|
|
||||||
|
foreach (var file in noneDicomStudy.FileList)
|
||||||
|
{
|
||||||
|
string destinationPath = Path.Combine(studyNoneDicomFolderPath, Path.GetFileName(file.FileName));
|
||||||
|
|
||||||
|
//下载到当前目录
|
||||||
|
await _oSSService.DownLoadFromOSSAsync(HttpUtility.UrlDecode(file.Path) , destinationPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var zipNoneDicomPath = Path.Combine(Directory.GetCurrentDirectory(), $"{info.SubjectCode}_{info.VisitName}_ImageStudy_NoneDicom.zip");
|
||||||
|
ZipFile.CreateFromDirectory(Path.Combine(tempFolderPath, "NoneDicom"), zipNoneDicomPath);
|
||||||
|
relativeNoneDicomPath = await _oSSService.UploadToOSSAsync(zipNoneDicomPath, $"download_zip", false);
|
||||||
|
|
||||||
|
File.Delete(zipNoneDicomPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { PackState = PackState.Packed, VisitNoDicomImageZipPath = relativeNoneDicomPath });
|
||||||
|
|
||||||
|
|
||||||
//subjectVisit.PackState = PackState.Packed;
|
}
|
||||||
//subjectVisit.VisitImageZipPath = relativePath;
|
|
||||||
//await _subjectVisitRepository.SaveChangesAsync();
|
|
||||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { PackState = PackState.Packed, VisitImageZipPath = relativePath });
|
|
||||||
|
|
||||||
|
|
||||||
//清理文件夹
|
//清理文件夹
|
||||||
Directory.Delete(tempFolderPath, true);
|
Directory.Delete(tempFolderPath, true);
|
||||||
File.Delete(zipPath);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace IRaCIS.Application.Services
|
|||||||
Task<IResponseOutput<LoginReturnDTO>> Login(string userName, string password);
|
Task<IResponseOutput<LoginReturnDTO>> Login(string userName, string password);
|
||||||
Task<IResponseOutput> VerifyMFACodeAsync(Guid userId, string Code);
|
Task<IResponseOutput> VerifyMFACodeAsync(Guid userId, string Code);
|
||||||
|
|
||||||
Task<IResponseOutput> SendMFAEmail(Guid userId);
|
Task<IResponseOutput> SendMFAEmail(Guid userId, int mfaType=0);
|
||||||
Task<UserBasicInfo> GetUserBasicInfo(Guid userId,string pwd);
|
Task<UserBasicInfo> GetUserBasicInfo(Guid userId,string pwd);
|
||||||
Task<IResponseOutput> ModifyPassword(EditPasswordCommand editPwModel);
|
Task<IResponseOutput> ModifyPassword(EditPasswordCommand editPwModel);
|
||||||
Task<IResponseOutput> ResetPassword(Guid userId);
|
Task<IResponseOutput> ResetPassword(Guid userId);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
|||||||
using IRaCIS.Core.Application.Auth;
|
using IRaCIS.Core.Application.Auth;
|
||||||
using BeetleX.Redis.Commands;
|
using BeetleX.Redis.Commands;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
@@ -36,7 +37,7 @@ namespace IRaCIS.Application.Services
|
|||||||
private readonly IEasyCachingProvider _cache;
|
private readonly IEasyCachingProvider _cache;
|
||||||
private readonly IReadingImageTaskService _readingImageTaskService;
|
private readonly IReadingImageTaskService _readingImageTaskService;
|
||||||
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
|
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
|
||||||
|
private readonly SystemEmailSendConfig _systemEmailConfig;
|
||||||
|
|
||||||
public UserService(IRepository<User> userRepository,
|
public UserService(IRepository<User> userRepository,
|
||||||
|
|
||||||
@@ -47,6 +48,7 @@ namespace IRaCIS.Application.Services
|
|||||||
IReadingImageTaskService readingImageTaskService,
|
IReadingImageTaskService readingImageTaskService,
|
||||||
IRepository<TrialUser> userTrialRepository,
|
IRepository<TrialUser> userTrialRepository,
|
||||||
IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig,
|
IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig,
|
||||||
|
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig,
|
||||||
IRepository<UserLog> userLogRepository,
|
IRepository<UserLog> userLogRepository,
|
||||||
IRepository<UserPassWordLog> userPassWordLogRepository
|
IRepository<UserPassWordLog> userPassWordLogRepository
|
||||||
,
|
,
|
||||||
@@ -64,6 +66,8 @@ namespace IRaCIS.Application.Services
|
|||||||
_userTrialRepository = userTrialRepository;
|
_userTrialRepository = userTrialRepository;
|
||||||
_userLogRepository = userLogRepository;
|
_userLogRepository = userLogRepository;
|
||||||
_distributedLockProvider = distributedLockProvider;
|
_distributedLockProvider = distributedLockProvider;
|
||||||
|
|
||||||
|
_systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -589,7 +593,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
if (user.IsZhiZhun)
|
if (user.IsZhiZhun)
|
||||||
{
|
{
|
||||||
user.OrganizationName = AppSettings.DefaultInternalOrganizationName;
|
user.OrganizationName = _userInfo.IsEn_Us? _systemEmailConfig.OrganizationName: _systemEmailConfig.OrganizationNameCN ;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = model.Id, OptType = UserOptType.UpdateUser }, true);
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = model.Id, OptType = UserOptType.UpdateUser }, true);
|
||||||
@@ -653,17 +657,19 @@ namespace IRaCIS.Application.Services
|
|||||||
/// 发送MFA 验证邮件
|
/// 发送MFA 验证邮件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId"></param>
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="mfaType"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IResponseOutput> SendMFAEmail(Guid userId)
|
public async Task<IResponseOutput> SendMFAEmail(Guid userId, int mfaType )
|
||||||
{
|
{
|
||||||
var userInfo = await _userRepository.Where(u => u.Id == userId).Select(t => new { t.FullName, t.EMail }).FirstOrDefaultAsync();
|
var userInfo = await _userRepository.Where(u => u.Id == userId).Select(t => new { t.FullName, t.EMail }).FirstOrDefaultAsync();
|
||||||
|
|
||||||
int verificationCode = new Random().Next(100000, 1000000);
|
int verificationCode = new Random().Next(100000, 1000000);
|
||||||
|
|
||||||
await _mailVerificationService.SenMFAVerifyEmail(userId, userInfo.FullName, userInfo.EMail, verificationCode);
|
await _mailVerificationService.SenMFAVerifyEmail(userId, userInfo.FullName, userInfo.EMail, verificationCode, (UserMFAType)mfaType );
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
var hiddenEmail = EmailMaskHelper.MaskEmail(userInfo.EMail);
|
||||||
|
return ResponseOutput.Ok(hiddenEmail);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -811,7 +817,8 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
||||||
{
|
{
|
||||||
LastLoginIP = _userInfo.IP
|
LastLoginIP = _userInfo.IP,
|
||||||
|
LastLoginTime= DateTime.Now
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public string FullFilePath => Path;
|
public string FullFilePath => Path;
|
||||||
|
|
||||||
public string PreviewPath => "/Common/LocalFilePreview?relativePath=" + Path;
|
public string FileType { get; set; }
|
||||||
|
|
||||||
|
//public string PreviewPath => "/Common/LocalFilePreview?relativePath=" + Path;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public List<NoneDicomStudyFileView> NoneDicomStudyFileList { get; set; } = new List<NoneDicomStudyFileView>();
|
public List<NoneDicomStudyFileView> NoneDicomStudyFileList { get; set; } = new List<NoneDicomStudyFileView>();
|
||||||
|
|
||||||
public List<string> NoneDicomStudyFilePreviewList => NoneDicomStudyFileList.Select(t=> t.PreviewPath).ToList();
|
//public List<string> NoneDicomStudyFilePreviewList => NoneDicomStudyFileList.Select(t=> t.PreviewPath).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
//public string VisitPlanInfo { get; set; } = String.Empty;
|
//public string VisitPlanInfo { get; set; } = String.Empty;
|
||||||
|
|
||||||
public Guid? HandleUserId { get; set; }
|
public Guid? HandleUserId { get; set; }
|
||||||
|
|
||||||
|
public DateTime? BeginAuditTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime? EndAuditTime { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetNextIQCQualityInDto
|
public class GetNextIQCQualityInDto
|
||||||
@@ -187,6 +191,13 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public string SubmitUserName { get; set; }
|
public string SubmitUserName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public TrialQCProcess QCProcessEnum { get; set; }
|
||||||
|
|
||||||
|
public DateTime? ReviewAuditTime { get; set; }
|
||||||
|
public DateTime? PreliminaryAuditTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime? AuditTime => QCProcessEnum == TrialQCProcess.SingleAudit ? PreliminaryAuditTime : (QCProcessEnum == TrialQCProcess.DoubleAudit ? ReviewAuditTime : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1105,6 +1116,9 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public bool IsHaveUploadFailed { get; set; }
|
public bool IsHaveUploadFailed { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1399,8 +1413,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
|
|
||||||
public string ReviewAuditUserName { get; set; } = String.Empty;
|
public string ReviewAuditUserName { get; set; } = String.Empty;
|
||||||
public DateTime? ReviewAuditTime { get; set; }
|
|
||||||
public DateTime? PreliminaryAuditTime { get; set; }
|
|
||||||
|
|
||||||
public bool IsEnrollmentConfirm { get; set; } = false;
|
public bool IsEnrollmentConfirm { get; set; } = false;
|
||||||
public DateTime? SubjectFirstGiveMedicineTime { get; set; }
|
public DateTime? SubjectFirstGiveMedicineTime { get; set; }
|
||||||
@@ -1475,6 +1488,12 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public PackState PackState { get; set; }
|
public PackState PackState { get; set; }
|
||||||
|
|
||||||
//public Guid? ClinicalDataSignUserId { get; set; }
|
//public Guid? ClinicalDataSignUserId { get; set; }
|
||||||
|
|
||||||
|
public DateTime? ReviewAuditTime { get; set; }
|
||||||
|
public DateTime? PreliminaryAuditTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public DateTime? AuditTime => QCProcessEnum == TrialQCProcess.SingleAudit ? PreliminaryAuditTime : (QCProcessEnum == TrialQCProcess.DoubleAudit ? ReviewAuditTime : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
Task<IResponseOutput> DeleteNoneDicomStudy(Guid noneDicomStudyId, Guid subjectVisitId);
|
Task<IResponseOutput> DeleteNoneDicomStudy(Guid noneDicomStudyId, Guid subjectVisitId);
|
||||||
Task<IResponseOutput> DeleteNoneDicomStudyFile(Guid noneDicomStudyFileId, Guid subjectVisitId);
|
Task<IResponseOutput> DeleteNoneDicomStudyFile(Guid noneDicomStudyFileId, Guid subjectVisitId);
|
||||||
Task<List<NoneDicomStudyFileView>> GetNoneDicomStudyFileList(Guid noneDicomStudyId);
|
Task<List<NoneDicomStudyFileView>> GetNoneDicomStudyFileList(Guid noneDicomStudyId);
|
||||||
Task<List<NoneDicomStudyView>> GetNoneDicomStudyList(Guid subjectVisitId, Guid? sujectVisitId = null);
|
Task<List<NoneDicomStudyView>> GetNoneDicomStudyList(Guid subjectVisitId, Guid? sujectVisitId = null, bool isFilterZip=false);
|
||||||
Task<List<NoneDicomStudyFileView>> GetVisitNoneDicomStudyFileList(Guid subjectVisitId);
|
Task<List<NoneDicomStudyFileView>> GetVisitNoneDicomStudyFileList(Guid subjectVisitId);
|
||||||
//Task<IResponseOutput> UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId);
|
//Task<IResponseOutput> UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId);
|
||||||
|
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<List<NoneDicomStudyView>> GetNoneDicomStudyList([FromQuery, NotDefault] Guid subjectVisitId, Guid? nonedicomStudyId)
|
public async Task<List<NoneDicomStudyView>> GetNoneDicomStudyList([FromQuery, NotDefault] Guid subjectVisitId, [FromQuery] Guid? nonedicomStudyId, [FromQuery] bool isFilterZip)
|
||||||
{
|
{
|
||||||
|
|
||||||
var noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
|
var noneDicomStudyQueryable = _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).WhereIf(nonedicomStudyId != null, t => t.Id == nonedicomStudyId)
|
||||||
|
|
||||||
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken });
|
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = isFilterZip });
|
||||||
|
|
||||||
return await noneDicomStudyQueryable.ToListAsync();
|
return await noneDicomStudyQueryable.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
PageSize = 1,
|
PageSize = 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
return result.Item1.CurrentPageData.Count > 0 ? result.Item1.CurrentPageData[0] : null;
|
return result.Data.CurrentPageData.Count > 0 ? result.Data.CurrentPageData[0] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -188,7 +188,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
/// <param name="visitSearchDTO"></param>
|
/// <param name="visitSearchDTO"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<(PageOutput<QCVisitViewModel>, TrialSubjectAndSVConfig)> GetQCVisitList(QCVisitSearchDTO visitSearchDTO)
|
public async Task<IResponseOutput<PageOutput<QCVisitViewModel>>> GetQCVisitList(QCVisitSearchDTO visitSearchDTO)
|
||||||
{
|
{
|
||||||
|
|
||||||
var svExpression = QCCommon.GetSubjectVisitFilter(visitSearchDTO.VisitPlanArray);
|
var svExpression = QCCommon.GetSubjectVisitFilter(visitSearchDTO.VisitPlanArray);
|
||||||
@@ -210,6 +210,12 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|| t.QCChallengeDialogList.Any(t => t.CreateUserId == visitSearchDTO.HandleUserId))
|
|| t.QCChallengeDialogList.Any(t => t.CreateUserId == visitSearchDTO.HandleUserId))
|
||||||
.WhereIf(visitSearchDTO.IsUrgent != null, t => t.IsUrgent == visitSearchDTO.IsUrgent)
|
.WhereIf(visitSearchDTO.IsUrgent != null, t => t.IsUrgent == visitSearchDTO.IsUrgent)
|
||||||
.Where(t => t.SubmitState != SubmitStateEnum.None)
|
.Where(t => t.SubmitState != SubmitStateEnum.None)
|
||||||
|
.WhereIf(visitSearchDTO.BeginAuditTime != null, t => t.Trial.QCProcessEnum==TrialQCProcess.SingleAudit? t.PreliminaryAuditTime>= visitSearchDTO.BeginAuditTime:
|
||||||
|
(t.Trial.QCProcessEnum == TrialQCProcess.DoubleAudit?t.ReviewAuditTime>= visitSearchDTO.BeginAuditTime:true))
|
||||||
|
|
||||||
|
.WhereIf(visitSearchDTO.EndAuditTime != null, t => t.Trial.QCProcessEnum == TrialQCProcess.SingleAudit ? t.PreliminaryAuditTime <= visitSearchDTO.EndAuditTime :
|
||||||
|
(t.Trial.QCProcessEnum == TrialQCProcess.DoubleAudit ? t.ReviewAuditTime <= visitSearchDTO.EndAuditTime : true))
|
||||||
|
|
||||||
//.WhereIf(visitSearchDTO.SubmitState != null, t => t.SubmitState == visitSearchDTO.SubmitState)
|
//.WhereIf(visitSearchDTO.SubmitState != null, t => t.SubmitState == visitSearchDTO.SubmitState)
|
||||||
//.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState)
|
//.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState)
|
||||||
.ProjectTo<QCVisitViewModel>(_mapper.ConfigurationProvider);
|
.ProjectTo<QCVisitViewModel>(_mapper.ConfigurationProvider);
|
||||||
@@ -223,7 +229,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
var config = await _repository.Where<Trial>(t => t.Id == visitSearchDTO.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
var config = await _repository.Where<Trial>(t => t.Id == visitSearchDTO.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||||
|
|
||||||
return (pageList, config);
|
return ResponseOutput.Ok (pageList, config);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
private readonly IRepository<QCChallenge> _qcChallengeRepository;
|
private readonly IRepository<QCChallenge> _qcChallengeRepository;
|
||||||
private readonly IRepository<DicomStudy> _dicomStudyRepository;
|
private readonly IRepository<DicomStudy> _dicomStudyRepository;
|
||||||
private readonly IRepository<DicomSeries> _dicomSeriesrepository;
|
private readonly IRepository<DicomSeries> _dicomSeriesrepository;
|
||||||
private readonly IReadingClinicalDataService _readingClinicalDataService;
|
private readonly IReadingClinicalDataService _readingClinicalDataService;
|
||||||
private readonly IRepository<Subject> _subjectRepository;
|
private readonly IRepository<Subject> _subjectRepository;
|
||||||
private readonly IRepository<ReadingClinicalData> _readingClinicalDataRepository;
|
private readonly IRepository<ReadingClinicalData> _readingClinicalDataRepository;
|
||||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||||
private readonly IRepository<QCChallengeDialog> _qCChallengeDialogrepository;
|
private readonly IRepository<QCChallengeDialog> _qCChallengeDialogrepository;
|
||||||
private readonly IRepository<CheckChallengeDialog> _checkChallengeDialogrepository;
|
private readonly IRepository<CheckChallengeDialog> _checkChallengeDialogrepository;
|
||||||
private readonly IRepository<Trial> _trialRepository;
|
private readonly IRepository<Trial> _trialRepository;
|
||||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||||
@@ -45,11 +45,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
IRepository<VisitTask> visitTaskRepository,
|
IRepository<VisitTask> visitTaskRepository,
|
||||||
IRepository<DicomStudy> dicomStudyRepository,
|
IRepository<DicomStudy> dicomStudyRepository,
|
||||||
IRepository<DicomSeries> dicomSeriesrepository,
|
IRepository<DicomSeries> dicomSeriesrepository,
|
||||||
IReadingClinicalDataService readingClinicalDataService,
|
IReadingClinicalDataService readingClinicalDataService,
|
||||||
IRepository<Subject> subjectRepository,
|
IRepository<Subject> subjectRepository,
|
||||||
IRepository<ReadingClinicalData> readingClinicalDataRepository,
|
IRepository<ReadingClinicalData> readingClinicalDataRepository,
|
||||||
IRepository<ClinicalDataTrialSet> clinicalDataTrialSetRepository,
|
IRepository<ClinicalDataTrialSet> clinicalDataTrialSetRepository,
|
||||||
IRepository<QCChallengeDialog> qCChallengeDialogrepository,
|
IRepository<QCChallengeDialog> qCChallengeDialogrepository,
|
||||||
IRepository<CheckChallengeDialog> checkChallengeDialogrepository,
|
IRepository<CheckChallengeDialog> checkChallengeDialogrepository,
|
||||||
IVisitTaskHelpeService visitTaskHelpeService,
|
IVisitTaskHelpeService visitTaskHelpeService,
|
||||||
IDistributedLockProvider distributedLockProvider
|
IDistributedLockProvider distributedLockProvider
|
||||||
@@ -59,11 +59,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
_qcChallengeRepository = qcChallengeRepository;
|
_qcChallengeRepository = qcChallengeRepository;
|
||||||
_dicomStudyRepository = dicomStudyRepository;
|
_dicomStudyRepository = dicomStudyRepository;
|
||||||
this._dicomSeriesrepository = dicomSeriesrepository;
|
this._dicomSeriesrepository = dicomSeriesrepository;
|
||||||
this._readingClinicalDataService = readingClinicalDataService;
|
this._readingClinicalDataService = readingClinicalDataService;
|
||||||
this._subjectRepository = subjectRepository;
|
this._subjectRepository = subjectRepository;
|
||||||
this._readingClinicalDataRepository = readingClinicalDataRepository;
|
this._readingClinicalDataRepository = readingClinicalDataRepository;
|
||||||
this._clinicalDataTrialSetRepository = clinicalDataTrialSetRepository;
|
this._clinicalDataTrialSetRepository = clinicalDataTrialSetRepository;
|
||||||
this._qCChallengeDialogrepository = qCChallengeDialogrepository;
|
this._qCChallengeDialogrepository = qCChallengeDialogrepository;
|
||||||
this._checkChallengeDialogrepository = checkChallengeDialogrepository;
|
this._checkChallengeDialogrepository = checkChallengeDialogrepository;
|
||||||
_trialRepository = trialRepository;
|
_trialRepository = trialRepository;
|
||||||
this._visitTaskRepository = visitTaskRepository;
|
this._visitTaskRepository = visitTaskRepository;
|
||||||
@@ -706,7 +706,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (await _subjectVisitRepository.AnyAsync(t => t.Id == updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted))
|
if (await _subjectVisitRepository.AnyAsync(t => t.Id == updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted && !t.QCChallengeList.Any(c=>c.ReuploadEnum==QCChanllengeReuploadEnum.QCAgreeUpload)) )
|
||||||
{
|
{
|
||||||
//---提交之后,不允许修改!
|
//---提交之后,不允许修改!
|
||||||
throw new BusinessValidationFailedException(_localizer["QCOperation_NoModifyAfterSubmit"]);
|
throw new BusinessValidationFailedException(_localizer["QCOperation_NoModifyAfterSubmit"]);
|
||||||
@@ -894,7 +894,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
public async Task<GetNextIQCQualityOutDto> CollectNextIQCQuality(GetNextIQCQualityInDto inDto)
|
public async Task<GetNextIQCQualityOutDto> CollectNextIQCQuality(GetNextIQCQualityInDto inDto)
|
||||||
{
|
{
|
||||||
var nextIQCQuality = await this.GetNextIQCQuality(inDto);
|
var nextIQCQuality = await this.GetNextIQCQuality(inDto);
|
||||||
|
|
||||||
if (nextIQCQuality.VisitId != null)
|
if (nextIQCQuality.VisitId != null)
|
||||||
{
|
{
|
||||||
var visit = await _subjectVisitRepository.Where(x => x.Id == nextIQCQuality.VisitId).FirstNotNullAsync();
|
var visit = await _subjectVisitRepository.Where(x => x.Id == nextIQCQuality.VisitId).FirstNotNullAsync();
|
||||||
@@ -902,7 +902,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
{
|
{
|
||||||
await ObtainOrCancelQCTask(inDto.TrialId, nextIQCQuality.VisitId.Value, true);
|
await ObtainOrCancelQCTask(inDto.TrialId, nextIQCQuality.VisitId.Value, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nextIQCQuality;
|
return nextIQCQuality;
|
||||||
@@ -932,23 +932,24 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
break;
|
break;
|
||||||
case TrialQCProcess.SingleAudit:
|
case TrialQCProcess.SingleAudit:
|
||||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted
|
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted
|
||||||
&& x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId!= _userInfo.Id&&(x.CurrentActionUserId == _userInfo.Id || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake)))
|
&& x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId != _userInfo.Id && (x.CurrentActionUserId == _userInfo.Id || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake)))
|
||||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y=>!y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.Id)
|
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.Id)
|
||||||
.Include(x => x.Subject).ToListAsync();
|
.Include(x => x.Subject).ToListAsync();
|
||||||
|
|
||||||
subjectVisit = visitList.Where(x => x.SubjectId == inDto.SubjectId)
|
subjectVisit = visitList.Where(x => x.SubjectId == inDto.SubjectId)
|
||||||
|
|
||||||
|
|
||||||
.OrderBy(x=>x.VisitNum).FirstOrDefault();
|
|
||||||
if(subjectVisit!=null)
|
.OrderBy(x => x.VisitNum).FirstOrDefault();
|
||||||
|
if (subjectVisit != null)
|
||||||
{
|
{
|
||||||
return new GetNextIQCQualityOutDto() {
|
return new GetNextIQCQualityOutDto()
|
||||||
SubjectId= subjectVisit.SubjectId,
|
{
|
||||||
VisitId= subjectVisit.Id
|
SubjectId = subjectVisit.SubjectId,
|
||||||
|
VisitId = subjectVisit.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
subjectVisit= visitList.OrderBy(x => x.Subject.Code).ThenBy(x=>x.VisitNum).FirstOrDefault();
|
subjectVisit = visitList.OrderBy(x => x.Subject.Code).ThenBy(x => x.VisitNum).FirstOrDefault();
|
||||||
if (subjectVisit != null)
|
if (subjectVisit != null)
|
||||||
{
|
{
|
||||||
return new GetNextIQCQualityOutDto()
|
return new GetNextIQCQualityOutDto()
|
||||||
@@ -965,10 +966,10 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
case TrialQCProcess.DoubleAudit:
|
case TrialQCProcess.DoubleAudit:
|
||||||
|
|
||||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId &&
|
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId &&
|
||||||
((x.CurrentActionUserId == _userInfo.Id)||(!x.IsTake&& x.AuditState != AuditStateEnum.QCPassed&& (x.PreliminaryAuditUserId != _userInfo.Id)))
|
((x.CurrentActionUserId == _userInfo.Id) || (!x.IsTake && x.AuditState != AuditStateEnum.QCPassed && (x.PreliminaryAuditUserId != _userInfo.Id)))
|
||||||
)
|
)
|
||||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId !=_userInfo.Id)
|
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.Id)
|
||||||
.Include(x => x.Subject).ToListAsync();
|
.Include(x => x.Subject).ToListAsync();
|
||||||
if (subjectVisit != null)
|
if (subjectVisit != null)
|
||||||
{
|
{
|
||||||
return new GetNextIQCQualityOutDto()
|
return new GetNextIQCQualityOutDto()
|
||||||
@@ -1027,14 +1028,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
{
|
{
|
||||||
//throw new BusinessValidationFailedException("当前访视已被领取,不允许领取");
|
//throw new BusinessValidationFailedException("当前访视已被领取,不允许领取");
|
||||||
|
|
||||||
//---当前访视的影像质控任务已被其他QC领取,不允许领取
|
//---当前访视的影像质控任务已被其他QC领取,不允许领取
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCTaskNoAccess"], ApiResponseCodeEnum.NeedTips);
|
return ResponseOutput.NotOk(_localizer["QCOperation_QCTaskNoAccess"], ApiResponseCodeEnum.NeedTips);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await _subjectVisitRepository.AnyAsync(t => t.Trial.QCQuestionConfirmedUserId == null && t.Id == subjectVisitId))
|
if (await _subjectVisitRepository.AnyAsync(t => t.Trial.QCQuestionConfirmedUserId == null && t.Id == subjectVisitId))
|
||||||
{
|
{
|
||||||
//---请先配置影像质控审核问题,再领取影像质控任务
|
//---请先配置影像质控审核问题,再领取影像质控任务
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCConfigFirst"], ApiResponseCodeEnum.NeedTips);
|
return ResponseOutput.NotOk(_localizer["QCOperation_QCConfigFirst"], ApiResponseCodeEnum.NeedTips);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,14 +1054,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||||
{
|
{
|
||||||
//---项目配置为不审,没有领取QC Task
|
//---项目配置为不审,没有领取QC Task
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoQC"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoQC"]);
|
||||||
}
|
}
|
||||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
||||||
{
|
{
|
||||||
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id)
|
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id)
|
||||||
{
|
{
|
||||||
//---初审已通过,不能继续领取
|
//---初审已通过,不能继续领取
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_InitialAuditPassed"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_InitialAuditPassed"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1074,15 +1075,15 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ---项目配置为单审,不满足Submmit State:已提交 或者 Audit State:待审核/审核中, 不允许领取,请刷新界面
|
// ---项目配置为单审,不满足Submmit State:已提交 或者 Audit State:待审核/审核中, 不允许领取,请刷新界面
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSingleAudit"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoSingleAudit"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit)
|
else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit)
|
||||||
{
|
{
|
||||||
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id)
|
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id)
|
||||||
{
|
{
|
||||||
//---复审不能和初审是同一个人
|
//---复审不能和初审是同一个人
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSameReviewer"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoSameReviewer"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1102,7 +1103,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//---项目配置为复审,不满足提交状态:已提交 或者 审核状态:待审核/QC中, 不允许领取,请刷新界面
|
//---项目配置为复审,不满足提交状态:已提交 或者 审核状态:待审核/QC中, 不允许领取,请刷新界面
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSecondaryAudit"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoSecondaryAudit"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1123,14 +1124,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
{
|
{
|
||||||
if (dbSubjectVisit!.CurrentActionUserId != _userInfo.Id)
|
if (dbSubjectVisit!.CurrentActionUserId != _userInfo.Id)
|
||||||
{
|
{
|
||||||
//---您不是该质控任务当前领取人,没有操作权限!
|
//---您不是该质控任务当前领取人,没有操作权限!
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoRecipient"], ApiResponseCodeEnum.NeedTips);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoRecipient"], ApiResponseCodeEnum.NeedTips);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||||
{
|
{
|
||||||
//---项目配置影像质控为不审,不需要取消任务功能
|
//---项目配置影像质控为不审,不需要取消任务功能
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCFunction"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCFunction"]);
|
||||||
}
|
}
|
||||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
||||||
@@ -1143,7 +1144,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//---当前访视影像质控任务没有当前领取人,不能释放。
|
//---当前访视影像质控任务没有当前领取人,不能释放。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoTaskOwner"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoTaskOwner"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1163,7 +1164,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//---当前访视影像质控任务没有当前领取人,不能释放。
|
//---当前访视影像质控任务没有当前领取人,不能释放。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoTaskOwner"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoTaskOwner"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1214,7 +1215,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
}
|
}
|
||||||
|
|
||||||
//同时要根据项目有没有配置Subject 级别临床数据
|
//同时要根据项目有没有配置Subject 级别临床数据
|
||||||
if (dbSubjectVisitList.Any(t => t.IsBaseLine && !t.IsHaveClinicalData)&&trialinfo.ClinicalInformationTransmissionEnum!=0)
|
if (dbSubjectVisitList.Any(t => t.IsBaseLine && !t.IsHaveClinicalData) && trialinfo.ClinicalInformationTransmissionEnum != 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
//---基线没有临床数据,确认提交?
|
//---基线没有临床数据,确认提交?
|
||||||
@@ -1235,36 +1236,36 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
//[Authorize(Policy = IRaCISPolicy.CRC)]
|
//[Authorize(Policy = IRaCISPolicy.CRC)]
|
||||||
public async Task<IResponseOutput> CRCRequestToQC(CRCRequestToQCCommand cRCRequestToQCCommand)
|
public async Task<IResponseOutput> CRCRequestToQC(CRCRequestToQCCommand cRCRequestToQCCommand)
|
||||||
{
|
{
|
||||||
List<string> modalitieTypess = new List<string>() { "PT、CT", "CT、PT", "PET-CT" };
|
List<string> modalitieTypess = new List<string>() { "PT、CT", "CT、PT", "PET-CT" };
|
||||||
// 验证临床数据 是否有Pet类型
|
// 验证临床数据 是否有Pet类型
|
||||||
#region 验证临床数据 是否有Pet类型
|
#region 验证临床数据 是否有Pet类型
|
||||||
if (await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == cRCRequestToQCCommand.TrialId && x.IsConfirm && x.ClinicalDataLevel == ClinicalLevel.Study))
|
if (await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == cRCRequestToQCCommand.TrialId && x.IsConfirm && x.ClinicalDataLevel == ClinicalLevel.Study))
|
||||||
{
|
{
|
||||||
foreach (var item in cRCRequestToQCCommand.SubjectVisitIds)
|
foreach (var item in cRCRequestToQCCommand.SubjectVisitIds)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (await _dicomStudyRepository.AnyAsync(x => x.SubjectVisitId == item && modalitieTypess.Contains(x.Modalities)))
|
if (await _dicomStudyRepository.AnyAsync(x => x.SubjectVisitId == item && modalitieTypess.Contains(x.Modalities)))
|
||||||
{
|
{
|
||||||
var visit = await _subjectVisitRepository.Where(x => x.Id == item).FirstNotNullAsync();
|
var visit = await _subjectVisitRepository.Where(x => x.Id == item).FirstNotNullAsync();
|
||||||
var clinicalData = await this._readingClinicalDataService.GetStudyClinicalData(new Service.Reading.Dto.GetStudyClinicalDataInDto()
|
var clinicalData = await this._readingClinicalDataService.GetStudyClinicalData(new Service.Reading.Dto.GetStudyClinicalDataInDto()
|
||||||
{
|
{
|
||||||
SubjectVisitId = item,
|
SubjectVisitId = item,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!clinicalData.Any(x => x.ClinicalDataLevel == ClinicalLevel.Study && x.ClinicalUploadType == ClinicalUploadType.PDF && x.PDFFileList.Count() > 0))
|
if (!clinicalData.Any(x => x.ClinicalDataLevel == ClinicalLevel.Study && x.ClinicalUploadType == ClinicalUploadType.PDF && x.PDFFileList.Count() > 0))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["QCOperation_NeedStudyClinical"]);
|
throw new BusinessValidationFailedException(_localizer["QCOperation_NeedStudyClinical"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
var trialId = cRCRequestToQCCommand.TrialId;
|
var trialId = cRCRequestToQCCommand.TrialId;
|
||||||
|
|
||||||
var trialConfig = (await _trialRepository
|
var trialConfig = (await _trialRepository
|
||||||
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification, t.IsUrgent, t.IsHaveFirstGiveMedicineDate, t.ClinicalInformationTransmissionEnum })
|
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification, t.IsUrgent, t.IsHaveFirstGiveMedicineDate, t.ClinicalInformationTransmissionEnum })
|
||||||
@@ -1311,82 +1312,36 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
//基线不验证
|
//基线不验证
|
||||||
if (trialConfig.IsHaveFirstGiveMedicineDate && !dbSubjectVisit.IsBaseLine && dbSubjectVisit.Subject.FirstGiveMedicineTime == null)
|
if (trialConfig.IsHaveFirstGiveMedicineDate && !dbSubjectVisit.IsBaseLine && dbSubjectVisit.Subject.FirstGiveMedicineTime == null)
|
||||||
{
|
{
|
||||||
//---项目配置了需要填写访视基准日期。但是受试者没有填写访视基准日期,不允许提交
|
//---项目配置了需要填写访视基准日期。但是受试者没有填写访视基准日期,不允许提交
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_MissingBaselineDate"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_MissingBaselineDate"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//基线 且配置了临床数据
|
if (_subjectVisitRepository.Where(t => t.Id == dbSubjectVisit.Id).Any(t => (t.StudyList.Count(t => t.ModalityForEdit == "") > 0 ||t.NoneDicomStudyList.Count(t => t.Modality == "")>0) && t.Trial.TrialReadingCriterionList.Count(t => t.IsImageFilter == true) > 0))
|
||||||
//if (trialConfig.ClinicalInformationTransmissionEnum != 0 /*&& dbSubjectVisit.IsBaseLine*//*&&dbSubjectVisit.ClinicalDataSignUserId==null*/)
|
{
|
||||||
//{
|
//有标准配置了影像筛选,该受试者有检查未设置检查类型,不允许提交
|
||||||
|
return ResponseOutput.NotOk(_localizer["QCOperation_MissingModality"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////找到需要确认的PDF 临床数据 如果没有CRC 没有上传 那么就添加一条没有文件的记录
|
//已确认临床数据完整性
|
||||||
|
dbSubjectVisit.IsConfirmedClinicalData = true;
|
||||||
//var crcNeedConfirmClinicalDataSetList = clinicalDataConfirmList.Where(t => t.UploadRole == UploadRole.CRC && t.ClinicalUploadType == ClinicalUploadType.PDF).ToList();
|
|
||||||
|
|
||||||
//// 找到CRC 已经自己添加的临床PDF数据文件
|
|
||||||
|
|
||||||
//var crcAddClinicalDataIdList = _readingClinicalDataRepository.Where(t => t.ReadingId == dbSubjectVisit.Id && t.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && t.ClinicalDataTrialSet.ClinicalUploadType == ClinicalUploadType.PDF)
|
|
||||||
// .Select(t => new { t.ClinicalDataTrialSetId }).ToList();
|
|
||||||
|
|
||||||
//foreach (var crcNeedConfirmClinicalDataSet in crcNeedConfirmClinicalDataSetList)
|
|
||||||
//{
|
|
||||||
// if (!crcAddClinicalDataIdList.Any(t => t.ClinicalDataTrialSetId == crcNeedConfirmClinicalDataSet.Id))
|
|
||||||
// {
|
|
||||||
// await _repository.AddAsync(new ReadingClinicalData()
|
|
||||||
// {
|
|
||||||
// TrialId = dbSubjectVisit.TrialId,
|
|
||||||
// SubjectId = dbSubjectVisit.SubjectId,
|
|
||||||
// ReadingId = dbSubjectVisit.Id,
|
|
||||||
// ClinicalDataTrialSetId = crcNeedConfirmClinicalDataSet.Id,
|
|
||||||
// IsVisit = true,
|
|
||||||
// IsSign = true,
|
|
||||||
// ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned
|
|
||||||
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//已确认临床数据完整性
|
|
||||||
dbSubjectVisit.IsConfirmedClinicalData = true;
|
|
||||||
|
|
||||||
|
|
||||||
// CRC 上传的基线数据签名
|
// CRC 上传的基线数据签名
|
||||||
|
|
||||||
List<ClinicalLevel> clinicalneedSign = new List<ClinicalLevel>() {
|
List<ClinicalLevel> clinicalneedSign = new List<ClinicalLevel>() {
|
||||||
ClinicalLevel.Subject,
|
ClinicalLevel.Subject,
|
||||||
ClinicalLevel.SubjectVisit,
|
ClinicalLevel.SubjectVisit,
|
||||||
ClinicalLevel.Study,
|
ClinicalLevel.Study,
|
||||||
};
|
};
|
||||||
|
|
||||||
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x =>
|
|
||||||
clinicalneedSign.Contains(x.ClinicalDataTrialSet.ClinicalDataLevel)&&
|
|
||||||
x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == dbSubjectVisit.Id && x.IsSign==false, x => new ReadingClinicalData()
|
|
||||||
{
|
|
||||||
IsSign = true,
|
|
||||||
ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//var signSuccess = await _repository.UpdateFromQueryAsync<TrialSign>(t => t.Id == cRCRequestToQCCommand.SignId, u => new TrialSign() { IsCompleted = true });
|
|
||||||
|
|
||||||
|
|
||||||
////现在修改为 提交时 设置签名信息
|
|
||||||
//dbSubjectVisit.ClinicalDataSignUserId = _userInfo.Id;
|
|
||||||
//dbSubjectVisit.ClinicalDataSignTime = DateTime.Now;
|
|
||||||
|
|
||||||
//那么没有录入 不允许提交
|
|
||||||
//if (!await _repository.AnyAsync<SubjectVisit>(t => t.PreviousHistoryList.Any() || t.PreviousOtherList.Any() || t.PreviousSurgeryList.Any()))
|
|
||||||
//{
|
|
||||||
// return ResponseOutput.NotOk("没有临床数据,不允许提交");
|
|
||||||
//}
|
|
||||||
|
|
||||||
//return ResponseOutput.NotOk("没有签名临床数据,不允许提交");
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x =>
|
||||||
|
clinicalneedSign.Contains(x.ClinicalDataTrialSet.ClinicalDataLevel) &&
|
||||||
|
x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == dbSubjectVisit.Id && x.IsSign == false, x => new ReadingClinicalData()
|
||||||
|
{
|
||||||
|
IsSign = true,
|
||||||
|
ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
var maxVisit = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.SubmitState == SubmitStateEnum.Submitted)
|
var maxVisit = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.SubmitState == SubmitStateEnum.Submitted)
|
||||||
@@ -1411,14 +1366,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId)&& x.SubjectId == dbSubjectVisit.SubjectId&&
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId &&
|
||||||
dbSubjectVisit.VisitNum<= x.VisitTaskNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum+0.01m) // 当前的访视 全局 裁判 及之前 全都加急
|
dbSubjectVisit.VisitNum <= x.VisitTaskNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum + 0.01m) // 当前的访视 全局 裁判 及之前 全都加急
|
||||||
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||||
{
|
{
|
||||||
|
|
||||||
IsUrgent = true,
|
IsUrgent = true,
|
||||||
TaskUrgentType = TaskUrgentType.PDProgress,
|
TaskUrgentType = TaskUrgentType.PDProgress,
|
||||||
IsCanEditUrgentState=false,
|
IsCanEditUrgentState = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId
|
||||||
@@ -1428,7 +1383,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
IsUrgent = true,
|
IsUrgent = true,
|
||||||
TaskUrgentType = TaskUrgentType.Other,
|
TaskUrgentType = TaskUrgentType.Other,
|
||||||
TaskUrgentRemake= "后续访视设为pd",
|
TaskUrgentRemake = "后续访视设为pd",
|
||||||
IsCanEditUrgentState = false,
|
IsCanEditUrgentState = false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1440,7 +1395,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
});
|
});
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) &&
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) &&
|
||||||
x.VisitTaskNum>= dbSubjectVisit.VisitNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum + 0.01m) // 当前的访视 全局 裁判 全都加急
|
x.VisitTaskNum >= dbSubjectVisit.VisitNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum + 0.01m) // 当前的访视 全局 裁判 全都加急
|
||||||
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1464,14 +1419,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
dbSubjectVisit.IsUrgent = true;
|
dbSubjectVisit.IsUrgent = true;
|
||||||
|
|
||||||
|
|
||||||
////PD确认的紧急会把前面所有未QC完成的访视均标记为紧急
|
|
||||||
|
|
||||||
//var previosSVlist = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.VisitNum < dbSubjectVisit.VisitNum && t.IsUrgent == false && t.SubmitState == SubmitStateEnum.Submitted, true).ToListAsync();
|
|
||||||
|
|
||||||
//previosSVlist.ForEach(t =>
|
|
||||||
//{
|
|
||||||
// t.IsUrgent = true;
|
|
||||||
//});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1522,7 +1470,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
}
|
}
|
||||||
|
|
||||||
//非基线设置为PD的话 或者设置为末次访视 根据配置自动生成阅片期
|
//非基线设置为PD的话 或者设置为末次访视 根据配置自动生成阅片期
|
||||||
if (!dbSubjectVisit.IsBaseLine && (dbSubjectVisit.PDState == PDStateEnum.PDProgress || dbSubjectVisit.IsFinalVisit) )
|
if (!dbSubjectVisit.IsBaseLine && (dbSubjectVisit.PDState == PDStateEnum.PDProgress || dbSubjectVisit.IsFinalVisit))
|
||||||
{
|
{
|
||||||
|
|
||||||
//该标准需要添加阅片期
|
//该标准需要添加阅片期
|
||||||
@@ -1590,7 +1538,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
//判断质疑是否都关闭了
|
//判断质疑是否都关闭了
|
||||||
if (await _repository.AnyAsync<QCChallenge>(t => t.SubjectVisitId == subjectVisitId && t.IsClosed == false))
|
if (await _repository.AnyAsync<QCChallenge>(t => t.SubjectVisitId == subjectVisitId && t.IsClosed == false))
|
||||||
{
|
{
|
||||||
//---当前访视有影像质控质疑未关闭,不能进行此操作。
|
//---当前访视有影像质控质疑未关闭,不能进行此操作。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotClosed"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotClosed"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1621,7 +1569,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||||
{
|
{
|
||||||
//---项目配置影像质控为不审,不需要设置为影像质控通过。
|
//---项目配置影像质控为不审,不需要设置为影像质控通过。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCNeeded"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCNeeded"]);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1631,7 +1579,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
{
|
{
|
||||||
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.First))
|
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.First))
|
||||||
{
|
{
|
||||||
//---影像质控审核问题没有保存,不能进行此操作。
|
//---影像质控审核问题没有保存,不能进行此操作。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1651,7 +1599,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
{
|
{
|
||||||
|
|
||||||
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
||||||
|
|
||||||
if (System.IO.File.Exists(physicalPath))
|
if (System.IO.File.Exists(physicalPath))
|
||||||
{
|
{
|
||||||
File.Delete(physicalPath);
|
File.Delete(physicalPath);
|
||||||
@@ -1662,7 +1610,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//---项目配置影像质控为单审,当前访视影像质控任务不能从当前审核状态变更到 审核通过。
|
//---项目配置影像质控为单审,当前访视影像质控任务不能从当前审核状态变更到 审核通过。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NotChangePass"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NotChangePass"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1678,7 +1626,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.First))
|
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.First))
|
||||||
{
|
{
|
||||||
//---影像质控审核问题没有保存,不能进行此操作。
|
//---影像质控审核问题没有保存,不能进行此操作。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1693,7 +1641,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.Second))
|
if (!await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.Second))
|
||||||
{
|
{
|
||||||
//---影像质控审核问题没有保存,不能进行此操作。
|
//---影像质控审核问题没有保存,不能进行此操作。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1738,7 +1686,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||||
{
|
{
|
||||||
//---项目配置影像质控为不审,不允许设置影像质控终止。
|
//---项目配置影像质控为不审,不允许设置影像质控终止。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCNeededNotEnd"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoQCNeededNotEnd"]);
|
||||||
}
|
}
|
||||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
||||||
@@ -1778,7 +1726,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _qcChallengeRepository.UpdatePartialFromQueryAsync(t => t.IsClosed == false&& t.SubjectVisitId==dbSubjectVisit.Id, u => new QCChallenge() { IsClosed = true, ClosedTime=DateTime.Now, CloseResonEnum = QCChallengeCloseEnum.Unresolvable });
|
await _qcChallengeRepository.UpdatePartialFromQueryAsync(t => t.IsClosed == false && t.SubjectVisitId == dbSubjectVisit.Id, u => new QCChallenge() { IsClosed = true, ClosedTime = DateTime.Now, CloseResonEnum = QCChallengeCloseEnum.Unresolvable });
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1958,31 +1906,31 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
throw new BusinessValidationFailedException(_localizer["QCOperation_InvalidCompleteResend"]);
|
throw new BusinessValidationFailedException(_localizer["QCOperation_InvalidCompleteResend"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> modalitieTypess = new List<string>() { "PT、CT", "CT、PT", "PET-CT" };
|
List<string> modalitieTypess = new List<string>() { "PT、CT", "CT、PT", "PET-CT" };
|
||||||
// 验证临床数据 是否有Pet类型
|
// 验证临床数据 是否有Pet类型
|
||||||
#region 验证临床数据 是否有Pet类型
|
#region 验证临床数据 是否有Pet类型
|
||||||
if (await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == cRCReuploadFinishedCommand.TrialId && x.IsConfirm && x.ClinicalDataLevel == ClinicalLevel.Study))
|
if (await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == cRCReuploadFinishedCommand.TrialId && x.IsConfirm && x.ClinicalDataLevel == ClinicalLevel.Study))
|
||||||
{
|
{
|
||||||
var item = qcChallenge.SubjectVisitId;
|
var item = qcChallenge.SubjectVisitId;
|
||||||
if (await _dicomStudyRepository.AnyAsync(x => x.SubjectVisitId == item && modalitieTypess.Contains(x.Modalities)))
|
if (await _dicomStudyRepository.AnyAsync(x => x.SubjectVisitId == item && modalitieTypess.Contains(x.Modalities)))
|
||||||
{
|
{
|
||||||
var visit = await _subjectVisitRepository.Where(x => x.Id == item).FirstNotNullAsync();
|
var visit = await _subjectVisitRepository.Where(x => x.Id == item).FirstNotNullAsync();
|
||||||
var clinicalData = await this._readingClinicalDataService.GetStudyClinicalData(new Service.Reading.Dto.GetStudyClinicalDataInDto()
|
var clinicalData = await this._readingClinicalDataService.GetStudyClinicalData(new Service.Reading.Dto.GetStudyClinicalDataInDto()
|
||||||
{
|
{
|
||||||
SubjectVisitId = item,
|
SubjectVisitId = item,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!clinicalData.Any(x => x.ClinicalDataLevel == ClinicalLevel.Study && x.ClinicalUploadType == ClinicalUploadType.PDF && x.PDFFileList.Count() > 0))
|
if (!clinicalData.Any(x => x.ClinicalDataLevel == ClinicalLevel.Study && x.ClinicalUploadType == ClinicalUploadType.PDF && x.PDFFileList.Count() > 0))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["QCOperation_NeedStudyClinical"]);
|
throw new BusinessValidationFailedException(_localizer["QCOperation_NeedStudyClinical"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
var subjectVisitId = qcChallenge.SubjectVisitId;
|
var subjectVisitId = qcChallenge.SubjectVisitId;
|
||||||
|
|
||||||
if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.StudyList).CountAsync() == 0 &&
|
if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.StudyList).CountAsync() == 0 &&
|
||||||
await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.NoneDicomStudyList).SelectMany(u => u.NoneDicomFileList).CountAsync() == 0)
|
await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.NoneDicomStudyList).SelectMany(u => u.NoneDicomFileList).CountAsync() == 0)
|
||||||
@@ -2117,14 +2065,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId)
|
if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId)
|
||||||
.AnyAsync(t => t.SubmitState == SubmitStateEnum.Submitted && t.IsEnrollmentConfirm != command.IsEnrollmentConfirm))
|
.AnyAsync(t => t.SubmitState == SubmitStateEnum.Submitted && t.IsEnrollmentConfirm != command.IsEnrollmentConfirm))
|
||||||
{
|
{
|
||||||
//---该访视已提交,不能修改入组确认状态
|
//---该访视已提交,不能修改入组确认状态
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyConfirmation"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyConfirmation"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId)
|
if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId)
|
||||||
.AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack))
|
.AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack))
|
||||||
{
|
{
|
||||||
//---该访视为回退访视,不允许修改PD确认状态
|
//---该访视为回退访视,不允许修改PD确认状态
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2211,7 +2159,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId,
|
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId,
|
||||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||||
|
|
||||||
//---转发影像失败。
|
//---转发影像失败。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + result.Failures.ToString() + result.ToJson());
|
return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + result.Failures.ToString() + result.ToJson());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2231,8 +2179,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId,
|
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId,
|
||||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||||
|
|
||||||
// --转发影像失败
|
// --转发影像失败
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + e.Message);
|
return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2242,7 +2190,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||||||
|
|
||||||
await _subjectVisitRepository.SaveChangesAsync();
|
await _subjectVisitRepository.SaveChangesAsync();
|
||||||
|
|
||||||
//---转发影像失败。
|
//---转发影像失败。
|
||||||
return isSuccess ? ResponseOutput.Ok() : ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"]);
|
return isSuccess ? ResponseOutput.Ok() : ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<Trial, ExcelExportInfo>();
|
CreateMap<Trial, ExcelExportInfo>();
|
||||||
CreateMap<SubjectVisit, CRCVisitExportDTO>()
|
CreateMap<SubjectVisit, CRCVisitExportDTO>()
|
||||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
.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.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
||||||
.ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.FullName))
|
.ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.FullName))
|
||||||
|
|
||||||
@@ -253,9 +254,10 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string token = string.Empty;
|
bool isFilterZip = false;
|
||||||
|
|
||||||
|
string token = string.Empty;
|
||||||
//一致性核查
|
//一致性核查
|
||||||
CreateMap<CheckDBModel, CheckViewModel>();
|
CreateMap<CheckDBModel, CheckViewModel>();
|
||||||
|
|
||||||
@@ -560,7 +562,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<NoneDicomStudy, NoneDicomStudyView>()
|
CreateMap<NoneDicomStudy, NoneDicomStudyView>()
|
||||||
//.ForMember(d => d.FileCount, u => u.MapFrom(s => s.NoneDicomFileList.Count))
|
//.ForMember(d => d.FileCount, u => u.MapFrom(s => s.NoneDicomFileList.Count))
|
||||||
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => s.NoneDicomFileList))
|
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip? s.NoneDicomFileList.Where(t=>!t.FileType.Contains(StaticData.FileType.Zip)): s.NoneDicomFileList))
|
||||||
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
|
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -299,6 +299,13 @@ namespace IRaCIS.Application.Services
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (inDto.FilterNoneForm)
|
||||||
|
{
|
||||||
|
cRCClinicalDataList = cRCClinicalDataList.Where(x => !(x.ClinicalFromList.Count() == 0 && x.ClinicalUploadType == ClinicalUploadType.Structuring)).ToList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return cRCClinicalDataList;
|
return cRCClinicalDataList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -158,6 +158,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
|
|
||||||
public Guid? StudyId { get; set; }
|
public Guid? StudyId { get; set; }
|
||||||
|
|
||||||
|
public bool FilterNoneForm { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1696,6 +1696,20 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ResetReadingTaskOutDto
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ResetReadingTaskInDto
|
||||||
|
{
|
||||||
|
public Guid VisitTaskId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SetSkipReadingCacheInDto
|
||||||
|
{
|
||||||
|
public Guid VisitTaskId { get; set; }
|
||||||
|
}
|
||||||
public class GetNextTaskInDto
|
public class GetNextTaskInDto
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
|
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
|
||||||
|
|
||||||
Task ResetReadingRestTime(Guid? userId);
|
Task<bool> ResetReadingRestTime(Guid? userId);
|
||||||
|
|
||||||
Task<List<GetReadingPastResultListOutDto>> GetReadingPastResultList(GetReadingPastResultListInDto inDto);
|
Task<List<GetReadingPastResultListOutDto>> GetReadingPastResultList(GetReadingPastResultListInDto inDto);
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Panda.DynamicWebApi.Attributes;
|
|||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
@@ -1093,10 +1094,10 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
await _readingTableQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.TrialCriterionId == trialCriterion.Id);
|
await _readingTableQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.TrialCriterionId == trialCriterion.Id);
|
||||||
await _readingTableQuestionTrialRepository.AddRangeAsync(needAddTableDatas);
|
await _readingTableQuestionTrialRepository.AddRangeAsync(_mapper.Map<List<ReadingTableQuestionTrial>>(needAddTableDatas));
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+519
-374
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -66,7 +66,7 @@ namespace IRaCIS.Application.Services
|
|||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<(List<NoneDicomStudyView>, object)> GetReadingImageFile(GetReadingImgInDto inDto)
|
public async Task<IResponseOutput<List<NoneDicomStudyView>> > GetReadingImageFile(GetReadingImgInDto inDto)
|
||||||
{
|
{
|
||||||
var task = await GetNextTask(new GetNextTaskInDto()
|
var task = await GetNextTask(new GetNextTaskInDto()
|
||||||
{
|
{
|
||||||
@@ -84,8 +84,8 @@ namespace IRaCIS.Application.Services
|
|||||||
// 阅片期取前面所有的图像
|
// 阅片期取前面所有的图像
|
||||||
visitIds.AddRange(await _subjectVisitRepository.Where(x => x.VisitNum <= task.VisitNum && x.SubjectId == task.SubjectId).Select(x => x.Id).ToListAsync());
|
visitIds.AddRange(await _subjectVisitRepository.Where(x => x.VisitNum <= task.VisitNum && x.SubjectId == task.SubjectId).Select(x => x.Id).ToListAsync());
|
||||||
}
|
}
|
||||||
List<NoneDicomStudyView> result = await _noneDicomStudyRepository.Where(t => visitIds.Contains(t.SubjectVisitId))
|
List<NoneDicomStudyView> result = await _noneDicomStudyRepository.Where(t => visitIds.Contains(t.SubjectVisitId) && t.NoneDicomFileList.Any(t=>!t.FileType.Contains(StaticData.FileType.Zip)))
|
||||||
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken }).ToListAsync();
|
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { isFilterZip = true }).ToListAsync();
|
||||||
|
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisistTaskId).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisistTaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == task.VisitTaskId).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == task.VisitTaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
return (result, new
|
return ResponseOutput.Ok (result, new
|
||||||
{
|
{
|
||||||
VisitTaskId = task.VisitTaskId,
|
VisitTaskId = task.VisitTaskId,
|
||||||
SubjectId = task.SubjectId,
|
SubjectId = task.SubjectId,
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ namespace IRaCIS.Application.Services
|
|||||||
var existsBubjectVisitsQuery = _readModuleRepository.Where(y => y.ReadingSetType == inDto.ReadingSetType && y.TrialId == inDto.TrialId && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId).Select(x => x.SubjectVisitId);
|
var existsBubjectVisitsQuery = _readModuleRepository.Where(y => y.ReadingSetType == inDto.ReadingSetType && y.TrialId == inDto.TrialId && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId).Select(x => x.SubjectVisitId);
|
||||||
|
|
||||||
visitQuery = visitQuery.Where(x => !existsBubjectVisitsQuery.Contains(x.Id))
|
visitQuery = visitQuery.Where(x => !existsBubjectVisitsQuery.Contains(x.Id))
|
||||||
.WhereIf(inDto.ExpirationDate != null, x => x.LatestScanDate <= inDto.ExpirationDate.Value)
|
.WhereIf(inDto.ExpirationDate != null, x => x.LatestScanDate < inDto.ExpirationDate.Value.AddDays(1))
|
||||||
.WhereIf(inDto.ExpirationVisitNum != null, x => x.VisitNum == inDto.ExpirationVisitNum)
|
.WhereIf(inDto.ExpirationVisitNum != null, x => x.VisitNum == inDto.ExpirationVisitNum)
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0);
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0);
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,10 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<ReadingTableQuestionTrial, ReadingTrialTableQuestionData>()
|
CreateMap<ReadingTableQuestionTrial, ReadingTrialTableQuestionData>()
|
||||||
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id));
|
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id));
|
||||||
|
|
||||||
CreateMap<ReadingQuestionCriterionSystem, ReadingQuestionCriterionTrial>()
|
CreateMap<ReadingTrialTableQuestionData, ReadingTableQuestionTrial>();
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<ReadingQuestionCriterionSystem, ReadingQuestionCriterionTrial>()
|
||||||
.ForMember(dest => dest.ReadingQuestionTrialList, opt => opt.Ignore())
|
.ForMember(dest => dest.ReadingQuestionTrialList, opt => opt.Ignore())
|
||||||
.ForMember(d => d.ReadingQuestionCriterionSystemId, u => u.MapFrom(s => s.Id)); ;
|
.ForMember(d => d.ReadingQuestionCriterionSystemId, u => u.MapFrom(s => s.Id)); ;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
@@ -30,6 +31,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public string TrialSiteSurveyEquipmentType { get; set; } = string.Empty;
|
public string TrialSiteSurveyEquipmentType { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string Modalitys { get; set; }
|
||||||
|
|
||||||
public List<TrialSiteForSelect> TrialSiteSelectList { get; set; } = new List<TrialSiteForSelect>();
|
public List<TrialSiteForSelect> TrialSiteSelectList { get; set; } = new List<TrialSiteForSelect>();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -67,6 +70,9 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public List<TrialSiteEquipmentSurveyView> TrialSiteEquipmentSurveyList { get; set; } = new List<TrialSiteEquipmentSurveyView>();
|
public List<TrialSiteEquipmentSurveyView> TrialSiteEquipmentSurveyList { get; set; } = new List<TrialSiteEquipmentSurveyView>();
|
||||||
|
|
||||||
public List<TrialSiteUserSurveyView> TrialSiteUserSurveyList { get; set; } = new List<TrialSiteUserSurveyView>();
|
public List<TrialSiteUserSurveyView> TrialSiteUserSurveyList { get; set; } = new List<TrialSiteUserSurveyView>();
|
||||||
|
|
||||||
|
|
||||||
|
public TrialExtraConfig SiteSurveyFiledConfig { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialSiteUserSurveyAllDTO : TrialSiteUserSurveyView
|
public class TrialSiteUserSurveyAllDTO : TrialSiteUserSurveyView
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ using IRaCIS.Core.Domain.Models;
|
|||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
@@ -115,7 +117,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
}
|
}
|
||||||
else //验证码正确 并且 没有超时
|
else //验证码正确 并且 没有超时
|
||||||
{
|
{
|
||||||
var dockerInfo=await _repository.Where<Doctor>(t=>t.EMail==inDto.EmailOrPhone||t.Phone==inDto.EmailOrPhone).FirstOrDefaultAsync();
|
var dockerInfo = await _repository.Where<Doctor>(t => t.EMail == inDto.EmailOrPhone || t.Phone == inDto.EmailOrPhone).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (dockerInfo != null)
|
if (dockerInfo != null)
|
||||||
{
|
{
|
||||||
@@ -386,10 +388,12 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var result = await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId && t.TrialId == trialId).IgnoreQueryFilters()
|
var result = await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId && t.TrialId == trialId).IgnoreQueryFilters()
|
||||||
.ProjectTo<LoginReturnDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
.ProjectTo<LoginReturnDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).FirstOrDefaultAsync().IfNullThrowException();
|
||||||
|
|
||||||
|
var siteSurveryConfig = _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).Select(t => t.Trial.TrialExtraConfigJsonStr).FirstOrDefault()??string.Empty;
|
||||||
|
|
||||||
|
result.SiteSurveyFiledConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(siteSurveryConfig) ?? new TrialExtraConfig();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,11 +470,11 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
.WhereIf(surveyQueryDTO.State != null, t => t.State == surveyQueryDTO.State)
|
.WhereIf(surveyQueryDTO.State != null, t => t.State == surveyQueryDTO.State)
|
||||||
.WhereIf(surveyQueryDTO.UpdateTimeBegin != null, t => t.UpdateTime >= surveyQueryDTO.UpdateTimeBegin)
|
.WhereIf(surveyQueryDTO.UpdateTimeBegin != null, t => t.UpdateTime >= surveyQueryDTO.UpdateTimeBegin)
|
||||||
.WhereIf(surveyQueryDTO.UpdateTimeEnd != null, t => t.UpdateTime <= surveyQueryDTO.UpdateTimeEnd)
|
.WhereIf(surveyQueryDTO.UpdateTimeEnd != null, t => t.UpdateTime <= surveyQueryDTO.UpdateTimeEnd)
|
||||||
|
|
||||||
.ProjectTo<TrialSiteSurveyView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us })
|
.ProjectTo<TrialSiteSurveyView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us })
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(surveyQueryDTO.PreliminaryUserName))
|
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(surveyQueryDTO.PreliminaryUserName))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(surveyQueryDTO.ReviewerUserName))
|
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(surveyQueryDTO.ReviewerUserName))
|
||||||
;
|
;
|
||||||
|
|
||||||
return await trialSiteSurveyQueryable.ToPagedListAsync(surveyQueryDTO.PageIndex, surveyQueryDTO.PageSize, surveyQueryDTO.SortField, surveyQueryDTO.Asc);
|
return await trialSiteSurveyQueryable.ToPagedListAsync(surveyQueryDTO.PageIndex, surveyQueryDTO.PageSize, surveyQueryDTO.SortField, surveyQueryDTO.Asc);
|
||||||
}
|
}
|
||||||
@@ -497,7 +501,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
var groupSelectIdQuery =
|
var groupSelectIdQuery =
|
||||||
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||||
.WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId)
|
.WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId)
|
||||||
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||||
.GroupBy(t => t.TrialSiteId)
|
.GroupBy(t => t.TrialSiteId)
|
||||||
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||||
@@ -622,7 +626,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
+ Path.DirectorySeparatorChar.ToString()
|
+ Path.DirectorySeparatorChar.ToString()
|
||||||
+ "EmailTemplate"
|
+ "EmailTemplate"
|
||||||
+ Path.DirectorySeparatorChar.ToString()
|
+ Path.DirectorySeparatorChar.ToString()
|
||||||
+ (_userInfo.IsEn_Us ? "TrialSiteSurveyReject_US.html" : "TrialSiteSurveyReject.html") ;
|
+ (_userInfo.IsEn_Us ? "TrialSiteSurveyReject_US.html" : "TrialSiteSurveyReject.html");
|
||||||
|
|
||||||
|
|
||||||
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
||||||
@@ -722,15 +726,15 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
t.Email,
|
t.Email,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList();
|
//var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList();
|
||||||
|
|
||||||
|
|
||||||
if (!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator) )
|
if (!siteUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator || t.UserTypeEnum == UserTypeEnum.CRA))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_MissingAccount"]);
|
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_MissingAccount"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentUserList.Where(t=>t.IsGenerateAccount && t.UserTypeId!=null).GroupBy(t => new { t.UserTypeId, t.Email })
|
if (siteUserList.Where(t => t.IsGenerateAccount && t.UserTypeId != null).GroupBy(t => new { t.UserTypeId, t.Email })
|
||||||
.Any(g => g.Count() > 1))
|
.Any(g => g.Count() > 1))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_DuplicateEmail"]);
|
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_DuplicateEmail"]);
|
||||||
@@ -760,7 +764,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.Id, PreliminaryTime = DateTime.Now });
|
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.Id, PreliminaryTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager|| _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||||
{
|
{
|
||||||
|
|
||||||
var allUserList = _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ProjectTo<TrialSiteUserSurveyView>(_mapper.ConfigurationProvider).ToList();
|
var allUserList = _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ProjectTo<TrialSiteUserSurveyView>(_mapper.ConfigurationProvider).ToList();
|
||||||
@@ -934,7 +938,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
DeletedTime = DateTime.Now,
|
DeletedTime = DateTime.Now,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
await _repository.SaveChangesAsync();
|
await _repository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,9 @@ namespace IRaCIS.Core.Application.AutoMapper
|
|||||||
.ForMember(d => d.IsJoin, u => u.MapFrom(c => !c.IsDeleted));
|
.ForMember(d => d.IsJoin, u => u.MapFrom(c => !c.IsDeleted));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//列表
|
//列表
|
||||||
CreateMap<TrialSiteEquipmentSurvey, TrialSiteEquipmentSurveyView>()
|
CreateMap<TrialSiteEquipmentSurvey, TrialSiteEquipmentSurveyView>()
|
||||||
.ForMember(t => t.EquipmentType, u => u.MapFrom(d => d.EquipmentType.Value));
|
.ForMember(t => t.EquipmentType, u => u.MapFrom(d => isEn_Us? d.EquipmentType.Value: d.EquipmentType.ValueCN));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -504,7 +504,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public string CriterionModalitys { get; set; }
|
public string CriterionModalitys { get; set; }
|
||||||
|
|
||||||
public ReadingImageDownload? ImageDownloadEnum { get; set; }
|
public ReadingImageDownload ImageDownloadEnum { get; set; }
|
||||||
|
|
||||||
public ReadingImageUpload? ImageUploadEnum { get; set; }
|
public ReadingImageUpload? ImageUploadEnum { get; set; }
|
||||||
|
|
||||||
@@ -870,9 +870,9 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public bool IsImageFilter { get; set; }
|
public bool IsImageFilter { get; set; }
|
||||||
public string CriterionModalitys { get; set; }
|
public string CriterionModalitys { get; set; }
|
||||||
|
|
||||||
public ReadingImageDownload? ImageDownloadEnum { get; set; }
|
public ReadingImageDownload ImageDownloadEnum { get; set; }
|
||||||
|
|
||||||
public ReadingImageUpload? ImageUploadEnum { get; set; }
|
public ReadingImageUpload ImageUploadEnum { get; set; }
|
||||||
|
|
||||||
|
|
||||||
//是否附加评估
|
//是否附加评估
|
||||||
|
|||||||
@@ -1465,7 +1465,7 @@ namespace IRaCIS.Core.Application
|
|||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
||||||
.WhereIf(inQuery.CriterionType != null, o => o.ReadingQuestionCriterionTrialList.Any(t=>t.CriterionType==inQuery.CriterionType && t.IsSigned && t.IsConfirm))
|
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t=>t.CriterionType==inQuery.CriterionType && t.IsSigned && t.IsConfirm))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.User.EMail.Contains(inQuery.PM_EMail) && (t.User.UserTypeEnum == UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM)))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.User.EMail.Contains(inQuery.PM_EMail) && (t.User.UserTypeEnum == UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM)))
|
||||||
.Select(t => new TrialToBeDoneDto()
|
.Select(t => new TrialToBeDoneDto()
|
||||||
{
|
{
|
||||||
@@ -1525,7 +1525,7 @@ namespace IRaCIS.Core.Application
|
|||||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count() : 0,
|
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count() : 0,
|
||||||
|
|
||||||
|
|
||||||
IR_ReadingCriterionList =isIR ? t.ReadingQuestionCriterionTrialList.Where(t=>t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t=>t.CriterionName).ToList():null,
|
IR_ReadingCriterionList =isIR ? t.TrialReadingCriterionList.Where(t=>t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t=>t.CriterionName).ToList():null,
|
||||||
|
|
||||||
IR_PMEmailList= isIR ? t.TrialUserList.Where(t=>t.User.UserTypeEnum==UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.User.EMail).Select(t => t.User.EMail).ToList() : null,
|
IR_PMEmailList= isIR ? t.TrialUserList.Where(t=>t.User.UserTypeEnum==UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.User.EMail).Select(t => t.User.EMail).ToList() : null,
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using DocumentFormat.OpenXml.Office.CustomUI;
|
|||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using SixLabors.ImageSharp.Formats.Tiff.Compression.Decompressors;
|
using SixLabors.ImageSharp.Formats.Tiff.Compression.Decompressors;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application
|
namespace IRaCIS.Core.Application
|
||||||
{
|
{
|
||||||
@@ -604,7 +605,7 @@ namespace IRaCIS.Core.Application
|
|||||||
|
|
||||||
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
|
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
|
||||||
{
|
{
|
||||||
IsImageFilter=inDto.IsImageFilter,
|
IsImageFilter = inDto.IsImageFilter,
|
||||||
ImageDownloadEnum = inDto.ImageDownloadEnum,
|
ImageDownloadEnum = inDto.ImageDownloadEnum,
|
||||||
ImageUploadEnum = inDto.ImageUploadEnum,
|
ImageUploadEnum = inDto.ImageUploadEnum,
|
||||||
CriterionModalitys = inDto.CriterionModalitys,
|
CriterionModalitys = inDto.CriterionModalitys,
|
||||||
@@ -954,7 +955,7 @@ namespace IRaCIS.Core.Application
|
|||||||
trialInfo.UpdateTime = DateTime.Now;
|
trialInfo.UpdateTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
//await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialConfig.TrialId && t.IsSigned == false, u => new ReadingQuestionCriterionTrial() { CriterionModalitys = trialConfig.Modalitys });
|
//await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialConfig.TrialId && t.IsSigned == false, u => new ReadingQuestionCriterionTrial() { CriterionModalitys = trialConfig.Modalitys });
|
||||||
|
|
||||||
return ResponseOutput.Ok(await _repository.SaveChangesAsync());
|
return ResponseOutput.Ok(await _repository.SaveChangesAsync());
|
||||||
}
|
}
|
||||||
@@ -1354,5 +1355,13 @@ namespace IRaCIS.Core.Application
|
|||||||
return ResponseOutput.Ok(cro.Id.ToString(), ApiResponseCodeEnum.NeedTips);
|
return ResponseOutput.Ok(cro.Id.ToString(), ApiResponseCodeEnum.NeedTips);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<TrialExtraConfig> GetTrialExtralConfig(Guid trialId)
|
||||||
|
{
|
||||||
|
var extralConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
|
||||||
|
|
||||||
|
return JsonConvert.DeserializeObject<TrialExtraConfig>(extralConfig) ?? new TrialExtraConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
{
|
{
|
||||||
var list= _siteRepository
|
var list= _siteRepository
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(siteName), t => t.SiteName.Contains(siteName) || t.SiteNameCN.Contains(siteName) || t.AliasName.Contains(siteName))
|
.WhereIf(!string.IsNullOrWhiteSpace(siteName), t => t.SiteName.Contains(siteName) || t.SiteNameCN.Contains(siteName) || t.AliasName.Contains(siteName))
|
||||||
.Select(t => new TrialSiteSelect() { SiteId = t.Id, SiteName = t.SiteName, AliasName = t.AliasName }).ToList();
|
.Select(t => new TrialSiteSelect() { SiteId = t.Id, SiteName = _userInfo.IsEn_Us? t.SiteName:t.SiteNameCN, AliasName = t.AliasName }).ToList();
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@@ -131,6 +131,14 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
{
|
{
|
||||||
var addArray = _mapper.Map<List<TrialSite>>(trialSites);
|
var addArray = _mapper.Map<List<TrialSite>>(trialSites);
|
||||||
|
|
||||||
|
foreach (var item in addArray)
|
||||||
|
{
|
||||||
|
if (item.IsDeleted==false)
|
||||||
|
{
|
||||||
|
item.EnabledTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await _repository.AddRangeAsync(addArray);
|
await _repository.AddRangeAsync(addArray);
|
||||||
|
|
||||||
|
|
||||||
@@ -197,7 +205,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
dbEntity.EnabledTime = null;
|
dbEntity.EnabledTime = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else if (editTrialSiteCommand.IsDeleted==false && dbEntity.EnabledTime==null)
|
||||||
{
|
{
|
||||||
dbEntity.EnabledTime = DateTime.Now;
|
dbEntity.EnabledTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
CreateMap<Trial, TrialProcessConfigDTO>();
|
CreateMap<Trial, TrialProcessConfigDTO>();
|
||||||
|
|
||||||
|
|
||||||
CreateMap<ReadingQuestionCriterionTrial, TrialTaskConfigView > ()
|
|
||||||
|
CreateMap<ReadingQuestionCriterionTrial, TrialTaskConfigView>()
|
||||||
.ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum))
|
.ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum))
|
||||||
.ForMember(d => d.IsImageConsistencyVerification, u => u.MapFrom(s => s.Trial.IsImageConsistencyVerification))
|
.ForMember(d => d.IsImageConsistencyVerification, u => u.MapFrom(s => s.Trial.IsImageConsistencyVerification))
|
||||||
.ReverseMap();
|
.ReverseMap();
|
||||||
@@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<TrialJudgeTaskConfig, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId));
|
CreateMap<TrialJudgeTaskConfig, Trial>().ForMember(d => d.Id, u => u.MapFrom(s => s.TrialId));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<UserTrialCommand, TrialUser>();
|
CreateMap<UserTrialCommand, TrialUser>();
|
||||||
|
|
||||||
@@ -66,15 +66,15 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var userTypeEnumInt = 0;
|
var userTypeEnumInt = 0;
|
||||||
var isEn_Us = false;
|
var isEn_Us = false;
|
||||||
CreateMap<Trial, TrialDetailDTO>()
|
CreateMap<Trial, TrialDetailDTO>()
|
||||||
.ForMember(x=>x.CriterionList,y=>y.MapFrom(z=>z.ReadingQuestionCriterionTrialList.Where(n=>n.IsConfirm).Select(m=>m.CriterionName)))
|
.ForMember(x => x.CriterionList, y => y.MapFrom(z => z.TrialReadingCriterionList.Where(n => n.IsConfirm).Select(m => m.CriterionName)))
|
||||||
.ForMember(d => d.DictionaryList, u => u.MapFrom(s => s.TrialDicList.Select(t => t.Dictionary).OrderBy(t => t.ShowOrder)))
|
.ForMember(d => d.DictionaryList, u => u.MapFrom(s => s.TrialDicList.Select(t => t.Dictionary).OrderBy(t => t.ShowOrder)))
|
||||||
//.ForMember(d => d.Code, u => u.MapFrom(s => s.TrialCode))
|
//.ForMember(d => d.Code, u => u.MapFrom(s => s.TrialCode))
|
||||||
.ForMember(d => d.Sponsor, u => u.MapFrom(s => s.Sponsor.SponsorName))
|
.ForMember(d => d.Sponsor, u => u.MapFrom(s => s.Sponsor.SponsorName))
|
||||||
.ForMember(d => d.Phase, u => u.MapFrom(s => isEn_Us? s.Phase.Value: s.Phase.ValueCN))
|
.ForMember(d => d.Phase, u => u.MapFrom(s => isEn_Us ? s.Phase.Value : s.Phase.ValueCN))
|
||||||
//.ForMember(d => d.DeclarationType, u => u.MapFrom(s => s.DeclarationType.MappedValue))
|
//.ForMember(d => d.DeclarationType, u => u.MapFrom(s => s.DeclarationType.MappedValue))
|
||||||
.ForMember(d => d.IndicationType, u => u.MapFrom(s => isEn_Us ? s.IndicationType.Value:s.IndicationType.ValueCN))
|
.ForMember(d => d.IndicationType, u => u.MapFrom(s => isEn_Us ? s.IndicationType.Value : s.IndicationType.ValueCN))
|
||||||
.ForMember(d => d.CRO, u => u.MapFrom(s => s.CRO.CROName))
|
.ForMember(d => d.CRO, u => u.MapFrom(s => s.CRO.CROName))
|
||||||
.ForMember(d => d.ReviewMode, u => u.MapFrom(s => isEn_Us ? s.ReviewMode.Value:s.ReviewMode.ValueCN))
|
.ForMember(d => d.ReviewMode, u => u.MapFrom(s => isEn_Us ? s.ReviewMode.Value : s.ReviewMode.ValueCN))
|
||||||
//.ForMember(d => d.ReviewType, u => u.MapFrom(s => s.ReviewType.Value))
|
//.ForMember(d => d.ReviewType, u => u.MapFrom(s => s.ReviewType.Value))
|
||||||
.ForMember(d => d.IsLocked, u => u.MapFrom(s => s.WorkloadList.Any(u => u.DataFrom == (int)WorkLoadFromStatus.FinalConfirm)))
|
.ForMember(d => d.IsLocked, u => u.MapFrom(s => s.WorkloadList.Any(u => u.DataFrom == (int)WorkLoadFromStatus.FinalConfirm)))
|
||||||
//.ForMember(d => d.SiteCount, u => u.MapFrom(s => userTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator ? s.TrialSiteUserList.Count(k => k.UserId == userId) : s.TrialSiteList.Count()))
|
//.ForMember(d => d.SiteCount, u => u.MapFrom(s => userTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator ? s.TrialSiteUserList.Count(k => k.UserId == userId) : s.TrialSiteList.Count()))
|
||||||
@@ -108,32 +108,20 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
CreateMap<Site, SiteSelectDTO>()
|
CreateMap<Site, SiteSelectDTO>()
|
||||||
.ForMember(d => d.HospitalName, u => u.MapFrom(s => isEn_Us? s.Hospital.HospitalName:s.Hospital.HospitalNameCN));
|
.ForMember(d => d.HospitalName, u => u.MapFrom(s => isEn_Us ? s.Hospital.HospitalName : s.Hospital.HospitalNameCN));
|
||||||
|
|
||||||
//trial site 选择列表 subjectVisit pannel 模式添加的时候
|
//trial site 选择列表 subjectVisit pannel 模式添加的时候
|
||||||
|
|
||||||
CreateMap<Site, TrialSiteScreeningDTO>()
|
CreateMap<Site, TrialSiteScreeningDTO>()
|
||||||
.ForMember(d => d.IsSelect, u => u.MapFrom(s => s.TrialSiteList.Any(k => k.TrialId == trialId)))
|
.ForMember(d => d.IsSelect, u => u.MapFrom(s => s.TrialSiteList.Any(k => k.TrialId == trialId)))
|
||||||
.ForMember(d => d.SiteName, u => u.MapFrom(c=> isEn_Us?c.SiteName:c.SiteNameCN));
|
.ForMember(d => d.SiteName, u => u.MapFrom(c => isEn_Us ? c.SiteName : c.SiteNameCN));
|
||||||
|
|
||||||
#region 项目 stie pannel
|
#region 项目 stie pannel
|
||||||
|
|
||||||
#region site 也有country hospital 也有 注意区分
|
#region site 也有country hospital 也有 注意区分
|
||||||
CreateMap<TrialSite, SiteStatDTO>()
|
CreateMap<TrialSite, SiteStatDTO>()
|
||||||
//.ForMember(d => d.SiteCode, u => u.MapFrom(s => s.Site.SiteCode))
|
|
||||||
//.ForMember(d => d.City, u => u.MapFrom(s => s.Site.City))
|
|
||||||
//.ForMember(d => d.Country, u => u.MapFrom(s => s.Site.Country))
|
|
||||||
//.ForMember(d => d.Hospital, u => u.MapFrom(s => s.Site.Hospital.HospitalName))
|
|
||||||
|
|
||||||
|
|
||||||
//.ForMember(d => d.DirectorName, u => u.MapFrom(s => s.Site.DirectorName))
|
|
||||||
//.ForMember(d => d.DirectorPhone, u => u.MapFrom(s => s.Site.DirectorPhone))
|
|
||||||
//.ForMember(d => d.ContactPhone, u => u.MapFrom(s => s.Site.ContactPhone))
|
|
||||||
//.ForMember(d => d.Address, u => u.MapFrom(s => s.Site.Address))
|
|
||||||
//.ForMember(d => d.Site, u => u.MapFrom(s => s.Site.SiteName))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.ForMember(d => d.TrialSiteId, u => u.MapFrom(s => s.Id))
|
||||||
.ForMember(d => d.VisitCount, u => u.MapFrom(s => s.SubjectVisitList.Count()))
|
.ForMember(d => d.VisitCount, u => u.MapFrom(s => s.SubjectVisitList.Count()))
|
||||||
.ForMember(d => d.SubjectCount, u => u.MapFrom(s => s.SubjectList.Count()))
|
.ForMember(d => d.SubjectCount, u => u.MapFrom(s => s.SubjectList.Count()))
|
||||||
.ForMember(d => d.UserCount, u => u.MapFrom(s => s.CRCUserList.Count()))
|
.ForMember(d => d.UserCount, u => u.MapFrom(s => s.CRCUserList.Count()))
|
||||||
@@ -170,10 +158,10 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
CreateMap<Domain.Models.Trial, TrialConfigDTO>().ForMember(t => t.TrialId, u => u.MapFrom(c => c.Id))
|
CreateMap<Domain.Models.Trial, TrialConfigDTO>().ForMember(t => t.TrialId, u => u.MapFrom(c => c.Id))
|
||||||
.ForMember(t => t.TrialCriterionIds, u => u.MapFrom(c => c.ReadingQuestionCriterionTrialList.Where(v =>v.IsConfirm).OrderBy(x=>x.ShowOrder).Select(r => r.Id)))
|
.ForMember(t => t.TrialCriterionIds, u => u.MapFrom(c => c.TrialReadingCriterionList.Where(v => v.IsConfirm).OrderBy(x => x.ShowOrder).Select(r => r.Id)))
|
||||||
.ForMember(t => t.TrialCriterionNames, u => u.MapFrom(c => c.ReadingQuestionCriterionTrialList.Where(v => v.IsConfirm).OrderBy(x => x.ShowOrder).Select(r => r.CriterionName)))
|
.ForMember(t => t.TrialCriterionNames, u => u.MapFrom(c => c.TrialReadingCriterionList.Where(v => v.IsConfirm).OrderBy(x => x.ShowOrder).Select(r => r.CriterionName)))
|
||||||
.ForMember(t => t.ClinicalDataTrialSetIds, u => u.MapFrom(c => c.clinicalDataTrialSets.Where(v => v.IsConfirm).Select(r => r.Id)))
|
.ForMember(t => t.ClinicalDataTrialSetIds, u => u.MapFrom(c => c.clinicalDataTrialSets.Where(v => v.IsConfirm).Select(r => r.Id)))
|
||||||
.ForMember(t => t.ClinicalDataSetNames, u => u.MapFrom(c => c.clinicalDataTrialSets.Where(v => v.IsConfirm).Select(r => isEn_Us ? r.ClinicalDataSetEnName:r.ClinicalDataSetName)))
|
.ForMember(t => t.ClinicalDataSetNames, u => u.MapFrom(c => c.clinicalDataTrialSets.Where(v => v.IsConfirm).Select(r => isEn_Us ? r.ClinicalDataSetEnName : r.ClinicalDataSetName)))
|
||||||
//.ForMember(t => t.CriterionIds, u => u.MapFrom(c => c.TrialDicList.Where(v => v.KeyName == StaticData.Criterion).Select(r => r.DictionaryId)))
|
//.ForMember(t => t.CriterionIds, u => u.MapFrom(c => c.TrialDicList.Where(v => v.KeyName == StaticData.Criterion).Select(r => r.DictionaryId)))
|
||||||
;
|
;
|
||||||
CreateMap<Domain.Models.Trial, TrialSubjectConfig>();
|
CreateMap<Domain.Models.Trial, TrialSubjectConfig>();
|
||||||
@@ -191,7 +179,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<Trial, TrialSelectDTO>();
|
CreateMap<Trial, TrialSelectDTO>();
|
||||||
|
|
||||||
CreateMap<TrialUrgentConfig, Trial>();
|
CreateMap<TrialUrgentConfig, Trial>();
|
||||||
CreateMap<Trial, TrialUrgentConfig > ().ForMember(t=>t.TrialId,u=>u.MapFrom(c=>c.Id));
|
CreateMap<Trial, TrialUrgentConfig>().ForMember(t => t.TrialId, u => u.MapFrom(c => c.Id));
|
||||||
|
|
||||||
CreateMap<SignDTO, TrialSign>();
|
CreateMap<SignDTO, TrialSign>();
|
||||||
|
|
||||||
@@ -262,7 +250,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(t => t.ParentQuestionName, u => u.MapFrom(c => c.ParentReadingQuestionTrial.QuestionName))
|
.ForMember(t => t.ParentQuestionName, u => u.MapFrom(c => c.ParentReadingQuestionTrial.QuestionName))
|
||||||
.ForMember(t => t.RelevanceShowOrder, u => u.MapFrom(c => c.RelevanceReadingQuestionTrial.ShowOrder))
|
.ForMember(t => t.RelevanceShowOrder, u => u.MapFrom(c => c.RelevanceReadingQuestionTrial.ShowOrder))
|
||||||
.ForMember(t => t.ParentQuestionShowOrder, u => u.MapFrom(c => c.ParentReadingQuestionTrial.ShowOrder));
|
.ForMember(t => t.ParentQuestionShowOrder, u => u.MapFrom(c => c.ParentReadingQuestionTrial.ShowOrder));
|
||||||
|
|
||||||
CreateMap<ReadingQuestionTrial, TrialReadQuestion>()
|
CreateMap<ReadingQuestionTrial, TrialReadQuestion>()
|
||||||
.ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupName : s.GroupInfo.GroupName))
|
.ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupName : s.GroupInfo.GroupName))
|
||||||
.ForMember(d => d.GroupEnName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupEnName : s.GroupInfo.GroupEnName))
|
.ForMember(d => d.GroupEnName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupEnName : s.GroupInfo.GroupEnName))
|
||||||
@@ -317,7 +305,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(t => t.WaitSignCount, u =>
|
.ForMember(t => t.WaitSignCount, u =>
|
||||||
u.MapFrom(c => userTypeEnumInt == (int)UserTypeEnum.SuperAdmin ? 0
|
u.MapFrom(c => userTypeEnumInt == (int)UserTypeEnum.SuperAdmin ? 0
|
||||||
|
|
||||||
: c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == userTypeId) && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == userId && t.ConfirmTime!=null)).Count())
|
: c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == userTypeId) && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == userId && t.ConfirmTime != null)).Count())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public class SetSubjectVisitUrgentCommand
|
public class SetSubjectVisitUrgentCommand
|
||||||
{
|
{
|
||||||
public Guid SubjectVisitId { get; set; }
|
public Guid SubjectVisitId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public bool isUrgent { get; set; }
|
public bool isUrgent { get; set; }
|
||||||
}
|
}
|
||||||
public class SubjectVisitDTO : SubjectVisitCommand
|
public class SubjectVisitDTO : SubjectVisitCommand
|
||||||
{
|
{
|
||||||
@@ -113,7 +113,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public class UploadVisitCheckExcelDto
|
public class UploadVisitCheckExcelDto
|
||||||
{
|
{
|
||||||
|
|
||||||
public Guid trialId { get; set; }
|
public Guid trialId { get; set; }
|
||||||
|
|
||||||
public string AuditInfo { get; set; }
|
public string AuditInfo { get; set; }
|
||||||
@@ -135,7 +135,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public class SubjectVisitSelectItem
|
public class SubjectVisitSelectItem
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public decimal VisitNum { get; set; }
|
public decimal VisitNum { get; set; }
|
||||||
public string VisitName { get; set; } = String.Empty;
|
public string VisitName { get; set; } = String.Empty;
|
||||||
|
|
||||||
@@ -186,9 +186,9 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public class GetReadingVisitStudyListIndto
|
public class GetReadingVisitStudyListIndto
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
public Guid SujectVisitId { get; set; }
|
public Guid SujectVisitId { get; set; }
|
||||||
public Guid? VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -207,54 +207,54 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public class GetPTAndCtSeriesOutDto
|
public class GetPTAndCtSeriesOutDto
|
||||||
{
|
{
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
public Guid CTSeriesId { get; set; }
|
public Guid CTSeriesId { get; set; }
|
||||||
public Guid PTSeriesId { get; set; }
|
public Guid PTSeriesId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public Guid StudyId { get; set; }
|
public Guid StudyId { get; set; }
|
||||||
|
|
||||||
public Guid? SubjectVisitId { get; set; }
|
public Guid? SubjectVisitId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public bool IsBaseLineTask { get; set; }
|
public bool IsBaseLineTask { get; set; }
|
||||||
|
|
||||||
public string TaskBlindName { get; set; } = string.Empty;
|
public string TaskBlindName { get; set; } = string.Empty;
|
||||||
|
|
||||||
public List<StudyInfo> StudyInfoList { get; set; }
|
public List<StudyInfo> StudyInfoList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class StudyInfo
|
public class StudyInfo
|
||||||
{
|
{
|
||||||
public Guid StudyId { get; set; }
|
public Guid StudyId { get; set; }
|
||||||
public string StudyCode { get; set; } = String.Empty;
|
public string StudyCode { get; set; } = String.Empty;
|
||||||
|
|
||||||
public Guid SubjectVisitId { get; set; }
|
public Guid SubjectVisitId { get; set; }
|
||||||
public string Modalities { get; set; } = String.Empty;
|
public string Modalities { get; set; } = String.Empty;
|
||||||
|
|
||||||
public bool IsCriticalSequence { get; set; } = false;
|
public bool IsCriticalSequence { get; set; } = false;
|
||||||
|
|
||||||
public int SeriesCount { get; set; }
|
public int SeriesCount { get; set; }
|
||||||
public int InstanceCount { get; set; }
|
public int InstanceCount { get; set; }
|
||||||
|
|
||||||
public bool IsDicom { get; set; } = true;
|
public bool IsDicom { get; set; } = true;
|
||||||
|
|
||||||
public List<DicomSeriesDTO> CTSeriesList { get; set; }
|
public List<DicomSeriesDTO> CTSeriesList { get; set; }
|
||||||
|
|
||||||
public List<DicomSeriesDTO> PTSeriesList { get; set; }
|
public List<DicomSeriesDTO> PTSeriesList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetDicomSeriesInfoInDto
|
public class GetDicomSeriesInfoInDto
|
||||||
{
|
{
|
||||||
|
|
||||||
public Guid SeriesId { get; set; }
|
public Guid SeriesId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class GetPTAndCtSeriesInDto
|
public class GetPTAndCtSeriesInDto
|
||||||
{
|
{
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class VisitStudyDTO
|
public class VisitStudyDTO
|
||||||
{
|
{
|
||||||
@@ -264,7 +264,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public bool IsCriticalSequence { get; set; } = false;
|
public bool IsCriticalSequence { get; set; } = false;
|
||||||
|
|
||||||
public int SeriesCount { get; set; }
|
public int SeriesCount =>SeriesList.Count;
|
||||||
public int InstanceCount { get; set; }
|
public int InstanceCount { get; set; }
|
||||||
|
|
||||||
public bool IsDicom { get; set; } = true;
|
public bool IsDicom { get; set; } = true;
|
||||||
@@ -287,11 +287,11 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
//public Guid StudyMonitorId { get; set; }
|
//public Guid StudyMonitorId { get; set; }
|
||||||
public Guid? AbandonStudyId { get; set; }
|
public Guid? AbandonStudyId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public Guid SubjectVisitId { get; set; }
|
public Guid SubjectVisitId { get; set; }
|
||||||
|
|
||||||
public string StudyInstanceUid { get; set; } = String.Empty;
|
public string StudyInstanceUid { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,7 +382,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public string ErrorMesseage { get; set; } = String.Empty;
|
public string ErrorMesseage { get; set; } = String.Empty;
|
||||||
|
|
||||||
public List<UploadedSeries> UploadedSeriesList { get; set;} = new List<UploadedSeries>();
|
public List<UploadedSeries> UploadedSeriesList { get; set; } = new List<UploadedSeries>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,7 +418,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
{
|
{
|
||||||
public string StudyInstanceUid { get; set; } = String.Empty;
|
public string StudyInstanceUid { get; set; } = String.Empty;
|
||||||
|
|
||||||
public DateTime? StudyDate { get; set; }
|
public DateTime? StudyDate { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -535,10 +535,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
public string SubjectInfo { get; set; } = String.Empty;
|
public string SubjectInfo { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string VisitPlanInfo { get; set; }=String.Empty;
|
public string VisitPlanInfo { get; set; } = String.Empty;
|
||||||
|
|
||||||
public Guid? SubjectVisitId { get; set; }
|
public Guid? SubjectVisitId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public DateTime? StudyTimeBegin { get; set; }
|
public DateTime? StudyTimeBegin { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ using IRaCIS.Application.Services;
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using DocumentFormat.OpenXml.Drawing.Charts;
|
using DocumentFormat.OpenXml.Drawing.Charts;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Services
|
namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
@@ -31,6 +32,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
private readonly IRepository<DicomInstance> _dicomInstanceRepository;
|
private readonly IRepository<DicomInstance> _dicomInstanceRepository;
|
||||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||||
|
private readonly IRepository<ReadingCustomTag> _readingCustomTagRepository;
|
||||||
private readonly IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository;
|
private readonly IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository;
|
||||||
private readonly IRepository<ReadingPeriodPlan> _readingPeriodPlanRepository;
|
private readonly IRepository<ReadingPeriodPlan> _readingPeriodPlanRepository;
|
||||||
private readonly IRepository<Subject> _subjectRepository;
|
private readonly IRepository<Subject> _subjectRepository;
|
||||||
@@ -49,6 +51,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
IRepository<DicomInstance> dicomInstanceRepository,
|
IRepository<DicomInstance> dicomInstanceRepository,
|
||||||
IRepository<VisitTask> visitTaskRepository,
|
IRepository<VisitTask> visitTaskRepository,
|
||||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||||
|
IRepository<ReadingCustomTag> readingCustomTagRepository,
|
||||||
IRepository<NoneDicomStudyFile> noneDicomStudyFileRepository,
|
IRepository<NoneDicomStudyFile> noneDicomStudyFileRepository,
|
||||||
IRepository<ReadingPeriodPlan> readingPeriodPlanRepository,
|
IRepository<ReadingPeriodPlan> readingPeriodPlanRepository,
|
||||||
IRepository<Subject> subjectRepository,
|
IRepository<Subject> subjectRepository,
|
||||||
@@ -69,6 +72,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
this._dicomInstanceRepository = dicomInstanceRepository;
|
this._dicomInstanceRepository = dicomInstanceRepository;
|
||||||
this._visitTaskRepository = visitTaskRepository;
|
this._visitTaskRepository = visitTaskRepository;
|
||||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||||
|
this._readingCustomTagRepository = readingCustomTagRepository;
|
||||||
this._noneDicomStudyFileRepository = noneDicomStudyFileRepository;
|
this._noneDicomStudyFileRepository = noneDicomStudyFileRepository;
|
||||||
this._readingPeriodPlanRepository = readingPeriodPlanRepository;
|
this._readingPeriodPlanRepository = readingPeriodPlanRepository;
|
||||||
_subjectRepository = subjectRepository;
|
_subjectRepository = subjectRepository;
|
||||||
@@ -263,7 +267,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
{
|
{
|
||||||
InstanceCount = k.InstanceCount,
|
InstanceCount = k.InstanceCount,
|
||||||
Modalities = k.Modalities,
|
Modalities = k.Modalities,
|
||||||
SeriesCount = k.SeriesCount,
|
//SeriesCount = k.SeriesCount,
|
||||||
StudyCode = k.StudyCode,
|
StudyCode = k.StudyCode,
|
||||||
StudyId = k.Id
|
StudyId = k.Id
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
@@ -297,7 +301,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
);
|
);
|
||||||
|
|
||||||
//设置为阅片与否 不更改数据库检查 的instance数量 和 SeriesCount 所以这里要实时统计
|
//设置为阅片与否 不更改数据库检查 的instance数量 和 SeriesCount 所以这里要实时统计
|
||||||
t.SeriesCount = t.SeriesList.Count;
|
//t.SeriesCount = t.SeriesList.Count;
|
||||||
t.InstanceCount = t.SeriesList.SelectMany(t => t.InstanceInfoList).Count();
|
t.InstanceCount = t.SeriesList.SelectMany(t => t.InstanceInfoList).Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,8 +342,8 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth;
|
//series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth;
|
||||||
series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter;
|
//series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter;
|
||||||
|
|
||||||
return series;
|
return series;
|
||||||
}
|
}
|
||||||
@@ -445,8 +449,8 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth;
|
//series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth;
|
||||||
series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter;
|
//series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,157 +484,214 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<VisitStudyDTO>> GetReadingVisitStudyList(GetReadingVisitStudyListIndto indto)
|
public async Task<List<VisitStudyDTO>> GetReadingVisitStudyList(GetReadingVisitStudyListIndto indto)
|
||||||
{
|
{
|
||||||
var result = new List<VisitStudyDTO>();
|
|
||||||
|
|
||||||
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new
|
var studyList = new List<VisitStudyDTO>();
|
||||||
{
|
|
||||||
x.ReadingQuestionTrial.ShowOrder,
|
|
||||||
x.RowIndex,
|
|
||||||
x.SeriesId,
|
|
||||||
x.StudyId,
|
|
||||||
x.InstanceId,
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(t => new { t.TrialReadingCriterionId, t.TrialReadingCriterion.IsImageFilter, t.TrialReadingCriterion.CriterionModalitys, t.ReadingTaskState, TaskStudyCount = t.TaskStudyList.Count }).FirstNotNullAsync();
|
||||||
|
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync();
|
//影像后处理 上传了新的影像
|
||||||
|
if (taskInfo.TaskStudyCount > 0)
|
||||||
if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
var thisStudyIds = rowInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.StudyId).Distinct().ToList();
|
var taskStudyList = await _repository.Where<TaskStudy>(t => t.TrialId == indto.TrialId && t.VisitTaskId == indto.VisitTaskId).ProjectTo<VisitStudyDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
var thisSeriesIdIds = rowInfoList.Where(x => x.SeriesId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.SeriesId).Distinct().ToList();
|
|
||||||
if (rowInfoList.Count > 0)
|
foreach (var study in taskStudyList)
|
||||||
{
|
{
|
||||||
var thisVisitTaskStudy = await _repository.Where<DicomStudy>(t => thisStudyIds.Contains(t.Id)).Select(k => new VisitStudyDTO()
|
study.SeriesList = study.SeriesList.OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ToList();
|
||||||
|
|
||||||
|
//foreach (var series in study.SeriesList)
|
||||||
|
//{
|
||||||
|
// series.WindowCenter = series.InstanceInfoList.FirstOrDefault()!.WindowCenter;
|
||||||
|
// series.WindowWidth = series.InstanceInfoList.FirstOrDefault()!.WindowWidth;
|
||||||
|
//}
|
||||||
|
//study.SeriesCount = study.SeriesList.Count;
|
||||||
|
|
||||||
|
study.InstanceCount = study.SeriesList.SelectMany(t => t.InstanceInfoList).Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
studyList.AddRange(taskStudyList);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#region dicom 检查查询
|
||||||
|
|
||||||
|
//如果是手动生成的标准,需要过滤检查和序列数据
|
||||||
|
|
||||||
|
var isManualGenerate = await _trialReadingCriterionRepository.AnyAsync(t => t.Id == taskInfo.TrialReadingCriterionId && t.IsAutoCreate == false);
|
||||||
|
|
||||||
|
var dicomStudyList = await _repository.Where<DicomStudy>(t => t.TrialId == indto.TrialId && t.SubjectVisitId == indto.SujectVisitId)
|
||||||
|
.WhereIf(taskInfo.IsImageFilter == true, t => taskInfo.CriterionModalitys.Contains(t.ModalityForEdit))
|
||||||
|
.WhereIf(isManualGenerate, t => t.SubjectCriteriaEvaluationVisitStudyFilterList.Any(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsConfirmed && t.IsReading))
|
||||||
|
.Select(k => new VisitStudyDTO()
|
||||||
{
|
{
|
||||||
InstanceCount = k.InstanceCount,
|
InstanceCount = k.InstanceCount,
|
||||||
|
Modalities = k.Modalities,
|
||||||
SeriesCount = k.SeriesCount,
|
//SeriesCount = k.SeriesCount,
|
||||||
|
StudyCode = k.StudyCode,
|
||||||
StudyId = k.Id,
|
StudyId = k.Id,
|
||||||
IsCriticalSequence = true,
|
|
||||||
|
|
||||||
}).FirstOrDefaultAsync();
|
}).ToListAsync();
|
||||||
|
var studyIds = dicomStudyList.Select(t => t.StudyId).ToList();
|
||||||
|
|
||||||
if (thisVisitTaskStudy != null)
|
var instanceList = await _repository.Where<DicomInstance>(t => studyIds.Contains(t.StudyId))
|
||||||
|
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath }).ToListAsync();
|
||||||
|
|
||||||
|
List<DicomSeriesDTO> seriesLists = await _repository.Where<DicomSeries>(s => studyIds.Contains(s.StudyId))
|
||||||
|
.WhereIf(isManualGenerate == false, t => t.IsReading)
|
||||||
|
.WhereIf(isManualGenerate, t => t.SubjectCriteriaEvaluationVisitStudyFilterList.Any(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsConfirmed && t.IsReading))
|
||||||
|
.OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var t in dicomStudyList)
|
||||||
|
{
|
||||||
|
t.SeriesList = seriesLists.Where(s => s.StudyId == t.StudyId).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ToList();
|
||||||
|
|
||||||
|
t.SeriesList.ForEach(series =>
|
||||||
{
|
{
|
||||||
thisVisitTaskStudy.StudyId = default(Guid);
|
series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k =>
|
||||||
var item = await _repository.Where<DicomSeries>(s => thisSeriesIdIds.Contains(s.Id)).OrderBy(s => s.SeriesNumber).
|
new InstanceBasicInfo()
|
||||||
ThenBy(s => s.SeriesTime)
|
{
|
||||||
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
Id = k.Id,
|
||||||
|
NumberOfFrames = k.NumberOfFrames,
|
||||||
|
HtmlPath = k.HtmlPath,
|
||||||
|
Path = k.Path,
|
||||||
|
InstanceNumber = k.InstanceNumber,
|
||||||
|
|
||||||
if (item != null)
|
}).ToList();
|
||||||
|
|
||||||
|
//series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth;
|
||||||
|
//series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter;
|
||||||
|
});
|
||||||
|
|
||||||
|
//设置为阅片与否 不更改数据库检查 的instance数量 和 SeriesCount 所以这里要实时统计
|
||||||
|
//t.SeriesCount = t.SeriesList.Count;
|
||||||
|
t.InstanceCount = t.SeriesList.SelectMany(t => t.InstanceInfoList).Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
studyList.AddRange(dicomStudyList);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region dicom 关键序列处理
|
||||||
|
|
||||||
|
//已经签名的任务,加关键序列
|
||||||
|
if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||||
|
{
|
||||||
|
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new StudyInstanceInfo()
|
||||||
|
{
|
||||||
|
ShowOrder = x.ReadingQuestionTrial.ShowOrder,
|
||||||
|
RowIndex = x.RowIndex,
|
||||||
|
SeriesId = x.SeriesId,
|
||||||
|
StudyId = x.StudyId,
|
||||||
|
InstanceId = x.InstanceId,
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var customoList = await _readingCustomTagRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).Select(x => new StudyInstanceInfo()
|
||||||
|
{
|
||||||
|
ShowOrder = 0,
|
||||||
|
RowIndex = 0m,
|
||||||
|
SeriesId = x.SeriesId,
|
||||||
|
StudyId = x.StudyId,
|
||||||
|
InstanceId = x.InstanceId,
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
rowInfoList.AddRange(customoList);
|
||||||
|
|
||||||
|
var thisStudyIds = rowInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.StudyId).Distinct().ToList();
|
||||||
|
var thisSeriesIdIds = rowInfoList.Where(x => x.SeriesId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.SeriesId).Distinct().ToList();
|
||||||
|
if (rowInfoList.Count > 0)
|
||||||
|
{
|
||||||
|
var thisVisitTaskStudy = await _repository.Where<DicomStudy>(t => thisStudyIds.Contains(t.Id)).Select(k => new VisitStudyDTO()
|
||||||
{
|
{
|
||||||
item.SeriesInstanceUid = string.Empty;
|
InstanceCount = k.InstanceCount,
|
||||||
|
|
||||||
var markInstanceIdList = rowInfoList.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList();
|
//SeriesCount = k.SeriesCount,
|
||||||
|
|
||||||
item.InstanceInfoList = await _repository.Where<DicomInstance>(t => markInstanceIdList.Contains(t.Id)).OrderBy(t => t.InstanceNumber).Select(k =>
|
StudyId = k.Id,
|
||||||
new InstanceBasicInfo()
|
IsCriticalSequence = true,
|
||||||
{
|
|
||||||
Id = k.Id,
|
|
||||||
NumberOfFrames = k.NumberOfFrames,
|
|
||||||
HtmlPath = k.HtmlPath,
|
|
||||||
Path = k.Path,
|
|
||||||
InstanceNumber = k.InstanceNumber,
|
|
||||||
|
|
||||||
}).ToListAsync();
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
item.InstanceInfoList.ForEach(x =>
|
if (thisVisitTaskStudy != null)
|
||||||
|
{
|
||||||
|
thisVisitTaskStudy.StudyId = default(Guid);
|
||||||
|
var item = await _repository.Where<DicomSeries>(s => thisSeriesIdIds.Contains(s.Id)).OrderBy(s => s.SeriesNumber).
|
||||||
|
ThenBy(s => s.SeriesTime)
|
||||||
|
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (item != null)
|
||||||
{
|
{
|
||||||
|
item.SeriesInstanceUid = string.Empty;
|
||||||
|
|
||||||
var item = rowInfoList.FirstOrDefault(y => y.InstanceId == x.Id);
|
var markInstanceIdList = rowInfoList.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList();
|
||||||
if (item != null)
|
|
||||||
|
item.InstanceInfoList = await _repository.Where<DicomInstance>(t => markInstanceIdList.Contains(t.Id)).OrderBy(t => t.InstanceNumber).Select(k =>
|
||||||
|
new InstanceBasicInfo()
|
||||||
|
{
|
||||||
|
Id = k.Id,
|
||||||
|
NumberOfFrames = k.NumberOfFrames,
|
||||||
|
HtmlPath = k.HtmlPath,
|
||||||
|
Path = k.Path,
|
||||||
|
InstanceNumber = k.InstanceNumber,
|
||||||
|
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
item.InstanceInfoList.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.ShowOrder = item.ShowOrder;
|
|
||||||
x.RowIndex = item.RowIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
var item = rowInfoList.FirstOrDefault(y => y.InstanceId == x.Id);
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
x.ShowOrder = item.ShowOrder;
|
||||||
|
x.RowIndex = item.RowIndex;
|
||||||
|
}
|
||||||
|
|
||||||
item.InstanceInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).ToList();
|
});
|
||||||
|
|
||||||
|
item.InstanceInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).ToList();
|
||||||
|
|
||||||
|
|
||||||
item.InstanceCount = item.InstanceInfoList.Count;
|
item.InstanceCount = item.InstanceInfoList.Count;
|
||||||
|
|
||||||
item.Description = "Key Series";
|
item.Description = "Key Series";
|
||||||
|
|
||||||
var modalityList = await _repository.Where<DicomSeries>(s => thisSeriesIdIds.Contains(s.Id)).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).Select(x => x.Modality).Distinct().ToListAsync(); ;
|
var modalityList = await _repository.Where<DicomSeries>(s => thisSeriesIdIds.Contains(s.Id)).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).Select(x => x.Modality).Distinct().ToListAsync(); ;
|
||||||
item.Modality = string.Join(",", modalityList);
|
item.Modality = string.Join(",", modalityList);
|
||||||
thisVisitTaskStudy.SeriesList.Add(item);
|
thisVisitTaskStudy.SeriesList.Add(item);
|
||||||
thisVisitTaskStudy.SeriesCount = thisVisitTaskStudy.SeriesList.Count;
|
//thisVisitTaskStudy.SeriesCount = thisVisitTaskStudy.SeriesList.Count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
studyList.Insert(0,thisVisitTaskStudy);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
result.Add(thisVisitTaskStudy);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
studyList.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.SeriesList.ForEach(y =>
|
||||||
|
{
|
||||||
|
y.IsBeMark = rowInfoList.Any(z => z.SeriesId == y.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//如果是手动生成的标准,需要过滤检查和序列数据
|
#region 非Dicom 检查查询
|
||||||
|
|
||||||
var isManualGenerate = await _trialReadingCriterionRepository.AnyAsync(t => t.Id == taskInfo.TrialReadingCriterionId && t.IsAutoCreate == false);
|
var noDicomList = await _noneDicomStudyRepository.Where(x => x.TrialId == indto.TrialId && x.SubjectVisitId == indto.SujectVisitId && x.NoneDicomFileList.Any(t => !t.FileType.Contains(StaticData.FileType.Zip)))
|
||||||
|
.WhereIf(taskInfo.IsImageFilter == true, t => taskInfo.CriterionModalitys.Contains(t.Modality) ).ToListAsync();
|
||||||
var studyList = await _repository.Where<DicomStudy>(t => t.TrialId == indto.TrialId && t.SubjectVisitId == indto.SujectVisitId)
|
|
||||||
.WhereIf(isManualGenerate, t => t.SubjectCriteriaEvaluationVisitStudyFilterList.Any(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsConfirmed && t.IsReading))
|
|
||||||
.Select(k => new VisitStudyDTO()
|
|
||||||
{
|
|
||||||
InstanceCount = k.InstanceCount,
|
|
||||||
Modalities = k.Modalities,
|
|
||||||
SeriesCount = k.SeriesCount,
|
|
||||||
StudyCode = k.StudyCode,
|
|
||||||
StudyId = k.Id,
|
|
||||||
|
|
||||||
}).ToListAsync();
|
|
||||||
var studyIds = studyList.Select(t => t.StudyId).ToList();
|
|
||||||
|
|
||||||
var instanceList = await _repository.Where<DicomInstance>(t => studyIds.Contains(t.StudyId))
|
|
||||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath }).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<DicomSeriesDTO> seriesLists = await _repository.Where<DicomSeries>(s => studyIds.Contains(s.StudyId) /*&& s.IsReading*/)
|
|
||||||
.WhereIf(isManualGenerate == false, t => t.IsReading)
|
|
||||||
.WhereIf(isManualGenerate, t => t.SubjectCriteriaEvaluationVisitStudyFilterList.Any(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsConfirmed && t.IsReading))
|
|
||||||
.OrderBy(s => s.SeriesNumber). ThenBy(s => s.SeriesTime).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
|
||||||
|
|
||||||
foreach (var t in studyList)
|
|
||||||
{
|
|
||||||
t.SeriesList = seriesLists.Where(s => s.StudyId == t.StudyId).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ToList();
|
|
||||||
|
|
||||||
t.SeriesList.ForEach(series =>
|
|
||||||
{
|
|
||||||
series.InstanceInfoList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k =>
|
|
||||||
new InstanceBasicInfo()
|
|
||||||
{
|
|
||||||
Id = k.Id,
|
|
||||||
NumberOfFrames = k.NumberOfFrames,
|
|
||||||
HtmlPath = k.HtmlPath,
|
|
||||||
Path = k.Path,
|
|
||||||
InstanceNumber = k.InstanceNumber,
|
|
||||||
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth;
|
|
||||||
series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter;
|
|
||||||
});
|
|
||||||
|
|
||||||
//设置为阅片与否 不更改数据库检查 的instance数量 和 SeriesCount 所以这里要实时统计
|
|
||||||
t.SeriesCount = t.SeriesList.Count;
|
|
||||||
t.InstanceCount = t.SeriesList.SelectMany(t => t.InstanceInfoList).Count();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 非Dicom
|
|
||||||
|
|
||||||
var noDicomList = await _noneDicomStudyRepository.Where(x => x.TrialId == indto.TrialId && x.SubjectVisitId == indto.SujectVisitId).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
List<VisitStudyDTO> noDicomStudyList = noDicomList.Select(x => new VisitStudyDTO()
|
List<VisitStudyDTO> noDicomStudyList = noDicomList.Select(x => new VisitStudyDTO()
|
||||||
@@ -638,7 +699,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
InstanceCount = x.FileCount,
|
InstanceCount = x.FileCount,
|
||||||
StudyId = x.Id,
|
StudyId = x.Id,
|
||||||
Modalities = x.Modality,
|
Modalities = x.Modality,
|
||||||
SeriesCount = 1,
|
//SeriesCount = 1,
|
||||||
StudyCode = x.StudyCode,
|
StudyCode = x.StudyCode,
|
||||||
IsDicom = false,
|
IsDicom = false,
|
||||||
|
|
||||||
@@ -653,7 +714,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
if (instanceCount == 0)
|
if (instanceCount == 0)
|
||||||
{
|
{
|
||||||
item.SeriesList = new List<DicomSeriesDTO>();
|
item.SeriesList = new List<DicomSeriesDTO>();
|
||||||
item.SeriesCount = 0;
|
//item.SeriesCount = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -669,7 +730,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
SubjectVisitId=nodicom.SubjectVisitId,
|
SubjectVisitId=nodicom.SubjectVisitId,
|
||||||
SubjectId=nodicom.SubjectId,
|
SubjectId=nodicom.SubjectId,
|
||||||
SeriesNumber=1,
|
SeriesNumber=1,
|
||||||
NoneDicomFileFirstFile=await _noneDicomStudyFileRepository.Where(x=>x.NoneDicomStudyId==item.StudyId).Select(x=>x.Path).FirstOrDefaultAsync(),
|
NoneDicomFileFirstFile=await _noneDicomStudyFileRepository.Where(x=>x.NoneDicomStudyId==item.StudyId && !x.FileType.Contains(StaticData.FileType.Zip)).Select(x=>x.Path).FirstOrDefaultAsync(),
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -677,24 +738,14 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (studyList == null || studyList.Count == 0)
|
|
||||||
{
|
|
||||||
studyList = new List<VisitStudyDTO>();
|
|
||||||
}
|
|
||||||
|
|
||||||
studyList.AddRange(noDicomStudyList);
|
studyList.AddRange(noDicomStudyList);
|
||||||
|
|
||||||
studyList.ForEach(x =>
|
#endregion
|
||||||
{
|
|
||||||
x.SeriesList.ForEach(y =>
|
|
||||||
{
|
|
||||||
y.IsBeMark = rowInfoList.Any(z => z.SeriesId == y.Id);
|
var result = studyList.Where(x => x.SeriesCount > 0).ToList();
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
result.AddRange(studyList);
|
|
||||||
result = result.Where(x => x.SeriesCount > 0).ToList();
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||||
using IRaCIS.Core.Application.MediatR.CommandAndQueries;
|
using IRaCIS.Core.Application.MediatR.CommandAndQueries;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
|
||||||
@@ -101,6 +102,16 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.SubjectVisit.Subject.Code))
|
.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.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName))
|
||||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.SubjectVisit.TrialSite.TrialSiteCode));
|
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.SubjectVisit.TrialSite.TrialSiteCode));
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<TaskStudy, VisitStudyDTO>()
|
||||||
|
.ForMember(d => d.StudyId, u => u.MapFrom(s => s.Id))
|
||||||
|
.ForMember(d => d.SeriesList, u => u.MapFrom(s => s.SeriesList));
|
||||||
|
|
||||||
|
CreateMap<TaskSeries, DicomSeriesDTO>()
|
||||||
|
.ForMember(d => d.InstanceInfoList, u => u.MapFrom(s => s.InstanceList));
|
||||||
|
|
||||||
|
CreateMap<TaskInstance, InstanceBasicInfo>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -377,9 +377,9 @@ namespace IRaCIS.Application.Contracts
|
|||||||
|
|
||||||
public bool IsReadingPeriod { get; set; }
|
public bool IsReadingPeriod { get; set; }
|
||||||
|
|
||||||
public ReadingImageDownload? ImageDownloadEnum { get; set; }
|
public ReadingImageDownload ImageDownloadEnum { get; set; }
|
||||||
|
|
||||||
public ReadingImageUpload? ImageUploadEnum { get; set; }
|
public ReadingImageUpload ImageUploadEnum { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialCriterionReadingCategory
|
public class TrialCriterionReadingCategory
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ namespace IRaCIS.Application.Services
|
|||||||
EnrollId = intoGroup.Id,
|
EnrollId = intoGroup.Id,
|
||||||
IsEnable = allocateRule.IsEnable,
|
IsEnable = allocateRule.IsEnable,
|
||||||
|
|
||||||
TrialReadingCriterionList = intoGroup.Trial.ReadingQuestionCriterionTrialList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName, CriterionType = t.CriterionType, IsOncologyReading = t.IsOncologyReading, IsArbitrationReading = t.IsArbitrationReading, IsGlobalReading = t.IsGlobalReading, ReadingInfoSignTime = t.ReadingInfoSignTime, ReadingType = t.ReadingType }).ToList(),
|
TrialReadingCriterionList = intoGroup.Trial.TrialReadingCriterionList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName, CriterionType = t.CriterionType, IsOncologyReading = t.IsOncologyReading, IsArbitrationReading = t.IsArbitrationReading, IsGlobalReading = t.IsGlobalReading, ReadingInfoSignTime = t.ReadingInfoSignTime, ReadingType = t.ReadingType }).ToList(),
|
||||||
|
|
||||||
DoctorCriterionStatusList= intoGroup.EnrollReadingCriteriaList.Select(t=>new DoctorCriterionStatus()
|
DoctorCriterionStatusList= intoGroup.EnrollReadingCriteriaList.Select(t=>new DoctorCriterionStatus()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -194,13 +194,14 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
var trial = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
var trial = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
||||||
|
|
||||||
|
var hasSPMOrCPM = await _repository.Where<TrialUser>(t => t.TrialId == trialId).AnyAsync(t=> t.User.UserTypeEnum == UserTypeEnum.SPM || t.User.UserTypeEnum == UserTypeEnum.CPM);
|
||||||
|
|
||||||
if (trial != null)
|
if (trial != null)
|
||||||
{
|
{
|
||||||
if (commitState == 1) //确认提交CRO
|
if (commitState == 1) //确认提交CRO
|
||||||
{
|
{
|
||||||
//更新项目状态
|
//更新项目状态
|
||||||
trial.TrialEnrollStatus = (int)TrialEnrollStatus.HasCommitCRO;
|
trial.TrialEnrollStatus = hasSPMOrCPM ? (int)TrialEnrollStatus.HasCommitCRO : (int)TrialEnrollStatus.HasConfirmedDoctorNames;
|
||||||
|
|
||||||
//添加项目详细记录
|
//添加项目详细记录
|
||||||
var trialDetail = new TrialStatusDetail()
|
var trialDetail = new TrialStatusDetail()
|
||||||
@@ -217,17 +218,30 @@ namespace IRaCIS.Application.Services
|
|||||||
{
|
{
|
||||||
if (doctorIdArray.Contains(intoGroupItem.DoctorId))
|
if (doctorIdArray.Contains(intoGroupItem.DoctorId))
|
||||||
{
|
{
|
||||||
intoGroupItem.EnrollStatus = EnrollStatus.HasCommittedToCRO;
|
intoGroupItem.EnrollStatus = hasSPMOrCPM ? EnrollStatus.HasCommittedToCRO : EnrollStatus.InviteIntoGroup;
|
||||||
//_enrollRepository.Update(intoGroupItem);
|
|
||||||
|
|
||||||
await _enrollDetailRepository.AddAsync(new EnrollDetail()
|
await _enrollDetailRepository.AddAsync(new EnrollDetail()
|
||||||
{
|
{
|
||||||
TrialDetailId = trialDetail.Id,
|
TrialDetailId = trialDetail.Id,
|
||||||
DoctorId = intoGroupItem.DoctorId,
|
DoctorId = intoGroupItem.DoctorId,
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
EnrollStatus = EnrollStatus.HasCommittedToCRO,
|
EnrollStatus = hasSPMOrCPM ? EnrollStatus.HasCommittedToCRO : EnrollStatus.InviteIntoGroup,
|
||||||
OptUserType = (int)SystemUserType.AdminUser, //后台用户
|
OptUserType = (int)SystemUserType.AdminUser, //后台用户
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!hasSPMOrCPM)
|
||||||
|
{
|
||||||
|
await _enrollDetailRepository.AddAsync(new EnrollDetail()
|
||||||
|
{
|
||||||
|
TrialDetailId = trialDetail.Id,
|
||||||
|
DoctorId = intoGroupItem.DoctorId,
|
||||||
|
TrialId = trialId,
|
||||||
|
EnrollStatus = EnrollStatus.HasCommittedToCRO,
|
||||||
|
OptUserType = (int)SystemUserType.AdminUser, //后台用户
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +271,7 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return ResponseOutput.Result(await _enrollRepository.SaveChangesAsync());
|
return ResponseOutput.Result(await _enrollRepository.SaveChangesAsync(), new {IsHaveSPMOrCPM=hasSPMOrCPM});
|
||||||
}
|
}
|
||||||
//$"Cannot find trial {trialId}"
|
//$"Cannot find trial {trialId}"
|
||||||
return ResponseOutput.NotOk(_localizer["Enroll_NotFound", trialId]);
|
return ResponseOutput.NotOk(_localizer["Enroll_NotFound", trialId]);
|
||||||
|
|||||||
@@ -258,9 +258,12 @@ namespace IRaCIS.Application.Services
|
|||||||
|
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task testwwwww([FromServices] IWebHostEnvironment env)
|
public async Task<string> testEmail([FromServices] IWebHostEnvironment env ,string email)
|
||||||
{
|
{
|
||||||
await Task.CompletedTask;
|
|
||||||
|
var hiddenEmail = EmailMaskHelper.MaskEmail(email);
|
||||||
|
|
||||||
|
return hiddenEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//"Problems are as follows:
|
//"Problems are as follows:
|
||||||
dialogMsg.AppendLine($"<br/><div style='color: yellow'>{_localizer["ConsistencyVerification_Prob"]}</div>");
|
dialogMsg.AppendLine($"<br/><div style='color: red'>{_localizer["ConsistencyVerification_Prob"]}</div>");
|
||||||
|
|
||||||
num = 0;
|
num = 0;
|
||||||
foreach (var item in dbExceptExcel)
|
foreach (var item in dbExceptExcel)
|
||||||
|
|||||||
@@ -368,7 +368,9 @@ namespace IRaCIS.Core.Domain.Share
|
|||||||
|
|
||||||
Agree = 1,
|
Agree = 1,
|
||||||
|
|
||||||
Reject = 2
|
Reject = 2,
|
||||||
|
|
||||||
|
Invalid = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ReReadingApplyState
|
public enum ReReadingApplyState
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
namespace IRaCIS.Core.Domain.Share
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Domain.Share
|
||||||
{
|
{
|
||||||
public enum TrialExpedited
|
public enum TrialExpedited
|
||||||
{
|
{
|
||||||
|
|
||||||
All=-1,
|
All = -1,
|
||||||
|
|
||||||
None=0,
|
None = 0,
|
||||||
|
|
||||||
ExpeditedIn24H = 1,
|
ExpeditedIn24H = 1,
|
||||||
|
|
||||||
@@ -29,26 +31,58 @@
|
|||||||
{
|
{
|
||||||
//0全部中国医生 1美国医生 2既有中国医生,也有美国医生
|
//0全部中国医生 1美国医生 2既有中国医生,也有美国医生
|
||||||
|
|
||||||
CN=0,
|
CN = 0,
|
||||||
|
|
||||||
US=1,
|
US = 1,
|
||||||
|
|
||||||
EU=2,
|
EU = 2,
|
||||||
|
|
||||||
Other=3
|
Other = 3
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class TrialExtraConfig
|
||||||
|
{
|
||||||
|
#region MyRegion
|
||||||
|
|
||||||
|
//QC质控
|
||||||
|
public bool IsSupportQCDownloadImage { get; set; } = false;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 中心调研
|
||||||
|
|
||||||
|
public List<string> NotShowFieldList { get; set; } = new List<string>();
|
||||||
|
|
||||||
|
public List<SiteSurveyModifyFiled> ModifyFiledList { get; set; } = new List<SiteSurveyModifyFiled>();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SiteSurveyModifyFiled
|
||||||
|
{
|
||||||
|
public string NeedModifyFiled { get; set; }
|
||||||
|
|
||||||
|
public string ReplaceContent { get; set; }
|
||||||
|
|
||||||
|
public string ReplaceContentCN { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public enum DeclarationType
|
public enum DeclarationType
|
||||||
{
|
{
|
||||||
Other=3,
|
Other = 3,
|
||||||
|
|
||||||
US=1,
|
US = 1,
|
||||||
|
|
||||||
CN=0,
|
CN = 0,
|
||||||
|
|
||||||
EU=2,
|
EU = 2,
|
||||||
|
|
||||||
JP=4
|
JP = 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,6 +90,13 @@
|
|||||||
EnrollOrPD_EMailCopy=5,
|
EnrollOrPD_EMailCopy=5,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum UserMFAType
|
||||||
|
{
|
||||||
|
Login=0,
|
||||||
|
|
||||||
|
Unlock=1,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,36 +8,36 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
namespace IRaCIS.Core.Domain.Models
|
namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
///<summary>
|
///<summary>
|
||||||
///NoneDicomStudyFile
|
///NoneDicomStudyFile
|
||||||
///</summary>
|
///</summary>
|
||||||
[Table("NoneDicomStudyFile")]
|
[Table("NoneDicomStudyFile")]
|
||||||
public class NoneDicomStudyFile : Entity, IAuditAdd
|
public class NoneDicomStudyFile : Entity, IAuditAdd
|
||||||
{
|
{
|
||||||
[ForeignKey("NoneDicomStudyId")]
|
[ForeignKey("NoneDicomStudyId")]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public NoneDicomStudy NoneDicomStudy { get; set; }
|
public NoneDicomStudy NoneDicomStudy { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public Guid NoneDicomStudyId { get; set; }
|
public Guid NoneDicomStudyId { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
public string FileName { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public DateTime CreateTime { get; set; }
|
public string FileName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
public Guid CreateUserId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
[Required]
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
public string FileType { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -276,9 +276,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||||||
public List<VisitTask> VisitTaskList { get; set; }
|
public List<VisitTask> VisitTaskList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public ReadingImageDownload? ImageDownloadEnum { get; set; }
|
public ReadingImageDownload ImageDownloadEnum { get; set; }
|
||||||
|
|
||||||
public ReadingImageUpload? ImageUploadEnum { get; set; }
|
public ReadingImageUpload ImageUploadEnum { get; set; }
|
||||||
|
|
||||||
public bool IsImageFilter { get; set; }
|
public bool IsImageFilter { get; set; }
|
||||||
}
|
}
|
||||||
@@ -294,7 +294,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
|
|
||||||
IRReadingEnable = 1
|
IRReadingSubejctEnable = 1,
|
||||||
|
|
||||||
|
IRReadingVisitEnable = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<TrialUser> TrialUserList { get; set; } = new List<TrialUser>();
|
public List<TrialUser> TrialUserList { get; set; } = new List<TrialUser>();
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<ReadingQuestionCriterionTrial> ReadingQuestionCriterionTrialList { get; set; } = new List<ReadingQuestionCriterionTrial>();
|
public List<ReadingQuestionCriterionTrial> TrialReadingCriterionList { get; set; } = new List<ReadingQuestionCriterionTrial>();
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<Subject> SubjectList { get; set; } = new List<Subject>();
|
public List<Subject> SubjectList { get; set; } = new List<Subject>();
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
@@ -183,6 +183,8 @@ namespace IRaCIS.Core.Domain.Models
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public string TrialExtraConfigJsonStr { get; set; } = string.Empty;
|
||||||
|
|
||||||
public bool VisitPlanConfirmed { get; set; }
|
public bool VisitPlanConfirmed { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -271,7 +273,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public string Modalitys { get; set; } = "CT|MRI|Bone Scan|Photograph|PET|X-ray|US";
|
public string Modalitys { get; set; } = string.Empty;
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public List<string> ModalityList => Modalitys.Split('|', StringSplitOptions.RemoveEmptyEntries).Where(t => !string.IsNullOrEmpty(t)).ToList();
|
public List<string> ModalityList => Modalitys.Split('|', StringSplitOptions.RemoveEmptyEntries).Where(t => !string.IsNullOrEmpty(t)).ToList();
|
||||||
|
|||||||
@@ -248,6 +248,10 @@ namespace IRaCIS.Core.Domain.Models
|
|||||||
public string VisitImageZipPath { get; set; } = string.Empty;
|
public string VisitImageZipPath { get; set; } = string.Empty;
|
||||||
|
|
||||||
public PackState PackState { get; set; }
|
public PackState PackState { get; set; }
|
||||||
|
|
||||||
|
public PackState NoDicomPackState { get; set; }
|
||||||
|
|
||||||
|
public string VisitNoDicomImageZipPath { get; set;} = string.Empty;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 影像下载打包状态
|
/// 影像下载打包状态
|
||||||
|
|||||||
@@ -24,6 +24,17 @@ namespace IRaCIS.Core.Domain.Share
|
|||||||
public int AutoLoginOutMinutes { get; set; }
|
public int AutoLoginOutMinutes { get; set; }
|
||||||
|
|
||||||
public bool OpenLoginMFA { get; set; }
|
public bool OpenLoginMFA { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 连续阅片时间 (min)
|
||||||
|
/// </summary>
|
||||||
|
public int ContinuousReadingTimeMin { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 休息时间 (min)
|
||||||
|
/// </summary>
|
||||||
|
public int ReadingRestTimeMin { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SystemEmailSendConfig
|
public class SystemEmailSendConfig
|
||||||
@@ -41,6 +52,9 @@ namespace IRaCIS.Core.Domain.Share
|
|||||||
|
|
||||||
public string SiteUrl { get; set; }
|
public string SiteUrl { get; set; }
|
||||||
|
|
||||||
|
public string OrganizationName { get; set; }
|
||||||
|
public string OrganizationNameCN { get; set; }
|
||||||
|
|
||||||
public string CompanyName { get; set; }
|
public string CompanyName { get; set; }
|
||||||
|
|
||||||
public string CompanyNameCN { get; set; }
|
public string CompanyNameCN { get; set; }
|
||||||
|
|||||||
@@ -112,7 +112,10 @@ public static class StaticData
|
|||||||
public static readonly string UploadFileFolder = "UploadFile";
|
public static readonly string UploadFileFolder = "UploadFile";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class FileType
|
||||||
|
{
|
||||||
|
public static readonly string Zip = "zip";
|
||||||
|
}
|
||||||
|
|
||||||
public static class TrialOpt
|
public static class TrialOpt
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -165,11 +165,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||||||
case "configTrialBasicInfo/ConfigTrialBasicInfoConfirm":
|
case "configTrialBasicInfo/ConfigTrialBasicInfoConfirm":
|
||||||
extraIdentification = $"/{oldentity.IsTrialBasicLogicConfirmed.ToString()}";
|
extraIdentification = $"/{oldentity.IsTrialBasicLogicConfirmed.ToString()}";
|
||||||
break;
|
break;
|
||||||
case "configTrialBasicInfo/ConfigTrialProcessInfoConfirm":
|
case "configTrialBasicInfo/ConfigTrialProcessInfoConfirm":
|
||||||
extraIdentification = $"/{oldentity.IsTrialProcessConfirmed.ToString()}";
|
extraIdentification = $"/{oldentity.IsTrialProcessConfirmed.ToString()}";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "configTrialBasicInfo/ConfigTrialUrgentInfoConfirm":
|
case "configTrialBasicInfo/ConfigTrialUrgentInfoConfirm":
|
||||||
extraIdentification = $"/{oldentity.IsTrialUrgentConfirmed.ToString()}";
|
extraIdentification = $"/{oldentity.IsTrialUrgentConfirmed.ToString()}";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -245,11 +245,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||||||
//项目流程确认
|
//项目流程确认
|
||||||
|| _userInfo.RequestUrl == "configTrialBasicInfo/ConfigTrialProcessInfoConfirm"
|
|| _userInfo.RequestUrl == "configTrialBasicInfo/ConfigTrialProcessInfoConfirm"
|
||||||
|
|
||||||
//确认医学审核问题
|
//确认医学审核问题
|
||||||
|| _userInfo.RequestUrl == "ReadingMedicineQuestion/ConfirmReadingMedicineQuestion"
|
|| _userInfo.RequestUrl == "ReadingMedicineQuestion/ConfirmReadingMedicineQuestion"
|
||||||
|
|
||||||
//阅片单元 保存阅片规则
|
//阅片单元 保存阅片规则
|
||||||
|| _userInfo.RequestUrl == "TrialConfig/setCriterionReadingInfo"
|
|| _userInfo.RequestUrl == "TrialConfig/setCriterionReadingInfo"
|
||||||
|
|
||||||
|| _userInfo.RequestUrl == "configTrialBasicInfo/TrialReadingInfoSign")
|
|| _userInfo.RequestUrl == "configTrialBasicInfo/TrialReadingInfoSign")
|
||||||
{
|
{
|
||||||
@@ -284,7 +284,32 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||||||
.Select(t => new { t.AdditionalAssessmentType, t.IsSelected }).ToListAsync();
|
.Select(t => new { t.AdditionalAssessmentType, t.IsSelected }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
await InsertInspection<ReadingQuestionCriterionTrial>(entity, type, x => new InspectionConvertDTO()
|
var oncologyAssessIdsStr = string.Empty;
|
||||||
|
var allList = new List<ReadingTrialCriterionDictionary>();
|
||||||
|
|
||||||
|
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary)))
|
||||||
|
{
|
||||||
|
allList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary))
|
||||||
|
.Select(t => t.Entity as ReadingTrialCriterionDictionary).ToList().Where(x=>
|
||||||
|
x.CriterionId== entity.Id &&
|
||||||
|
x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess).ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
allList=await _dbContext.ReadingTrialCriterionDictionary.Where(x =>
|
||||||
|
x.CriterionId == entity.Id &&
|
||||||
|
x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//查询出字典的Value ValueCN Des 保存
|
||||||
|
var diclistOncologyAssess = allList.Select(t => t.DictionaryId).ToList();
|
||||||
|
|
||||||
|
var selectList = await _dbContext.Dictionary.Where(x => diclistOncologyAssess.Contains(x.Id)).Select(t => t.ValueCN).ToListAsync();
|
||||||
|
|
||||||
|
oncologyAssessIdsStr = string.Join(",", selectList);
|
||||||
|
|
||||||
|
await InsertInspection<ReadingQuestionCriterionTrial>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
IsDistinctionInterface = isDistinctionInterface,
|
IsDistinctionInterface = isDistinctionInterface,
|
||||||
|
|
||||||
@@ -296,7 +321,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||||||
|
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
EvaluationResultTypes = dicValueList.Count > 0 ? string.Join(",", dicValueList) : string.Empty,
|
OncologyAssessIdsStr= oncologyAssessIdsStr,
|
||||||
|
|
||||||
|
EvaluationResultTypes = dicValueList.Count > 0 ? string.Join(",", dicValueList) : string.Empty,
|
||||||
AdditionalAssessmentTypeList = addtionalAssesementList
|
AdditionalAssessmentTypeList = addtionalAssesementList
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||||||
Task<IEnumerable<TEntity>> AddRangeAsync(IEnumerable<TEntity> entities, bool autoSave = false);
|
Task<IEnumerable<TEntity>> AddRangeAsync(IEnumerable<TEntity> entities, bool autoSave = false);
|
||||||
|
|
||||||
Task<bool> SaveChangesAsync(CancellationToken cancellationToken = default);
|
Task<bool> SaveChangesAsync(CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
|
Task<bool> SaveChangesAndClearAllTrackingAsync(CancellationToken cancellationToken = default);
|
||||||
Task<bool> DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default);
|
Task<bool> DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -449,7 +449,12 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||||||
return await _dbContext.SaveChangesAsync(cancellationToken) > 0;
|
return await _dbContext.SaveChangesAsync(cancellationToken) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<bool> SaveChangesAndClearAllTrackingAsync(CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var count = await _dbContext.SaveChangesAsync(cancellationToken);
|
||||||
|
_dbContext.ChangeTracker.Clear();
|
||||||
|
return count > 0;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 不常用
|
#region 不常用
|
||||||
|
|||||||
+83
-109
@@ -1,83 +1,31 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: ssh
|
||||||
name: irc-netcore-api
|
name: ssh-linux-uat-irc-build-image
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: 386
|
||||||
|
|
||||||
clone:
|
clone:
|
||||||
disable: true
|
disable: true
|
||||||
|
|
||||||
|
server:
|
||||||
|
host: 47.117.164.182
|
||||||
|
user: root
|
||||||
|
password:
|
||||||
|
from_secret: test_ssh_pwd
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: clone-repo
|
- name: build-uat-irc
|
||||||
image: alpine/git
|
|
||||||
pull: if-not-exists
|
|
||||||
volumes:
|
|
||||||
- name: irc-test-work
|
|
||||||
path: /work
|
|
||||||
commands:
|
commands:
|
||||||
- if [ ! -e /work/netcore-repo/.git ]; then
|
- cd /opt/1panel/xc-deploy/Uat_IRC/devops-build-publish/Uat-To-Uat
|
||||||
git clone -b Test.IRC http://192.168.3.68:2000/XCKJ/irc-netcore-api.git /work/netcore-repo;
|
- sh uat-branch-latest-build-image-publish.sh v${DRONE_BUILD_NUMBER}
|
||||||
else
|
|
||||||
cd /work/netcore-repo;
|
|
||||||
git pull;
|
|
||||||
fi
|
|
||||||
|
|
||||||
- |
|
|
||||||
if [ ! -e Dockerfile ]; then
|
|
||||||
echo 'FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
|
||||||
EXPOSE 80
|
|
||||||
WORKDIR /app
|
|
||||||
COPY publish .
|
|
||||||
ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"]' > /work/Dockerfile
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: restore-publish
|
|
||||||
image: mcr.microsoft.com/dotnet/sdk:6.0
|
|
||||||
pull: if-not-exists
|
|
||||||
depends_on:
|
|
||||||
- clone-repo
|
|
||||||
volumes:
|
|
||||||
- name: nuget-packages
|
|
||||||
path: /root/.nuget/packages
|
|
||||||
- name: irc-test-work
|
|
||||||
path: /work
|
|
||||||
commands:
|
|
||||||
- cd /work/netcore-repo/IRaCIS.Core.API
|
|
||||||
- dotnet restore ./IRaCIS.Core.API.csproj
|
|
||||||
- rm -rf /work/publish
|
|
||||||
- cd /work/netcore-repo/IRaCIS.Core.API
|
|
||||||
- dotnet publish ./IRaCIS.Core.API.csproj -c Release --no-restore -o /work/publish
|
|
||||||
|
|
||||||
- name: docker-build
|
|
||||||
image: docker
|
|
||||||
pull: if-not-exists
|
|
||||||
depends_on:
|
|
||||||
- restore-publish
|
|
||||||
commands:
|
|
||||||
- cd /work
|
|
||||||
- docker build -t test-irc:v${DRONE_BUILD_NUMBER} .
|
|
||||||
volumes:
|
|
||||||
- name: irc-test-work
|
|
||||||
path: /work
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: nuget-packages
|
|
||||||
host:
|
|
||||||
path: /opt/cicd/nuget/packages
|
|
||||||
- name: irc-test-work
|
|
||||||
host:
|
|
||||||
path: /opt/cicd/irc-test
|
|
||||||
- name: dockersock
|
|
||||||
host:
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- Uat_IRC_Net8
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: ssh
|
type: ssh
|
||||||
name: ssh-linux-test-irc-publish
|
name: ssh-linux-test-irc-publish
|
||||||
@@ -98,45 +46,13 @@ server:
|
|||||||
steps:
|
steps:
|
||||||
- name: publish-test-irc
|
- name: publish-test-irc
|
||||||
commands:
|
commands:
|
||||||
- echo start publish test-irc-api
|
- cd /opt/1panel/xc-deploy/Test_IRC/devops-build-publish;sh test-irc-update-or-create-stack.sh v${DRONE_BUILD_NUMBER}
|
||||||
- cd /opt/1panel/hang/devops/test-irc-net8
|
|
||||||
- sh test-irc.sh v${DRONE_BUILD_NUMBER}
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- Test_IRC_Net8
|
- Test_IRC_Net8
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
kind: pipeline
|
|
||||||
type: ssh
|
|
||||||
name: test-irc-publish-image-push-aliyun
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: Linux
|
|
||||||
arch: 386
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: 192.168.3.68
|
|
||||||
user: root
|
|
||||||
password:
|
|
||||||
from_secret: local_pwd
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build-and-push-image
|
|
||||||
commands:
|
|
||||||
- cd /opt/hang/netcore/irc-test
|
|
||||||
- sh test-irc.sh v${DRONE_BUILD_NUMBER}
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: ssh
|
type: ssh
|
||||||
name: ssh-linux-test-study-publish
|
name: ssh-linux-test-study-publish
|
||||||
@@ -146,10 +62,10 @@ platform:
|
|||||||
arch: 386
|
arch: 386
|
||||||
|
|
||||||
clone:
|
clone:
|
||||||
disable: true
|
disable: true #禁用默认克隆
|
||||||
|
|
||||||
server:
|
server:
|
||||||
host: 123.56.94.154
|
host: 106.14.89.110
|
||||||
user: root
|
user: root
|
||||||
password:
|
password:
|
||||||
from_secret: test_ssh_pwd
|
from_secret: test_ssh_pwd
|
||||||
@@ -157,10 +73,68 @@ server:
|
|||||||
steps:
|
steps:
|
||||||
- name: publish-test-study
|
- name: publish-test-study
|
||||||
commands:
|
commands:
|
||||||
- echo start publish test-study-api
|
- cd /opt/1panel/xc-deploy/Test_Study/devops-build-publish
|
||||||
- cd /opt/1panel/hang/devops/test-study
|
|
||||||
- sh test-study.sh v${DRONE_BUILD_NUMBER}
|
- sh test-study.sh v${DRONE_BUILD_NUMBER}
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- Test.Study
|
- Test.Study
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: ssh
|
||||||
|
name: ssh-linux-test-scp-publish
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: 386
|
||||||
|
|
||||||
|
clone:
|
||||||
|
disable: true #禁用默认克隆
|
||||||
|
|
||||||
|
server:
|
||||||
|
host: 106.14.89.110
|
||||||
|
user: root
|
||||||
|
password:
|
||||||
|
from_secret: test_ssh_pwd
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: publish-test-hir-scp
|
||||||
|
commands:
|
||||||
|
- cd /opt/1panel/xc-deploy/Test_HIR_SCP/devops-build-publish;sh pull-build-test-hir-scp-image.sh v${DRONE_BUILD_NUMBER}
|
||||||
|
- cd /opt/1panel/xc-deploy/Test_HIR_SCP ;sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER}
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- Test_HIR
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
kind: pipeline
|
||||||
|
type: ssh
|
||||||
|
name: ssh-linux-test-hir-publish
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: 386
|
||||||
|
|
||||||
|
clone:
|
||||||
|
disable: true #禁用默认克隆
|
||||||
|
|
||||||
|
server:
|
||||||
|
host: 106.14.89.110
|
||||||
|
user: root
|
||||||
|
password:
|
||||||
|
from_secret: test_ssh_pwd
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: publish-test-hir
|
||||||
|
commands:
|
||||||
|
- cd /opt/1panel/xc-deploy/Test_HIR/devops-build-publish;sh pull-build-test-hir-image.sh v${DRONE_BUILD_NUMBER}
|
||||||
|
- cd /opt/1panel/xc-deploy/Test_HIR ; sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER}
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- Test_HIR
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user