Merge branch 'Test_IRC_Net10' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net10

Uat_IRC_Net10
he 2026-07-10 18:05:16 +08:00
commit 28e367eb88
10 changed files with 205 additions and 162 deletions

View File

@ -1,32 +1,28 @@
{
//
"Logging": {
//
"LogLevel": {
//
"Default": "Information",
//
"Microsoft": "Warning",
// ASP.NET Core
"Microsoft.Hosting.Lifetime": "Information"
}
},
//
"ConnectionStrings": {
//
"RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
// Hangfire
"Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
},
"WeComNoticeConfig": {
"IsOpenWeComNotice": true,
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449", //4355b98e-1e72-4678-8dfb-2fc6ad0bf449 //cdd97aab-d256-4f07-9145-a0a2b1555322
"APINoticeUserList": [ "u", "wait..." ],
"VueNoticeUserList": [ "wangxiaoshuang", "6b7717a31647293621b97b96f74e6f3d" ]
"WebhookUrl": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=4355b98e-1e72-4678-8dfb-2fc6ad0bf449",
"APINoticeUserList": [
"u",
"wait..."
],
"VueNoticeUserList": [
"wangxiaoshuang",
"6b7717a31647293621b97b96f74e6f3d"
]
},
//
"ObjectStoreService": {
// 使
"ObjectStoreUse": "AliyunOSS",
"IsOpenStoreSync": true,
"ApiDeployRegion": "CN",
@ -48,168 +44,88 @@
"IsOpenSync": true
}
],
//
"AliyunOSS": {
// OSS Region ID
"RegionId": "cn-shanghai",
// OSS 访
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
// OSS 访
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
// OSS 访 ID
"AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm",
// OSS 访 Secret
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
// OSS ARN
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
// OSS Bucket
"BucketName": "zy-irc-test-store",
// OSS 访
"ViewEndpoint": "https://zy-irc-test-dev-cache.oss-cn-shanghai.aliyuncs.com",
// OSS
"Region": "oss-cn-shanghai",
// OSS 访
"DurationSeconds": 7200,
// OSS
"PreviewEndpoint": "https://test-oss.test.extimaging.com"
},
// MinIO
"MinIO": {
// MinIO 访
"EndPoint": "hir-oss.test.extimaging.com",
// MinIO
"Port": "443",
// 使 SSL
"UseSSL": true,
// MinIO ARN
"AccessKey": "fbStsVYCIPKHQneeqMwD",
// MinIO 访
"SecretKey": "TzgvyA3zGXMUnpilJNUlyMYHfosl1hBMl6lxPmjy",
// MinIO BucketName
"BucketName": "irc-test",
// MinIO 访
"ViewEndpoint": "https://hir-oss.test.extimaging.com/irc-test"
},
// AWS S3
"AWS": {
// AWS S3 Region
"Region": "us-east-1",
// AWS S3 访
"EndPoint": "s3.us-east-1.amazonaws.com",
// 使 SSL
"UseSSL": true,
// AWS S3 ARN
"RoleArn": "arn:aws:iam::471112624751:role/uat_s3_access",
// AWS S3 访 ID
"AccessKeyId": "AKIAW3MEAFJX7IPXISP4",
// AWS S3 访 Secret
"SecretAccessKey": "Pgrg3le5jPxZQ7MR1yYNS30J0XRyJeKVyIIjElXc",
// AWS S3 Bucket
"BucketName": "ei-med-s3-lili-uat-store",
// AWS S3 访
"ViewEndpoint": "https://ei-med-s3-lili-uat-store.s3.amazonaws.com",
// AWS S3
"DurationSeconds": 7200
}
},
//
"BasicSystemConfig": {
//
"QCRiskControl": true,
//
"OpenUserComplexPassword": false,
//
"OpenSignDocumentBeforeWork": false,
//
"OpenLoginLimit": false,
//
"LoginMaxFailCount": 5,
//
"LoginFailLockMinutes": 1,
//
"AutoLoginOutMinutes": 10,
// MFA
"OpenLoginMFA": false,
//
"ContinuousReadingTimeMin": 120,
//
"ReadingRestTimeMin": 10,
//
"IsNeedChangePassWord": true,
//
"ChangePassWordDays": 90,
// 1 ElevateLiLi 2 Extensive()
"TemplateType": 2,
//
"OpenTrialRelationDelete": true,
// PDF
"OpenTrialRelationDelete": false,
"ThirdPdfUrl": "http://106.14.89.110:30088/api/v1/convert/file/pdf",
//MFA
"UserMFAVerifyMinutes": 1440
},
//
"SystemEmailSendConfig": {
// SMTP
"Host": "smtp.qiye.aliyun.com",
// SMTP
"Port": 465,
"Imap": "imap.qiye.aliyun.com",
"ImapPort": 993,
//
"FromEmail": "test@extimaging.com",
//
"FromName": "Test EIC Imaging System",
// SMTP
"AuthorizationCode": "SHzyyl2021",
// 访
"SiteUrl": "http://irc.test.extimaging.com/login",
// - 使
"SystemShortName": "IRC",
// -
"OrganizationName": "ExtImaging",
//
"OrganizationNameCN": "ExtImaging",
"PlatformName": "EICS",
"PlatformNameCN": "展影云平台",
//
"CompanyName": "Extensive Imaging",
//
"CompanyNameCN": "上海展影医疗科技有限公司",
//
"CompanyShortName": "Extensive Imaging",
//
"CompanyShortNameCN": "展影医疗",
// 便lili irc
"IsEnv_US": false,
//
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
//
"CronEmailDefaultCulture": "zh-CN"
},
// PACS
"SystemPacsConfig": {
// PACS
"Port": "11113",
// PACSIP
"IP": "106.14.89.110"
},
//
"RequestDuplicationOptions": {
//
"IsEnabled": true,
//
"DuplicationWindowMs": 500,
//
"CacheTimeSeconds": 5,
"ExcludedPaths": [
]
"ExcludedPaths": []
}
}
}

