diff --git a/IRC.Core.Dicom/BusinessFilter/ProjectExceptionFilter.cs b/IRC.Core.Dicom/BusinessFilter/ProjectExceptionFilter.cs
index 0952bc457..0021a15d9 100644
--- a/IRC.Core.Dicom/BusinessFilter/ProjectExceptionFilter.cs
+++ b/IRC.Core.Dicom/BusinessFilter/ProjectExceptionFilter.cs
@@ -43,7 +43,7 @@ namespace IRaCIS.Core.SCP.Filter
else
{
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["Project_ExceptionContactDeveloper"] + (context.Exception.InnerException is null ? (context.Exception.Message /*+ context.Exception.StackTrace*/)
- : (context.Exception.InnerException?.Message /*+ context.Exception.InnerException?.StackTrace*/)), ApiResponseCodeEnum.ProgramException));
+ : (context.Exception.InnerException?.Message /*+ context.Exception.InnerException?.StackTrace*/)), ApiResponseCodeEnum.BackEndAnomaly));
}
diff --git a/IRC.Core.SCP/BusinessFilter/ProjectExceptionFilter.cs b/IRC.Core.SCP/BusinessFilter/ProjectExceptionFilter.cs
index 0952bc457..0021a15d9 100644
--- a/IRC.Core.SCP/BusinessFilter/ProjectExceptionFilter.cs
+++ b/IRC.Core.SCP/BusinessFilter/ProjectExceptionFilter.cs
@@ -43,7 +43,7 @@ namespace IRaCIS.Core.SCP.Filter
else
{
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["Project_ExceptionContactDeveloper"] + (context.Exception.InnerException is null ? (context.Exception.Message /*+ context.Exception.StackTrace*/)
- : (context.Exception.InnerException?.Message /*+ context.Exception.InnerException?.StackTrace*/)), ApiResponseCodeEnum.ProgramException));
+ : (context.Exception.InnerException?.Message /*+ context.Exception.InnerException?.StackTrace*/)), ApiResponseCodeEnum.BackEndAnomaly));
}
diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs
index 88534140b..f9798cd6b 100644
--- a/IRaCIS.Core.API/Controllers/InspectionController.cs
+++ b/IRaCIS.Core.API/Controllers/InspectionController.cs
@@ -351,6 +351,23 @@ namespace IRaCIS.Core.API.Controllers
return result;
}
+ ///
+ /// 提交阅片裁判表单
+ ///
+ ///
+ ///
+ [HttpPost, Route("Inspection/ReadingImageTask/SubmitJudgeForm")]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
+
+ [UnitOfWork]
+
+ public async Task SubmitJudgeForm(DataInspectionDto opt)
+ {
+ var singid = await _inspectionService.RecordSing(opt.SignInfo);
+ var result = await _iReadingImageTaskService.SubmitJudgeForm(opt.Data);
+ await _inspectionService.CompletedSign(singid, result);
+ return result;
+ }
///
/// 配置 基础逻辑信息并确认
diff --git a/IRaCIS.Core.API/appsettings.Test_IRC.json b/IRaCIS.Core.API/appsettings.Test_IRC.json
index 50a4c7090..fae372b3d 100644
--- a/IRaCIS.Core.API/appsettings.Test_IRC.json
+++ b/IRaCIS.Core.API/appsettings.Test_IRC.json
@@ -127,5 +127,6 @@
"DuplicationWindowMs": 500,
"CacheTimeSeconds": 5,
"ExcludedPaths": []
- }
+ },
+ "FrontWebConfig": "222"
}
\ No newline at end of file
diff --git a/IRaCIS.Core.Application/BusinessFilter/LegacyController/ModelActionFilter .cs b/IRaCIS.Core.Application/BusinessFilter/LegacyController/ModelActionFilter .cs
index 65552ebcf..fbdd24ea6 100644
--- a/IRaCIS.Core.Application/BusinessFilter/LegacyController/ModelActionFilter .cs
+++ b/IRaCIS.Core.Application/BusinessFilter/LegacyController/ModelActionFilter .cs
@@ -75,7 +75,7 @@ public class ModelActionFilter(IStringLocalizer _localizer, IConfiguration _conf
//---提供给接口的参数无效。
- context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["ModelAction_InvalidAPIParameter"] + JsonConvert.SerializeObject(validationErrors)));
+ context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["ModelAction_InvalidAPIParameter"] + JsonConvert.SerializeObject(validationErrors), ApiResponseCodeEnum.BackEndAnomaly));
}
}
}
diff --git a/IRaCIS.Core.Application/BusinessFilter/LegacyController/ProjectExceptionFilter.cs b/IRaCIS.Core.Application/BusinessFilter/LegacyController/ProjectExceptionFilter.cs
index eeb70dcc9..c535bacf1 100644
--- a/IRaCIS.Core.Application/BusinessFilter/LegacyController/ProjectExceptionFilter.cs
+++ b/IRaCIS.Core.Application/BusinessFilter/LegacyController/ProjectExceptionFilter.cs
@@ -49,7 +49,7 @@ public class ProjectExceptionFilter(ILogger _logger, ISt
else
{
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["Project_ExceptionContactDeveloper"] + (exception.InnerException is null ? (exception.Message)
- : (exception.Message + "Inner ExceptionMsg:" + exception.InnerException?.Message)), ApiResponseCodeEnum.ProgramException));
+ : (exception.Message + "Inner ExceptionMsg:" + exception.InnerException?.Message)), ApiResponseCodeEnum.BackEndAnomaly));
try
{
diff --git a/IRaCIS.Core.Application/BusinessFilter/MinimalAPI/GlobalExceptionHandler.cs b/IRaCIS.Core.Application/BusinessFilter/MinimalAPI/GlobalExceptionHandler.cs
index 1cdec4619..dd3603e53 100644
--- a/IRaCIS.Core.Application/BusinessFilter/MinimalAPI/GlobalExceptionHandler.cs
+++ b/IRaCIS.Core.Application/BusinessFilter/MinimalAPI/GlobalExceptionHandler.cs
@@ -58,7 +58,7 @@ public class GlobalExceptionHandler(IStringLocalizer _localizer, ILogger
///
///
- public static async Task DataExportAsync(string code, ExcelExportInfo data, string exportFileNamePrefix, IRepository _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null)
+ public static async Task DataExportAsync(string code, ExcelExportInfo data, string exportFileNamePrefix, IRepository _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null, List removeExcelIndexList = null)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
@@ -136,7 +136,7 @@ public static class ExcelExportHelper
#region 根据中英文 删除模板sheet
// 打开模板文件
- var templateFile = new FileStream(tplPath, FileMode.Open, FileAccess.Read);
+ using var templateFile = new FileStream(tplPath, FileMode.Open, FileAccess.Read);
// 获取文件流
var templateStream = new MemoryStream();
@@ -158,6 +158,17 @@ public static class ExcelExportHelper
workbook.Worksheets.Delete(2); // 删除第2个(索引2)
}
+ if (removeExcelIndexList != null)
+ {
+ var worksheet = workbook.Worksheet(1); // 索引从1开始
+ foreach (int colIndex in removeExcelIndexList.OrderByDescending(t => t))
+ {
+ // 删除整列
+ worksheet.Column(colIndex).Delete();
+ }
+ }
+
+
//中文替换项目术语
if (data.TrialObjectNameList?.Count > 0)
{
@@ -932,14 +943,14 @@ public static class ExcelExportHelper
//if (sheetCount == 2)
//{
- if (inDto.IsEnglish)
- {
- workbook.Worksheet(1).Delete(); // 删除第一个工作表
- }
- else
- {
- workbook.Worksheet(2).Delete(); // 删除第二个工作表
- }
+ if (inDto.IsEnglish)
+ {
+ workbook.Worksheet(1).Delete(); // 删除第一个工作表
+ }
+ else
+ {
+ workbook.Worksheet(2).Delete(); // 删除第二个工作表
+ }
//}
#endregion
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index aa431fdec..bfbde93b8 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -43,7 +43,7 @@
-
+
@@ -579,6 +579,12 @@
+
+
+ 获取前端配置
+
+
+
方案编号 STUDYID
@@ -849,6 +855,20 @@
裁决日期 CODTC
+
+
+ 获取中心设备信息
+
+
+
+
+
+
+ 调研表基本信息
+
+
+
+
质控问题答案导出
@@ -3974,6 +3994,16 @@
+
+
+ 自定义病灶判断是否是同一个病灶 除了根据器官判断还需要根据复制前值的答案是否相等
+
+
+
+
+
+
+
标准和服务对应
@@ -14818,6 +14848,13 @@
IR影像阅片
+
+
+ 测试异常
+
+
+
+
获取报告图表数据
@@ -19430,7 +19467,7 @@
TrialSiteSurveyService
-
+
TrialSiteSurveyService
@@ -19551,6 +19588,34 @@
+
+
+ 获取中心调研日志
+
+
+
+
+
+
+ 获取中心设备信息
+
+
+
+
+
+
+ 调研表基本信息
+
+
+
+
+
+
+ SPM 是否参与流程
+
+
+
+
TrialSiteUserSurveyService
diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/SiteSurverEmailConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/SiteSurverEmailConsumer.cs
index eaa991375..ec9a855e9 100644
--- a/IRaCIS.Core.Application/MassTransit/Consumer/SiteSurverEmailConsumer.cs
+++ b/IRaCIS.Core.Application/MassTransit/Consumer/SiteSurverEmailConsumer.cs
@@ -269,9 +269,45 @@ public class SiteSurverRejectedEventConsumer(
if (context.Message.IsHaveSPMOrCPM)
{
- //PM 驳回到SPM
- if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted)
+ ////PM 驳回到SPM
+ //if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted)
+ //{
+
+ // var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.IsDeleted == false)
+ // .Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)
+ // .Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum, t.UserRole.IdentityUser.UserWorkLanguage }).ToList();
+
+ // var lan_SPMOrCPMList = sPMOrCPMList.Where(t => t.UserWorkLanguage == workLanguage);
+
+ // foreach (var user in lan_SPMOrCPMList)
+ // {
+ // messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
+ // }
+
+ // toUserName = string.Join('、', lan_SPMOrCPMList.Select(t => t.FullName));
+
+ //}
+ ////SPM 驳回到CRC
+ //else if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
+ //{
+ // //使用中心国家语言 一致才发送
+ // if ((siteInfo.Country == StaticData.SiteCountry.US && isEn_US) || (siteInfo.Country == StaticData.SiteCountry.CN && isEn_US == false))
+ // {
+ // messageToSend.To.Add(new MailboxAddress(toUserName, siteSurveyInfo.Email));
+
+ // }
+
+ //}
+
+ // PM 驳回到CRC
+ if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
{
+ //使用中心国家语言 一致才发送
+ if ((siteInfo.Country == StaticData.SiteCountry.US && isEn_US) || (siteInfo.Country == StaticData.SiteCountry.CN && isEn_US == false))
+ {
+ messageToSend.To.Add(new MailboxAddress(toUserName, siteSurveyInfo.Email));
+
+ }
var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.IsDeleted == false)
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)
@@ -281,24 +317,10 @@ public class SiteSurverRejectedEventConsumer(
foreach (var user in lan_SPMOrCPMList)
{
- messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
- }
-
- toUserName = string.Join('、', lan_SPMOrCPMList.Select(t => t.FullName));
-
- }
- //SPM 驳回到CRC
- else if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
- {
- //使用中心国家语言 一致才发送
- if ((siteInfo.Country == StaticData.SiteCountry.US && isEn_US) || (siteInfo.Country == StaticData.SiteCountry.CN && isEn_US == false))
- {
- messageToSend.To.Add(new MailboxAddress(toUserName, siteSurveyInfo.Email));
-
+ messageToSend.Cc.Add(new MailboxAddress(user.FullName, user.EMail));
}
}
-
}
else
{
@@ -312,6 +334,11 @@ public class SiteSurverRejectedEventConsumer(
}
}
+ Uri uri = new Uri(_systemEmailConfig.SiteUrl);
+
+ // 获取 Scheme + Host(不包含路径)
+ string baseUrl = uri.GetLeftPart(UriPartial.Authority);
+
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
@@ -330,8 +357,9 @@ public class SiteSurverRejectedEventConsumer(
siteInfo.TrialSiteCode, //中心编号
siteInfo.TrialSiteAliasName,//中心名称
siteSurveyInfo.LatestBackReason, //驳回原因
- _systemEmailConfig.SiteUrl, //链接
- (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none")
+ $"{baseUrl}/researchLogin?trialId={trialId}", //链接
+ (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none"),
+ trialInfo.LinkVerificationCode.IsNullOrEmpty()? trialInfo.ResearchProgramNo: trialInfo.LinkVerificationCode
);
return (topicStr, htmlBodyStr);
diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
index 0ee98e373..0d195ab95 100644
--- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
@@ -767,6 +767,7 @@ namespace IRaCIS.Core.Application.Service
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt, nameof(VisitTask)),
ReadingCategory = ReadingCategory.Visit,
+
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
IsNeedClinicalDataSign = isNeedClinicalDataSign,
IsClinicalDataSign = isClinicalDataSign,
@@ -1421,6 +1422,7 @@ namespace IRaCIS.Core.Application.Service
// AllocateTime = DateTime.Now,
//DoctorUserId = reReadingVisitTask.DoctorUserId,
+ IsIRImageDownloaded= reReadingVisitTask.IsIRImageDownloaded,
});
generateTaskCommand.Action(newTask);
diff --git a/IRaCIS.Core.Application/Service/Common/DeployConfigService.cs b/IRaCIS.Core.Application/Service/Common/DeployConfigService.cs
index 28f875901..30c0beee9 100644
--- a/IRaCIS.Core.Application/Service/Common/DeployConfigService.cs
+++ b/IRaCIS.Core.Application/Service/Common/DeployConfigService.cs
@@ -31,7 +31,7 @@ public class DeployConfigService(IMapper _mapper, IConfiguration _configuration,
//return config;
- var path = Path.Combine( _hostEnvironment.ContentRootPath,$"appsettings.{_hostEnvironment.EnvironmentName}.json");
+ var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
var json = File.ReadAllText(path);
@@ -123,7 +123,7 @@ public class DeployConfigService(IMapper _mapper, IConfiguration _configuration,
[HttpPost]
public async Task UpdateSystemEmailConfig(SystemEmailSendConfig emailConfig)
{
- var path = Path.Combine(_hostEnvironment.ContentRootPath,$"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");
@@ -171,4 +171,57 @@ public class DeployConfigService(IMapper _mapper, IConfiguration _configuration,
return ResponseOutput.Ok();
}
+
+ ///
+ /// 获取前端配置
+ ///
+ ///
+ [AllowAnonymous]
+ public async Task GetWebConfigInfo()
+ {
+
+
+ var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
+
+ var json = File.ReadAllText(path);
+
+ var obj = JObject.Parse(json);
+
+ return obj["FrontWebConfig"]!.ToString();
+ }
+
+
+ public class WebConfigCommand
+ {
+ public string ConfigStr { get; set; }
+
+ }
+
+ public async Task UpdateWebConfigInfo(WebConfigCommand incommand)
+ {
+ var path = Path.Combine(_hostEnvironment.ContentRootPath, $"appsettings.{_hostEnvironment.EnvironmentName}.json");
+ //var path = $"appsettings.{_hostEnvironment.EnvironmentName}.json";
+
+ var @lock = _distributedLockProvider.CreateLock("WriteConfigFile");
+
+ using (await @lock.AcquireAsync())
+ {
+ string text = System.IO.File.ReadAllText(path);
+ // 修改
+ JObject obj = JObject.Parse(text);
+
+ // SystemEmailSendConfig 相关配置
+ obj["FrontWebConfig"] = incommand.ConfigStr;
+
+ // 重新写入appsettings.json
+ string result = obj.ToString();
+
+ System.IO.File.WriteAllText(path, result);
+
+ }
+
+ return ResponseOutput.Ok();
+ }
+
+
}
diff --git a/IRaCIS.Core.Application/Service/Common/Export/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/Export/ExcelExportService.cs
index f814ddc5d..edee8f66a 100644
--- a/IRaCIS.Core.Application/Service/Common/Export/ExcelExportService.cs
+++ b/IRaCIS.Core.Application/Service/Common/Export/ExcelExportService.cs
@@ -10,6 +10,7 @@ using IRaCIS.Core.Infra.EFCore.Common;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
using System.Reflection;
using System.Text;
using static IRaCIS.Core.Application.Service.ExcelExportHelper;
@@ -40,6 +41,191 @@ namespace IRaCIS.Core.Application.Service.Common
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService
{
+
+ #region 中心调研导出
+
+ [HttpPost]
+ public async Task GetTrialSiteSurveyList_Export(TrialSiteSurveyQueryDTO inQuery,
+ [FromServices] IRepository _trialSiteSurveyRepository,
+ [FromServices] IDictionaryService _dictionaryService)
+ {
+ var trialSiteSurveyQueryable = _trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId).IgnoreQueryFilters()
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
+ .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
+ .WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.UserName.Contains(inQuery.UserKeyInfo) || t.Phone.Contains(inQuery.UserKeyInfo) || t.Email.Contains(inQuery.UserKeyInfo))
+ .WhereIf(inQuery.State != null, t => t.State == inQuery.State)
+ .WhereIf(inQuery.UpdateTimeBegin != null, t => t.UpdateTime >= inQuery.UpdateTimeBegin)
+ .WhereIf(inQuery.UpdateTimeEnd != null, t => t.UpdateTime <= inQuery.UpdateTimeEnd)
+
+ .ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us })
+ .WhereIf(!string.IsNullOrWhiteSpace(inQuery.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(inQuery.PreliminaryUserName))
+ .WhereIf(!string.IsNullOrWhiteSpace(inQuery.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(inQuery.ReviewerUserName))
+ ;
+
+ //var defalutSortArray = new string[] { /*nameof(TrialSiteSurveyView.LanguageType) + " desc", nameof(TrialSiteSurveyView.ShowOrder)*/ };
+
+
+ var list = await trialSiteSurveyQueryable.SortToListAsync(inQuery /*,defalutSortArray*/);
+
+ var exportInfo = new ExcelExportInfo();
+
+ exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
+ exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
+
+ return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteSurvey_BasicInfo_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialSiteSurveyView));
+
+ }
+
+
+ ///
+ /// 获取中心设备信息
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task GetSiteSurveyEquipmentList_Export(SiteSurveyEquipmentQuery inQuery,
+ [FromServices] IRepository _trialSiteEquipmentSurveyRepository,
+ [FromServices] IRepository _trialSiteSurveyRepository,
+ [FromServices] IDictionaryService _dictionaryService)
+ {
+
+
+ //找到该中心最新的调研记录
+ var groupSelectIdQuery =
+ _trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId)
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
+ .GroupBy(t => t.TrialSiteId)
+ .Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
+
+
+ var query = _trialSiteEquipmentSurveyRepository.Where(t => t.TrialSiteSurvey.TrialId == inQuery.TrialId)
+ .IgnoreQueryFilters().Where(t => groupSelectIdQuery.Contains(t.TrialSiteSurveyId))
+ .WhereIf(inQuery.IsDeleted != null, t => t.TrialSiteSurvey.IsDeleted == inQuery.IsDeleted)
+ .WhereIf(inQuery.State != null, t => t.TrialSiteSurvey.State == inQuery.State)
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteSurvey.TrialSiteId == inQuery.TrialSiteId)
+ .WhereIf(inQuery.TrialSiteCode.IsNotNullOrEmpty(), t => t.TrialSiteSurvey.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode))
+ .WhereIf(inQuery.TrialSiteName.IsNotNullOrEmpty(), t => t.TrialSiteSurvey.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteName) ||
+ t.TrialSiteSurvey.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteName))
+ .ProjectTo(_mapper.ConfigurationProvider);
+
+ var siteSurveryConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
+
+ var config = JsonConvert.DeserializeObject(siteSurveryConfig) ?? new TrialExtraConfig();
+
+
+ var fields = new List<(string FieldName, int excelIndex)>()
+ {
+
+ ("Parameters", 9),
+ ("ManufacturerType", 10),
+ ("ScannerType", 11),
+ ("MagneticFieldStrengthType", 12),
+ ("BodyCoilChannelCount", 13),
+ ("HasDedicatedPdfFatQuantificationSequence", 14),
+ ("PdfFatQuantificationSequenceType", 15),
+ //("OtherSequenceSpecification", 15),
+ ("HasT2R2Correction", 16),
+ ("CanFullyExportPdfParameterMapsAndRawDicom", 17),
+ ("Note", 18),
+ };
+
+
+ var viewNameList = config.EquipmentControlFieldList.Where(t => t.IsView == true).Select(t => t.FiledName).ToList();
+
+ var columnsToDelete = fields.Where(f => !viewNameList.Any(t => f.FieldName == t)).Select(f => f.excelIndex).Distinct().OrderByDescending(i => i).ToList();
+
+
+ //var defalutSortArray = new string[] { /*nameof(TrialSiteSurveyView.LanguageType) + " desc", nameof(TrialSiteSurveyView.ShowOrder)*/ };
+
+
+ var list = await query.SortToListAsync(inQuery /*,defalutSortArray*/);
+
+ var exportInfo = new ExcelExportInfo();
+
+ exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
+ exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
+
+ return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteSurvey_Equipment_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SiteSurveyEquipmentDto), removeExcelIndexList: columnsToDelete);
+
+ }
+
+ ///
+ /// 调研表基本信息
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task GetSiteSurveyInfoList_Export(SiteSurveyInfoQuery inQuery,
+ [FromServices] IRepository _trialSiteSurveyRepository,
+ [FromServices] IDictionaryService _dictionaryService)
+ {
+
+ //找到该中心最新的调研记录
+ var groupSelectIdQuery =
+ _trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId)
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
+ .GroupBy(t => t.TrialSiteId)
+ .Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
+
+ var query = _trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId).IgnoreQueryFilters()
+ .Where(t => groupSelectIdQuery.Contains(t.Id))
+ .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
+ .WhereIf(inQuery.State != null, t => t.State == inQuery.State)
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
+ .WhereIf(inQuery.TrialSiteCode.IsNotNullOrEmpty(), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode))
+ .WhereIf(inQuery.TrialSiteName.IsNotNullOrEmpty(), t => t.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteName) ||
+ t.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteName))
+
+ .ProjectTo(_mapper.ConfigurationProvider);
+
+
+ var siteSurveryConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
+
+ var config = JsonConvert.DeserializeObject(siteSurveryConfig) ?? new TrialExtraConfig();
+
+
+ var fields = new List<(string FieldName, int excelIndex)>()
+ {
+
+ ("AverageEngravingCycle", 8),
+ ("IsRoutineMRIPDEE", 9),
+ ("MRIPDFFScanTime", 10),
+ ("MRIPDFFLeadTime", 11),
+ ("MRIPDFFOther", 12),
+ ("IsAuthorizeRadiologistsParticipate", 13),
+ ("AssignFixedTechnologists", 14),
+ ("IsConfirmImagingTechnologist", 15),
+ ("NotConfirmReson", 16),
+ ("EfficacyEvaluatorType", 17),
+
+ ("IsFollowStudyParameters", 18),
+ ("NotFollowReson", 19),
+ ("ISStrictManualBurnFlag", 20),
+ ("NotStrictManualBurnFlagReason",21)
+ };
+
+
+ //var viewNameList = config.NotShowFieldList;
+
+ var columnsToDelete = fields.Where(f => config.NotShowFieldList.Any(t => f.FieldName == t)).Select(f => f.excelIndex).Distinct().OrderByDescending(i => i).ToList();
+
+
+ //var defalutSortArray = new string[] { /*nameof(TrialSiteSurveyView.LanguageType) + " desc", nameof(TrialSiteSurveyView.ShowOrder)*/ };
+
+
+ var list = await query.SortToListAsync(inQuery /*,defalutSortArray*/);
+
+ var exportInfo = new ExcelExportInfo();
+
+ exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
+ exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
+
+ return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteSurvey_Info_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialSiteSurveyView), removeExcelIndexList: columnsToDelete);
+
+ }
+
+ #endregion
+
///
/// 质控问题答案导出
///
@@ -1197,7 +1383,7 @@ namespace IRaCIS.Core.Application.Service.Common
t.VisitTaskList.Where(t => t.TaskState == TaskState.Effect && t.TrialReadingCriterionId == dto.TrialReadingCriterionId && t.TaskAllocationState == TaskAllocationState.Allocated && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() == (int)trialReadingCriterion.ReadingType ?
ReadingStatusEnum.ReadCompleted : t.VisitTaskList.Where(t => t.TaskState == TaskState.Effect && t.TrialReadingCriterionId == dto.TrialReadingCriterionId && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Visit && t.TaskAllocationState == TaskAllocationState.Allocated).Count() == (int)trialReadingCriterion.ReadingType ? ReadingStatusEnum.ImageReading :
t.ReadingStatus
- }).OrderBy(t=>t.VisitTaskNum).ToList(),
+ }).OrderBy(t => t.VisitTaskNum).ToList(),
ModuleList = subject.ReadModuleList.Where(t => t.TrialReadingCriterionId == dto.TrialReadingCriterionId).Select(t => new SubjectProgressDto.MouduleProgress()
{
@@ -2863,7 +3049,7 @@ namespace IRaCIS.Core.Application.Service.Common
{
//仲裁阅片 才有裁判阅片明细表 同时要把模板里面的三列给去掉
//removeColumnIndexList = new List() { 6, 7, 8 };
- removeColumnIndexList = new List() { 7, 8 ,9};
+ removeColumnIndexList = new List() { 7, 8, 9 };
}
//阅片结果表 和阅片结果明细表 没有肿瘤学的时候需要移除肿瘤学三个字段
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
index 81092d152..1d435bd13 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
@@ -2199,6 +2199,21 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
///
public DefaultSegmentNameDto DefaultSegmentName { get; set; }
+ ///
+ /// 仲裁模式
+ ///
+ public JudgeMode JudgeModeEnum { get; set; } = JudgeMode.SelectOne;
+
+ ///
+ /// 裁判规则
+ ///
+ public JudgeRule JudgeRuleEnum { get; set; } = JudgeRule.Consistent;
+
+ ///
+ /// 仲裁对象
+ ///
+ public ArbitrationRule ArbitrationRule { get; set; } = ArbitrationRule.Reading;
+
}
public class GetReadingImgInDto
@@ -2437,6 +2452,83 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid VisitTaskId { get; set; }
}
+ public class GetSingleVisitJudgeAnswerInDto
+ {
+ [NotDefault]
+ public Guid VisitTaskId { get; set; }
+ }
+
+ public class GetSingleVisitJudgeAnswerOutDto
+ {
+ public Guid R1VisitTaskId { get; set; }
+ public Guid R2VisitTaskId { get; set; }
+ public List QuestionList { get; set; } = new List();
+ }
+
+ public class SingleVisitJudgeAnswerItemDto
+ {
+ public Guid ReadingQuestionId { get; set; }
+ public string QuestionName { get; set; } = string.Empty;
+ public string Type { get; set; } = string.Empty;
+ public string TypeValue { get; set; } = string.Empty;
+ public int ShowOrder { get; set; }
+ public string R1Answer { get; set; } = string.Empty;
+ public string R2Answer { get; set; } = string.Empty;
+ public TableQuestionType? QuestionGenre { get; set; }
+ public string DictionaryCode { get; set; } = string.Empty;
+ public ValueUnit? Unit { get; set; }
+ public string? CustomUnit { get; set; }
+ public ValueOfType? ValueType { get; set; }
+ public JudgeReadingQuestionType QuestionType { get; set; } = JudgeReadingQuestionType.Question;
+ }
+
+ public class GetJudgeFormInDto
+ {
+ [NotDefault]
+ public Guid VisitTaskId { get; set; }
+ }
+
+ public class GetJudgeFormOutDto
+ {
+ public string JudgeResultRemark { get; set; } = string.Empty;
+ public List JudgeResultImagePathList { get; set; } = new List();
+ public List QuestionList { get; set; } = new List();
+ }
+
+ public class JudgeFormQuestionDto
+ {
+ public Guid ReadingQuestionId { get; set; }
+ public string QuestionName { get; set; } = string.Empty;
+ public string Type { get; set; } = string.Empty;
+ public string TypeValue { get; set; } = string.Empty;
+ public int ShowOrder { get; set; }
+ public string Answer { get; set; } = string.Empty;
+ public TableQuestionType? QuestionGenre { get; set; }
+ public string DictionaryCode { get; set; } = string.Empty;
+ public ValueUnit? Unit { get; set; }
+ public string? CustomUnit { get; set; }
+ public ValueOfType? ValueType { get; set; }
+ public JudgeReadingQuestionType QuestionType { get; set; } = JudgeReadingQuestionType.Question;
+ }
+
+ public class SetJudgeFormInDto
+ {
+ [NotDefault]
+ public Guid VisitTaskId { get; set; }
+
+ public string JudgeResultRemark { get; set; } = string.Empty;
+
+ public List JudgeResultImagePathList { get; set; } = new List();
+
+ public List QuestionList { get; set; } = new List();
+ }
+
+ public class JudgeFormAnswerDto
+ {
+ public Guid ReadingQuestionId { get; set; }
+ public string Answer { get; set; } = string.Empty;
+ }
+
public class JudgeReadingInfoDto
{
public string VisitName { get; set; }
@@ -2908,12 +3000,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
}
- public class AnswerCombinationDto
- {
- public List AnswerGroupA { get; set; }
-
- public List AnswerGroupB { get; set; }
- }
+
public class TaskAnswerDto
{
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
index 6a130a511..e323cf048 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
@@ -6,6 +6,82 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Application.Service.Reading.Dto
{
+ public class GetTrialQuestionVisitJudgeRuleInDto
+ {
+ [NotDefault]
+ public Guid TrialId { get; set; }
+
+ [NotDefault]
+ public Guid TrialReadingCriterionId { get; set; }
+
+ public decimal VisitNum { get; set; }
+
+ public Guid? ReadingQuestionId { get; set; }
+ }
+
+ public class SetTrialQuestionVisitJudgeRuleInDto
+ {
+ [NotDefault]
+ public Guid TrialReadingCriterionId { get; set; }
+
+ public decimal VisitNum { get; set; }
+
+ public List QuestionList { get; set; } = new List();
+ }
+
+ public class TrialQuestionVisitJudgeRuleItemDto
+ {
+ public Guid ReadingQuestionTrialId { get; set; }
+ public string QuestionName { get; set; } = string.Empty;
+ public int ShowOrder { get; set; }
+ public List AnswerGroup { get; set; } = new List();
+ public JudgeTypeEnum JudgeType { get; set; }
+ public decimal? JudgeDifferenceValue { get; set; }
+ public JudgeDifferenceType JudgeDifferenceType { get; set; }
+
+
+
+
+
+ ///
+ /// 类型
+ ///
+ public string Type { get; set; } = string.Empty;
+
+
+
+
+ public string PageName { get; set; }
+
+
+ public string TypeValue { get; set; }
+
+ ///
+ /// 问题类型
+ ///
+ public TableQuestionType? QuestionGenre { get; set; }
+
+ ///
+ /// 字典code
+ ///
+ public string DictionaryCode { get; set; } = string.Empty;
+
+
+
+
+ ///
+ /// 单位
+ ///
+ public ValueUnit? Unit { get; set; }
+
+ public string CustomUnit { get; set; } = string.Empty;
+
+ ///
+ /// 答案组合
+ ///
+ public List AnswerCombination { get; set; }
+ }
+
public class TumorAssessmentView : AddOrUpdateTumorAssessmentInDto
{
@@ -702,6 +778,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid TrialReadingCriterionId { get; set; }
}
+ public class SetTrialJudgeRuleInfoInDto
+ {
+ [NotDefault]
+ public Guid TrialReadingCriterionId { get; set; }
+
+ public JudgeMode JudgeModeEnum { get; set; } = JudgeMode.SelectOne;
+ public JudgeRule JudgeRuleEnum { get; set; } = JudgeRule.Consistent;
+ public JudgeGenerate JudgeGenerateEnum { get; set; } = JudgeGenerate.Instant;
+ }
+
public class GetTrialJudgyInfoOutDto
{
public Guid TrialId { get; set; }
@@ -717,6 +803,24 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 仲裁规则
///
public ArbitrationRule ArbitrationRule { get; set; }
+
+ ///
+ /// 仲裁模式
+ ///
+ public JudgeMode JudgeModeEnum { get; set; } = JudgeMode.SelectOne;
+
+ ///
+ /// 裁判规则
+ ///
+ public JudgeRule JudgeRuleEnum { get; set; } = JudgeRule.Consistent;
+
+ ///
+ /// 裁判任务生成
+ ///
+ public JudgeGenerate JudgeGenerateEnum { get; set; } = JudgeGenerate.Instant;
+
+ public bool IsSigned { get; set; } = false;
+
}
public enum NeedSynchronize
diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs
index db9ca1114..dc3a3874d 100644
--- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs
@@ -15,6 +15,7 @@ namespace IRaCIS.Core.Application.Contracts
Task TriggerJudgeQuestion(Guid visitTaskId);
Task SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
+ Task SubmitJudgeForm(SetJudgeFormInDto inDto);
Task SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
Task GetOncologyReadingInfo(GetOncologyReadingInfoInDto inDto);
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs
index 1481e4766..4b9eaa2c9 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs
@@ -370,13 +370,32 @@ namespace IRaCIS.Core.Application.Service.RC
TrialId = x.TrialId,
IsReadingTaskViewInOrder = x.IsReadingTaskViewInOrder,
ArbitrationRule = x.ArbitrationRule,
- IsArbitrationReading = x.IsArbitrationReading
-
+ IsArbitrationReading = x.IsArbitrationReading,
+ JudgeModeEnum = x.JudgeModeEnum,
+ JudgeRuleEnum = x.JudgeRuleEnum,
+ JudgeGenerateEnum = x.JudgeGenerateEnum,
+ IsSigned = x.IsSigned,
}).FirstNotNullAsync();
return result;
}
+ ///
+ /// 编辑裁判规则配置
+ ///
+ [HttpPost]
+ public async Task SetTrialJudgeRuleInfo(SetTrialJudgeRuleInfoInDto inDto)
+ {
+ await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
+ {
+ JudgeModeEnum = inDto.JudgeModeEnum,
+ JudgeRuleEnum = inDto.JudgeRuleEnum,
+ JudgeGenerateEnum = inDto.JudgeGenerateEnum,
+ });
+
+ return ResponseOutput.Ok(await _readingQuestionCriterionTrialRepository.SaveChangesAsync());
+ }
+
///
/// 新增修改项目问题标准(项目)
///
@@ -482,7 +501,6 @@ namespace IRaCIS.Core.Application.Service.RC
return ResponseOutput.Ok(result);
}
-
#endregion
#region 项目阅片标准问题分页
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
index 53c1ba5fd..04f855ea3 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
@@ -1,3 +1,4 @@
+using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share;
@@ -33,10 +34,105 @@ namespace IRaCIS.Core.Application.Service
IRepository _organInfoRepository,
IRepository _readingTableQuestionSystemRepository,
IRepository _readingTaskQuestionAnswer,
- IRepository _previousPDFRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IReadingQuestionService
+ IRepository _previousPDFRepository,
+ IRepository _readingQuestionVisitJudgeRuleRepository,
+ IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IReadingQuestionService
{
+ #region 项目访视裁判规则
+
+ ///
+ /// 获取项目阅片标准各访视的裁判规则配置。
+ /// 未配置规则的访视问题也会返回,供前端直接进行配置。
+ ///
+ [HttpPost]
+ public async Task> GetTrialQuestionVisitJudgeRule(GetTrialQuestionVisitJudgeRuleInDto inDto)
+ {
+ var questionList = await _readingQuestionTrialRepository
+ .Where(x=>!x.ExcludeShowVisitList.Contains(inDto.VisitNum))
+ .Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId && x.IsJudgeQuestion)
+ .WhereIf(inDto.ReadingQuestionId != null, x => x.Id == inDto.ReadingQuestionId)
+ .OrderBy(x => x.ShowOrder)
+ .Select(x => new TrialQuestionVisitJudgeRuleItemDto
+ {
+ ReadingQuestionTrialId = x.Id,
+ QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
+ ShowOrder = x.ShowOrder,
+ Type = x.Type,
+ TypeValue = x.TypeValue,
+ QuestionGenre = x.QuestionGenre,
+ DictionaryCode = x.DictionaryCode,
+ Unit = x.Unit,
+ CustomUnit = x.CustomUnit,
+ })
+ .ToListAsync();
+
+ var questionIds = questionList.Select(x => x.ReadingQuestionTrialId).ToList();
+ var ruleList = await _readingQuestionVisitJudgeRuleRepository
+ .Where(x => x.VisitNum == inDto.VisitNum && questionIds.Contains(x.ReadingQuestionId))
+ .ToListAsync();
+
+ return questionList.Select(question =>
+ {
+ var rule = ruleList.FirstOrDefault(x => x.ReadingQuestionId == question.ReadingQuestionTrialId);
+ return new TrialQuestionVisitJudgeRuleItemDto
+ {
+ ReadingQuestionTrialId = question.ReadingQuestionTrialId,
+ QuestionName = question.QuestionName,
+ ShowOrder = question.ShowOrder,
+ Type = question.Type,
+ PageName = question.PageName,
+ TypeValue = question.TypeValue,
+ QuestionGenre = question.QuestionGenre,
+ DictionaryCode = question.DictionaryCode,
+ Unit = question.Unit,
+ CustomUnit = question.CustomUnit,
+ AnswerGroup = rule?.AnswerGroup ?? new List(),
+ AnswerCombination = rule?.AnswerCombination ?? new List(),
+ JudgeType = rule?.JudgeType ?? JudgeTypeEnum.None,
+ JudgeDifferenceValue = rule?.JudgeDifferenceValue,
+ JudgeDifferenceType = rule?.JudgeDifferenceType ?? default,
+ };
+ }).ToList();
+ }
+
+ ///
+ /// 编辑项目阅片标准各访视的裁判规则配置。
+ ///
+ [HttpPost]
+ public async Task SetTrialQuestionVisitJudgeRule(SetTrialQuestionVisitJudgeRuleInDto inDto)
+ {
+ var questionIds = await _readingQuestionTrialRepository
+ .Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId && x.IsJudgeQuestion)
+ .Select(x => x.Id)
+ .ToListAsync();
+
+ await _readingQuestionVisitJudgeRuleRepository.BatchDeleteNoTrackingAsync(x =>
+ x.VisitNum == inDto.VisitNum && questionIds.Contains(x.ReadingQuestionId));
+
+ var rules = inDto.QuestionList.Select(question => new ReadingQuestionVisitJudgeRule
+ {
+ Id = NewId.NextGuid(),
+ ReadingQuestionId = question.ReadingQuestionTrialId,
+ VisitNum = inDto.VisitNum,
+ AnswerGroup = question.AnswerGroup ?? new List(),
+ AnswerCombination = question.AnswerCombination ?? new List(),
+ JudgeType = question.JudgeType,
+ JudgeDifferenceValue = question.JudgeDifferenceValue,
+ JudgeDifferenceType = question.JudgeDifferenceType,
+ }).ToList();
+
+ if (rules.Count > 0)
+ {
+ await _readingQuestionVisitJudgeRuleRepository.AddRangeAsync(rules);
+ }
+
+ return ResponseOutput.Result(await _readingQuestionVisitJudgeRuleRepository.SaveChangesAsync());
+ }
+
+ #endregion
+
#region 获取计算问题
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
index 92b8767fc..636644bd0 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
@@ -66,6 +66,7 @@ namespace IRaCIS.Core.Application.Service
IRepository _readingTableQuestionTrialRepository,
IRepository _readingTaskQuestionAnswerRepository,
IRepository _readingQuestionCriterionTrialRepository,
+ IRepository _readingQuestionVisitJudgeRuleRepository,
IRepository _readingQuestionSystem,
IRepository _criterionKeyFileReadRepository,
IRepository _trialCriterionKeyFileRepository,
@@ -81,6 +82,20 @@ namespace IRaCIS.Core.Application.Service
{
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
+
+ ///
+ /// 测试异常
+ ///
+ ///
+ ///
+ public async Task Test(GetReportsChartSummaryInDto inDto)
+ {
+ var a = 0;
+ var v = 1 / a;
+
+ return ResponseOutput.Ok();
+ }
+
///
/// 获取报告图表数据
///
@@ -3920,6 +3935,10 @@ namespace IRaCIS.Core.Application.Service
x.ReadingToolList,
x.CircleRadius,
x.DefaultSegmentName,
+ x.JudgeGenerateEnum,
+ x.JudgeModeEnum,
+ x.JudgeRuleEnum,
+ x.ArbitrationRule,
}).FirstNotNullAsync();
task.IsReadingShowPreviousResults = criterionInfo.IsReadingShowPreviousResults;
@@ -3983,6 +4002,9 @@ namespace IRaCIS.Core.Application.Service
task.IsViewStudyPart = visitTaskInfo.ReadingCategory == ReadingCategory.Judge || visitTaskInfo.IsViewStudyPart;
task.IsReadKeyFile = await _criterionKeyFileReadRepository.AnyAsync(x => x.IdentityUserId == _userInfo.IdentityUserId && x.TrialCriterionId == task.TrialReadingCriterionId);
task.IsHaveKeyFile = await _trialCriterionKeyFileRepository.AnyAsync(x => x.TrialCriterionId == task.TrialReadingCriterionId);
+ task.JudgeModeEnum = criterionInfo.JudgeModeEnum;
+ task.JudgeRuleEnum = criterionInfo.JudgeRuleEnum;
+ task.ArbitrationRule = criterionInfo.ArbitrationRule;
// 添加默认答案
if (inDto.VisitTaskId == null && visitTaskInfo.ReadingTaskState != ReadingTaskState.HaveSigned)
{
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs
index 7b6102a48..cd8c6a9be 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs
@@ -91,6 +91,200 @@ namespace IRaCIS.Core.Application.Service
#region 获取裁判阅片任务信息
+
+ ///
+ /// 获取单访视裁判答案
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task GetSingleVisitJudgeAnswer(GetSingleVisitJudgeAnswerInDto inDto)
+ {
+ var judgeDataInfo = await _readingJudgeInfoRepository
+ .Where(x => x.JudgeTaskId == inDto.VisitTaskId)
+ .FirstNotNullAsync();
+
+ var taskIds = new List { judgeDataInfo.TaskIdOne, judgeDataInfo.TaskIdTwo };
+ var readingTasks = await _visitTaskRepository
+ .Where(x => taskIds.Contains(x.Id))
+ .Select(x => new
+ {
+ x.Id,
+ x.ArmEnum,
+ x.TrialReadingCriterionId,
+ x.VisitTaskNum,
+ })
+ .ToListAsync();
+
+ var r1Task = readingTasks.First(x => x.ArmEnum == Arm.DoubleReadingArm1);
+ var r2Task = readingTasks.First(x => x.ArmEnum == Arm.DoubleReadingArm2);
+
+ var judgeRule = await _readingQuestionCriterionTrialRepository
+ .Where(x => x.Id == r1Task.TrialReadingCriterionId)
+ .Select(x => x.JudgeRuleEnum)
+ .FirstNotNullAsync();
+
+ var displayQuestions = await GetJudgeDisplayQuestions(r1Task.TrialReadingCriterionId, r1Task.VisitTaskNum, judgeRule);
+ var judgeAnswers = displayQuestions
+ .Select(x => new SingleVisitJudgeAnswerItemDto
+ {
+ ReadingQuestionId = x.Id,
+ QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
+ Type = x.Type,
+ TypeValue = x.TypeValue,
+ ShowOrder = x.ShowOrder,
+ QuestionGenre = x.QuestionGenre,
+ DictionaryCode = x.DictionaryCode,
+ Unit = x.Unit,
+ CustomUnit = x.CustomUnit,
+ ValueType = x.ValueType,
+ })
+ .ToList();
+
+ var displayQuestionIds = judgeAnswers.Select(x => x.ReadingQuestionId).ToList();
+ var answerList = await _readingTaskQuestionAnswerRepository
+ .Where(x => taskIds.Contains(x.VisitTaskId) && displayQuestionIds.Contains(x.ReadingQuestionTrialId))
+ .Select(x => new
+ {
+ x.VisitTaskId,
+ x.ReadingQuestionTrialId,
+ x.Answer,
+ })
+ .ToListAsync();
+
+ judgeAnswers.ForEach(question =>
+ {
+ question.R1Answer = answerList.FirstOrDefault(x => x.VisitTaskId == r1Task.Id && x.ReadingQuestionTrialId == question.ReadingQuestionId)?.Answer ?? string.Empty;
+ question.R2Answer = answerList.FirstOrDefault(x => x.VisitTaskId == r2Task.Id && x.ReadingQuestionTrialId == question.ReadingQuestionId)?.Answer ?? string.Empty;
+ });
+
+ return new GetSingleVisitJudgeAnswerOutDto
+ {
+ R1VisitTaskId = r1Task.Id,
+ R2VisitTaskId = r2Task.Id,
+ QuestionList = judgeAnswers,
+ };
+ }
+
+ ///
+ /// 获取裁判表单
+ ///
+ [HttpPost]
+ public async Task GetJudgeForm(GetJudgeFormInDto inDto)
+ {
+ var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
+ var judgeRule = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).Select(x => x.JudgeRuleEnum).FirstNotNullAsync();
+ var questionList = await GetJudgeDisplayQuestions(taskInfo.TrialReadingCriterionId, taskInfo.VisitTaskNum, judgeRule);
+ var questionIds = questionList.Select(x => x.Id).ToList();
+ var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && questionIds.Contains(x.ReadingQuestionTrialId)).ToListAsync();
+
+ return new GetJudgeFormOutDto
+ {
+ JudgeResultRemark = taskInfo.JudgeResultRemark,
+ JudgeResultImagePathList = taskInfo.JudgeResultImagePathList,
+ QuestionList = questionList.Select(x => new JudgeFormQuestionDto
+ {
+ ReadingQuestionId = x.Id,
+ QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
+ Type = x.Type,
+ TypeValue = x.TypeValue,
+ ShowOrder = x.ShowOrder,
+ Answer = answers.FirstOrDefault(answer => answer.ReadingQuestionTrialId == x.Id)?.Answer ?? string.Empty,
+ QuestionGenre = x.QuestionGenre,
+ DictionaryCode = x.DictionaryCode,
+ Unit = x.Unit,
+ CustomUnit = x.CustomUnit,
+ ValueType = x.ValueType,
+ }).ToList(),
+ };
+ }
+
+ ///
+ /// 编辑裁判表单
+ ///
+ [HttpPost]
+ public async Task SetJudgeForm(SetJudgeFormInDto inDto)
+ {
+
+ await SaveJudgeForm(inDto);
+ await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
+ {
+ JudgeResultRemark = inDto.JudgeResultRemark,
+ JudgeResultImagePath = string.Join(',', inDto.JudgeResultImagePathList),
+
+ });
+
+ return ResponseOutput.Result(await _readingTaskQuestionAnswerRepository.SaveChangesAsync());
+ }
+
+
+ private async Task SaveJudgeForm(SetJudgeFormInDto inDto)
+ {
+ var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
+ var judgeRule = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).Select(x => x.JudgeRuleEnum).FirstNotNullAsync();
+ var displayQuestionIds = (await GetJudgeDisplayQuestions(taskInfo.TrialReadingCriterionId, taskInfo.VisitTaskNum, judgeRule)).Select(x => x.Id).ToList();
+ var submittedQuestionIds = inDto.QuestionList.Select(x => x.ReadingQuestionId).ToList();
+
+
+ await _readingTaskQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && submittedQuestionIds.Contains(x.ReadingQuestionTrialId));
+ if (inDto.QuestionList.Count > 0)
+ {
+ await _readingTaskQuestionAnswerRepository.AddRangeAsync(inDto.QuestionList.Select(x => new ReadingTaskQuestionAnswer
+ {
+ ReadingQuestionTrialId = x.ReadingQuestionId,
+ ReadingQuestionCriterionTrialId = taskInfo.TrialReadingCriterionId,
+ TrialId = taskInfo.TrialId,
+ SubjectId = taskInfo.SubjectId,
+ VisitTaskId = inDto.VisitTaskId,
+ Answer = x.Answer,
+ }).ToList());
+ }
+
+ }
+
+ ///
+ /// 提交裁判表单
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task SubmitJudgeForm(SetJudgeFormInDto inDto)
+ {
+
+ await SaveJudgeForm(inDto);
+ await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
+ {
+ JudgeResultRemark = inDto.JudgeResultRemark,
+ ReadingTaskState = ReadingTaskState.HaveSigned,
+ SignTime=DateTime.Now,
+ JudgeResultImagePath = string.Join(',', inDto.JudgeResultImagePathList),
+
+ });
+ await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
+
+ await SignatureAfter(inDto.VisitTaskId);
+ return ResponseOutput.Ok();
+ }
+
+
+ private async Task> GetJudgeDisplayQuestions(Guid trialReadingCriterionId, decimal visitNum, JudgeRule judgeRule)
+ {
+ var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.IsJudgeQuestion)
+ .Where(x=>x.ShowQuestion== ShowQuestion.Show)
+ .OrderBy(x => x.ShowOrder).ToListAsync();
+ var questionIds = questionList.Select(x => x.Id).ToList();
+ var visitJudgeRules = judgeRule == JudgeRule.Difference
+ ? await _readingQuestionVisitJudgeRuleRepository.Where(x => questionIds.Contains(x.ReadingQuestionId) && (x.VisitNum == visitNum || x.VisitNum == -1)).ToListAsync()
+ : new List();
+
+ return questionList.Where(x => !x.ExcludeShowVisitList.Contains(visitNum))
+ .Where(x => judgeRule == JudgeRule.Consistent
+ ? x.JudgeType != JudgeTypeEnum.NotApplicable
+ : (visitJudgeRules.FirstOrDefault(rule => rule.ReadingQuestionId == x.Id && rule.VisitNum == visitNum)
+ ?? visitJudgeRules.FirstOrDefault(rule => rule.ReadingQuestionId == x.Id && rule.VisitNum == -1))?.JudgeType != JudgeTypeEnum.NotApplicable)
+ .ToList();
+ }
+
///
/// 获取裁判阅片任务信息
///
@@ -476,8 +670,15 @@ namespace IRaCIS.Core.Application.Service
});
var result = await _visitTaskRepository.SaveChangesAsync();
+ await SignatureAfter(inDto.VisitTaskId);
+
+ return ResponseOutput.Ok(result);
+ }
+
+ private async Task SignatureAfter(Guid visitTaskId)
+ {
// 需要判断是否添加肿瘤学任务
- var taskInfo = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
+ var taskInfo = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == visitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
if (taskInfo.ReadingCategory == ReadingCategory.Visit)
{
@@ -514,11 +715,9 @@ namespace IRaCIS.Core.Application.Service
// 创建任务关联关系
- await this.CreateTaskRelated(inDto.VisitTaskId);
+ await this.CreateTaskRelated(visitTaskId);
- await SafeMailHelper.Run(async () => await _trialEmailNoticeConfigService.BaseBusinessScenarioSendEmailAsync(inDto.VisitTaskId));
-
- return ResponseOutput.Ok(result);
+ await SafeMailHelper.Run(async () => await _trialEmailNoticeConfigService.BaseBusinessScenarioSendEmailAsync(visitTaskId));
}
///
@@ -624,6 +823,7 @@ namespace IRaCIS.Core.Application.Service
x.ArbitrationRule,
x.IsGlobalReading,
x.IsReadingPeriod,
+ x.JudgeRuleEnum,
}).FirstNotNullAsync();
var noteEqual = false;
@@ -667,6 +867,7 @@ namespace IRaCIS.Core.Application.Service
VisitTaskId = questionAnswer.VisitTaskId,
};
var globalVisitAnswerlist = await globalVisitQuestionQuery.ToListAsync();
+ await ApplyVisitJudgeRules(globalVisitAnswerlist, criterionInfo.JudgeRuleEnum);
var taskNums = globalVisitAnswerlist.Select(x => x.VisitTaskNum).Distinct().OrderBy(x => x).ToList();
@@ -697,11 +898,13 @@ namespace IRaCIS.Core.Application.Service
AnswerCombination = question.AnswerCombination,
JudgeType = question.JudgeType,
QuestionId = question.Id,
- JudgeDifferenceValue = question.JudgeDifferenceValue,
- JudgeDifferenceType = question.JudgeDifferenceType,
- VisitTaskId = questionAnswet.VisitTaskId,
- };
+ JudgeDifferenceValue = question.JudgeDifferenceValue,
+ JudgeDifferenceType = question.JudgeDifferenceType,
+ VisitTaskId = questionAnswet.VisitTaskId,
+ VisitTaskNum = questionAnswet.VisitTask.VisitTaskNum,
+ };
var questionAnswerlist = await query.ToListAsync();
+ await ApplyVisitJudgeRules(questionAnswerlist, criterionInfo.JudgeRuleEnum);
// 将答案进行分组
List groupTasks = questionAnswerlist.GroupBy(x => new { x.JudgeDifferenceValue, x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
@@ -749,6 +952,8 @@ namespace IRaCIS.Core.Application.Service
}
else
{
+ await ApplyVisitJudgeRules(item.AfterQuestionList, item.VisitNum, criterionInfo.JudgeRuleEnum);
+ await ApplyVisitJudgeRules(twoItem.AfterQuestionList, twoItem.VisitNum, criterionInfo.JudgeRuleEnum);
var newlist = item.AfterQuestionList.Where(x => x.QuestionId != null && x.IsJudgeQuestion).ToList().Union(
twoItem.AfterQuestionList.Where(x => x.QuestionId != null && x.IsJudgeQuestion).ToList()
).ToList();
@@ -811,6 +1016,8 @@ namespace IRaCIS.Core.Application.Service
};
var visitTaskQuestions = await query.ToListAsync();
+ await ApplyVisitJudgeRules(visitTaskQuestions, lastTask.VisitNum, criterionInfo.JudgeRuleEnum);
+ await ApplyVisitJudgeRules(lastTask.AfterQuestionList, lastTask.VisitNum, criterionInfo.JudgeRuleEnum);
var newlist = visitTaskQuestions.Where(x => x.QuestionId != null).ToList().Union(
lastTask.AfterQuestionList.Where(x => x.QuestionId != null).ToList()
@@ -929,6 +1136,102 @@ namespace IRaCIS.Core.Application.Service
}
+ ///
+ /// 应用访视裁判规则 以及剔除排除的问题
+ ///
+ private async Task ApplyVisitJudgeRules(List answerList, JudgeRule judgeRule)
+ {
+ if (answerList.Count == 0)
+ {
+ return;
+ }
+
+ var questionIds = answerList.Select(x => x.QuestionId).Distinct().ToList();
+ var questions = await _readingQuestionTrialRepository.Where(x => questionIds.Contains(x.Id)).Select(x => new
+ {
+ x.Id,
+ x.ExcludeShowVisitList,
+ }).ToListAsync();
+ var excludedQuestionIds = answerList
+ .Where(x => questions.FirstOrDefault(question => question.Id == x.QuestionId)?.ExcludeShowVisitList.Contains(x.VisitTaskNum) == true)
+ .Select(x => x.QuestionId)
+ .Distinct()
+ .ToList();
+ answerList.RemoveAll(x => excludedQuestionIds.Contains(x.QuestionId));
+
+ if (judgeRule != JudgeRule.Difference || answerList.Count == 0)
+ {
+ return;
+ }
+
+ questionIds = answerList.Select(x => x.QuestionId).Distinct().ToList();
+ var visitNums = answerList.Select(x => x.VisitTaskNum).Distinct().ToList();
+ var visitRules = await _readingQuestionVisitJudgeRuleRepository
+ .Where(x => questionIds.Contains(x.ReadingQuestionId) && (visitNums.Contains(x.VisitNum) || x.VisitNum == -1))
+ .ToListAsync();
+
+ answerList.ForEach(answer =>
+ {
+ var rule = visitRules.FirstOrDefault(x => x.ReadingQuestionId == answer.QuestionId && x.VisitNum == answer.VisitTaskNum)
+ ?? visitRules.FirstOrDefault(x => x.ReadingQuestionId == answer.QuestionId && x.VisitNum == -1);
+ if (rule != null)
+ {
+ answer.AnswerGroup = JsonConvert.SerializeObject(rule.AnswerGroup);
+ answer.AnswerCombination = JsonConvert.SerializeObject(rule.AnswerCombination);
+ answer.JudgeType = rule.JudgeType;
+ answer.JudgeDifferenceValue = rule.JudgeDifferenceValue;
+ answer.JudgeDifferenceType = rule.JudgeDifferenceType;
+ }
+ });
+ }
+
+ ///
+ /// 应用访视裁判规则 以及剔除排除的问题
+ ///
+ private async Task ApplyVisitJudgeRules(List questionList, decimal visitNum, JudgeRule judgeRule)
+ {
+ if (questionList.Count == 0)
+ {
+ return;
+ }
+
+ var questionIds = questionList.Where(x => x.QuestionId != null).Select(x => x.QuestionId!.Value).Distinct().ToList();
+ var excludedQuestionIds = await _readingQuestionTrialRepository
+ .Where(x => questionIds.Contains(x.Id) && x.ExcludeShowVisitList.Contains(visitNum))
+ .Select(x => x.Id)
+ .ToListAsync();
+ questionList.RemoveAll(x => x.QuestionId != null && excludedQuestionIds.Contains(x.QuestionId.Value));
+
+ if (judgeRule != JudgeRule.Difference || questionList.Count == 0)
+ {
+ return;
+ }
+
+ questionIds = questionList.Where(x => x.QuestionId != null).Select(x => x.QuestionId!.Value).Distinct().ToList();
+ var visitRules = await _readingQuestionVisitJudgeRuleRepository
+ .Where(x => questionIds.Contains(x.ReadingQuestionId) && (x.VisitNum == visitNum || x.VisitNum == -1))
+ .ToListAsync();
+
+ questionList.ForEach(question =>
+ {
+ if (question.QuestionId == null)
+ {
+ return;
+ }
+
+ var rule = visitRules.FirstOrDefault(x => x.ReadingQuestionId == question.QuestionId && x.VisitNum == visitNum)
+ ?? visitRules.FirstOrDefault(x => x.ReadingQuestionId == question.QuestionId && x.VisitNum == -1);
+ if (rule != null)
+ {
+ question.AnswerGroup = JsonConvert.SerializeObject(rule.AnswerGroup);
+ question.AnswerCombination = JsonConvert.SerializeObject(rule.AnswerCombination);
+ question.JudgeType = rule.JudgeType;
+ question.JudgeDifferenceValue = rule.JudgeDifferenceValue;
+ question.JudgeDifferenceType = rule.JudgeDifferenceType;
+ }
+ });
+ }
+
///
/// 发送微信通知
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
index 831b93073..229f2646b 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
@@ -258,7 +258,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (historyTaskId != Guid.Empty)
{
- var historyTableRowList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == historyTaskId).ToListAsync();
+ var criterionType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => x.CriterionType).FirstOrDefaultAsync();
+ var historyTableRowList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == historyTaskId).Include(x => x.ReadingQuestionTrial).ToListAsync();
var historyTableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == historyTaskId).ToListAsync();
@@ -278,7 +279,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
continue;
}
- var historyRow = historyTableRowList.Where(x =>
+
+ // 自定义标准(SelfDefine)的病灶IdentityRowId不可靠 除了根据器官判断还需要根据复制前值的答案是否相等 优先用答案匹配
+ var historyRow = historyTableRowList
+ .WhereIf(criterionType == CriterionType.SelfDefine, x => IsSameCustomRowAnswer(item, x, tableAnswerList, historyTableAnswerList))
+ .Where(x =>
x.QuestionId == item.QuestionId &&
x.RowIndex == item.RowIndex &&
x.IdentityRowId == item.IdentityRowId &&
@@ -311,6 +316,77 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
}
+ // 将失效任务在当前访视新增的病灶添加过来
+ // 例如现在是访视三,把失效任务访视三中在访视三新增的病灶(FristAddTaskId == historyTaskId)添加过来
+ var historyAddRowList = historyTableRowList.Where(x => x.FristAddTaskId == historyTaskId && x.SplitOrMergeType != SplitOrMergeType.Merged).ToList();
+ var historyRowIdSet = historyTableRowList.Select(x => x.Id).ToHashSet();
+
+ foreach (var historyRow in historyAddRowList)
+ {
+ // 判断当前任务是否已经存在该病灶 失效任务新增的病灶IdentityRowId是新建的不会与当前任务重复
+ bool isExist = tableRowList.Any(x => x.QuestionId == historyRow.QuestionId && x.IdentityRowId != null && x.IdentityRowId == historyRow.IdentityRowId);
+
+ if (isExist)
+ {
+ continue;
+ }
+
+ // 通过CopyTableAnswerRowInfo映射复制行字段
+ var copyRow = _mapper.Map(historyRow);
+ copyRow.Id = NewId.NextGuid();
+ copyRow.VisitTaskId = taskinfo.Id;
+ copyRow.MeasureData = historyRow.MeasureData.Replace(historyTaskId.ToString(), taskinfo.Id.ToString());
+ copyRow.IsCurrentTaskAdd = true;
+ copyRow.FristAddTaskId = taskinfo.Id;
+
+ var newRow = _mapper.Map(copyRow);
+ // CopyTableAnswerRowInfo没有Other和PET/CT融合字段 单独复制
+ newRow.OtherMeasureData = historyRow.OtherMeasureData.Replace(historyTaskId.ToString(), taskinfo.Id.ToString());
+ newRow.OtherInstanceId = historyRow.OtherInstanceId;
+ newRow.OtherSeriesId = historyRow.OtherSeriesId;
+ newRow.OtherStudyId = historyRow.OtherStudyId;
+ newRow.OtherMarkTool = historyRow.OtherMarkTool;
+ newRow.OtherPicturePath = historyRow.OtherPicturePath;
+ newRow.OtherNumberOfFrames = historyRow.OtherNumberOfFrames;
+ newRow.PTSeriesId = historyRow.PTSeriesId;
+ newRow.CTSeriesId = historyRow.CTSeriesId;
+
+ tableRowList.Add(newRow);
+ if (!lesionRelationship.ContainsKey(historyRow.Id))
+ {
+ lesionRelationship.Add(historyRow.Id, newRow.Id);
+ }
+
+ // 复制该病灶的表格答案
+ historyTableAnswerList.Where(x => x.RowId == historyRow.Id).ForEach(x =>
+ {
+ tableAnswerList.Add(new ReadingTableQuestionAnswer()
+ {
+ Id = NewId.NextGuid(),
+ Answer = x.Answer,
+ QuestionId = x.QuestionId,
+ VisitTaskId = taskinfo.Id,
+ TrialId = x.TrialId,
+ RowIndex = x.RowIndex,
+ TableQuestionId = x.TableQuestionId,
+ RowId = newRow.Id,
+ });
+ });
+ }
+
+ // 处理新增病灶的分割合并关系 新增病灶已经在tableRowList里 通过SplitRowId/MergeRowId是否指向失效任务的行来识别
+ tableRowList.ForEach(x =>
+ {
+ if (x.SplitRowId != null && historyRowIdSet.Contains(x.SplitRowId.Value))
+ {
+ x.SplitRowId = lesionRelationship.ContainsKey(x.SplitRowId.Value) ? lesionRelationship[x.SplitRowId.Value] : (Guid?)null;
+ }
+ if (x.MergeRowId != null && historyRowIdSet.Contains(x.MergeRowId.Value))
+ {
+ x.MergeRowId = lesionRelationship.ContainsKey(x.MergeRowId.Value) ? lesionRelationship[x.MergeRowId.Value] : (Guid?)null;
+ }
+ });
+
// 复制外层问题
answerList.ForEach(x =>
{
@@ -920,5 +996,31 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
});
return taskInfoList;
}
+
+ ///
+ /// 自定义病灶判断是否是同一个病灶 除了根据器官判断还需要根据复制前值的答案是否相等
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private bool IsSameCustomRowAnswer(ReadingTableAnswerRowInfo currentRow, ReadingTableAnswerRowInfo historyRow,
+ List currentAnswerList, List historyAnswerList)
+ {
+ // 复制前值的答案:即当前任务从上一次有效访视复制过来的答案,自定义阅片只有IsCopy的问题会复制值,非空的就是复制前值
+ var currentAnswers = currentAnswerList.Where(x => x.RowId == currentRow.Id && !x.Answer.IsNullOrEmpty())
+ .GroupBy(x => x.TableQuestionId).ToDictionary(x => x.Key, x => x.First().Answer);
+ var historyAnswers = historyAnswerList.Where(x => x.RowId == historyRow.Id && !x.Answer.IsNullOrEmpty())
+ .GroupBy(x => x.TableQuestionId).ToDictionary(x => x.Key, x => x.First().Answer);
+
+ // 没有复制前值可以比较时 只根据器官判断
+ if (currentAnswers.Count == 0)
+ {
+ return true;
+ }
+
+ return currentAnswers.All(x => historyAnswers.TryGetValue(x.Key, out var historyAnswer) && historyAnswer == x.Value);
+ }
}
}
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs
index 604bc582e..3864aa883 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs
@@ -29,6 +29,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
IGeneralCalculateService _generalCalculateService,
IRepository _readingTaskQuestionAnswerRepository,
IVisitTaskHelpeService _visitTaskHelpeService,
+ IRepository _noneDicomStudyFileRepository,
IHttpContextAccessor httpContext,
ILogger _logger, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ICriterionCalculateService
{
@@ -1083,6 +1084,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
+ var noneDicomFiles = await _noneDicomStudyFileRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId)
+ .Select(x => new { x.FileType, x.FileName }).ToListAsync();
+ var hasZip = noneDicomFiles.Any(x => x.FileType == "application/zip"
+ || x.FileType == "application/x-zip-compressed"
+ || x.FileName.EndsWith(".zip", StringComparison.OrdinalIgnoreCase));
+ var hasImage = noneDicomFiles.Any(x => x.FileType.StartsWith("image/", StringComparison.OrdinalIgnoreCase)
+ || x.FileName.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase)
+ || x.FileName.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase)
+ || x.FileName.EndsWith(".png", StringComparison.OrdinalIgnoreCase)
+ || x.FileName.EndsWith(".bmp", StringComparison.OrdinalIgnoreCase)
+ || x.FileName.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase));
+
+ if (!hasZip || !hasImage)
+ {
+ throw new BusinessValidationFailedException(_localizer["IVUSCriterionImageFileVerify"]);
+ }
+
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.ROI && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs
index 7f05e0469..02e40a44d 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs
@@ -35,6 +35,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
IGeneralCalculateService _generalCalculateService,
IVisitTaskHelpeService _visitTaskHelpeService,
IRepository _readingTaskQuestionAnswerRepository,
+ IRepository _taskStudyRepository,
+ IRepository _noneDicomStudyFileRepository,
ILogger _logger, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ICriterionCalculateService
{
///
@@ -1597,6 +1599,18 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
+ var noneDicomFiles = await _noneDicomStudyFileRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId)
+ .Select(x => new { x.FileType, x.FileName }).ToListAsync();
+ var hasDicom = await _taskStudyRepository.AnyAsync(x => x.VisitTaskId == inDto.VisitTaskId);
+ var hasZip = noneDicomFiles.Any(x => x.FileType == "application/zip"
+ || x.FileType == "application/x-zip-compressed"
+ || x.FileName.EndsWith(".zip", StringComparison.OrdinalIgnoreCase));
+
+ if (!hasDicom || !hasZip)
+ {
+ throw new BusinessValidationFailedException(_localizer["OCTCriterionImageFileVerify"]);
+ }
+
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.ROI && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteEquipmentSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteEquipmentSurveyViewModel.cs
index 1b383906d..74a79c5b2 100644
--- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteEquipmentSurveyViewModel.cs
+++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteEquipmentSurveyViewModel.cs
@@ -3,6 +3,8 @@
// 生成时间 2021-12-23 13:21:04
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
+using IRaCIS.Core.Application.Helper;
+
namespace IRaCIS.Core.Application.Contracts
{
/// TrialSiteEquipmentSurveyView 列表视图模型
@@ -49,33 +51,44 @@ namespace IRaCIS.Core.Application.Contracts
public string ScannerType { get; set; } = string.Empty;
public string Note { get; set; } = string.Empty;
-
+ [DictionaryTranslate("SiteSurvey_ScanEquipmentType")]
[Comment("扫描设备-New")]
public int? EquipmentTypeEnum { get; set; }
public string OtherEquipmentType { get; set; }
[Comment("扫描设备厂商")]
+ [DictionaryTranslate("ManufacturerType")]
public int? ManufacturerType { get; set; }
[Comment("磁场强度 (1.5T / 3.0T)")]
+ [DictionaryTranslate("MagneticFieldStrengthType")]
public int? MagneticFieldStrengthType { get; set; }
+
+ [DictionaryTranslate("BodyCoilChannelCount")]
[Comment("体部线圈通道数 (≥16 或 <16)")]
public int? BodyCoilChannelCount { get; set; }
+ [DictionaryTranslate("YesOrNo")]
[Comment("是否具备专用的PDFF脂肪定量序列(CSE-MRI序列)")]
public bool? HasDedicatedPdfFatQuantificationSequence { get; set; }
+ [DictionaryTranslate("PdfFatQuantificationSequenceType")]
+
[Comment("专用的PDFF脂肪定量序列类型 (当 HasDedicatedPdfFatQuantificationSequence = true 时有效)")]
public int? PdfFatQuantificationSequenceType { get; set; }
[Comment("其他序列详细说明 (当 PdfFatQuantificationSequenceType = Other 时建议填写)")]
public string OtherSequenceSpecification { get; set; }
+ [DictionaryTranslate("YesOrNo")]
[Comment("是否包含 T2/R2 校正(用于铁沉积校正)")]
public bool? HasT2R2Correction { get; set; }
+
+
+ [DictionaryTranslate("YesOrNo")]
[Comment("是否可完整导出 PDFF 参数图及全部原始 DICOM 数据")]
public bool? CanFullyExportPdfParameterMapsAndRawDicom { get; set; }
}
diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs
index d6f928d35..08500b416 100644
--- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs
+++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs
@@ -5,6 +5,7 @@
//--------------------------------------------------------------------
using IRaCIS.Application.Contracts;
+using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations;
@@ -131,21 +132,23 @@ namespace IRaCIS.Core.Application.Contracts
/// TrialSiteSurveyView 列表视图模型
- public class TrialSiteSurveyView: TrialSiteSurveyAddOrEdit
+ public class TrialSiteSurveyView : TrialSiteSurveyAddOrEdit
{
public string TrialSiteCode { get; set; } = String.Empty;
public string TrialSiteAliasName { get; set; } = String.Empty;
public string SiteName { get; set; } = string.Empty;
+
+ [DictionaryTranslate("YesOrNo")]
public bool IsDeleted { get; set; }
-
+
public DateTime CreateTime { get; set; }
public Guid CreateUserId { get; set; }
public DateTime UpdateTime { get; set; }
public Guid UpdateUserId { get; set; }
-
+ [DictionaryTranslate("ResearchRecord")]
public TrialSiteSurveyEnum State { get; set; }
public string LatestBackReason { get; set; } = string.Empty;
@@ -215,7 +218,7 @@ namespace IRaCIS.Core.Application.Contracts
}
public class UseEmialGetDoctorInfoOutDto
- {
+ {
public Guid DoctorId { get; set; }
}
@@ -326,14 +329,21 @@ namespace IRaCIS.Core.Application.Contracts
public string UserName { get; set; } = string.Empty;
public string Phone { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
+
public int AverageEngravingCycle { get; set; }
+
+ [DictionaryTranslate("YesOrNo")]
public bool IsConfirmImagingTechnologist { get; set; }
public string NotConfirmReson { get; set; } = string.Empty;
+
+ [DictionaryTranslate("EfficacyEvaluatorType")]
public int EfficacyEvaluatorType { get; set; }
+
+ [DictionaryTranslate("YesOrNo")]
public bool IsFollowStudyParameters { get; set; }
public string NotFollowReson { get; set; } = string.Empty;
-
+ [DictionaryTranslate("YesOrNo")]
[Comment("MRI-PDEE 是否为本中心该适应症的常规诊疗检查项目")]
public bool? IsRoutineMRIPDEE { get; set; }
@@ -346,14 +356,17 @@ namespace IRaCIS.Core.Application.Contracts
[Comment("MRI-PDEE 其他")]
public string MRIPDFFOther { get; set; }
+ [DictionaryTranslate("YesOrNo")]
[Comment("是否授权影像科老师参与")]
public bool? IsAuthorizeRadiologistsParticipate { get; set; }
+ [DictionaryTranslate("YesOrNo")]
[Comment("保持 1-2 名固定技师")]
public bool? AssignFixedTechnologists { get; set; }
+ [DictionaryTranslate("YesOrNo")]
[Comment("是否严格按照影像手册参数完成刻盘")]
public bool? ISStrictManualBurnFlag { get; set; }
@@ -450,6 +463,92 @@ namespace IRaCIS.Core.Application.Contracts
}
+ public class SiteSurveyLogQuery:SortInput
+ {
+ [NotDefault]
+ public Guid TrialSiteSurveyId { get; set; }
+
+ public Guid? Id { get; set; }
+ }
+
+ public class SiteSurveyLogDTO
+ {
+ public Guid Id { get; set; }
+ public Guid TrialSiteSurveyId { get; set; }
+
+ public string Name { get; set; }
+
+ public UserTypeEnum UserType { get; set; }
+
+ public SiteSurveyOptTyp OptType { get; set; }
+
+ public string Reason { get; set; }
+
+ [MaxLength]
+ public string Json { get; set; }
+
+ [Comment("更新调研表之前的调研表")]
+ public Guid? OriginTrialSiteSurveyId { get; set; }
+
+
+ public string CreateTime { get; set; }
+ }
+
+ public class SiteSurveyEquipmentDto : TrialSiteEquipmentSurveyView
+ {
+ public string TrialSiteCode { get; set; }
+
+
+ public string TrialSiteName { get; set; } = String.Empty;
+
+ public string TrialSiteAliasName { get; set; } = String.Empty;
+
+
+ public string UserName { get; set; } = string.Empty;
+ public string Phone { get; set; } = string.Empty;
+ public string Email { get; set; } = string.Empty;
+
+ [DictionaryTranslate("YesOrNo")]
+ public bool IsDeleted { get; set; }
+
+ [DictionaryTranslate("ResearchRecord")]
+ public TrialSiteSurveyEnum State { get; set; }
+ }
+
+ public class SiteSurveyEquipmentQuery : PageInput
+ {
+ [NotDefault]
+ public Guid TrialId { get; set; }
+
+ public Guid? TrialSiteId { get; set; }
+ public string? TrialSiteCode { get; set; }
+
+ public string? TrialSiteName { get; set; }
+
+ public bool? IsDeleted { get; set; }
+
+ public TrialSiteSurveyEnum? State { get; set; }
+ }
+
+ public class SiteSurveyInfoQuery : PageInput
+ {
+ [NotDefault]
+ public Guid TrialId { get; set; }
+
+ public Guid? TrialSiteId { get; set; }
+
+ public string? TrialSiteCode { get; set; }
+
+ public string? TrialSiteName { get; set; }
+
+ public bool? IsDeleted { get; set; }
+
+ public TrialSiteSurveyEnum? State { get; set; }
+ }
+
+ public class SiteSurveyInfoDto
+ {
+
+ }
}
-
diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs
index 4d27ac9aa..4d0d46e97 100644
--- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs
+++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs
@@ -3,6 +3,9 @@
// 生成时间 2021-12-23 13:20:59
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
+using DocumentFormat.OpenXml.Office2013.Excel;
+using DocumentFormat.OpenXml.Spreadsheet;
+using DocumentFormat.OpenXml.Vml;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Helper;
@@ -22,6 +25,8 @@ namespace IRaCIS.Core.Application.Contracts
///
[ApiExplorerSettings(GroupName = "Trial")]
public class TrialSiteSurveyService(IRepository _trialSiteSurveyRepository,
+ IRepository _siteSurveyLogRepository,
+ IRepository _trialSiteEquipmentSurveyRepository,
IRepository _trialSiteUserSurveyRepository,
IRepository _userRoleRepository,
IRepository _identityUserRepository,
@@ -474,6 +479,7 @@ namespace IRaCIS.Core.Application.Contracts
public async Task SubmissionRejection(TrialSiteSubmitBackCommand trialSiteSubmitBackCommand, [FromServices] IMailVerificationService _IMailVerificationService)
{
+ var trialId = trialSiteSubmitBackCommand.TrialId;
var trialSiteSurveyId = trialSiteSubmitBackCommand.TrialSiteSurveyId;
var survey = await _trialSiteSurveyRepository.FirstOrDefaultAsync(t => t.Id == trialSiteSurveyId);
@@ -492,36 +498,48 @@ namespace IRaCIS.Core.Application.Contracts
}
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
{
- var isTrialSPMJoin = await _trialRepository.AnyAsync(t => t.Id == trialSiteSubmitBackCommand.TrialId && t.IsSPMJoinSiteSurvey);
+ // var isTrialSPMJoin = await _trialRepository.AnyAsync(t => t.Id == trialSiteSubmitBackCommand.TrialId && t.IsSPMJoinSiteSurvey);
- var hasSPMOrCPM = await _trialRepository.Where(t => t.Id == trialSiteSubmitBackCommand.TrialId).AnyAsync(t => t.TrialIdentityUserList.SelectMany(t => t.TrialUserRoleList).Any(t =>
- t.UserRole.IdentityUser.Status == UserStateEnum.Enable
- && t.UserRole.IsUserRoleDisabled == false
- && (t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM))
- );
+ // var hasSPMOrCPM = await _trialRepository.Where(t => t.Id == trialSiteSubmitBackCommand.TrialId).AnyAsync(t => t.TrialIdentityUserList.SelectMany(t => t.TrialUserRoleList).Any(t =>
+ //t.UserRole.IdentityUser.Status == UserStateEnum.Enable
+ //&& t.UserRole.IsUserRoleDisabled == false
+ //&& (t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM))
+ //);
- var isSPMjoin = isTrialSPMJoin && hasSPMOrCPM;
+ // var isSPMjoin = isTrialSPMJoin && hasSPMOrCPM;
- if (isSPMjoin)
- {
- survey.State = TrialSiteSurveyEnum.CRCSubmitted;
+ // if (isSPMjoin)
+ // {
+ // survey.State = TrialSiteSurveyEnum.CRCSubmitted;
- survey.ReviewerUserId = null;
- survey.ReviewerTime = null;
- }
- else
- {
- survey.State = TrialSiteSurveyEnum.ToSubmit;
+ // survey.ReviewerUserId = null;
+ // survey.ReviewerTime = null;
+ // }
+ // else
+ // {
+ // survey.State = TrialSiteSurveyEnum.ToSubmit;
- survey.PreliminaryUserId = null;
- survey.ReviewerUserId = null;
- survey.PreliminaryTime = null;
- survey.ReviewerTime = null;
+ // survey.PreliminaryUserId = null;
+ // survey.ReviewerUserId = null;
+ // survey.PreliminaryTime = null;
+ // survey.ReviewerTime = null;
+
+
+ // }
+
+ survey.State = TrialSiteSurveyEnum.ToSubmit;
+
+ survey.PreliminaryUserId = null;
+ survey.ReviewerUserId = null;
+ survey.PreliminaryTime = null;
+ survey.ReviewerTime = null;
- }
}
+ var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId);
+ await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = $"{_userInfo.FullName} ({_userInfo.UserName})", UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Reject, Reason = survey.LatestBackReason, Json = info.ToJsonStr() });
+
await _trialSiteSurveyRepository.SaveChangesAsync();
return ResponseOutput.Ok();
@@ -547,6 +565,10 @@ namespace IRaCIS.Core.Application.Contracts
survey.IsDeleted = true;
+ var info = await GetSiteSurveyInfo(trialSiteSurveyId, survey.TrialId);
+ await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = $"{_userInfo.FullName} ({_userInfo.UserName})", UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Over, Json = info.ToJsonStr() });
+
+
await _trialSiteSurveyRepository.SaveChangesAsync();
return ResponseOutput.Ok();
@@ -612,6 +634,9 @@ namespace IRaCIS.Core.Application.Contracts
//从项目site 中找到已存在的 加到历史人员中
addSurvey.TrialSiteUserSurveyList = userList;
+ //添加创建日志
+ addSurvey.SiteSurveyLogList.Add(new SiteSurveyLog() { Name = userInfo.EmailOrPhone, OptType = SiteSurveyOptTyp.Create });
+
currentEntity = await _trialSiteSurveyRepository.AddAsync(addSurvey);
}
@@ -649,7 +674,7 @@ namespace IRaCIS.Core.Application.Contracts
//找到最新的调研表
var currentLatest = await _trialSiteSurveyRepository.Where(t => t.TrialId == userInfo.TrialId && t.TrialSiteId == userInfo.TrialSiteId, true)
- .Include(u => u.TrialSiteEquipmentSurveyList).Include(u => u.TrialSiteUserSurveyList).OrderByDescending(t => t.CreateTime).FirstOrDefaultAsync();
+ .Include(u => u.TrialSiteEquipmentSurveyList).Include(u => u.TrialSiteUserSurveyList).Include(t => t.SiteSurveyLogList).OrderByDescending(t => t.CreateTime).FirstOrDefaultAsync();
if (currentLatest == null)
{
@@ -674,6 +699,11 @@ namespace IRaCIS.Core.Application.Contracts
{
}
+
+ //更新调研表日志 - 老的调研表
+ var info1 = await GetSiteSurveyInfo(currentLatest.Id, currentLatest.TrialId);
+ currentLatest.SiteSurveyLogList.Add(new SiteSurveyLog() { Name = userInfo.ReplaceUserEmailOrPhone, OptType = SiteSurveyOptTyp.Over, Json = info1.ToJsonStr() });
+
var copy = currentLatest.Clone();
copy.State = TrialSiteSurveyEnum.ToSubmit;
@@ -685,10 +715,21 @@ namespace IRaCIS.Core.Application.Contracts
copy.Id = Guid.Empty;
copy.CreateTime = DateTime.Now;
+ copy.PreliminaryUserId = null;
+ copy.ReviewerUserId = null;
+ copy.PreliminaryTime = null;
+ copy.ReviewerTime = null;
+
if (userInfo.ReplaceUserEmailOrPhone != userInfo.EmailOrPhone)
{
copy.UserName = String.Empty;
copy.Phone = String.Empty;
+
+ //更新调研表日志
+
+ var info = await GetSiteSurveyInfo(currentLatest.Id, currentLatest.TrialId);
+ copy.SiteSurveyLogList.ForEach(t => { t.Id = Guid.Empty; });
+ copy.SiteSurveyLogList.Add(new SiteSurveyLog() { Name = userInfo.EmailOrPhone, OptType = SiteSurveyOptTyp.Update, OriginTrialSiteSurveyId = currentLatest.Id, Json = info.ToJsonStr() });
}
@@ -885,12 +926,25 @@ namespace IRaCIS.Core.Application.Contracts
}
+ //审批调研表日志
+
+ var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId);
+
+ await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = trialSiteSurvey.UserName, OptType = SiteSurveyOptTyp.Submit, Json = info.ToJsonStr() });
+
}
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)
{
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.UserRoleId, PreliminaryTime = DateTime.Now });
+
+ //审批调研表日志
+
+ var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId);
+
+ await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = $"{_userInfo.FullName} ({_userInfo.UserName})", UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Approved, Json = info.ToJsonStr() });
+
}
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
{
@@ -903,7 +957,16 @@ namespace IRaCIS.Core.Application.Contracts
//将历史锁定的调研表废弃
await _trialSiteSurveyRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteSurvey.TrialSiteId && t.State == TrialSiteSurveyEnum.PMCreatedAndLock && t.Id != trialSiteSurveyId, z => new TrialSiteSurvey() { IsDeleted = true });
+
+ //审批调研表日志
+
+ var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId);
+ await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = $"{_userInfo.FullName} ({_userInfo.UserName})", UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Approved, Json = info.ToJsonStr() });
+
}
+
+
+
await _trialSiteSurveyRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
@@ -1137,7 +1200,7 @@ namespace IRaCIS.Core.Application.Contracts
await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => userJoinIdList.Contains(t.Id), u => new TrialSiteUserSurvey() { IsJoin = true, SystemUserId = existSysUser.Id });
-
+
await _trialSiteUserRoleRepository.SaveChangesAsync();
@@ -1149,12 +1212,19 @@ namespace IRaCIS.Core.Application.Contracts
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()
+ foreach (var item in needQuitUserList)
{
- IsDeleted = true,
- DeletedTime = DateTime.Now,
- });
+ await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId
+ && t.UserRole.UserTypeId == item.UserTypeId
+ && t.UserRole.IdentityUserId == item.SystemUserId, 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 });
@@ -1398,5 +1468,105 @@ namespace IRaCIS.Core.Application.Contracts
+ ///
+ /// 获取中心调研日志
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> GetSiteSurveyLogList(SiteSurveyLogQuery inQuery)
+ {
+ return _siteSurveyLogRepository.Where(t => t.TrialSiteSurveyId == inQuery.TrialSiteSurveyId)
+ .WhereIf(inQuery.Id != null, t => t.Id == inQuery.Id)
+ .ProjectTo(_mapper.ConfigurationProvider).OrderBy(t => t.CreateTime).ToList();
+ }
+
+ ///
+ /// 获取中心设备信息
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task GetSiteSurveyEquipmentList(SiteSurveyEquipmentQuery inQuery)
+ {
+
+ //找到该中心最新的调研记录
+ var groupSelectIdQuery =
+ _trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId)
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
+ .GroupBy(t => t.TrialSiteId)
+ .Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
+
+ var pageList = await _trialSiteEquipmentSurveyRepository.Where(t => t.TrialSiteSurvey.TrialId == inQuery.TrialId).IgnoreQueryFilters()
+ .Where(t => groupSelectIdQuery.Contains(t.TrialSiteSurveyId))
+ .WhereIf(inQuery.IsDeleted != null, t => t.TrialSiteSurvey.IsDeleted == inQuery.IsDeleted)
+ .WhereIf(inQuery.State != null, t => t.TrialSiteSurvey.State == inQuery.State)
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteSurvey.TrialSiteId == inQuery.TrialSiteId)
+ .WhereIf(inQuery.TrialSiteCode.IsNotNullOrEmpty(), t => t.TrialSiteSurvey.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode))
+ .WhereIf(inQuery.TrialSiteName.IsNotNullOrEmpty(), t => t.TrialSiteSurvey.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteName) ||
+ t.TrialSiteSurvey.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteName))
+ .ProjectTo(_mapper.ConfigurationProvider).ToPagedListAsync(inQuery);
+
+ var siteSurveryConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
+
+ var config = JsonConvert.DeserializeObject(siteSurveryConfig) ?? new TrialExtraConfig();
+
+ return ResponseOutput.Ok(pageList, config);
+ }
+
+ ///
+ /// 调研表基本信息
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task GetSiteSurveyInfoList(SiteSurveyInfoQuery inQuery)
+ {
+
+ //找到该中心最新的调研记录
+ var groupSelectIdQuery =
+ _trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId)
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
+ .GroupBy(t => t.TrialSiteId)
+ .Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
+
+ var pageList = await _trialSiteSurveyRepository.Where(t => t.TrialId == inQuery.TrialId).IgnoreQueryFilters()
+ .Where(t => groupSelectIdQuery.Contains(t.Id))
+ .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
+ .WhereIf(inQuery.State != null, t => t.State == inQuery.State)
+ .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
+ .WhereIf(inQuery.TrialSiteCode.IsNotNullOrEmpty(), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode))
+ .WhereIf(inQuery.TrialSiteName.IsNotNullOrEmpty(), t => t.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteName) ||
+ t.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteName))
+
+ .ProjectTo(_mapper.ConfigurationProvider).ToPagedListAsync(inQuery);
+
+
+ var siteSurveryConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
+
+ var config = JsonConvert.DeserializeObject(siteSurveryConfig) ?? new TrialExtraConfig();
+
+ return ResponseOutput.Ok(pageList, config);
+ }
+
+ ///
+ /// SPM 是否参与流程
+ ///
+ ///
+ ///
+ public async Task GetTrialIsSPMJoin(Guid trialId)
+ {
+ var hasSPMOrCPM = await _trialRepository.Where(t => t.Id == trialId).AnyAsync(t => t.TrialIdentityUserList.SelectMany(t => t.TrialUserRoleList).Any(t =>
+ t.UserRole.IdentityUser.Status == UserStateEnum.Enable
+ && t.UserRole.IsUserRoleDisabled == false
+ && (t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM))
+ );
+
+ var isTrialSPMJoin = await _trialRepository.AnyAsync(t => t.Id == trialId && t.IsSPMJoinSiteSurvey);
+
+ var isSPMjoin = isTrialSPMJoin && hasSPMOrCPM;
+
+ return isSPMjoin;
+ }
}
}
diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs b/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs
index 9b0aa6e84..cf1575976 100644
--- a/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs
@@ -97,7 +97,22 @@ namespace IRaCIS.Core.Application.AutoMapper
CreateMap();
-
+
+
+ CreateMap();
+
+ CreateMap()
+ .ForMember(d => d.IsDeleted, u => u.MapFrom(s => s.TrialSiteSurvey.IsDeleted))
+ .ForMember(d => d.State, u => u.MapFrom(s => s.TrialSiteSurvey.State))
+ .ForMember(d => d.Email, u => u.MapFrom(s => s.TrialSiteSurvey.Email))
+ .ForMember(d => d.Phone, u => u.MapFrom(s => s.TrialSiteSurvey.Phone))
+ .ForMember(d => d.UserName, u => u.MapFrom(s => s.TrialSiteSurvey.UserName))
+ .ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSiteSurvey.TrialSite.TrialSiteAliasName))
+ .ForMember(d => d.TrialSiteName, u => u.MapFrom(s => s.TrialSiteSurvey.TrialSite.TrialSiteName))
+ .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSiteSurvey.TrialSite.TrialSiteCode));
+
+
+
}
}
}
\ No newline at end of file
diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
index 8240f31c5..38d389b97 100644
--- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
+++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
@@ -3381,6 +3381,11 @@ namespace IRaCIS.Core.Domain.Share
///
PercentageDifference = 5,
+ ///
+ /// 不适用
+ ///
+ NotApplicable = 6,
+
}
diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs
index b7526d38d..4f9ab14ba 100644
--- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs
+++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs
@@ -316,6 +316,11 @@ public class VisitTask : BaseFullAuditEntity
///
public bool IsCopyLesionAnswer { get; set; } = false;
+ ///
+ /// 是否计算过裁判
+ ///
+ public bool IsCalculatedJudge { get; set; } = false;
+
#region 完全随机增加字段
[Comment("完全随机阅片号")]
diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs
index 08d310614..2e308c3fc 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs
@@ -196,6 +196,73 @@ public class ReadingQuestionCriterionTrial : BaseAddAuditEntity
/// 定圆工具默认半径
///
public decimal CircleRadius { get; set; } = 10;
+
+ ///
+ /// 仲裁模式
+ ///
+ public JudgeMode JudgeModeEnum { get; set; } = JudgeMode.SelectOne;
+
+ ///
+ /// 裁判规则
+ ///
+ public JudgeRule JudgeRuleEnum { get; set; } = JudgeRule.Consistent;
+
+ ///
+ /// 裁判任务生成
+ ///
+ public JudgeGenerate JudgeGenerateEnum { get; set; } = JudgeGenerate.Instant;
+}
+
+///
+/// 裁判任务生成时间
+///
+public enum JudgeGenerate
+{
+ ///
+ /// 及时
+ ///
+ Instant = 0,
+
+ ///
+ /// 阶段性
+ ///
+ Phased = 1,
+
+}
+
+
+///
+/// 仲裁模式
+///
+public enum JudgeMode
+{
+ ///
+ /// 整体结果择一判定
+ ///
+ SelectOne = 0,
+
+ ///
+ /// 指标组合判定
+ ///
+ Combined = 1,
+
+}
+
+///
+/// 裁判规则
+///
+public enum JudgeRule
+{
+ ///
+ /// 跨访视一致规则
+ ///
+ Consistent = 0,
+
+ ///
+ /// 访视间差异规则
+ ///
+ Difference = 1,
+
}
diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionVisitJudgeRule.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionVisitJudgeRule.cs
new file mode 100644
index 000000000..67dcf892d
--- /dev/null
+++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionVisitJudgeRule.cs
@@ -0,0 +1,67 @@
+using IRaCIS.Core.Domain.Share;
+using System.Linq;
+
+namespace IRaCIS.Core.Domain.Models;
+
+[Comment("项目阅片访视裁判规则")]
+[Table("ReadingQuestionVisitJudgeRule")]
+public class ReadingQuestionVisitJudgeRule : BaseAddAuditEntity
+{
+ #region 导航属性
+ [Comment("分页标准")]
+ [ForeignKey("ReadingQuestionId")]
+ [JsonIgnore]
+ public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
+ #endregion
+
+ ///
+ /// 问题Id
+ ///
+ [Comment("问题Id")]
+ public Guid ReadingQuestionId { get; set; }
+
+ ///
+ /// 访视Num
+ ///
+ public decimal VisitNum { get; set; }
+
+ ///
+ /// 答案分组
+ ///
+ [MaxLength]
+ [Comment("答案分组")]
+ public List AnswerGroup { get; set; } = new List();
+
+ ///
+ /// 答案组合
+ ///
+ [Comment("答案组合")]
+ [MaxLength]
+ public List AnswerCombination { get; set; } = new List();
+
+ ///
+ /// 裁判类型
+ ///
+ [Comment("裁判类型")]
+ public JudgeTypeEnum JudgeType { get; set; } = JudgeTypeEnum.AnswerDisaffinity;
+
+ ///
+ /// 裁判百分比或绝对值的相差值
+ ///
+ [Comment("裁判百分比或绝对值的相差值")]
+ public decimal? JudgeDifferenceValue { get; set; } = 0;
+
+ ///
+ /// 裁判百分比或绝对值的相差值匹配规则
+ ///
+ [Comment("裁判百分比或绝对值的相差值匹配规则")]
+ public JudgeDifferenceType JudgeDifferenceType { get; set; }
+}
+
+
+public class AnswerCombinationDto
+{
+ public List AnswerGroupA { get; set; }
+
+ public List AnswerGroupB { get; set; }
+}
diff --git a/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs b/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs
index 2112130a3..e13678cf2 100644
--- a/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs
+++ b/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs
@@ -23,6 +23,10 @@ public class TrialSiteSurvey : BaseFullDeleteAuditEntity
[JsonIgnore]
public CommonUploadRecord SiteSurveyFile { get; set; }
+
+ [JsonIgnore]
+
+ public List SiteSurveyLogList { get; set; }=new List();
#endregion
public Guid TrialSiteId { get; set; }
@@ -64,7 +68,7 @@ public class TrialSiteSurvey : BaseFullDeleteAuditEntity
public bool? IsRoutineMRIPDEE { get; set; }
[Comment("MRI-PDFF 单次检查时长")]
- public string MRIPDFFScanTime { get; set; }
+ public string MRIPDFFScanTime { get; set; }
[Comment("MRI-PDFF 预约等待时长")]
public string MRIPDFFLeadTime { get; set; }
@@ -74,7 +78,7 @@ public class TrialSiteSurvey : BaseFullDeleteAuditEntity
[Comment("是否授权影像科老师参与")]
-
+
public bool? IsAuthorizeRadiologistsParticipate { get; set; }
[Comment("保持 1-2 名固定技师")]
@@ -88,3 +92,43 @@ public class TrialSiteSurvey : BaseFullDeleteAuditEntity
public string NotStrictManualBurnFlagReason { get; set; }
}
+
+
+public class SiteSurveyLog : BaseAddAuditEntity
+{
+
+ [JsonIgnore]
+ [ForeignKey("TrialSiteSurveyId")]
+ public TrialSiteSurvey TrialSiteSurvey { get; set; }
+
+ public Guid TrialSiteSurveyId { get; set; }
+
+ public string Name { get; set; }
+
+ public UserTypeEnum UserType { get; set; }
+
+ public SiteSurveyOptTyp OptType { get; set; }
+
+ public string Reason { get; set; }
+
+ [MaxLength]
+ public string Json { get; set; }
+
+ [Comment("更新调研表之前的调研表")]
+ public Guid? OriginTrialSiteSurveyId { get; set; }
+}
+
+public enum SiteSurveyOptTyp
+{
+ Create = 0,
+
+ Submit = 1,
+
+ Approved = 2,
+
+ Reject = 3,
+
+ Update = 4,
+
+ Over=5,
+}
\ No newline at end of file
diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
index 8d3313044..d3fa00088 100644
--- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
+++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
@@ -119,6 +119,14 @@ public class IRaCISDBContext : DbContext
);
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.Property(e => e.AnswerCombination).HasConversion(
+ v => v == null ? null : JsonConvert.SerializeObject(v),
+ v => string.IsNullOrEmpty(v) ? new List() { } : JsonConvert.DeserializeObject>(v)
+ );
+ });
+
#region pgsql codefirst 配置 暂时屏蔽
//if (base.Database.IsNpgsql())
//{
@@ -421,6 +429,8 @@ public class IRaCISDBContext : DbContext
public virtual DbSet ReadingQuestionTrial { get; set; }
+ public virtual DbSet ReadingQuestionVisitJudgeRule { get; set; }
+
public virtual DbSet ReadingClinicalDataPDF { get; set; }
public virtual DbSet ReadingConsistentClinicalData { get; set; }
diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20260811061835_siteSurveylog.Designer.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20260811061835_siteSurveylog.Designer.cs
new file mode 100644
index 000000000..6b0de7c74
--- /dev/null
+++ b/IRaCIS.Core.Infra.EFCore/Migrations/20260811061835_siteSurveylog.Designer.cs
@@ -0,0 +1,22496 @@
+//
+using System;
+using IRaCIS.Core.Infra.EFCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace IRaCIS.Core.Infra.EFCore.Migrations
+{
+ [DbContext(typeof(IRaCISDBContext))]
+ [Migration("20260811061835_siteSurveylog")]
+ partial class siteSurveylog
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "10.0.8")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.Attachment", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("编码");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DoctorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("datetime2")
+ .HasComment("过期时间");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsAuthorizedView")
+ .HasColumnType("bit");
+
+ b.Property("IsOfficial")
+ .HasColumnType("bit")
+ .HasComment("是否正式简历");
+
+ b.Property("Language")
+ .HasColumnType("int")
+ .HasComment("1 中文 2为英文");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("文件类型名");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("Attachment", t =>
+ {
+ t.HasComment("医生 - 简历|证书 文档表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditDocumentTypeEnum")
+ .HasColumnType("int");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileFormat")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FilePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("FileSize")
+ .HasPrecision(18, 2)
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("IsAuthorization")
+ .HasColumnType("bit");
+
+ b.Property("MainFileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("AuditDocument", t =>
+ {
+ t.HasComment("稽查文档管理");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocumentClosure", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AncestorId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("祖先");
+
+ b.Property("Depth")
+ .HasColumnType("int");
+
+ b.Property("DescendantId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("后代");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.ToTable("AuditDocumentClosure");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditContent")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("AuditState")
+ .HasColumnType("int")
+ .HasComment("稽查状态");
+
+ b.Property("AuditTime")
+ .HasColumnType("date")
+ .HasComment("稽查日期");
+
+ b.Property("AuditType")
+ .HasColumnType("int")
+ .HasComment("稽查形式");
+
+ b.Property("BeginTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("EndTime")
+ .HasColumnType("datetime2");
+
+ b.Property("IsViewTrainingRecord")
+ .HasColumnType("bit");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("AuditRecord");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecordIdentityUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditRecordId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IdentityUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("AuditRecordIdentityUser");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecordPermission", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditDocumentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditRecordId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("AuditRecordPermission");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CRO", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CROCode")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CROName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CRONameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsTrialLevel")
+ .HasColumnType("bit")
+ .HasComment("是否是项目级别");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("CROCompany", t =>
+ {
+ t.HasComment("机构 - CRO");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CheckChallengeDialog", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsCRCNeedReply")
+ .HasColumnType("bit")
+ .HasComment("CRC是否需要回复 前端使用");
+
+ b.Property("ParamInfo")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasComment("核查的检查信息Json");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TalkContent")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserTypeEnum")
+ .HasColumnType("int")
+ .HasComment("核查过程中的操作用户类型");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("CheckChallengeDialog", t =>
+ {
+ t.HasComment("一致性核查 - 对话记录表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalAnswerRowInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowIndex")
+ .HasColumnType("int");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("ClinicalAnswerRowInfo", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题行记录");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataSystemSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetEnum")
+ .HasColumnType("int")
+ .HasComment("枚举(字典里面取的)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("EnFileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("EnPath")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsEnable")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("ClinicalDataSystemSet", t =>
+ {
+ t.HasComment("系统 - 临床数据配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataTrialSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int")
+ .HasComment("临床级别");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("EnFileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("EnPath")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsConfirm")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("SystemClinicalDataSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("ClinicalDataTrialSet", t =>
+ {
+ t.HasComment("项目 - 临床数据适应标准配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalForm", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CheckDate")
+ .HasColumnType("datetime2")
+ .HasComment("检查日期");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PicturePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("截图地址");
+
+ b.Property("ReadingId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("VisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("ClinicalForm", t =>
+ {
+ t.HasComment("受试者 - 临床表单");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("ClinicalQuestionAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalTableAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("答案");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("答案行的Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TableQuestionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("ClinicalTableAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessScenarioEnum")
+ .HasColumnType("int")
+ .HasComment("业务场景");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionTypeEnum")
+ .HasColumnType("int")
+ .HasComment("系统标准枚举");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileTypeEnum")
+ .HasColumnType("int")
+ .HasComment("类型-上传|导出|邮件附件");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("NameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("CommonDocument", t =>
+ {
+ t.HasComment("数据上传 | 数据导出 | 邮件附件 文件记录表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonUploadRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("FileType")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("文件类型");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("CommonUploadRecord");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionKeyFileRead", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IdentityUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialCriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("CriterionKeyFileRead", t =>
+ {
+ t.HasComment("标准阅读关键点");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusSystem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsSystemCriterion")
+ .HasColumnType("bit");
+
+ b.Property("LesionType")
+ .HasColumnType("int")
+ .HasComment("病灶类型");
+
+ b.Property("OrganType")
+ .HasColumnType("int")
+ .HasComment("器官类型");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("CriterionNidusSystem", t =>
+ {
+ t.HasComment("系统标准 - 病灶器官表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusTrial", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LesionType")
+ .HasColumnType("int");
+
+ b.Property("OrganType")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreateTime");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
+
+ b.ToTable("CriterionNidusTrial", t =>
+ {
+ t.HasComment("项目标准 - 病灶器官表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DataInspection", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BatchId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("批次Id");
+
+ b.Property("ChildrenTypeId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("子类");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateUserName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("创建人姓名");
+
+ b.Property("CreateUserRealName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("DoctorUserId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("阅片医生");
+
+ b.Property("EntityName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("被稽查实体名");
+
+ b.Property("GeneralId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("要稽查对象Id");
+
+ b.Property("IP")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Identification")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("标识");
+
+ b.Property("IsFrontAdd")
+ .HasColumnType("bit")
+ .HasComment("是否是前端添加");
+
+ b.Property("IsSign")
+ .HasColumnType("bit");
+
+ b.Property("JsonDetail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastJsonDetail")
+ .HasColumnType("nvarchar(max)")
+ .HasComment("上一条json");
+
+ b.Property("ModuleTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("被稽查对象外键1");
+
+ b.Property("ObjectRelationParentId2")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId3")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OptTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("父ID");
+
+ b.Property