View File

@ -8,6 +8,8 @@ public static class CacheKeys
//项目缓存
public static string Trial(string trialIdStr) => $"TrialId:{trialIdStr}";
public static string TrialVisitTaskMaxCode(Guid trialId) => $"TrialVisitTaskMaxCode:{trialId}";
//检查编号递增锁
public static string TrialStudyMaxCode(Guid trialId) => $"TrialStudyMaxCode:{trialId}";

View File

@ -337,6 +337,12 @@
<param name="taskId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.GenerateTaskNo">
<summary>
从 NewId 的后 3 个字节24 位)生成一个 6 位十六进制字符串
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.GetIsClinicalDataSignTest(System.Guid)">
<summary>
获取GetIsClinicalDataSignTest
@ -17537,17 +17543,17 @@
</member>
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question">
<summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
质疑
</summary>
</member>
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency">
<summary>
һ<EFBFBD><EFBFBD><EFBFBD>Ժ˲<EFBFBD>
一致性核查
</summary>
</member>
<member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto">
<summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
复制
</summary>
</member>
<member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView">

View File

@ -439,6 +439,8 @@ namespace IRaCIS.Core.Application.ViewModel
public string TaskName { get; set; } = String.Empty;
public string TaskBlindName { get; set; } = String.Empty;
public Guid? DoctorUserId { get; set; }
public ReadingCategory? ReadingCategory { get; set; }

View File

@ -124,6 +124,45 @@ namespace IRaCIS.Core.Application.Service
}
#region 获取随机编号
/// <summary>
/// 从 NewId 的后 3 个字节24 位)生成一个 6 位十六进制字符串
/// </summary>
/// <returns></returns>
public static string GenerateTaskNo()
{
var bytes = NewId.Next().ToByteArray();
uint value =
BitConverter.ToUInt32(bytes, 0)
^ BitConverter.ToUInt32(bytes, 4)
^ BitConverter.ToUInt32(bytes, 8)
^ BitConverter.ToUInt32(bytes, 12);
return (value & 0xFFFFFF).ToString("X6");
}
private async Task<string> GetRandomTaskName(Guid trialId, List<string> existList)
{
var taskName = GenerateTaskNo();
while (existList.Any(t => t == taskName))
{
taskName = GenerateTaskNo();
}
while (await _visitTaskRepository.AnyAsync(t => t.TaskBlindName == taskName && t.TrialId == trialId))
{
taskName = GenerateTaskNo();
}
existList.Add(taskName);
return taskName;
}
#endregion
//基于标准签名 产生任务 (或者手动选择某些访视生成该标准的任务)
public async Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId, bool? isManualSelectVisit = null, List<Guid>? subjectVisitIdList = null)
@ -151,11 +190,11 @@ namespace IRaCIS.Core.Application.Service
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(trialId));
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialVisitTaskMaxCode(trialId));
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
var randomTaskBlindNameList = new List<string>();
foreach (var subjectGroup in needGenerateVisit.GroupBy(t => t.SubjectId).Select(g => new { SubjectId = g.Key, SubjectVisitList = g.ToList() }))
{
@ -173,6 +212,8 @@ namespace IRaCIS.Core.Application.Service
var blindTaskName = string.Empty;
var isRandom = false;
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
{
if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0 && subjectVisit.VisitNum == 0)
@ -185,6 +226,12 @@ namespace IRaCIS.Core.Application.Service
}
}
else if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.Random)
{
blindTaskName = await GetRandomTaskName(trialId, randomTaskBlindNameList);
isRandom = true;
}
else
{
blindTaskName = "Timepoint";
@ -258,12 +305,14 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
var blindTaskName2 = isRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : blindTaskName;
task2 = await _visitTaskRepository.AddAsync(new VisitTask()
{
TrialId = trialId,
SubjectId = subjectVisit.SubjectId,
IsUrgent = subjectVisit.IsUrgent,
TaskBlindName = blindTaskName,
TaskBlindName = blindTaskName2,
TaskName = subjectVisit.VisitName,
TaskUrgentType = taskUrgentType,
IsCanEditUrgentState = isCanEditUrgentState,
@ -283,7 +332,7 @@ namespace IRaCIS.Core.Application.Service
}
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
@ -344,7 +393,7 @@ namespace IRaCIS.Core.Application.Service
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
@ -590,11 +639,11 @@ namespace IRaCIS.Core.Application.Service
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialStudyMaxCode(trialId));
var cacheMaxCodeInt = _fusionCache.GetOrDefault<int>(CacheKeys.TrialVisitTaskMaxCode(trialId));
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
var randomTaskBlindNameList = new List<string>();
switch (generateTaskCommand.ReadingCategory)
@ -654,7 +703,9 @@ namespace IRaCIS.Core.Application.Service
var isFrontTaskNeedSignButNotSign = await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TaskState == TaskState.Effect && t.VisitTaskNum < subjectVisit.VisitNum && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false);
var blindTaskName = string.Empty;
var isFullRandom = false;
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
{
@ -668,6 +719,12 @@ namespace IRaCIS.Core.Application.Service
}
}
else if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.Random)
{
blindTaskName = await GetRandomTaskName(trialId, randomTaskBlindNameList);
isFullRandom = true;
}
//受试者随机
else
{
blindTaskName = "Timepoint";
@ -721,11 +778,15 @@ namespace IRaCIS.Core.Application.Service
if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2))
{
currentMaxCodeInt = currentMaxCodeInt + 1;
var blindTaskName2 = isFullRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : blindTaskName;
task2 = await _visitTaskRepository.AddAsync(new VisitTask()
{
TrialId = trialId,
SubjectId = subjectVisit.SubjectId,
TaskBlindName = blindTaskName,
TaskBlindName = blindTaskName2,
TaskName = subjectVisit.VisitName,
IsUrgent = subjectVisit.IsUrgent,
@ -747,7 +808,7 @@ namespace IRaCIS.Core.Application.Service
}
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
#region 分配
@ -920,7 +981,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
}
}
@ -992,7 +1053,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
}
}
@ -1069,7 +1130,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
#region 分配
@ -1197,7 +1258,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
}
}
@ -1277,6 +1338,7 @@ namespace IRaCIS.Core.Application.Service
var reReadingVisitTask = generateTaskCommand.ReReadingTask;
Guid? subjectVisitId = Guid.Empty;
if (reReadingVisitTask.SourceSubjectVisitId == null)
@ -1317,6 +1379,10 @@ namespace IRaCIS.Core.Application.Service
//&& t.TrialReadingCriterionId == reReadingVisitTask.TrialReadingCriterionId && t.TaskState == TaskState.Effect
// && t.SourceSubjectVisitId == reReadingVisitTask.SourceSubjectVisitId && t.ArmEnum == reReadingVisitTask.ArmEnum && t.DoctorUserId == reReadingVisitTask.DoctorUserId).FirstOrDefault();
var isRandomReading = trialReadingCriterionConfigList.FirstOrDefault(t => t.TrialReadingCriterionId == reReadingVisitTask.TrialReadingCriterionId)?.IsReadingTaskViewInOrder == ReadingOrder.Random;
var taskBlindName = isRandomReading ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : reReadingVisitTask.TaskBlindName;
var newTask = await _visitTaskRepository.AddAsync(new VisitTask()
{
@ -1325,7 +1391,7 @@ namespace IRaCIS.Core.Application.Service
SubjectId = reReadingVisitTask.SubjectId,
ArmEnum = reReadingVisitTask.ArmEnum,
TaskName = reReadingVisitTask.TaskName,
TaskBlindName = reReadingVisitTask.TaskBlindName,
TaskBlindName = taskBlindName,
IsUrgent = reReadingVisitTask.IsAnalysisCreate ? false : subjectVisitUrgentInfo.IsUrgent,
TaskUrgentType = reReadingVisitTask.IsAnalysisCreate ? null : taskUrgent,
@ -1386,7 +1452,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
//}
@ -1491,7 +1557,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
}
break;
@ -1538,7 +1604,7 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
}
break;
@ -1548,6 +1614,11 @@ namespace IRaCIS.Core.Application.Service
var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm && x.IsConfirmed && x.TrialReadingCriterionId == firstTask.TrialReadingCriterionId).FirstOrDefaultAsync();
var isRandom = trialReadingCriterionConfigList.FirstOrDefault(t => t.TrialReadingCriterionId == firstTask.TrialReadingCriterionId)?.IsReadingTaskViewInOrder == ReadingOrder.Random;
var blindName = isRandom ? await GetRandomTaskName(trialId, randomTaskBlindNameList) : firstTask.TaskBlindName;
VisitTask visitTask = new VisitTask()
{
ArmEnum = Arm.JudgeArm,
@ -1564,7 +1635,7 @@ namespace IRaCIS.Core.Application.Service
SouceReadModuleId = firstTask.SouceReadModuleId,
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
TaskState = TaskState.Effect,
TaskBlindName = firstTask.TaskBlindName,
TaskBlindName = blindName,
DoctorUserId = subjectUser == null ? null : subjectUser.DoctorUserId,
TaskAllocationState = subjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated,
AllocateTime = subjectUser == null ? null : DateTime.Now,
@ -1576,7 +1647,7 @@ namespace IRaCIS.Core.Application.Service
await _visitTaskRepository.AddAsync(visitTask);
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id), x => new VisitTask()
{
@ -1637,7 +1708,7 @@ namespace IRaCIS.Core.Application.Service
});
currentMaxCodeInt = currentMaxCodeInt + 1;
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
}
}
@ -1707,7 +1778,7 @@ namespace IRaCIS.Core.Application.Service
TrialId = originalTaskInfo.TrialId
});
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
_fusionCache.Set<int>(CacheKeys.TrialVisitTaskMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
}
break;
}

View File

@ -854,7 +854,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ReReadingTaskView>> GetIRReReadingTaskList(VisitTaskQuery inQuery)
public async Task<IResponseOutput<PageOutput<ReReadingTaskView>>> GetIRReReadingTaskList(VisitTaskQuery inQuery)
{
var visitTaskQueryable = _visitTaskReReadingRepository
@ -878,6 +878,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.OriginalReReadingTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate) || (t.OriginalReReadingTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.OriginalReReadingTask.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.OriginalReReadingTask.TaskName.Contains(inQuery.TaskName) || t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskBlindName), t => t.NewReReadingTask.TaskBlindName.Contains(inQuery.TaskBlindName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.OriginalReReadingTask.Subject.Code.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate == false) || (t.OriginalReReadingTask.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.OriginalReReadingTask.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.OriginalReReadingTask.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
@ -889,7 +890,11 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
return ResponseOutput.Ok(pageList, criterionInfo);
}
@ -1242,7 +1247,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<IRHaveReadView>> GetIRHaveReadTaskList(VisitTaskQuery inQuery)
public async Task<IResponseOutput<PageOutput<IRHaveReadView>>> GetIRHaveReadTaskList(VisitTaskQuery inQuery)
{
@ -1261,6 +1266,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskBlindName), t => t.TaskBlindName.Contains(inQuery.TaskBlindName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
@ -1270,7 +1276,10 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
var pageList = await visitTaskQueryable.ToPagedListAsync(inQuery, defalutSortArray);
return pageList;
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
return ResponseOutput.Ok(pageList, criterionInfo);
}
@ -2267,7 +2276,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
_ = _taskSeriesRepository.AddAsync(newSeries).Result;
var studyInstanceList = taskInstanceList.Where(t => t.StudyId == taskStudy.Id).ToList();
var studyInstanceList = taskInstanceList.Where(t => t.StudyId == taskStudy.Id && t.SeriesId == series.Id).ToList();
foreach (var instance in studyInstanceList)
{

View File

@ -4,6 +4,7 @@ using Medallion.Threading;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
@ -16,7 +17,7 @@ using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Service.Common;
[ApiExplorerSettings(GroupName = "Common")]
public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _distributedLockProvider, IUserInfo _userInfo, IWebHostEnvironment _hostEnvironment, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService
public class DeployConfigService(IMapper _mapper, IConfiguration _configuration, IDistributedLockProvider _distributedLockProvider, IUserInfo _userInfo, IWebHostEnvironment _hostEnvironment, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService
{
/// <summary>
@ -26,7 +27,18 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
/// <returns></returns>
public async Task<ServiceVerifyConfigOption> GetSystemBasicConfigInfo([FromServices] IOptionsMonitor<ServiceVerifyConfigOption> options)
{
return options.CurrentValue;
//var config = _configuration.GetSection("BasicSystemConfig").Get<ServiceVerifyConfigOption>();
//return config;
var path = Path.Combine( _hostEnvironment.ContentRootPath,$"appsettings.{_hostEnvironment.EnvironmentName}.json");
var json = File.ReadAllText(path);
var obj = JObject.Parse(json);
return obj["BasicSystemConfig"]!.ToObject<ServiceVerifyConfigOption>()!;
}
/// <summary>
@ -37,7 +49,8 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
[HttpPost]
public async Task<IResponseOutput> UpdateSystemBasicConfig(ServiceVerifyConfigOption basicSystemConfigOption)
{
var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
//var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
@ -73,6 +86,7 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
// 重新写入appsettings.json
string result = obj.ToString();
System.IO.File.WriteAllText(path, result);
}
@ -86,7 +100,18 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
/// <returns></returns>
public async Task<SystemEmailSendConfig> GetEmailConfigInfo([FromServices] IOptionsMonitor<SystemEmailSendConfig> options)
{
return options.CurrentValue;
//两种方式都有问题
//var config = _configuration.GetSection("BasicSystemConfig").Get<SystemEmailSendConfig>();
//return config;
//return options.CurrentValue;
var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
var json = File.ReadAllText(path);
var obj = JObject.Parse(json);
return obj["SystemEmailSendConfig"]!.ToObject<SystemEmailSendConfig>()!;
}
@ -98,7 +123,8 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
[HttpPost]
public async Task<IResponseOutput> UpdateSystemEmailConfig(SystemEmailSendConfig emailConfig)
{
var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
var path = Path.Combine(_hostEnvironment.ContentRootPath,$"appsettings.{_hostEnvironment.EnvironmentName}.json");
//var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
@ -139,6 +165,7 @@ public class DeployConfigService(IMapper _mapper, IDistributedLockProvider _dist
string result = obj.ToString();
System.IO.File.WriteAllText(path, result);
}
return ResponseOutput.Ok();

View File

@ -58,8 +58,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{
//subject 随机阅片 或者无序 有上传 才处理任务编号
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId &&
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom ||
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageDownloadEnum != ReadingImageDownload.None))))
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom
//||(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageDownloadEnum != ReadingImageDownload.None)
)))
{
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId

View File

@ -246,9 +246,9 @@ namespace IRaCIS.Core.Application.Service
var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
{
Answer = x.Answer,
Unit=x.ReadingQuestionTrial.Unit,
ValueType=x.ReadingQuestionTrial.ValueType,
CustomUnit=x.ReadingQuestionTrial.CustomUnit,
Unit = x.ReadingQuestionTrial.Unit,
ValueType = x.ReadingQuestionTrial.ValueType,
CustomUnit = x.ReadingQuestionTrial.CustomUnit,
VisitTaskId = x.VisitTaskId,
DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
ShowOrder = x.ReadingQuestionTrial.ShowOrder,
@ -643,8 +643,8 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<string> TestGetJointMedicalReviewDialog(Guid id)
{
var dialog = await _readingMedicalReviewDialogRepository.Where(x => x.Id == id)
.ProjectTo<GetMedicalReviewDialogOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
var dialog = await _readingMedicalReviewDialogRepository.Where(x => x.Id == id)
.ProjectTo<GetMedicalReviewDialogOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
Dictionary<string, string> i18NKeys = new Dictionary<string, string>()
@ -661,11 +661,11 @@ namespace IRaCIS.Core.Application.Service
};
var i18Values = i18NKeys.Select(x => x.Value).ToList();
var i18nList=await _internationalizationRepository.Where(x => i18Values.Contains(x.Code))
.Select(x => new
var i18nList = await _internationalizationRepository.Where(x => i18Values.Contains(x.Code))
.Select(x => new
{
Code= x.Code,
Value= _userInfo.IsEn_Us?x.Value:x.ValueCN
Code = x.Code,
Value = _userInfo.IsEn_Us ? x.Value : x.ValueCN
}).ToListAsync();
List<string> dictionaryCodeList = new List<string>()
@ -676,16 +676,16 @@ namespace IRaCIS.Core.Application.Service
"YesOrNo",
};
var dictionadParents=await _dictionaryRepository.Where(x=> dictionaryCodeList.Contains(x.Parent.Code))
var dictionadParents = await _dictionaryRepository.Where(x => dictionaryCodeList.Contains(x.Parent.Code))
.Select(x => new
{
ParentCode = x.Parent.Code,
Code=x.Code,
Code = x.Code,
Value = _userInfo.IsEn_Us ? x.Value : x.ValueCN
}).ToListAsync();
JointMedicalReviewI18n i18N = new JointMedicalReviewI18n() { };
foreach (var kv in i18NKeys)
foreach (var kv in i18NKeys)
{
PropertyInfo? pi = i18N.GetType().GetProperty(kv.Key);
if (pi != null && pi.CanWrite)
@ -706,7 +706,7 @@ namespace IRaCIS.Core.Application.Service
}
}
return await JointMedicalReviewDialog(dialog,i18N);
return await JointMedicalReviewDialog(dialog, i18N);
@ -910,7 +910,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<GetIRMedicalFeedbackListOutDto> GetNextIRMedicalFeedback(GetNextIRMedicalFeedbackInDto inDto)
{
var list = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
var responseOutput = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
{
TrialId = inDto.TrialId,
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
@ -919,6 +919,8 @@ namespace IRaCIS.Core.Application.Service
PageSize = 99999,
});
var list = responseOutput.Data;
var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId);
var result = new GetIRMedicalFeedbackListOutDto() { };
@ -949,12 +951,12 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<GetIRMedicalFeedbackListOutDto>> GetIRMedicalFeedbackList(GetIRMedicalFeedbackListInDto inDto)
public async Task<IResponseOutput<PageOutput<GetIRMedicalFeedbackListOutDto>>> GetIRMedicalFeedbackList(GetIRMedicalFeedbackListInDto inDto)
{
var taskMedicalReviewquery = _taskMedicalReviewRepository.Where(x => x.TrialId == inDto.TrialId).Include(x => x.VisitTask)
.Where(x => x.VisitTask.DoctorUserId == _userInfo.UserRoleId)
.Where(x => x.IsHaveQuestion)
.WhereIf(!inDto.TaskBlindName.IsNullOrEmpty(), x => x.VisitTask.TaskBlindName == inDto.TaskBlindName)
.WhereIf(!inDto.TaskBlindName.IsNullOrEmpty(), x => x.VisitTask.TaskBlindName.Contains(inDto.TaskBlindName))
.WhereIf(inDto.SubjectId != null, x => x.VisitTask.SubjectId == inDto.SubjectId!)
.WhereIf(inDto.IsUrgent != null, x => x.VisitTask.IsUrgent == inDto.IsUrgent!)
.WhereIf(inDto.AuditState != null, x => x.AuditState == inDto.AuditState!)
@ -1004,7 +1006,11 @@ namespace IRaCIS.Core.Application.Service
var result = await taskMedicalReviewquery.ToPagedListAsync(inDto, nameof(GetIRMedicalFeedbackListOutDto.AuditState));
return result;
var criterionInfo = await _readingQuestionCriterionTrial.Where(t => t.Id == inDto.TrialReadingCriterionId)
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
return ResponseOutput.Ok(result, criterionInfo);
}
}
}

View File

@ -920,7 +920,7 @@ namespace IRaCIS.Core.Application.Contracts
var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault();
foreach (var item in needGenerateList.GroupBy(t => t.Email))
foreach (var item in needSendEmailList.GroupBy(t => t.Email))
{
var addUserRoleList = item.ToList();
@ -1137,23 +1137,26 @@ namespace IRaCIS.Core.Application.Contracts
await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => userJoinIdList.Contains(t.Id), u => new TrialSiteUserSurvey() { IsJoin = true, SystemUserId = existSysUser.Id });
//中心调研设置用户角色退出
var needQuitUserList = item.Where(t => t.IsHistoryUser && t.IsHistoryUserOriginDeleted == false && t.IsHistoryUserDeleted == true).ToList();
var queitUserTypeIdList = needQuitUserList.Select(t => t.UserTypeId).ToList();
await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId && queitUserTypeIdList.Contains(t.UserRole.UserTypeId), c => new TrialSiteUserRole()
{
IsDeleted = true,
DeletedTime = DateTime.Now,
});
await _trialSiteUserRoleRepository.SaveChangesAsync();
}
//中心调研设置用户角色退出
var needQuitUserList = allUserList.Where(t => t.IsHistoryUser && t.IsHistoryUserOriginDeleted == false && t.IsHistoryUserDeleted == true).ToList();
var queitUserTypeIdList = needQuitUserList.Select(t => t.UserTypeId).ToList();
await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId && queitUserTypeIdList.Contains(t.UserRole.UserTypeId), c => new TrialSiteUserRole()
{
IsDeleted = true,
DeletedTime = DateTime.Now,
});
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.UserRoleId, ReviewerTime = DateTime.Now });
}