修改site关联
parent
4db3860ade
commit
0e23719c7b
|
@ -276,7 +276,6 @@ namespace IRaCIS.Core.API.Controllers
|
|||
var studyMonitor = new StudyMonitor()
|
||||
{
|
||||
TrialId = savedInfo.TrialId,
|
||||
SiteId = savedInfo.SiteId,
|
||||
SubjectId = savedInfo.SubjectId,
|
||||
SubjectVisitId = savedInfo.SubjectVisitId,
|
||||
|
||||
|
@ -504,7 +503,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
|
||||
await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
|
||||
|
||||
var sv = (await _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException();
|
||||
var sv = (await _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.TrialSiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException();
|
||||
|
||||
var studyMonitor = await _studyMonitorRepository.FirstOrDefaultAsync(t => t.Id == studyMonitorId);
|
||||
|
||||
|
@ -1073,7 +1072,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
}
|
||||
//处理好 用户类型 和用户类型枚举
|
||||
var sysUserTypeList = _usertypeRepository.Where(t => t.UserTypeEnum == UserTypeEnum.CRA || t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { UserTypeId = t.Id, t.UserTypeEnum }).ToList();
|
||||
var siteList = _trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode)).Select(t => new { t.TrialSiteCode, t.SiteId }).ToList();
|
||||
var siteList = _trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode)).Select(t => new { t.TrialSiteCode, TrialSiteId= t.Id }).ToList();
|
||||
|
||||
foreach (var item in excelList)
|
||||
{
|
||||
|
@ -1094,7 +1093,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
|
||||
}
|
||||
|
||||
item.SiteId = siteList.FirstOrDefault(t => t.TrialSiteCode.ToUpper() == item.TrialSiteCode.ToUpper()).SiteId;
|
||||
item.TrialSiteId = siteList.FirstOrDefault(t => t.TrialSiteCode.ToUpper() == item.TrialSiteCode.ToUpper()).TrialSiteId;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -515,18 +515,18 @@ public static class FileStoreHelper
|
|||
|
||||
// 获取 入组确认 PD 进展发送邮件Word|PDF 存放路径
|
||||
|
||||
public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId,bool isChangeToPdfFormat=false)
|
||||
public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid trialSiteId, Guid subjectId,bool isChangeToPdfFormat=false)
|
||||
{
|
||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
||||
string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), siteId.ToString(), subjectId.ToString());
|
||||
string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), trialSiteId.ToString(), subjectId.ToString());
|
||||
|
||||
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
|
||||
|
||||
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName, isChangeToPdfFormat);
|
||||
|
||||
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{siteId}/{subjectId}/{trustedFileNameForFileStorage}";
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{trialSiteId}/{subjectId}/{trustedFileNameForFileStorage}";
|
||||
|
||||
var serverFilePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage);
|
||||
|
||||
|
@ -541,7 +541,7 @@ public static class FileStoreHelper
|
|||
return Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), siteId.ToString(), subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.DicomFolder);
|
||||
}
|
||||
|
||||
public static (string PhysicalPath, string RelativePath) GetDicomInstanceFilePath(IWebHostEnvironment _hostEnvironment, Guid trialId, Guid siteId, Guid subjectId, Guid subjectVisitId, Guid studyId, Guid instanceId)
|
||||
public static (string PhysicalPath, string RelativePath) GetDicomInstanceFilePath(IWebHostEnvironment _hostEnvironment, Guid trialId, Guid subjectId, Guid subjectVisitId, Guid studyId, Guid instanceId)
|
||||
{
|
||||
#region 切换存储前
|
||||
//var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
@ -552,7 +552,7 @@ public static class FileStoreHelper
|
|||
|
||||
//加入访视层级 和Data
|
||||
var path = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(),
|
||||
siteId.ToString(), subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.DicomFolder, studyId.ToString());
|
||||
subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.DicomFolder, studyId.ToString());
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
|
@ -561,7 +561,7 @@ public static class FileStoreHelper
|
|||
|
||||
var physicalPath = Path.Combine(path, instanceId.ToString() );
|
||||
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{siteId}/{subjectId}/{subjectVisitId}/{StaticData.Folder.DicomFolder}/{studyId}/{instanceId}";
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{subjectId}/{subjectVisitId}/{StaticData.Folder.DicomFolder}/{studyId}/{instanceId}";
|
||||
|
||||
//var physicalPath = Path.Combine(path, instanceId.ToString() + ".dcm");
|
||||
|
||||
|
|
|
@ -1036,7 +1036,7 @@
|
|||
项目iD
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.SiteId">
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.TrialSiteId">
|
||||
<summary>
|
||||
中心
|
||||
</summary>
|
||||
|
@ -10915,22 +10915,6 @@
|
|||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.LesionInformation.TUTESTCD">
|
||||
<summary>
|
||||
检查项目
|
||||
TUMIDENT (Tumor Identification )
|
||||
TUSPLIT (Tumor Split )
|
||||
TUMERGE (Tumor Merged)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.IReportService.AddLesion(System.Collections.Generic.List{IRaCIS.Core.Application.Contracts.LesionInformation},IRaCIS.Core.Application.Contracts.ReportDTO)">
|
||||
<summary> 添加基线期病灶标识及测量信息 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.IReportService.GetVisitLineLesion(System.String,System.String,System.Decimal,System.String)">
|
||||
<summary>
|
||||
获取访视病灶信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteEquipmentSurveyView">
|
||||
<summary> TrialSiteEquipmentSurveyView 列表视图模型 </summary>
|
||||
</member>
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ViewModel
|
||||
{
|
||||
public class AllocationVisitViewModel
|
||||
{
|
||||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public string BlindName { get; set; } = string.Empty;
|
||||
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
public DateTime? CheckPassedTime { get; set; }
|
||||
|
||||
public bool IsUrgent { get; set; }
|
||||
|
||||
|
||||
public ReadingCategory ReadingCategoryEnum { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -118,7 +118,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public class ConsistentCommonView
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public String TrialSiteCode { get; set; }
|
||||
public string SubjectCode { get; set; }
|
||||
|
@ -200,31 +200,12 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
}
|
||||
|
||||
|
||||
//public class DoctorConsistentRuleSubjectView
|
||||
//{
|
||||
// public Guid TrialId => VisitTaskList.Select(t => t.TrialId).First();
|
||||
// public Guid SiteId => VisitTaskList.Select(t => t.SiteId).First();
|
||||
|
||||
// public String TrialSiteCode => VisitTaskList.Select(t => t.TrialSiteCode).First();
|
||||
// public string SubjectCode => VisitTaskList.Select(t => t.SubjectCode).First();
|
||||
|
||||
// public Guid SubjectId { get; set; }
|
||||
|
||||
// public bool IsHaveGeneratedTask { get; set; }
|
||||
// public int? ValidTaskCount { get; set; }
|
||||
|
||||
// public int? ValidVisitCount => VisitTaskList.Select(t => t.TaskName).Distinct().Count();
|
||||
|
||||
// public List<VisitTaskSimpleView> VisitTaskList { get; set; }
|
||||
|
||||
// //public List<UserSimpleInfo> HistoryDoctorUserList => VisitTaskList.SelectMany(t => t.RelationDoctorUserList).DistinctBy(t=>t.UserId).ToList();
|
||||
//}
|
||||
|
||||
public class InfluenceTaskInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
@ -267,7 +248,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public class TaskMedicalReviewQuery : PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 传了Id
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public Guid UpdateUserId { get; set; }
|
||||
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public string BlindTrialSiteCode { get; set; }
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
|
@ -388,7 +388,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public Guid TrialId { get; set; }
|
||||
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
|
@ -499,7 +499,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
|
@ -521,7 +521,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
|
@ -564,7 +564,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public class SubjectAssignStat
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
@ -644,7 +644,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public class SubjectAssignView
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
|
@ -560,7 +560,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var query = subjectQuery.Select(t => new DoctorSelfConsistentSubjectView()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.TrialSiteId,
|
||||
SubjectCode = t.Code,
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
SubjectId = t.Id,
|
||||
|
@ -687,7 +687,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var query = subjectQuery.Select(t => new DoctorGroupConsistentSubjectView()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.TrialSiteId,
|
||||
SubjectCode = t.Code,
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
SubjectId = t.Id,
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inQuery.IsEffect == true, t => t.VisitTask.TaskState == TaskState.Effect || t.VisitTask.TaskState == TaskState.Freeze)
|
||||
.WhereIf(inQuery.IsEffect == false, t => t.VisitTask.TaskState == TaskState.Adbandon || t.VisitTask.TaskState == TaskState.HaveReturned)
|
||||
|
||||
.WhereIf(inQuery.SiteId != null, t => t.VisitTask.Subject.SiteId == inQuery.SiteId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode) || t.VisitTask.Subject.MedicalNo.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.VisitTask.TaskName.Contains(inQuery.TaskName) || t.VisitTask.TaskBlindName.Contains(inQuery.TaskName))
|
||||
|
@ -103,7 +103,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.Where(t => t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect||t.TaskState==TaskState.Freeze) && t.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
|
||||
.WhereIf(inQuery.SiteId != null, t => t.Subject.SiteId == inQuery.SiteId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
|
||||
|
@ -230,7 +230,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
||x.Id == inQuery.Id // 这里必须找传入id 因为要找到这条的索引 获取下一条
|
||||
)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.SiteId != null, t => t.VisitTask.Subject.SiteId == inQuery.SiteId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.VisitTask.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(inQuery.AuditState != null, t => t.AuditState == inQuery.AuditState)
|
||||
.WhereIf(inQuery.DoctorUserIdeaEnum != null, t => t.DoctorUserIdeaEnum == inQuery.DoctorUserIdeaEnum)
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
var isAddtinoarlCriterion = await _trialReadingCriterionRepository.AnyAsync(t => t.Id == querySubjectAssign.TrialReadingCriterionId && t.IsAutoCreate == false);
|
||||
|
||||
var subjectQuery = _subjectRepository.Where(t => t.TrialId == querySubjectAssign.TrialId && t.SubjectVisitTaskList.Any())
|
||||
.WhereIf(querySubjectAssign.SiteId != null, t => t.SiteId == querySubjectAssign.SiteId)
|
||||
.WhereIf(querySubjectAssign.TrialSiteId != null, t => t.TrialSiteId == querySubjectAssign.TrialSiteId)
|
||||
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
|
||||
.WhereIf(querySubjectAssign.DoctorUserId != null, t => t.SubjectDoctorList.Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
|
||||
.WhereIf(!string.IsNullOrEmpty(querySubjectAssign.SubjectCode), t => t.Code.Contains(querySubjectAssign.SubjectCode))
|
||||
|
@ -421,7 +421,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
.WhereIf(querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(querySubjectAssign.IsJudgeDoctor, t => t.SubjectVisitTaskList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
|
||||
.WhereIf(querySubjectAssign.SiteId != null, t => t.SiteId == querySubjectAssign.SiteId)
|
||||
.WhereIf(querySubjectAssign.TrialSiteId != null, t => t.TrialSiteId == querySubjectAssign.TrialSiteId)
|
||||
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
|
||||
|
||||
.WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == true && querySubjectAssign.IsJudgeDoctor == false, t => t.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
|
@ -684,7 +684,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
.WhereIf(queryVisitTask.ReadingCategory == null, t => t.ReadingCategory != ReadingCategory.Judge)
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -724,7 +724,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -765,7 +765,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
.WhereIf(queryVisitTask.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
|
||||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -811,7 +811,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
.Where(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId /*&& t.OriginalReReadingTask.IsAnalysisCreate == false*/)
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.OriginalReReadingTask.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.WhereIf(queryVisitTask.RequestReReadingType != null, t => t.RequestReReadingType == queryVisitTask.RequestReReadingType)
|
||||
|
@ -875,7 +875,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.OriginalReReadingTask.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.OriginalReReadingTask.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -910,7 +910,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.OriginalReReadingTask.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.OriginalReReadingTask.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.OriginalReReadingTask.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -1242,7 +1242,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState == ReadingTaskState.HaveSigned)//该医生 已经签名的数据
|
||||
|
||||
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<VisitTask, VisitTaskView>().IncludeBase<VisitTask, VisitTaskViewBasic>()
|
||||
|
||||
|
||||
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
||||
.ForMember(o => o.TrialSiteId, t => t.MapFrom(u => u.Subject.TrialSiteId))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
||||
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
||||
|
@ -169,7 +169,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
CreateMap<VisitTask, IRHaveReadView>().IncludeBase<VisitTask, VisitTaskViewBasic>()
|
||||
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
||||
.ForMember(o => o.TrialSiteId, t => t.MapFrom(u => u.Subject.TrialSiteId))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code));
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
var list = await _trialSiteUserRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.TrialSite.TrialSiteName.Contains(param.SiteName) || t.TrialSite.TrialSiteAliasName.Contains(param.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName),
|
||||
t => t.TrialSite.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode),
|
||||
|
@ -153,9 +153,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
var groupSelectIdQuery =
|
||||
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||
.WhereIf(queryParam.SiteId != null, t => t.SiteId == queryParam.SiteId)
|
||||
.WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||
.GroupBy(t => t.SiteId)
|
||||
.GroupBy(t => t.TrialSiteId)
|
||||
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||
|
||||
|
||||
|
@ -222,7 +222,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
var list = await _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
||||
.WhereIf(visitSearchDTO.SiteId != null, t => t.SiteId == visitSearchDTO.SiteId)
|
||||
.WhereIf(visitSearchDTO.TrialSiteId != null, t => t.TrialSiteId == visitSearchDTO.TrialSiteId)
|
||||
.WhereIf(visitSearchDTO.SubjectId != null, t => t.Subject.Id == visitSearchDTO.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(visitSearchDTO.SubjectInfo), t => t.Subject.Code.Contains(visitSearchDTO.SubjectInfo))
|
||||
|
||||
|
@ -275,7 +275,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
|
||||
.WhereIf(challengeQuery.ReuploadEnum != null, t => t.ReuploadEnum == challengeQuery.ReuploadEnum)
|
||||
.WhereIf(challengeQuery.IsClosed != null, t => t.IsClosed == challengeQuery.IsClosed)
|
||||
.WhereIf(challengeQuery.SiteId != null, t => t.SubjectVisit.SiteId == challengeQuery.SiteId)
|
||||
.WhereIf(challengeQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == challengeQuery.TrialSiteId)
|
||||
.WhereIf(challengeQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == challengeQuery.SubjectId)
|
||||
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
|
||||
.WhereIf(!string.IsNullOrEmpty(challengeQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode))
|
||||
|
@ -318,7 +318,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(param.Name), t => t.ShortName.Contains(param.Name))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.Sex), t => t.Sex.Contains(param.Sex))
|
||||
.WhereIf(param.Status != null, t => t.Status == param.Status)
|
||||
.WhereIf(param.SiteId != null, t => t.SiteId == param.SiteId)
|
||||
.WhereIf(param.TrialSiteId != null, t => t.TrialSiteId == param.TrialSiteId)
|
||||
// CRC 只负责他管理site的受试者
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.ProjectTo<SubjectExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
@ -537,7 +537,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
|
||||
.WhereIf(studyQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == studyQuery.TrialSiteId)
|
||||
.Select(t => new UnionStudyMonitorExportDto()
|
||||
{
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
|
@ -642,7 +642,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
|
||||
var dicomStudyQuery = _repository.Where<DicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.Where(x => x.SubjectVisit.AuditState == AuditStateEnum.QCPassed)
|
||||
|
@ -656,9 +656,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
StudyCode = t.StudyCode,
|
||||
StudyTime = t.StudyTime,
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
CheckState = t.SubjectVisit.CheckState,
|
||||
//Uploader = t.Uploader.UserName,
|
||||
|
@ -670,7 +670,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
|
||||
var nodeDicomStudyQuery = _repository.Where<NoneDicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.Where(x => x.SubjectVisit.AuditState == AuditStateEnum.QCPassed)
|
||||
|
@ -685,9 +685,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
StudyCode = t.StudyCode,
|
||||
StudyTime = t.ImageDate,
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
CheckState = t.SubjectVisit.CheckState,
|
||||
|
||||
|
@ -735,7 +735,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
var list = await _subjectVisitRepository.Where(x => x.TrialId == checkQuery.TrialId)
|
||||
.Where(x => x.AuditState == AuditStateEnum.QCPassed) //一致性核查中的,或者还没一致性核查的
|
||||
.WhereIf(checkQuery.CheckState != null, t => t.CheckState == checkQuery.CheckState)
|
||||
.WhereIf(checkQuery.SiteId != null, t => t.SiteId == checkQuery.SiteId)
|
||||
.WhereIf(checkQuery.TrialSiteId != null, t => t.TrialSiteId == checkQuery.TrialSiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(checkQuery.SubjectInfo), t => t.Subject.Code.Contains(checkQuery.SubjectInfo))
|
||||
.WhereIf(checkQuery.VisitPlanArray != null && checkQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site
|
||||
|
@ -774,7 +774,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ArmEnum != null, t => t.ArmEnum == queryVisitTask.ArmEnum)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -827,7 +827,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
var list = await _repository.Where<VisitTaskReReading>(t => t.OriginalReReadingTask.TrialId == queryVisitTask.TrialId /*&& t.OriginalReReadingTask.IsAnalysisCreate == false*/)
|
||||
.WhereIf(queryVisitTask.RootReReadingTaskId != null, t => t.RootReReadingTaskId == queryVisitTask.RootReReadingTaskId || t.OriginalReReadingTaskId == queryVisitTask.RootReReadingTaskId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskCode), t => t.OriginalReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!) || t.RootReReadingTask.TaskCode.Contains(queryVisitTask.TaskCode!))
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.OriginalReReadingTask.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.OriginalReReadingTask.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.TaskState != null, t => t.OriginalReReadingTask.TaskState == queryVisitTask.TaskState)
|
||||
.WhereIf(queryVisitTask.ReReadingApplyState != null, t => t.OriginalReReadingTask.ReReadingApplyState == queryVisitTask.ReReadingApplyState)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.OriginalReReadingTask.SubjectId == queryVisitTask.SubjectId)
|
||||
|
@ -875,7 +875,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
{
|
||||
|
||||
var list = await _repository.Where<TaskMedicalReview>(t => t.VisitTask.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.SiteId != null, t => t.VisitTask.Subject.SiteId == inQuery.SiteId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.VisitTask.TaskName.Contains(inQuery.TaskName) || t.VisitTask.TaskBlindName.Contains(inQuery.TaskName))
|
||||
|
@ -936,7 +936,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -1020,7 +1020,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -1224,7 +1224,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -1281,7 +1281,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -1350,7 +1350,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
|
||||
.WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId)
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var taskInfo = await _repository.Where<VisitTask>(t => t.Id == visitTaskId).Select(t => new
|
||||
{
|
||||
t.Subject.SiteId,
|
||||
t.Subject.TrialSiteId,
|
||||
t.Trial.ResearchProgramNo,
|
||||
t.Subject.TrialSite.TrialSiteCode,
|
||||
SubjectCode = t.Subject.Code,
|
||||
|
@ -102,7 +102,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
return (topicStr, htmlBodyStr, isEn_us, null);
|
||||
};
|
||||
|
||||
await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.SiteId);
|
||||
await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.TrialSiteId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
return (topicStr, htmlBodyStr, isEn_us, null);
|
||||
};
|
||||
|
||||
await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.SiteId);
|
||||
await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.TrialSiteId);
|
||||
}
|
||||
|
||||
|
||||
|
@ -283,9 +283,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
|
||||
public async Task SendTrialEmailAsync(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null, Func<TrialEmailNoticeConfig, SMTPEmailConfig, SMTPEmailConfig> emailAttachFunc=null)
|
||||
public async Task SendTrialEmailAsync(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? trialSiteId = null, Guid? trialReadingCriterionId = null, Func<TrialEmailNoticeConfig, SMTPEmailConfig, SMTPEmailConfig> emailAttachFunc=null)
|
||||
{
|
||||
var (trialEmailConfig, sendEmailConfig) = await BuildEmailConfig(trialId, businessScenario, topicAndHtmlFunc, siteId, trialReadingCriterionId);
|
||||
var (trialEmailConfig, sendEmailConfig) = await BuildEmailConfig(trialId, businessScenario, topicAndHtmlFunc, trialSiteId, trialReadingCriterionId);
|
||||
|
||||
if (sendEmailConfig != null)
|
||||
{
|
||||
|
@ -295,7 +295,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
|
||||
public async Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null)
|
||||
public async Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? trialSiteId = null, Guid? trialReadingCriterionId = null)
|
||||
{
|
||||
//找到配置
|
||||
var trialEmailConfig = await _trialEmailNoticeConfigRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionId && t.BusinessScenarioEnum == businessScenario, ignoreQueryFilters: true)
|
||||
|
@ -333,13 +333,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ToList();
|
||||
|
||||
//收件人 有CRC CRA , CRC CRA的账户要按照中心发送
|
||||
if (siteId == null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA) && onlyToUserId == null)
|
||||
if (trialSiteId == null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA) && onlyToUserId == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前场景收件人包含CRC CRA,但是没有siteId,请联系后端开发");
|
||||
}
|
||||
if (siteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
if (trialSiteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
{
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId).Select(t => t.UserId).ToList();
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
|
||||
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||
}
|
||||
|
@ -351,9 +351,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
var copyUserList = allUserList.Where(t => copyUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||
.Where(t => !blackUserIdList.Contains(t.UserId)).ToList();
|
||||
|
||||
if (siteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
if (trialSiteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
{
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId).Select(t => t.UserId).ToList();
|
||||
var curentSiteUserIdList = _repository.Where<TrialSiteUser>(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
|
||||
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
t.SourceSubjectVisitId,
|
||||
t.SouceReadModuleId,
|
||||
t.SubjectId,
|
||||
t.Subject.SiteId,
|
||||
t.Subject.TrialSiteId,
|
||||
|
||||
t.DoctorUserId,
|
||||
t.ReadingTaskState,
|
||||
|
@ -317,7 +317,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
};
|
||||
|
||||
|
||||
var (trialEmailConfig, sendEmailConfig) = await _emailSendService.BuildEmailConfig(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.SiteId, taskInfo.TrialReadingCriterionId);
|
||||
var (trialEmailConfig, sendEmailConfig) = await _emailSendService.BuildEmailConfig(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.TrialSiteId, taskInfo.TrialReadingCriterionId);
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -659,7 +659,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var path = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, _userInfo.IsEn_Us ? trialEmailConfig.AttachPath : trialEmailConfig.AttachCNPath);
|
||||
|
||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetSubjectEnrollConfirmOrPDEmailPath(_hostEnvironment, Path.GetFileName(path), taskInfo.TrialId, taskInfo.SiteId, taskInfo.SubjectId, true);
|
||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetSubjectEnrollConfirmOrPDEmailPath(_hostEnvironment, Path.GetFileName(path), taskInfo.TrialId, taskInfo.TrialSiteId, taskInfo.SubjectId, true);
|
||||
|
||||
if (emailStoreMode == EmailStoreSendMode.StoreLocalSend || emailStoreMode == EmailStoreSendMode.OnlyStoreLocalNotSentEmail)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,6 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public int SliceLocation { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
@ -51,7 +50,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string VisitName { get; set; } = string.Empty;
|
||||
public string Sponsor { get; set; } = string.Empty;
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
|||
public class DicomSeriesDTO
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
public bool IsDicom { get; set; } = true;
|
||||
|
||||
public bool IsBeMark { get; set; } = false;
|
||||
|
@ -24,7 +27,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
|||
public string SliceThickness { get; set; } = String.Empty;
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
@ -18,7 +18,7 @@
|
|||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
@ -74,7 +74,7 @@
|
|||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
//public string SubjectName { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
|||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubejctId { get; set; }
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
|||
public class ImageShareCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid? StudyId { get; set; }
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
@ -147,7 +147,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public Guid? SubjectVisitId { get; set; }
|
||||
|
||||
public string SubjectInfo { get; set; } = String.Empty;
|
||||
|
@ -194,7 +194,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
[NotDefault]
|
||||
|
@ -231,7 +231,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
[NotDefault]
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
|
||||
var (physicalPath, relativePath) = FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
var (physicalPath, relativePath) = FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
|
||||
dicomInstance.Path = relativePath;
|
||||
|
||||
|
@ -270,7 +270,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty),
|
||||
|
||||
|
||||
SiteId = addtionalInfo.SiteId,
|
||||
TrialId = addtionalInfo.TrialId,
|
||||
SubjectId = addtionalInfo.SubjectId,
|
||||
SubjectVisitId = addtionalInfo.SubjectVisitId,
|
||||
|
@ -400,7 +399,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
AcquisitionNumber = dataset.GetSingleValueOrDefault(DicomTag.AcquisitionNumber, string.Empty),
|
||||
TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty),
|
||||
|
||||
SiteId = dicomStudy.SiteId,
|
||||
TrialId = dicomStudy.TrialId,
|
||||
SubjectId = dicomStudy.SubjectId,
|
||||
SubjectVisitId = dicomStudy.SubjectVisitId,
|
||||
|
@ -433,7 +431,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
StudyId = dicomStudy.Id,
|
||||
SeriesId = dicomSeries.Id,
|
||||
|
||||
SiteId = dicomStudy.SiteId,
|
||||
TrialId = dicomStudy.TrialId,
|
||||
SubjectId = dicomStudy.SubjectId,
|
||||
SubjectVisitId = dicomStudy.SubjectVisitId,
|
||||
|
@ -536,7 +533,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty),
|
||||
|
||||
|
||||
SiteId = Guid.Empty,
|
||||
TrialId = Guid.Empty,
|
||||
SubjectId = Guid.Empty,
|
||||
SubjectVisitId = Guid.Empty,
|
||||
|
@ -607,7 +603,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
AcquisitionNumber = dataset.GetSingleValueOrDefault(DicomTag.AcquisitionNumber, string.Empty),
|
||||
TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty),
|
||||
|
||||
SiteId = Guid.Empty,
|
||||
TrialId = Guid.Empty,
|
||||
SubjectId = Guid.Empty,
|
||||
SubjectVisitId = Guid.Empty,
|
||||
|
@ -630,7 +625,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
StudyInstanceUid = findStudy.StudyInstanceUid,
|
||||
SeriesInstanceUid = findSerice.SeriesInstanceUid,
|
||||
|
||||
SiteId = Guid.Empty,
|
||||
TrialId = Guid.Empty,
|
||||
SubjectId = Guid.Empty,
|
||||
SubjectVisitId = Guid.Empty,
|
||||
|
|
|
@ -59,9 +59,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
SubejctId = u.SubjectId,
|
||||
|
||||
|
||||
|
||||
SiteId=u.Subject.SiteId,
|
||||
|
||||
TrialSiteId = u.Subject.TrialSiteId,
|
||||
|
||||
CriterionModalitys= u.TrialReadingCriterion.CriterionModalitys,
|
||||
|
||||
|
@ -253,7 +253,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
study.Id = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString(), findOriginStudy.VisitTaskId.ToString());
|
||||
study.TrialId = incommand.TrialId;
|
||||
//study.SiteId = incommand.SiteId;
|
||||
study.SubjectId = incommand.SubjectId;
|
||||
study.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
//study.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
@ -279,7 +278,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
//series.SiteId = incommand.SiteId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
//series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
series.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
|
@ -300,7 +298,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
isntance.SeriesId = series.Id;
|
||||
|
||||
isntance.TrialId = incommand.TrialId;
|
||||
//isntance.SiteId = incommand.SiteId;
|
||||
isntance.SubjectId = incommand.SubjectId;
|
||||
//isntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
isntance.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
|
@ -348,8 +345,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
//series.SiteId = incommand.SiteId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
series.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
//series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
||||
|
@ -372,7 +369,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
insntance.SeriesId = dicomSeries.Id;
|
||||
|
||||
insntance.TrialId = incommand.TrialId;
|
||||
//insntance.SiteId = incommand.SiteId;
|
||||
insntance.SubjectId = incommand.SubjectId;
|
||||
insntance.VisitTaskId = findOriginStudy.VisitTaskId;
|
||||
|
||||
|
|
|
@ -49,8 +49,8 @@ namespace IRaCIS.Core.Application.Services
|
|||
#endregion
|
||||
|
||||
var studyIds = await _studyRepository.AsQueryable()
|
||||
.Where(t => t.TrialId == imageShareCommand.TrialId && t.SubjectId == imageShareCommand.SubjectId &&
|
||||
t.SiteId == imageShareCommand.SiteId)
|
||||
.Where(t => t.TrialId == imageShareCommand.TrialId && t.SubjectId == imageShareCommand.SubjectId
|
||||
)
|
||||
.Select(u => u.Id).ToListAsync();
|
||||
|
||||
if (!studyIds.Any())
|
||||
|
|
|
@ -60,12 +60,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
path = (await _instanceRepository.Where(s => s.Id == instanceId).Select(t => t.Path).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
//DicomInstance dicomInstance = await _instanceRepository.FirstOrDefaultAsync(s => s.Id == instanceId).IfNullThrowException();
|
||||
|
||||
//DicomStudy dicomStudy = await _studyRepository.FirstOrDefaultAsync(s => s.Id == dicomInstance.StudyId).IfNullThrowException();
|
||||
|
||||
//var (physicalPath, relativePath) = FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
|
||||
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
||||
|
||||
using (var sw = ImageHelper.RenderPreviewJpeg(physicalPath))
|
||||
|
@ -86,16 +80,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
var filePath = string.Empty;
|
||||
var path = (await _instanceRepository.Where(s => s.Id == instanceId).Select(t=>t.Path).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
//DicomStudy dicomStudy = await _studyRepository.FirstOrDefaultAsync(s => s.Id == dicomInstance.StudyId).IfNullThrowException();
|
||||
|
||||
////if (dicomInstance.Anonymize) //被匿名化
|
||||
////{
|
||||
//// filePath = _dicomFileStoreHelper.GetInstanceFilePath(dicomStudy, dicomInstance.SeriesId, dicomInstance.Id + ".Anonymize");
|
||||
////}
|
||||
|
||||
////else
|
||||
//var (physicalPath, relativePath) = FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
|
||||
|
||||
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
||||
|
||||
|
|
|
@ -110,7 +110,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
var studyMonitor = new StudyMonitor()
|
||||
{
|
||||
TrialId = preArchiveStudyCommand.TrialId,
|
||||
SiteId = preArchiveStudyCommand.SiteId,
|
||||
SubjectId = preArchiveStudyCommand.SubjectId,
|
||||
SubjectVisitId = preArchiveStudyCommand.SubjectVisitId,
|
||||
|
||||
|
@ -188,7 +187,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
study.Id = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString());
|
||||
study.TrialId = incommand.TrialId;
|
||||
study.SiteId = incommand.SiteId;
|
||||
study.SubjectId = incommand.SubjectId;
|
||||
study.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -223,7 +221,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SiteId = incommand.SiteId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -243,7 +240,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
isntance.SeriesId = series.Id;
|
||||
|
||||
isntance.TrialId = incommand.TrialId;
|
||||
isntance.SiteId = incommand.SiteId;
|
||||
isntance.SubjectId = incommand.SubjectId;
|
||||
isntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -290,7 +286,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SiteId = incommand.SiteId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -314,7 +309,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
insntance.SeriesId = dicomSeries.Id;
|
||||
|
||||
insntance.TrialId = incommand.TrialId;
|
||||
insntance.SiteId = incommand.SiteId;
|
||||
insntance.SubjectId = incommand.SubjectId;
|
||||
insntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -364,14 +358,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
|
||||
var dicomStudyQuery = _repository.Where<DicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.Select(t => new UnionStudyViewModel()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.Subject.TrialSiteId,
|
||||
SubjectId = t.SubjectId,
|
||||
SubjectVisitId = t.SubjectVisitId,
|
||||
VisitName = t.SubjectVisit.VisitName,
|
||||
|
@ -396,9 +390,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
StudyTime = t.StudyTime,
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = t.Uploader.UserName,
|
||||
|
||||
|
@ -412,7 +406,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
|
||||
var nodeDicomStudyQuery = _repository.Where<NoneDicomStudy>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
|
@ -420,7 +414,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
.Select(t => new UnionStudyViewModel()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.Subject.TrialSiteId,
|
||||
SubjectId = t.SubjectId,
|
||||
SubjectVisitId = t.SubjectVisitId,
|
||||
VisitName = t.SubjectVisit.VisitName,
|
||||
|
@ -445,9 +439,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
StudyTime = t.ImageDate,
|
||||
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = t.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = t.CreateUser.UserName,
|
||||
|
||||
|
@ -461,7 +455,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
var unionQuery = dicomStudyQuery.Union(nodeDicomStudyQuery)
|
||||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId);
|
||||
.WhereIf(studyQuery.TrialSiteId != null, t => t.TrialSiteId == studyQuery.TrialSiteId);
|
||||
|
||||
return await unionQuery.ToPagedListAsync(studyQuery.PageIndex, studyQuery.PageSize, studyQuery.SortField, studyQuery.Asc);
|
||||
}
|
||||
|
@ -478,7 +472,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
|
||||
.WhereIf(studyQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == studyQuery.TrialSiteId)
|
||||
.WhereIf(studyQuery.IsDicom != null, t => t.IsDicom == studyQuery.IsDicom)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.Uploader), t => t.Uploader.UserName.Contains(studyQuery.Uploader))
|
||||
.WhereIf(studyQuery.IsSuccess != null, t => t.IsSuccess == studyQuery.IsSuccess)
|
||||
|
@ -486,7 +480,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
.Select(t => new UnionStudyMonitorModel()
|
||||
{
|
||||
TrialId = t.TrialId,
|
||||
SiteId = t.SiteId,
|
||||
TrialSiteId = t.Subject.TrialSiteId,
|
||||
SubjectId = t.SubjectId,
|
||||
SubjectVisitId = t.SubjectVisitId,
|
||||
VisitName = t.SubjectVisit.VisitName,
|
||||
|
@ -530,108 +524,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
|
||||
|
||||
#region 冗余查询
|
||||
//var dicomStudyQuery = _repository.Where<StudyMonitor>(t => t.TrialId == studyQuery.TrialId && t.IsDicom)
|
||||
// .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
// .WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
// .Select(t => new UnionStudyMonitorModel()
|
||||
// {
|
||||
// TrialId = t.TrialId,
|
||||
// SiteId = t.SiteId,
|
||||
// SubjectId = t.SubjectId,
|
||||
// SubjectVisitId = t.SubjectVisitId,
|
||||
// VisitName = t.SubjectVisit.VisitName,
|
||||
// VisitNum = t.SubjectVisit.VisitNum,
|
||||
|
||||
|
||||
|
||||
// SubjectCode = t.Subject.Code,
|
||||
|
||||
|
||||
// TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
|
||||
// TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
|
||||
// Uploader = t.Uploader.FullName,
|
||||
|
||||
// UploadTime = t.CreateTime,
|
||||
|
||||
|
||||
// IP = t.IP,
|
||||
// FileCount = t.FileCount,
|
||||
// FileSize = t.FileSize,
|
||||
// UploadFinishedTime = t.UploadFinishedTime,
|
||||
// UploadStartTime = t.UploadStartTime,
|
||||
|
||||
// TotalMillisecondsInterval = t.TotalMillisecondsInterval,
|
||||
|
||||
// IsDicomReUpload = t.IsDicomReUpload,
|
||||
// StudyId = t.Id,
|
||||
// IsDicom = t.IsDicom,
|
||||
|
||||
// StudyCode = t.DicomStudy.StudyCode
|
||||
// //DicomStudyCode = t.DicomStudy.StudyCode,
|
||||
// //NoneDicomCode = 0,
|
||||
|
||||
// });
|
||||
|
||||
////.ProjectTo<UnionStudyViewDodel>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
|
||||
//var nodeDicomStudyQuery = _repository.Where<StudyMonitor>(t => t.TrialId == studyQuery.TrialId && t.IsDicom == false)
|
||||
// .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
// .WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
|
||||
// .Select(t => new UnionStudyMonitorModel()
|
||||
// {
|
||||
|
||||
// TrialId = t.TrialId,
|
||||
// SiteId = t.SiteId,
|
||||
// SubjectId = t.SubjectId,
|
||||
// SubjectVisitId = t.SubjectVisitId,
|
||||
// VisitName = t.SubjectVisit.VisitName,
|
||||
// VisitNum = t.SubjectVisit.VisitNum,
|
||||
// SubjectCode = t.Subject.Code,
|
||||
// TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
// TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
// Uploader = t.Uploader.FullName,
|
||||
// UploadTime = t.CreateTime,
|
||||
|
||||
// IP = t.IP,
|
||||
// FileCount = t.FileCount,
|
||||
// FileSize = t.FileSize,
|
||||
// UploadFinishedTime = t.UploadFinishedTime,
|
||||
// UploadStartTime = t.UploadStartTime,
|
||||
|
||||
// TotalMillisecondsInterval = t.TotalMillisecondsInterval,
|
||||
|
||||
// IsDicomReUpload = t.IsDicomReUpload,
|
||||
// StudyId = t.Id,
|
||||
// IsDicom = t.IsDicom,
|
||||
|
||||
// StudyCode = t.NoneDicomStudy.StudyCode
|
||||
|
||||
// //DicomStudyCode = string.Empty,
|
||||
// //NoneDicomCode = t.NoneDicomStudy.Code,
|
||||
|
||||
// });
|
||||
|
||||
////.ProjectTo<UnionStudyViewDodel>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
//var unionQuery = dicomStudyQuery.Union(nodeDicomStudyQuery)
|
||||
// .WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
// .WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
// .WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId);
|
||||
|
||||
//return await unionQuery.ToPagedListAsync(studyQuery.PageIndex, studyQuery.PageSize, string.IsNullOrEmpty(studyQuery.SortField) ? "UploadTime" : studyQuery.SortField, studyQuery.Asc);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -645,18 +540,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
path = (await _dicomInstanceRepository.Where(s => s.StudyId == studyId).Select(t => t.Path).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
//DicomInstance dicomInstance = await _repository.FirstOrDefaultAsync<DicomInstance>(s => s.StudyId == studyId);
|
||||
|
||||
//if (dicomInstance != null)
|
||||
//{
|
||||
// DicomStudy dicomStudy = await _repository.FirstOrDefaultAsync<DicomStudy>(s => s.Id == dicomInstance.StudyId);
|
||||
// if (dicomStudy != null)
|
||||
// {
|
||||
// var( physicalPath ,relativePath )= FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, dicomInstance.Id);
|
||||
|
||||
// path = physicalPath;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
using (var sw = ImageHelper.RenderPreviewJpeg(path))
|
||||
{
|
||||
|
|
|
@ -40,8 +40,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
CreateMap<DicomStudy, StudyDTO>().IncludeMembers(t => t.Subject, u => u.SubjectVisit)
|
||||
.ForMember(d => d.UploaderFirstName, u => u.MapFrom(s => s.Site.SiteName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Site.SiteName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteName))
|
||||
.ForMember(d => d.UploaderFirstName, u => u.MapFrom(s => s.Uploader.FirstName))
|
||||
.ForMember(d => d.UploaderLastName, u => u.MapFrom(s => s.Uploader.LastName))
|
||||
.ForMember(d => d.UploadedTime, u => u.MapFrom(s => s.CreateTime));
|
||||
|
@ -104,8 +103,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
//.ForMember(d => d.Modality, u => u.MapFrom(s => s.Modalities))
|
||||
.ForMember(d => d.Bodypart, u => u.MapFrom(s => s.BodyPartExamined))
|
||||
.ForMember(d => d.StudyTime, u => u.MapFrom(s => s.StudyTime))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.IsDicom, u => u.MapFrom(s => true))
|
||||
.ForMember(d => d.Count, u => u.MapFrom(s => s.SeriesCount))
|
||||
.ForMember(d => d.VisitNum, u => u.MapFrom(s => s.SubjectVisit.VisitNum))
|
||||
|
@ -116,8 +115,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
//.ForMember(d => d.Modality, u => u.MapFrom(s => s.Modalities))
|
||||
.ForMember(d => d.Bodypart, u => u.MapFrom(s => s.BodyPart))
|
||||
.ForMember(d => d.StudyTime, u => u.MapFrom(s => s.ImageDate))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.IsDicom, u => u.MapFrom(s => false))
|
||||
.ForMember(d => d.Count, u => u.MapFrom(s => s.NoneDicomFileList.Count()))
|
||||
.ForMember(d => d.VisitNum, u => u.MapFrom(s => s.SubjectVisit.VisitNum))
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
{
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
public Guid? SubjectVisitId { get; set; }
|
||||
|
||||
|
@ -336,7 +336,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public string Code { get; set; } = string.Empty;
|
||||
}
|
||||
|
@ -441,7 +441,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
/// <summary>
|
||||
/// 中心
|
||||
/// </summary>
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 受试者
|
||||
|
|
|
@ -41,10 +41,9 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
|
||||
join trial in _repository.GetQueryable<Trial>().IgnoreQueryFilters() on data.TrialId equals trial.Id into trialtemp
|
||||
from leftrial in trialtemp.DefaultIfEmpty()
|
||||
join site in _repository.GetQueryable<Site>().IgnoreQueryFilters() on data.SiteId equals site.Id into sitetemp
|
||||
from leftsite in sitetemp.DefaultIfEmpty()
|
||||
|
||||
join trialSite in _repository.GetQueryable<TrialSite>().IgnoreQueryFilters() on new { SiteId = leftsite.Id, Trialid = leftrial.Id } equals new { SiteId = trialSite.SiteId, Trialid = trialSite.TrialId } into trialSitetemp
|
||||
|
||||
join trialSite in _repository.GetQueryable<TrialSite>().IgnoreQueryFilters() on data.TrialSiteId equals trialSite.Id into trialSitetemp
|
||||
from lefttrialSite in trialSitetemp.DefaultIfEmpty()
|
||||
|
||||
|
||||
|
@ -97,7 +96,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
BlindName = data.VisitTask.TaskBlindName,
|
||||
TaskName = data.VisitTask.TaskName,
|
||||
TrialId = data.TrialId,
|
||||
SiteId = data.SiteId,
|
||||
TrialSiteId = data.TrialSiteId,
|
||||
SubjectId = data.SubjectId,
|
||||
SubjectVisitId = data.SubjectVisitId,
|
||||
//OptType = data.OptType,
|
||||
|
@ -161,7 +160,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
TrialReadingCriterionName = data.TrialReadingCriterion.CriterionName
|
||||
};
|
||||
|
||||
query = query.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId)
|
||||
query = query.WhereIf(dto.TrialSiteId != null, x => x.TrialSiteId == dto.TrialSiteId)
|
||||
//.Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime))
|
||||
.Where(x => x.TrialId == dto.TrialId )
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace IRaCIS.Application.Services
|
|||
public async Task<IResponseOutput> DeleteSite(Guid siteId)
|
||||
{
|
||||
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.SiteId == siteId))
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.TrialSite.SiteId == siteId))
|
||||
{
|
||||
//---该中心已经加入项目,不可以被删除。
|
||||
return ResponseOutput.NotOk(_localizer["Site_InProject"]);
|
||||
|
|
|
@ -56,33 +56,6 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
return clinicalObj;
|
||||
|
||||
#region 老方式 linq join 而且需要映射
|
||||
|
||||
|
||||
//var query = from sv in _subjectVisitRepository.GetAll()
|
||||
// join subject in _subjectRepository.GetAll() on sv.SubjectId equals subject.Id
|
||||
// join trialSite in _trialSiteRepository.Find(t => t.TrialId == subjectClinicalDataQuery.TrialId) on sv.SiteId equals trialSite.SiteId
|
||||
// select new SubjectClinicalDataDto()
|
||||
// {
|
||||
// SubjectId = sv.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// SubjectVisitId = sv.Id,
|
||||
// VisitName = sv.VisitName,
|
||||
// VisitNum = sv.VisitNum,
|
||||
// TrialSiteCode = trialSite.TrialSiteCode
|
||||
// };
|
||||
|
||||
//var clinicalObj = query.FirstOrDefault(t => t.SubjectVisitId == subjectClinicalDataQuery.SubjectVisitId);
|
||||
|
||||
//clinicalObj.PreviousHistoryList = _previousHistoryRepository.Find(t => t.SubjectVisitId == subjectClinicalDataQuery.SubjectVisitId)
|
||||
// .ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToList();
|
||||
//clinicalObj.PreviousOtherList = _previousOtherRepository.Find(t => t.SubjectVisitId == subjectClinicalDataQuery.SubjectVisitId)
|
||||
// .ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToList();
|
||||
//clinicalObj.PreviousSurgeryList = _previousSurgeryRepository.Find(t => t.SubjectVisitId == subjectClinicalDataQuery.SubjectVisitId)
|
||||
// .ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public Guid? Id { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
public string BodyPart { get; set; } = string.Empty;
|
||||
|
|
|
@ -319,7 +319,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||
//public string LastName { get; set; }
|
||||
//public string Modalities { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string SiteName { get; set; } = String.Empty;
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public bool? IsUrgent { get; set; }
|
||||
|
@ -51,7 +51,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public bool? IsUrgent { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? VisitId { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
@ -263,7 +263,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
//public int? Age { get; set; }
|
||||
//public string Sex { get; set; } = string.Empty;
|
||||
//public Guid SiteId { get; set; }
|
||||
//public Guid TrialSiteId { get; set; }
|
||||
//public Guid TrialId { get; set; }
|
||||
//public string MedicalNo { get; set; } = string.Empty;
|
||||
//public string ShortName { get; set; } = string.Empty;
|
||||
|
@ -610,7 +610,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
[DictionaryTranslateAttribute("RequestBackState")]
|
||||
public RequestBackStateEnum RequestBackState { get; set; }
|
||||
|
@ -1121,7 +1121,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public bool? IsUrgent { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public bool? IsClosed { get; set; }
|
||||
public bool? IsOverTime { get; set; }
|
||||
public Guid? CreateUserId { get; set; }
|
||||
|
@ -1184,7 +1184,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public QCChanllengeReuploadEnum ReuploadEnum { get; set; }
|
||||
public DateTime? DeadlineTime { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public AuditStateEnum AuditState { get; set; }
|
||||
public CurrentQC CurrentQCEnum { get; set; }
|
||||
public TrialQCProcess QCProcessEnum { get; set; }
|
||||
|
@ -1234,7 +1234,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public string SubjectInfo { get; set; } = String.Empty;
|
||||
|
||||
|
||||
|
@ -1277,7 +1277,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public string SubjectInfo { get; set; } = String.Empty;
|
||||
|
||||
public string[]? VisitPlanArray { get; set; }
|
||||
|
@ -1350,7 +1350,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
//public string Modality { get; set; }
|
||||
|
||||
|
@ -1438,7 +1438,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public Guid? Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public bool InPlan { get; set; } = true;
|
||||
public int VisitExecuted { get; set; }
|
||||
public decimal VisitNum { get; set; }
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
var query = _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
||||
.WhereIf(visitSearchDTO.SiteId != null, t => t.SiteId == visitSearchDTO.SiteId)
|
||||
.WhereIf(visitSearchDTO.TrialSiteId != null, t => t.TrialSiteId == visitSearchDTO.TrialSiteId)
|
||||
.WhereIf(visitSearchDTO.SubjectId != null, t => t.Subject.Id == visitSearchDTO.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(visitSearchDTO.SubjectInfo), t => t.Subject.Code.Contains(visitSearchDTO.SubjectInfo))
|
||||
|
||||
|
@ -98,39 +98,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
public async Task<(PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig)> GetCRCChallengeList(ChallengeQuery challengeQuery)
|
||||
{
|
||||
|
||||
#region CRC 质疑列表 join连表方式
|
||||
//var query = from qcChanllenge in _qcChallengeRepository.Find(qcChallengeLambda)
|
||||
// join subjectVisit in _subjectVisitRepository.Find() on qcChanllenge.SubjectVisitId equals subjectVisit.Id
|
||||
// join trialSite in _trialSiteRepository.Find(t => t.TrialId == challengeQuery.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join subject in _subjectRepository.Find() on subjectVisit.SubjectId equals subject.Id
|
||||
// select new QCCRCChallengeViewModel()
|
||||
// {
|
||||
// Id = qcChanllenge.Id,
|
||||
// SubjectVisitId = qcChanllenge.SubjectVisitId,
|
||||
// ChallengeCode = qcChanllenge.ChallengeCode,
|
||||
// ChallengeType = qcChanllenge.ChallengeType,
|
||||
// Note = qcChanllenge.Note,
|
||||
// Content = qcChanllenge.Content,
|
||||
// UserTypeEnum = qcChanllenge.UserTypeEnum,
|
||||
// CreateTime = qcChanllenge.CreateTime,
|
||||
// CreateUser = qcChanllenge.CreateUser,
|
||||
// CreateUserId = qcChanllenge.CreateUserId,
|
||||
|
||||
// DeadlineTime = qcChanllenge.DeadlineTime,
|
||||
// IsClosed = qcChanllenge.IsClosed,
|
||||
// ClosedTime = qcChanllenge.ClosedTime,
|
||||
// ClosedUser = qcChanllenge.ClosedUser,
|
||||
// NeedReUpload = qcChanllenge.NeedReUpload,
|
||||
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// SubjectCode = subject.Code,
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
|
||||
// LatestMsgTime = qcChanllenge.LatestMsgTime,
|
||||
// LatestReplyUser = qcChanllenge.LatestReplyUser,
|
||||
// };
|
||||
#endregion
|
||||
|
||||
var svExpression = QCCommon.GetQCChallengeFilter(challengeQuery.VisitPlanArray);
|
||||
|
||||
|
@ -138,7 +105,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
|
||||
.WhereIf(challengeQuery.ReuploadEnum != null, t => t.ReuploadEnum == challengeQuery.ReuploadEnum)
|
||||
.WhereIf(challengeQuery.IsClosed != null, t => t.IsClosed == challengeQuery.IsClosed)
|
||||
.WhereIf(challengeQuery.SiteId != null, t => t.SubjectVisit.SiteId == challengeQuery.SiteId)
|
||||
.WhereIf(challengeQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == challengeQuery.TrialSiteId)
|
||||
.WhereIf(challengeQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == challengeQuery.SubjectId)
|
||||
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
|
||||
.WhereIf(challengeQuery.SubjectCode != null, t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode!))
|
||||
|
@ -170,57 +137,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
[HttpPost]
|
||||
public async Task<(PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig)> GetQCChallengeList(ChallengeQuery challengeQuery)
|
||||
{
|
||||
#region linq方式 + Expression 拼接
|
||||
|
||||
//Expression<Func<QCChallenge, bool>> qcChallengeLambda = x => x.TrialId == challengeQuery.TrialId;
|
||||
|
||||
//if (challengeQuery.ReuploadEnum != null)
|
||||
//{
|
||||
// qcChallengeLambda = qcChallengeLambda.And(t => t.ReuploadEnum == challengeQuery.ReuploadEnum);
|
||||
//}
|
||||
//if (challengeQuery.IsClosed != null)
|
||||
//{
|
||||
// qcChallengeLambda = qcChallengeLambda.And(t => t.IsClosed == challengeQuery.IsClosed);
|
||||
//}
|
||||
//if (challengeQuery.SiteId != null)
|
||||
//{
|
||||
// qcChallengeLambda = qcChallengeLambda.And(t => t.SubjectVisit.SiteId == challengeQuery.SiteId.Value);
|
||||
//}
|
||||
//if (challengeQuery.SubjectId != null)
|
||||
//{
|
||||
// qcChallengeLambda = qcChallengeLambda.And(t => t.SubjectVisit.Subject.Id == challengeQuery.SubjectId.Value);
|
||||
//}
|
||||
|
||||
//var query = from qcChanllenge in _qcChallengeRepository.Find(qcChallengeLambda)
|
||||
// join subjectVisit in _subjectVisitRepository.Find(subjectVisitLambda) on qcChanllenge.SubjectVisitId equals subjectVisit.Id
|
||||
// join trialSite in _trialSiteRepository.Find(t => t.TrialId == challengeQuery.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join subject in _subjectRepository.Find() on subjectVisit.SubjectId equals subject.Id
|
||||
// select new QCChallengeViewModel()
|
||||
// {
|
||||
// Id = qcChanllenge.Id,
|
||||
// SubjectVisitId = qcChanllenge.SubjectVisitId,
|
||||
// ChallengeCode = qcChanllenge.ChallengeCode.ToString(),
|
||||
// ChallengeType = qcChanllenge.ChallengeType,
|
||||
// Note = qcChanllenge.Note,
|
||||
// UserTypeEnum = qcChanllenge.UserTypeEnum,
|
||||
// Content = qcChanllenge.Content,
|
||||
// CreateTime = qcChanllenge.CreateTime,
|
||||
// CreateUserId = qcChanllenge.CreateUserId,
|
||||
// CreateUser = qcChanllenge.CreateUser,
|
||||
// SubjectCode = subject.Code,
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
// DeadlineTime = qcChanllenge.DeadlineTime,
|
||||
// IsClosed = qcChanllenge.IsClosed,
|
||||
// ClosedTime = qcChanllenge.ClosedTime,
|
||||
// ClosedUser = qcChanllenge.ClosedUser,
|
||||
// NeedReUpload = qcChanllenge.NeedReUpload,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// LatestMsgTime = qcChanllenge.LatestMsgTime,
|
||||
// LatestReplyUser = qcChanllenge.LatestReplyUser,
|
||||
|
||||
// };
|
||||
#endregion
|
||||
|
||||
var svExpression = QCCommon.GetQCChallengeFilter(challengeQuery.VisitPlanArray);
|
||||
|
||||
|
@ -228,7 +144,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
|
||||
.WhereIf(challengeQuery.ReuploadEnum != null, t => t.ReuploadEnum == challengeQuery.ReuploadEnum)
|
||||
.WhereIf(challengeQuery.IsClosed != null, t => t.IsClosed == challengeQuery.IsClosed)
|
||||
.WhereIf(challengeQuery.SiteId != null, t => t.SubjectVisit.SiteId == challengeQuery.SiteId)
|
||||
.WhereIf(challengeQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == challengeQuery.TrialSiteId)
|
||||
.WhereIf(challengeQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == challengeQuery.SubjectId)
|
||||
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
|
||||
.WhereIf(!string.IsNullOrEmpty(challengeQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode))
|
||||
|
@ -275,170 +191,12 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
public async Task<(PageOutput<QCVisitViewModel>, TrialSubjectAndSVConfig)> GetQCVisitList(QCVisitSearchDTO visitSearchDTO)
|
||||
{
|
||||
|
||||
#region 经典 linq
|
||||
//Expression<Func<Subject, bool>> subjectLambda = x => true;
|
||||
|
||||
//Expression<Func<SubjectVisit, bool>> subjectVisitLambda = x => x.TrialId == visitSearchDTO.TrialId;
|
||||
//Expression<Func<DicomStudy, bool>> studyLambda = x => x.TrialId == visitSearchDTO.TrialId;
|
||||
////Expression<Func<VisitStage, bool>> visitPlanLambda = x => x.TrialId == subjectVisitSearch.TrialId;
|
||||
|
||||
//if (visitSearchDTO.SiteId != null && visitSearchDTO.SiteId != Guid.Empty)shiwu
|
||||
//{
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => t.SiteId == visitSearchDTO.SiteId.Value);
|
||||
// studyLambda = studyLambda.And(t => t.SiteId == visitSearchDTO.SiteId.Value);
|
||||
//}
|
||||
|
||||
//if (visitSearchDTO.SubjectId != null && visitSearchDTO.SubjectId != Guid.Empty)
|
||||
//{
|
||||
// subjectLambda = subjectLambda.And(t => t.Id == visitSearchDTO.SubjectId.Value);
|
||||
|
||||
// studyLambda = studyLambda.And(t => t.SubjectId == visitSearchDTO.SubjectId.Value);
|
||||
//}
|
||||
|
||||
//if (!string.IsNullOrEmpty(visitSearchDTO.SubjectInfo))
|
||||
//{
|
||||
// var search = visitSearchDTO.SubjectInfo.Trim();
|
||||
// subjectLambda = subjectLambda.And(t => t.FirstName.Contains(search) || t.LastName.Contains(search) || t.Code.Contains(search));
|
||||
//}
|
||||
|
||||
//if (!string.IsNullOrWhiteSpace(visitSearchDTO.VisitPlanInfo))
|
||||
//{
|
||||
// var visitInfo = visitSearchDTO.VisitPlanInfo.Trim();
|
||||
|
||||
// if (visitInfo.Contains('.')) // 包含小数点的是计划外访视
|
||||
// {
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => t.VisitNum.ToString().Contains("."));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (int.TryParse(visitInfo, out var visitNum))
|
||||
// {
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => t.VisitNum == visitNum);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//var query = from subjectVisit in _subjectVisitRepository.Where(subjectVisitLambda)
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on subjectVisit.SubjectId equals subject.Id
|
||||
// join trialSite in _trialSiteRepository.Where(t => t.TrialId == visitSearchDTO.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join study in _studyRepository.Where(studyLambda).GroupBy(t => t.SubjectVisitId).Select(g => new { SubjectVisitId = g.Key, StudyCount = g.Count() }) on subjectVisit.Id equals study.SubjectVisitId into d
|
||||
// from study in d.DefaultIfEmpty()
|
||||
// join trial in _trialRepository.AsQueryable() on subjectVisit.TrialId equals trial.Id
|
||||
|
||||
// select new QCVisitViewModel()
|
||||
// {
|
||||
// Id = subjectVisit.Id,
|
||||
// //VisitPlanId = visitStage.Id,
|
||||
// SubjectId = subjectVisit.SubjectId,
|
||||
// TrialId = subjectVisit.TrialId,
|
||||
// SiteId = subjectVisit.SiteId,
|
||||
|
||||
// VisitDay = subjectVisit.VisitDay,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// SVENDTC = subjectVisit.SVENDTC,
|
||||
// SVSTDTC = subjectVisit.SVSTDTC,
|
||||
// SVUPDES = subjectVisit.SVUPDES,
|
||||
// InPlan = subjectVisit.InPlan,
|
||||
// VisitExecuted = subjectVisit.VisitExecuted,
|
||||
|
||||
|
||||
// StudyCount = study.StudyCount,
|
||||
// SubjectStatus = subject.Status,
|
||||
|
||||
// SubjectCode = subject.Code,
|
||||
|
||||
// IsUrgent = subjectVisit.IsUrgent,
|
||||
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
|
||||
// EarliestScanDate = subjectVisit.EarliestScanDate,
|
||||
// LatestScanDate = subjectVisit.LatestScanDate,
|
||||
|
||||
// QCProcessEnum = trial.QCProcessEnum,
|
||||
// CurrentActionUserId = subjectVisit.CurrentActionUserId,
|
||||
// CurrentActionUser = subjectVisit.CurrentActionUser,
|
||||
// CurrentActionUserExpireTime = subjectVisit.CurrentActionUserExpireTime,
|
||||
// PreliminaryAuditTime = subjectVisit.PreliminaryAuditTime,
|
||||
// PreliminaryAuitUser = subjectVisit.PreliminaryAuitUser,
|
||||
// ReviewAuitTime = subjectVisit.ReviewAuitTime,
|
||||
// ReviewAuitUser = subjectVisit.ReviewAuitUser,
|
||||
|
||||
// AuditState = subjectVisit.AuditState,
|
||||
// SubmitTime = subjectVisit.SubmitTime,
|
||||
// IsTake = subjectVisit.IsTake,
|
||||
|
||||
// };
|
||||
#endregion
|
||||
|
||||
#region WhereIf + ling 统计
|
||||
//var query = from subjectVisit in _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
// .WhereIf(visitSearchDTO.SiteId != null, t => t.SiteId == visitSearchDTO.SiteId)
|
||||
// .WhereIf(visitSearchDTO.SubjectId != null, t => t.Subject.Id == visitSearchDTO.SubjectId)
|
||||
// .WhereIf(!string.IsNullOrEmpty(subjectInfo), t => /*t.Subject.FirstName.Contains(subjectInfo) || t.Subject.LastName.Contains(subjectInfo) ||*/ t.Subject.Code.Contains(subjectInfo))
|
||||
// .WhereIf(!string.IsNullOrEmpty(visitInfo), visitInfo.Contains('.') ? t => t.VisitNum.ToString().Contains(".") : t => t.VisitNum.ToString() == visitInfo)
|
||||
// .WhereIf(visitSearchDTO.AuditState != null, t => t.AuditState == visitSearchDTO.AuditState)
|
||||
// .WhereIf(visitSearchDTO.HandleUser != null, t => t.PreliminaryAuitUser.Contains(visitSearchDTO.HandleUser) || t.ReviewAuitUser.Contains(visitSearchDTO.HandleUser))
|
||||
// .WhereIf(visitSearchDTO.IsUrgent != null, t => t.IsUrgent == visitSearchDTO.IsUrgent)
|
||||
// //.WhereIf(visitSearchDTO.SubmitState != null, t => t.SubmitState == visitSearchDTO.SubmitState)
|
||||
// //.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState)
|
||||
// join subject in _subjectRepository.AsQueryable() on subjectVisit.SubjectId equals subject.Id
|
||||
// join trialSite in _trialSiteRepository.Where(t => t.TrialId == visitSearchDTO.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join study in _studyRepository.AsQueryable().GroupBy(t => t.SubjectVisitId).Select(g => new { SubjectVisitId = g.Key, StudyCount = g.Count() }) on subjectVisit.Id equals study.SubjectVisitId into d
|
||||
// from study in d.DefaultIfEmpty()
|
||||
// join trial in _trialRepository.AsQueryable() on subjectVisit.TrialId equals trial.Id
|
||||
|
||||
// select new QCVisitViewModel()
|
||||
// {
|
||||
// Id = subjectVisit.Id,
|
||||
// //VisitPlanId = visitStage.Id,
|
||||
// SubjectId = subjectVisit.SubjectId,
|
||||
// TrialId = subjectVisit.TrialId,
|
||||
// SiteId = subjectVisit.SiteId,
|
||||
|
||||
// VisitDay = subjectVisit.VisitDay,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// SVENDTC = subjectVisit.SVENDTC,
|
||||
// SVSTDTC = subjectVisit.SVSTDTC,
|
||||
// SVUPDES = subjectVisit.SVUPDES,
|
||||
// InPlan = subjectVisit.InPlan,
|
||||
// VisitExecuted = subjectVisit.VisitExecuted,
|
||||
// IsUrgent = subjectVisit.IsUrgent,
|
||||
// EarliestScanDate = subjectVisit.EarliestScanDate,
|
||||
// LatestScanDate = subjectVisit.LatestScanDate,
|
||||
|
||||
// CurrentActionUserId = subjectVisit.CurrentActionUserId,
|
||||
// CurrentActionUser = subjectVisit.CurrentActionUser,
|
||||
// CurrentActionUserExpireTime = subjectVisit.CurrentActionUserExpireTime,
|
||||
// PreliminaryAuditTime = subjectVisit.PreliminaryAuditTime,
|
||||
// PreliminaryAuitUser = subjectVisit.PreliminaryAuitUser,
|
||||
// ReviewAuitTime = subjectVisit.ReviewAuitTime,
|
||||
// ReviewAuitUser = subjectVisit.ReviewAuitUser,
|
||||
|
||||
// AuditState = subjectVisit.AuditState,
|
||||
// SubmitTime = subjectVisit.SubmitTime,
|
||||
// IsTake = subjectVisit.IsTake,
|
||||
|
||||
// QCProcessEnum = trial.QCProcessEnum,
|
||||
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
|
||||
// SubjectStatus = subject.Status,
|
||||
// SubjectCode = subject.Code,
|
||||
|
||||
// StudyCount = study.StudyCount,
|
||||
|
||||
// };
|
||||
|
||||
#endregion
|
||||
|
||||
var svExpression = QCCommon.GetSubjectVisitFilter(visitSearchDTO.VisitPlanArray);
|
||||
var query = _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
.WhereIf(visitSearchDTO.VisitId != null, t => t.Id == visitSearchDTO.VisitId)
|
||||
.WhereIf(visitSearchDTO.CurrentActionUserId != null, t => t.CurrentActionUserId == visitSearchDTO.CurrentActionUserId)
|
||||
.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState)
|
||||
.WhereIf(visitSearchDTO.SiteId != null, t => t.SiteId == visitSearchDTO.SiteId)
|
||||
.WhereIf(visitSearchDTO.TrialSiteId != null, t => t.TrialSiteId == visitSearchDTO.TrialSiteId)
|
||||
.WhereIf(visitSearchDTO.SubjectId != null, t => t.Subject.Id == visitSearchDTO.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(visitSearchDTO.SubjectInfo), t => /*t.Subject.FirstName.Contains(subjectInfo) || t.Subject.LastName.Contains(subjectInfo) ||*/ t.Subject.Code.Contains(visitSearchDTO.SubjectInfo))
|
||||
.WhereIf(visitSearchDTO.VisitPlanArray != null && visitSearchDTO.VisitPlanArray?.Length > 0, svExpression)
|
||||
|
@ -481,60 +239,13 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
[HttpPost]
|
||||
public async Task<(PageOutput<QCCheckWithModalityView>, TrialSubjectAndSVConfig)> GetConsistencyVerificationList(CheckQuery checkQuery)
|
||||
{
|
||||
#region linq 废弃 byzhouhang 2021 11 30
|
||||
//Expression<Func<Subject, bool>> subjectLambda = x => true;
|
||||
//Expression<Func<SubjectVisit, bool>> subjectVisitLambda = x => x.TrialId == checkQuery.TrialId && x.AuditState == AuditStateEnum.QCPassed;
|
||||
//Expression<Func<DicomStudy, bool>> studyLambda = x => x.TrialId == checkQuery.TrialId;
|
||||
//if (checkQuery.SiteId != null && checkQuery.SiteId != Guid.Empty)
|
||||
//{
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => t.SiteId == checkQuery.SiteId.Value);
|
||||
//}
|
||||
//if (checkQuery.SubjectId != null && checkQuery.SubjectId != Guid.Empty)
|
||||
//{
|
||||
// subjectLambda = subjectLambda.And(t => t.Id == checkQuery.SubjectId.Value);
|
||||
//}
|
||||
|
||||
//if (_userInfo.UserTypeEnumInt == (int)UserType.ClinicalResearchCoordinator)
|
||||
//{
|
||||
// var siteQuery = _userTrialSiteRepository.Where(t => t.UserId == _userInfo.Id && t.TrialId == checkQuery.TrialId).Select(t => t.SiteId);
|
||||
|
||||
// subjectVisitLambda = subjectVisitLambda.And(t => siteQuery.Contains(t.SiteId));
|
||||
//}
|
||||
|
||||
//var query =
|
||||
// from subjectVisit in _subjectVisitRepository.Where(subjectVisitLambda)
|
||||
// join trialSite in _trialSiteRepository.Where(t => t.TrialId == checkQuery.TrialId) on subjectVisit.SiteId equals trialSite.SiteId
|
||||
// join subject in _subjectRepository.Where() on subjectVisit.SubjectId equals subject.Id
|
||||
|
||||
// select new QCCheckViewModel()
|
||||
// {
|
||||
// Id = subjectVisit.Id,
|
||||
// AuditState = subjectVisit.AuditState,
|
||||
|
||||
// CheckTime = subjectVisit.CheckTime,
|
||||
// CheckState = subjectVisit.CheckState,
|
||||
|
||||
// CheckChallengeState = subjectVisit.CheckChallengeState,
|
||||
|
||||
// CheckResult = subjectVisit.CheckResult,
|
||||
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
|
||||
// SubjectCode = subject.Code,
|
||||
|
||||
// //Modality=study.Modalities,
|
||||
// //StudyTime = subjectVisit.sv,
|
||||
// TrialSiteCode = trialSite.TrialSiteCode,
|
||||
// };
|
||||
#endregion
|
||||
|
||||
var svExpression = QCCommon.GetSubjectVisitFilter(checkQuery.VisitPlanArray);
|
||||
|
||||
var query = _subjectVisitRepository.Where(x => x.TrialId == checkQuery.TrialId)
|
||||
.Where(x => x.AuditState == AuditStateEnum.QCPassed) //一致性核查中的,或者还没一致性核查的
|
||||
.WhereIf(checkQuery.CheckState != null, t => t.CheckState == checkQuery.CheckState)
|
||||
.WhereIf(checkQuery.SiteId != null, t => t.SiteId == checkQuery.SiteId)
|
||||
.WhereIf(checkQuery.TrialSiteId != null, t => t.TrialSiteId == checkQuery.TrialSiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(checkQuery.SubjectInfo), t => t.Subject.Code.Contains(checkQuery.SubjectInfo))
|
||||
.WhereIf(checkQuery.VisitPlanArray != null && checkQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
//.WhereIf(!string.IsNullOrEmpty(checkQuery.VisitPlanInfo), checkQuery.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(checkQuery.VisitPlanInfo))
|
||||
|
@ -580,7 +291,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
var query = _subjectVisitRepository.Where(x => x.TrialId == forwardQuery.TrialId)
|
||||
.Where(t => t.CheckState == CheckStateEnum.CVPassed)
|
||||
.WhereIf(forwardQuery.ForwardState != null, t => t.ForwardState == forwardQuery.ForwardState)
|
||||
.WhereIf(forwardQuery.SiteId != null, t => t.SiteId == forwardQuery.SiteId)
|
||||
.WhereIf(forwardQuery.TrialSiteId != null, t => t.TrialSiteId == forwardQuery.TrialSiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(forwardQuery.SubjectInfo), t => t.Subject.Code.Contains(forwardQuery.SubjectInfo))
|
||||
.WhereIf(forwardQuery.VisitPlanArray != null && forwardQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
//.WhereIf(!string.IsNullOrEmpty(forwardQuery.VisitPlanInfo), forwardQuery.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(forwardQuery.VisitPlanInfo))
|
||||
|
|
|
@ -1651,12 +1651,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
{
|
||||
|
||||
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
||||
|
||||
//var dicomStudy = new DicomStudy() { Id = t.StudyId, SubjectId = t.SubjectId, TrialId = trialId, SiteId = t.SiteId, SubjectVisitId = subjectVisitId };
|
||||
//var (physicalPath, relativePath) =
|
||||
|
||||
// FileStoreHelper.GetDicomInstanceFilePath(_hostEnvironment, dicomStudy.TrialId, dicomStudy.SiteId, dicomStudy.SubjectId, dicomStudy.SubjectVisitId, dicomStudy.Id, t.InstanceId);
|
||||
|
||||
|
||||
if (System.IO.File.Exists(physicalPath))
|
||||
{
|
||||
File.Delete(physicalPath);
|
||||
|
@ -2166,7 +2161,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
var targetPath = "/IMPORT-IMAGES/" + info.TrialCode + "_" + info.SubjectCode + "_" + info.VisitName;
|
||||
|
||||
var path = FileStoreHelper.GetSubjectVisitDicomFolderPhysicalPath(_hostEnvironment, info.TrialId, info.SiteId, info.SubjectId, info.SubjectVisitId);
|
||||
var path = FileStoreHelper.GetSubjectVisitDicomFolderPhysicalPath(_hostEnvironment, info.TrialId, info.TrialSiteId, info.SubjectId, info.SubjectVisitId);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
CreateMap<Subject, SubjectExportDTO>()
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.Site.SiteName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.LatestBlindName, u => u.MapFrom(s => s.LatestSubjectVisit.BlindName))
|
||||
.ForMember(d => d.LatestVisitName, u => u.MapFrom(s => s.LatestSubjectVisit.VisitName))
|
||||
|
@ -439,7 +439,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.IsHaveFirstGiveMedicineDate, u => u.MapFrom(s => s.Trial.IsHaveFirstGiveMedicineDate))
|
||||
//.ForMember(d => d.ChangeDefalutDays, u => u.MapFrom(s => s.Trial.ChangeDefalutDays))
|
||||
.ForMember(d => d.SubjectFirstGiveMedicineTime, u => u.MapFrom(s => s.Subject.FirstGiveMedicineTime))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Site.SiteName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName))
|
||||
.ForMember(d => d.TotalChallengeCount, u => u.MapFrom(s => s.QCChallengeList.Count()))
|
||||
.ForMember(d => d.NotClosedChallengeCount, u => u.MapFrom(s => s.QCChallengeList.Count(c => c.IsClosed == false)));
|
||||
|
||||
|
@ -513,7 +513,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.SubmitState, u => u.MapFrom(s => s.SubjectVisit.SubmitState))
|
||||
|
||||
|
||||
.ForMember(d => d.SiteId, u => u.MapFrom(s => s.SubjectVisit.SiteId))
|
||||
.ForMember(d => d.TrialSiteId, u => u.MapFrom(s => s.SubjectVisit.TrialSiteId))
|
||||
.ForMember(d => d.AuditState, u => u.MapFrom(s => s.SubjectVisit.AuditState))
|
||||
.ForMember(d => d.IsUrgent, u => u.MapFrom(s => s.SubjectVisit.IsUrgent))
|
||||
.ForMember(d => d.IsBaseLine, u => u.MapFrom(s => s.SubjectVisit.IsBaseLine))
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public Guid TrialId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
|
|
@ -457,7 +457,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
TrialId = subjectVisit.TrialId,
|
||||
SubjectId = subjectVisit.SubjectId,
|
||||
SubjectCode = subjectVisit.Subject.Code,
|
||||
SiteId = subjectVisit.SiteId,
|
||||
TrialSiteId = subjectVisit.TrialSiteId,
|
||||
TrialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
||||
LatestScanDate = subjectVisit.LatestScanDate,
|
||||
EarliestScanDate = subjectVisit.LatestScanDate,
|
||||
|
|
|
@ -265,7 +265,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public string? SiteCode { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
|
@ -283,7 +283,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public string SiteCode { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
@ -359,7 +359,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public string OutPlanPreviousVisitName { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public bool IsVisit { get; set; } = true;
|
||||
|
||||
|
|
|
@ -166,11 +166,11 @@ namespace IRaCIS.Application.Services
|
|||
var subjectIds = await subjectQuery.OrderBy(dto.SortField).Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
|
||||
List<ReadModuleView> ReadModuleViewList = await subjectQuery.Where(x => subjectIds.Contains(x.SubjectId)).OrderBy(dto.SortField).ToListAsync();
|
||||
List<GetReadModuleDtoOut> getReadList = ReadModuleViewList.GroupBy(x => new { x.SubjectId, x.SiteId, x.TrialSiteCode, x.SubjectCode })
|
||||
List<GetReadModuleDtoOut> getReadList = ReadModuleViewList.GroupBy(x => new { x.SubjectId, x.TrialSiteId, x.TrialSiteCode, x.SubjectCode })
|
||||
.Select(x => new GetReadModuleDtoOut()
|
||||
{
|
||||
TrialSiteCode = x.Key.TrialSiteCode,
|
||||
SiteId = x.Key.SiteId,
|
||||
TrialSiteId = x.Key.TrialSiteId,
|
||||
SubjectCode = x.Key.SubjectCode,
|
||||
SubjectId = x.Key.SubjectId,
|
||||
Data = x.OrderBy(x=>x.ModuleType).ThenBy(x=>x.VisitNum).ToList(),
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
ReadingPeriodSetId = entity.Id,
|
||||
TrialId = entity.TrialId,
|
||||
SiteId = x,
|
||||
TrialSiteId = x,
|
||||
}).ToList();
|
||||
|
||||
entity.ReadingPeriodPlanList = addOrEditReadingPeriodSet.SubjectVisitIds.Select(x => new ReadingPeriodPlan
|
||||
|
@ -107,7 +107,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
ReadingPeriodSetId = entity.Id,
|
||||
TrialId = entity.TrialId,
|
||||
SiteId = x,
|
||||
TrialSiteId = x,
|
||||
}).ToList();
|
||||
|
||||
entity.ReadingPeriodPlanList = addOrEditReadingPeriodSet.SubjectVisitIds.Select(x => new ReadingPeriodPlan
|
||||
|
@ -493,7 +493,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
// 当前项目 最晚拍片日期不为null 中心筛选
|
||||
var visitQuery = _subjectVisitRepository.Where(x => x.TrialId == inDto.TrialId && x.LatestScanDate != null && !x.IsLostVisit)
|
||||
.WhereIf(inDto.ReadingScope == ReadingScopeEnum.Site, x => inDto.SiteIds.Contains(x.SiteId))
|
||||
.WhereIf(inDto.ReadingScope == ReadingScopeEnum.Site, x => inDto.SiteIds.Contains(x.TrialSiteId))
|
||||
.Where(x=>!x.IsBaseLine);// 排除基线
|
||||
|
||||
// 已经存在的访视 需要排除
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<ReadingPeriodSet, ReadingPeriodSetView>()
|
||||
.ForMember(d => d.SubjectVisitName, u => u.MapFrom(s => s.VisitStage==null?string.Empty: s.VisitStage.VisitName))
|
||||
.ForMember(d => d.SiteIds, u => u.MapFrom(s => s.ReadingPeriodSites.Select(x => x.SiteId)))
|
||||
.ForMember(d => d.SiteIds, u => u.MapFrom(s => s.ReadingPeriodSites.Select(x => x.TrialSiteId)))
|
||||
.ForMember(d => d.SiteCodes, u => u.MapFrom(s => s.ReadingPeriodSites.Select(x => x.TrialSite.TrialSiteCode)))
|
||||
.ForMember(d => d.PlanCount, u => u.MapFrom(s => s.ReadingPeriodPlanList.Count));
|
||||
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public class HistoryVisitRSDTO
|
||||
{
|
||||
|
||||
public Guid StudyId { get; set; }
|
||||
public string StudyCode { get; set; } = String.Empty;
|
||||
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
public string VisitName { get; set; } = String.Empty;
|
||||
|
||||
public string OverallResponse { get; set; } = String.Empty;
|
||||
|
||||
public string TpCode { get; set; } = String.Empty;
|
||||
|
||||
public GlobalRSSelectView GlobalRSSelect { get; set; } = new GlobalRSSelectView();
|
||||
|
||||
}
|
||||
|
||||
public class GlobalRSSelectView
|
||||
{
|
||||
public bool? Agree { get; set; }
|
||||
public string NewRS { get; set; } = String.Empty;
|
||||
public string Note { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
public class HistoryGlobalRsDTO
|
||||
{
|
||||
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
public string VisitName { get; set; } = String.Empty;
|
||||
|
||||
public string OverallResponse { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
public class PreviousGlobalReadsView
|
||||
{
|
||||
public string SubjectNote { get; set; } = String.Empty;
|
||||
|
||||
public List<HistoryGlobalRsDTO> PreviousGlobalReadsList { get; set; } = new List<HistoryGlobalRsDTO>();
|
||||
}
|
||||
|
||||
|
||||
public class GlobalTaskReportCommand
|
||||
{
|
||||
public Guid GlobalId { get; set; }
|
||||
public string SubjectNote { get; set; } = String.Empty;
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public List<GlobalReportCommand> GlobalRSReportList { get; set; }=new List<GlobalReportCommand>();
|
||||
}
|
||||
|
||||
public class GlobalReportCommand
|
||||
{
|
||||
public Guid GlobalId { get; set; }
|
||||
public string TpCode { get; set; } = String.Empty;
|
||||
public int VisitNum { get; set; }
|
||||
public bool? Agree { get; set; }
|
||||
public string NewRS { get; set; } = String.Empty;
|
||||
public string Note { get; set; } = String.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class AdReportDTO
|
||||
{
|
||||
public PreviousGlobalReadsView Global1 { get; set; } = new PreviousGlobalReadsView();
|
||||
public PreviousGlobalReadsView Global2 { get; set; } = new PreviousGlobalReadsView();
|
||||
|
||||
public IEnumerable<HistoryVisitRSDTO> Global1VisitRS { get; set; }=new List<HistoryVisitRSDTO>();
|
||||
public IEnumerable<HistoryVisitRSDTO> Global2VisitRS { get; set; } = new List<HistoryVisitRSDTO>();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class ADReportCommand
|
||||
{
|
||||
|
||||
public Guid AdId { get; set; }
|
||||
public Guid SelectGlobalId { get; set; }
|
||||
public string ADNote { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,280 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public class LesionInformation
|
||||
{
|
||||
public Guid TUId { get; set; }
|
||||
public int LesionType { get; set; } //病灶类型
|
||||
public string STUDYID { get; set; } = string.Empty; // 项目ID
|
||||
public string USUBJID { get; set; } = string.Empty;// 受试者ID
|
||||
public int TUSEQ { get; set; } // 病灶序号
|
||||
|
||||
// 病灶分组,主要是用于将分裂或者结合在一起的已经被标识的肿瘤分类
|
||||
public string TUGRPID { get; set; } = string.Empty;
|
||||
|
||||
//内部或外部的肿瘤/病灶标识。 例如:医学影像 ID
|
||||
public string TUREFID { get; set; } = string.Empty;
|
||||
|
||||
public string TUSPID { get; set; } = string.Empty;// 申办方标识
|
||||
|
||||
// 关联测量结果,及TUGRPID一起,标识分裂及合并
|
||||
public string TULNKID { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 检查项目
|
||||
/// TUMIDENT (Tumor Identification )
|
||||
/// TUSPLIT (Tumor Split )
|
||||
/// TUMERGE (Tumor Merged)
|
||||
/// </summary>
|
||||
public string TUTESTCD { get; set; } = string.Empty;
|
||||
public string TUTEST { get; set; } = string.Empty;
|
||||
|
||||
public string TUORRES { get; set; } = string.Empty;//TARGET, NON-TARGET, NEW
|
||||
|
||||
public string TUSTRESC { get; set; } = string.Empty;//包含从 TUORRES拷贝的所有发现的结果
|
||||
public string TUNAM { get; set; } = string.Empty;//完成肿瘤标识的供应商名称或标识
|
||||
|
||||
public string LocDescription { get; set; } = string.Empty;// 部位描述
|
||||
public string TULOC { get; set; } = string.Empty; // 解剖学部位
|
||||
public string TULAT { get; set; } = string.Empty;//解剖学部位或者样本更详细的偏侧性修饰语,比如,左侧, 右侧,双侧。
|
||||
public string TUDIR { get; set; } = string.Empty;//解剖学部位或者样本更详细的方向性修饰语,比如,上边的 ,里面的。
|
||||
public string TUPORTOT { get; set; } = string.Empty;//解剖学部位或者样本更详细的分布,安排,分配的修饰语, 比如,全部的,单一的,部分的,多数的。
|
||||
|
||||
public string TUMETHOD { get; set; } = string.Empty; //用来标识肿瘤的办法。 例如,核磁共振,CT扫描。
|
||||
|
||||
public string TUEVAL { get; set; } = string.Empty; //评估者的角色。 例如:研究者,独立评估者。
|
||||
public string TUEVALID { get; set; } = string.Empty;//这个特定的评估者变量是与 TUEVAL一起使用来提供更详 细的信息
|
||||
public string TUACPTFL { get; set; } = string.Empty;
|
||||
|
||||
// 访视信息
|
||||
public decimal VISITNUM { get; set; } = 0;
|
||||
public string VISIT { get; set; } = string.Empty;
|
||||
public int VISITDY { get; set; }
|
||||
public string EPOCH { get; set; } = string.Empty;
|
||||
public string TUDTC { get; set; } = string.Empty;
|
||||
public int TUDY { get; set; } = 0;
|
||||
|
||||
//TR
|
||||
|
||||
public string TRTESTCD { get; set; } = string.Empty;
|
||||
public string TRTEST { get; set; } = string.Empty;
|
||||
public string TRORRES { get; set; } = string.Empty;//原始收到或采集的肿瘤测量/评估结
|
||||
public string TRORRESU { get; set; } = string.Empty;//原始单位
|
||||
public string TRSTRESC { get; set; } = string.Empty;//标准化结 果
|
||||
public double TRSTRESN { get; set; }//标准化结 果(N)
|
||||
public string TRSTRESU { get; set; } = string.Empty;// 标准化单位
|
||||
public string TRSTAT { get; set; } = string.Empty; // 未做状态
|
||||
public string TRREASND { get; set; } = string.Empty; // 未做原因
|
||||
public string Note { get; set; } = string.Empty;
|
||||
public string TRGRPID { get; set; } = string.Empty;
|
||||
public string TRDTC { get; set; } = string.Empty;
|
||||
public int TRDY { get; set; } = 0;
|
||||
////RS
|
||||
//public string RSCAT { get; set; } // 类别,用来识别对反应评估中使用的标准,以及适当时提供版本号
|
||||
//public string RSORRES { get; set; } //原始接收、采集或者计算的肿瘤反应评估的结果。
|
||||
//public string RSSTRESC { get; set; } //标准化结果
|
||||
|
||||
public bool CoveredLesion { get; set; }
|
||||
}
|
||||
public class VisitLesion : LesionInformation
|
||||
{
|
||||
public LesionInformation CurrentLesion { get; set; } = new LesionInformation();
|
||||
}
|
||||
|
||||
public class EfficacyAssessment
|
||||
{
|
||||
public string TargetLesion { get; set; } = string.Empty;
|
||||
public string Non_targetLesion { get; set; } = string.Empty;
|
||||
public string OverallAssessment { get; set; } = string.Empty;
|
||||
|
||||
public string TargetLesionNote { get; set; } = string.Empty;
|
||||
public string Non_targetLesionNote { get; set; } = string.Empty;
|
||||
public string OverallAssessmentNote { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class PreviousOverallAssessment
|
||||
{
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
public string OverallAssessment { get; set; } = string.Empty;
|
||||
}
|
||||
public class VisitLesionInfo
|
||||
{
|
||||
//基线病灶信息及本次访视测量信息
|
||||
public IList<VisitLesion> BLLesionList { get; set; } = new List<VisitLesion>();
|
||||
// public IList<LesionInformation> BLVisitLesionList { get; set; } = new List<LesionInformation>();
|
||||
//public IList<LesionInformation> CurrentVisitLesionList { get; set; } = new List<LesionInformation>();
|
||||
|
||||
// 以往病灶信息
|
||||
public IList<VisitLesion> PreviousNewLesionList { get; set; } = new List<VisitLesion>();
|
||||
//本次疑似新病灶
|
||||
public IList<LesionInformation> EquivocalNewLesionList { get; set; } = new List<LesionInformation>();
|
||||
public IList<LesionInformation> UnequivocalNewLesionList { get; set; } = new List<LesionInformation>();
|
||||
public ReportDTO ReportResult { get; set; } = new ReportDTO();
|
||||
public EfficacyAssessment Efficacy { get; set; } = new EfficacyAssessment();
|
||||
public List<PreviousOverallAssessment> PreviousOverallAssessment { get; set; } = new List<PreviousOverallAssessment>();
|
||||
|
||||
public MinVisit MinVisitInfo { get; set; } = new MinVisit();
|
||||
}
|
||||
|
||||
public class MinVisit
|
||||
{
|
||||
public double MinSum { get; set; } = 0.0;
|
||||
public string MinVistName { get; set; } = string.Empty;
|
||||
}
|
||||
public class ReportCommand
|
||||
{
|
||||
public List<LesionInformation> LesionInformationList { get; set; } = new List<LesionInformation>();
|
||||
|
||||
//RS
|
||||
public string RSCAT { get; set; } = string.Empty;// 类别,用来识别对反应评估中使用的标准,以及适当时提供版本号
|
||||
public string RSORRES { get; set; } = string.Empty; //原始接收、采集或者计算的肿瘤反应评估的结果。
|
||||
public string RSSTRESC { get; set; } = string.Empty; //标准化结果
|
||||
}
|
||||
public class TUDTO
|
||||
{
|
||||
public int LesionType { get; set; }
|
||||
public string STUDYID { get; set; } = string.Empty;
|
||||
public string USUBJID { get; set; } = string.Empty;
|
||||
public int TUSEQ { get; set; }
|
||||
public string TUGRPID { get; set; } = string.Empty;
|
||||
public string TUREFID { get; set; } = string.Empty;//内部或外部的肿瘤/病灶标识。 例如:医学影像 ID
|
||||
public string TUSPID { get; set; } = string.Empty;
|
||||
public string TULNKID { get; set; } = string.Empty;
|
||||
public string TUTESTCD { get; set; } = string.Empty;
|
||||
public string TUTEST { get; set; } = string.Empty;
|
||||
|
||||
public double TUORRES { get; set; } = 0;
|
||||
public string TUSTRESC { get; set; } = string.Empty;
|
||||
public string TUNAM { get; set; } = string.Empty;
|
||||
public string TULOC { get; set; } = string.Empty;
|
||||
public string TULAT { get; set; } = string.Empty;
|
||||
public string TUDIR { get; set; } = string.Empty;
|
||||
public string TUPORTOT { get; set; } = string.Empty;
|
||||
public string TUMETHOD { get; set; } = string.Empty;
|
||||
public string TUEVAL { get; set; } = string.Empty;
|
||||
public string TUEVALID { get; set; } = string.Empty;
|
||||
public string TUACPTFL { get; set; } = string.Empty;
|
||||
public double VISITNUM { get; set; } = 0;
|
||||
public string VISIT { get; set; } = string.Empty;
|
||||
public string VISITDY { get; set; } = string.Empty;
|
||||
public string EPOCH { get; set; } = string.Empty;
|
||||
public string TUDTC { get; set; } = string.Empty;
|
||||
public int TUDY { get; set; } = 0;
|
||||
}
|
||||
public class TRDTO
|
||||
{
|
||||
public string STUDYID { get; set; } = string.Empty;
|
||||
public string DOMAIN { get; set; } = string.Empty;
|
||||
public string USUBJID { get; set; } = string.Empty;
|
||||
public int TRSEQ { get; set; }
|
||||
public string TRGRPID { get; set; } = string.Empty;
|
||||
public string TRREFID { get; set; } = string.Empty;
|
||||
public string TRSPID { get; set; } = string.Empty;
|
||||
public string TRLNKID { get; set; } = string.Empty;
|
||||
public string TRLNKGRP { get; set; } = string.Empty;
|
||||
public string TRTESTCD { get; set; } = string.Empty;
|
||||
public string TRTEST { get; set; } = string.Empty;
|
||||
public string TRORRES { get; set; } = string.Empty;
|
||||
public string TRORRESU { get; set; } = string.Empty;
|
||||
public string TRSTRESC { get; set; } = string.Empty;
|
||||
public double TRSTRESN { get; set; } = 0;
|
||||
public string TRSTRESU { get; set; } = string.Empty;
|
||||
public string TRSTAT { get; set; } = string.Empty;
|
||||
public string TRREASND { get; set; } = string.Empty;
|
||||
public string TRNAM { get; set; } = string.Empty;
|
||||
public string TRMETHOD { get; set; } = string.Empty;
|
||||
public string TREVAL { get; set; } = string.Empty;
|
||||
public string TREVALID { get; set; } = string.Empty;
|
||||
public string TRACPTFL { get; set; } = string.Empty;
|
||||
public decimal VISITNUM { get; set; } = 0;
|
||||
public string VISIT { get; set; } = string.Empty;
|
||||
public int VISITDY { get; set; } = 0;
|
||||
public string EPOCH { get; set; } = string.Empty;
|
||||
public string TRDTC { get; set; } = string.Empty;
|
||||
public int TRDY { get; set; } = 0;
|
||||
public string Note { get; set; } = string.Empty;
|
||||
public bool CoveredLesion { get; set; } = true;
|
||||
}
|
||||
|
||||
public class RSDTO
|
||||
{
|
||||
public string STUDYID { get; set; } = string.Empty;
|
||||
public string DOMAIN { get; set; } = string.Empty;
|
||||
public string USUBJID { get; set; } = string.Empty;
|
||||
public int RSSEQ { get; set; }
|
||||
public string RSGRPID { get; set; } = string.Empty;
|
||||
public string RSREFID { get; set; } = string.Empty;
|
||||
public string RSSPID { get; set; } = string.Empty;
|
||||
public string RSLNKID { get; set; } = string.Empty;
|
||||
public string RSLNKGRP { get; set; } = string.Empty;
|
||||
public string RSTESTCD { get; set; } = string.Empty;
|
||||
public string RSTEST { get; set; } = string.Empty;
|
||||
public string RSCAT { get; set; } = string.Empty;
|
||||
public string RSORRES { get; set; } = string.Empty;
|
||||
public string RSSTRESC { get; set; } = string.Empty;
|
||||
public string RSSTAT { get; set; } = string.Empty;
|
||||
public string RSREASND { get; set; } = string.Empty;
|
||||
public string RSNAM { get; set; } = string.Empty;
|
||||
|
||||
public string RSEVAL { get; set; } = string.Empty;
|
||||
public string RSEVALID { get; set; } = string.Empty;
|
||||
public string RSACPTFL { get; set; } = string.Empty;
|
||||
public decimal VISITNUM { get; set; } = 0;
|
||||
public string VISIT { get; set; } = string.Empty;
|
||||
public int VISITDY { get; set; } = 0;
|
||||
public string EPOCH { get; set; } = string.Empty;
|
||||
public string RSDTC { get; set; } = string.Empty;
|
||||
public int RSDY { get; set; } = 0;
|
||||
public Guid StudyGuid { get; set; } = Guid.Empty;
|
||||
public Guid TrialGuid { get; set; } = Guid.Empty;
|
||||
public Guid SubjectGuid { get; set; } = Guid.Empty;
|
||||
|
||||
public string Note { get; set; } = string.Empty;
|
||||
}
|
||||
public class ReportDTO
|
||||
{
|
||||
public bool Qualified { get; set; } = true;
|
||||
public string DiseaseProgression { get; set; } = string.Empty;
|
||||
public string NotEvaluable { get; set; } = string.Empty;
|
||||
public string Timepoint { get; set; } = string.Empty;
|
||||
public string TrialCode { get; set; } = string.Empty;
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
public decimal? VisitNum { get; set; }
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
public int? DiseaseSituation { get; set; }
|
||||
public string Comment { get; set; } = String.Empty;
|
||||
public Guid? TPId { get; set; }
|
||||
public Guid? DicomStudyId { get; set; }
|
||||
public string TpCode { get; set; } = string.Empty;
|
||||
|
||||
public bool AffectRead { get; set; }//是否影响读片
|
||||
public string AffectReadNote { get; set; } = String.Empty;//备注说明
|
||||
}
|
||||
|
||||
|
||||
public class VisitReportCommand
|
||||
{
|
||||
public List<LesionInformation> LesionInformation { get; set; } = new List<LesionInformation>();
|
||||
public List<TRDTO> TRList { get; set; } = new List<TRDTO>();
|
||||
public List<RSDTO> RSList { get; set; } = new List<RSDTO>();
|
||||
public ReportDTO ReportResult { get; set; } = new ReportDTO();
|
||||
}
|
||||
|
||||
public class BaseLineReportCommand
|
||||
{
|
||||
//public Guid TimepointId { get; set; }
|
||||
public string SumOfDiameter { get; set; } = String.Empty;
|
||||
public string SumDiameterOfNonLymphNode { get; set; } = String.Empty;
|
||||
public IList<LesionInformation> LesionInformation { get; set; } = new List<LesionInformation>();
|
||||
public ReportDTO ReportResult { get; set; } = new ReportDTO();
|
||||
}
|
||||
|
||||
public class BaseLineReportDTO
|
||||
{
|
||||
public IList<LesionInformation> LesionInformation { get; set; } = new List<LesionInformation>();
|
||||
public ReportDTO ReportResult { get; set; } = new ReportDTO();
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
|
||||
namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
public class WorkloadReadingDTO
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid StudyId { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public string TrialCode { get; set; } = string.Empty;
|
||||
public string TrialIndication { get; set; } = string.Empty;
|
||||
public string Sponsor { get; set; } = string.Empty;
|
||||
public int Expedited { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
|
||||
public Guid WorkloadId { get; set; }
|
||||
public string WorkloadCode { get; set; } = string.Empty;
|
||||
public int WorkloadType { get; set; }
|
||||
public int Status { get; set; }
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
}
|
||||
|
||||
public class WorkloadQueryParam : PageInput
|
||||
{
|
||||
public Guid? TrialId { get; set; } = Guid.Empty;
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
public int? Status { get; set; }
|
||||
public int WorkloadType { get; set; }
|
||||
public int? Expedited { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,197 +0,0 @@
|
|||
//using IRaCIS.Core.Application.Contracts;
|
||||
//using System.Linq.Dynamic.Core;
|
||||
//using AutoMapper;
|
||||
//using IRaCIS.Application.Contracts;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
//using IRaCIS.Core.Domain.Models;
|
||||
//using IRaCIS.Core.Infrastructure.Extention;
|
||||
//using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//namespace IRaCIS.Core.Application.Services
|
||||
//{
|
||||
// [ ApiExplorerSettings(GroupName = "Reading")]
|
||||
// public class GlobalReportService : BaseService, IGlobalService
|
||||
// {
|
||||
// private readonly IRepository<GlobalRS> _globalRsRepository;
|
||||
// private readonly IRepository<GlobalResult> _globalResultRepository;
|
||||
// private readonly IRSRepository _rsRepository;
|
||||
// private readonly IRepository<VisitStage> _visitStageRepository;
|
||||
|
||||
// private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
// private readonly IWorkloadADRepository _workloadAdRepository;
|
||||
// private readonly IWorkloadGlobalRepository _workloadGlobalRepository;
|
||||
// private readonly IRepository<Trial> _trialRepository;
|
||||
// private readonly IRepository<Subject> _subjectRepository;
|
||||
|
||||
// public GlobalReportService(IRepository<GlobalRS> globalRsRepository, IRepository<GlobalResult> globalResultRepository,
|
||||
// IRSRepository rsRepository, IRepository<VisitStage> visitStageRepository, IRepository<SubjectVisit> subjectVisitRepository, IWorkloadADRepository workloadAdRepository,
|
||||
// IWorkloadGlobalRepository workloadGlobalRepository, IRepository<Trial> trialRepository, IRepository<Subject> subjectRepository)
|
||||
// {
|
||||
// _globalRsRepository = globalRsRepository;
|
||||
// _globalResultRepository = globalResultRepository;
|
||||
// _rsRepository = rsRepository;
|
||||
// _visitStageRepository = visitStageRepository;
|
||||
|
||||
// _subjectVisitRepository = subjectVisitRepository;
|
||||
// _workloadAdRepository = workloadAdRepository;
|
||||
// _workloadGlobalRepository = workloadGlobalRepository;
|
||||
// _trialRepository = trialRepository;
|
||||
// _subjectRepository = subjectRepository;
|
||||
// }
|
||||
|
||||
// [HttpGet("{trialId:guid}/{subjectId:guid}/{visitNum:decimal}/{globalId:guid}/{globalCode}")]
|
||||
// public IEnumerable<HistoryVisitRSDTO> GetHistoryVisitRsList(Guid trialId, Guid subjectId, decimal visitNum, Guid globalId, string globalCode)
|
||||
// {
|
||||
|
||||
// var tpGroup = 'T' + globalCode.Trim().Substring(globalCode.Trim().Length - 2);
|
||||
|
||||
|
||||
// var query = from rs in _rsRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectGuid == subjectId && t.TrialGuid == trialId && t.RSTESTCD == "OVRLRESP" && t.VISITNUM <= visitNum && t.TpCode.Contains(tpGroup))
|
||||
|
||||
// join globalRs in _globalRsRepository.Where(t => t.GlobalId == globalId) on new { rs.TpCode, VisitNum = rs.VISITNUM } equals new { globalRs.TpCode, globalRs.VisitNum } into cc
|
||||
// from globalRs in cc.DefaultIfEmpty()
|
||||
|
||||
// join visitStage in _visitStageRepository.Where(t => t.TrialId == trialId) on rs.VISITNUM equals visitStage.VisitNum
|
||||
// select new HistoryVisitRSDTO
|
||||
// {
|
||||
// StudyId = rs.StudyGuid,
|
||||
// StudyCode = rs.STUDYID,
|
||||
// VisitNum = visitStage.VisitNum,
|
||||
// VisitName = visitStage.VisitName,
|
||||
// OverallResponse = rs.RSORRES,
|
||||
// TpCode = rs.TpCode,
|
||||
// GlobalRSSelect = new GlobalRSSelectView()
|
||||
// {
|
||||
// Agree = globalRs.Agree,
|
||||
// NewRS = globalRs.NewRS,
|
||||
// Note = globalRs.Note
|
||||
// }
|
||||
// };
|
||||
|
||||
// var visitRsList = query.OrderBy(t => t.VisitNum).ToList();
|
||||
|
||||
// return visitRsList;
|
||||
|
||||
// }
|
||||
// #pragma warning disable
|
||||
// [HttpGet("{trialId:guid}/{subjectId:guid}/{visitNum:decimal}/{globalId:guid}")]
|
||||
// public PreviousGlobalReadsView GetHistoryGlobalRsList(Guid trialId, Guid subjectId, decimal visitNum,
|
||||
// Guid globalId)
|
||||
// {
|
||||
// //subjectCode = subjectCode.Trim();
|
||||
|
||||
// var query = from globalResult in _globalResultRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectId == subjectId && t.VisitNum < visitNum)
|
||||
// join visitStage in _visitStageRepository.Where(t => t.TrialId == trialId) on globalResult.VisitNum equals visitStage.VisitNum
|
||||
// select new HistoryGlobalRsDTO
|
||||
// {
|
||||
// VisitNum = visitStage.VisitNum,
|
||||
// VisitName = visitStage.VisitName,
|
||||
// OverallResponse = globalResult.Result
|
||||
// };
|
||||
|
||||
// var subjectNote = _globalResultRepository.FirstOrDefault(t => t.GlobalId == globalId)?.SubjectNote;
|
||||
|
||||
// return new PreviousGlobalReadsView()
|
||||
// {
|
||||
// PreviousGlobalReadsList = query.ToList(),
|
||||
// SubjectNote = subjectNote
|
||||
// };
|
||||
|
||||
// }
|
||||
|
||||
// public IResponseOutput AddGlobalReport(GlobalTaskReportCommand globalTaskReportCommand)
|
||||
// {
|
||||
// //删除上一次保存得记录
|
||||
// _globalResultRepository.Delete(t => t.GlobalId == globalTaskReportCommand.GlobalId);
|
||||
// _globalRsRepository.Delete(t => t.GlobalId == globalTaskReportCommand.GlobalId);
|
||||
|
||||
|
||||
// var globalRsList = _mapper.Map<List<GlobalRS>>(globalTaskReportCommand.GlobalRSReportList);
|
||||
|
||||
// _globalRsRepository.AddRange(globalRsList);
|
||||
|
||||
// var first = globalRsList.OrderByDescending(t => t.VisitNum).First();
|
||||
|
||||
// var globalResult = new GlobalResult()
|
||||
// {
|
||||
// VisitNum = first.VisitNum,
|
||||
// SubjectCode = globalTaskReportCommand.SubjectCode,
|
||||
// SubjectNote = globalTaskReportCommand.SubjectNote,
|
||||
// SubjectId = globalTaskReportCommand.SubjectId,
|
||||
|
||||
// GlobalId = first.GlobalId,
|
||||
// Result = first.NewRS
|
||||
// };
|
||||
|
||||
// _globalResultRepository.Add(globalResult);
|
||||
|
||||
// return ResponseOutput.Result(_globalResultRepository.SaveChanges()) ;
|
||||
|
||||
// }
|
||||
|
||||
// //public string GetCommentsForSubject(Guid globalId)
|
||||
// //{
|
||||
// // return _globalResultRepository.FirstOrDefault(t => t.GlobalId == globalId)?.SubjectNote;
|
||||
// //}
|
||||
// [HttpGet("{adId}")]
|
||||
// public AdReportDTO GetAdReport(Guid adId)
|
||||
// {
|
||||
// var adReport = new AdReportDTO();
|
||||
// var ad = _workloadAdRepository.FirstOrDefault(t => t.Id == adId);
|
||||
// var globalId1 = ad.Global1Id;
|
||||
// var globalId2 = ad.Global2Id;
|
||||
|
||||
// var query = from global in _workloadGlobalRepository.Where(t => t.Id == globalId1 || t.Id == globalId2)
|
||||
// join trial in _trialRepository.Where(t => t.Id == ad.TrialId) on global.TrialId equals trial.Id
|
||||
// join subject in _subjectRepository.AsQueryable() on global.SubjectId equals subject.Id
|
||||
// select new WorkloadReadingDTO
|
||||
// {
|
||||
// Id = global.Id,
|
||||
// WorkloadId = global.Id,
|
||||
// WorkloadType = 1,
|
||||
// Status = global.Status,
|
||||
// UpdateTime = global.UpdateTime,
|
||||
// TrialId = global.TrialId,
|
||||
// SubjectId = global.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// //VisitNum = visit.VisitNum,
|
||||
// //VisitName = visit.VisitName,
|
||||
// VisitNum = global.VisitNum,
|
||||
// VisitName = global.VisitName,
|
||||
|
||||
// Expedited = trial.Expedited,
|
||||
// TrialCode = trial.TrialCode,
|
||||
// TrialIndication = trial.Indication,
|
||||
// WorkloadCode = global.GlobalCode
|
||||
// };
|
||||
|
||||
// var globalList = query.ToList();
|
||||
|
||||
// var global1 = globalList.First(t => t.Id == globalId1);
|
||||
// var global2 = globalList.First(t => t.Id == globalId2);
|
||||
|
||||
// adReport.Global1VisitRS = GetHistoryVisitRsList(global1.TrialId, global1.SubjectId,
|
||||
// global1.VisitNum, global1.Id, global1.WorkloadCode);
|
||||
|
||||
// adReport.Global2VisitRS = GetHistoryVisitRsList(global2.TrialId, global2.SubjectId
|
||||
// ,global2.VisitNum, global2.Id, global2.WorkloadCode);
|
||||
|
||||
// adReport.Global1 = GetHistoryGlobalRsList(global1.TrialId, global1.SubjectId, global1.VisitNum, global1.Id);
|
||||
// adReport.Global2 = GetHistoryGlobalRsList(global2.TrialId, global2.SubjectId, global2.VisitNum, global2.Id);
|
||||
|
||||
// adReport.ADInfo = ad;
|
||||
|
||||
// return adReport;
|
||||
|
||||
// }
|
||||
|
||||
// public IResponseOutput AddAdjudicationReport(ADReportCommand adReportCommand)
|
||||
// {
|
||||
// return ResponseOutput.Result(_workloadAdRepository.Update(t => t.Id == adReportCommand.AdId,
|
||||
// u => new WorkloadAD()
|
||||
// { AdNote = adReportCommand.ADNote, SelectGlobalId = adReportCommand.SelectGlobalId })) ;
|
||||
// }
|
||||
// }
|
||||
//}
|
|
@ -1,24 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface IGlobalService
|
||||
{
|
||||
//string GetCommentsForSubject(Guid globalId);
|
||||
IEnumerable<HistoryVisitRSDTO> GetHistoryVisitRsList(Guid trialId, Guid subjectId, decimal visitNum, Guid globalId,string globalCode);
|
||||
|
||||
PreviousGlobalReadsView GetHistoryGlobalRsList(Guid trialId, Guid subjectId, decimal visitNum, Guid globalId);
|
||||
|
||||
IResponseOutput AddGlobalReport(GlobalTaskReportCommand globalTaskReportCommand);
|
||||
|
||||
|
||||
|
||||
AdReportDTO GetAdReport(Guid adId);
|
||||
IResponseOutput AddAdjudicationReport(ADReportCommand adReportCommand);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface IReportService
|
||||
{
|
||||
//bool SaveReport(ReportCommand reportCommand);
|
||||
|
||||
/// <summary> 添加基线期病灶标识及测量信息 </summary>
|
||||
bool AddLesion(List<LesionInformation> lesionInformation, ReportDTO report);
|
||||
///// <summary> 获取基线期信息 <summary>
|
||||
//IList<LesionInformation> GetBLLesion(string trialCode, string subjectCode);
|
||||
|
||||
/// <summary>
|
||||
/// 获取访视病灶信息
|
||||
/// </summary>
|
||||
VisitLesionInfo GetVisitLineLesion(string trialCode, string subjectCode, decimal visitNum,string tpCode);
|
||||
|
||||
bool SaveVisitReport(VisitReportCommand visitReportCommand);
|
||||
bool AddBaseLineLesion(BaseLineReportCommand baseLineReportCommand);
|
||||
BaseLineReportDTO getBLLineLesion(string trialCode, string subjectCode, string tpCode);
|
||||
|
||||
bool SubmiteReport(Guid tpId);
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
|
||||
namespace IRaCIS.Application.Interfaces
|
||||
{
|
||||
public interface IReviewerReadingService
|
||||
{
|
||||
PageOutput<WorkloadReadingDTO> GetWorkloadList(WorkloadQueryParam param);
|
||||
}
|
||||
}
|
|
@ -1,184 +0,0 @@
|
|||
//using IRaCIS.Application.Interfaces;
|
||||
//using IRaCIS.Application.Contracts;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
|
||||
//using IRaCIS.Core.Domain.Models;
|
||||
//using System.Linq.Expressions;
|
||||
//using IRaCIS.Core.Infrastructure.ExpressionExtend;
|
||||
//using IRaCIS.Core.Infrastructure.Extention;
|
||||
//using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//namespace IRaCIS.Core.Application.Services
|
||||
//{
|
||||
// [ApiExplorerSettings(GroupName = "Reading")]
|
||||
// public class ReadingService : BaseService, IReviewerReadingService
|
||||
// {
|
||||
// private readonly IWorkloadTPRepository _workloadTPRepository;
|
||||
// private readonly IWorkloadGlobalRepository _workloadGlobalRepository;
|
||||
// private readonly IWorkloadADRepository _workloadADRepository;
|
||||
// private readonly IRepository<Trial> _trialRepository;
|
||||
|
||||
// private readonly IRepository<Subject> _subjectRepository;
|
||||
// private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
|
||||
// public ReadingService(IWorkloadTPRepository workloadTPRepository,
|
||||
// IWorkloadGlobalRepository workloadGlobalRepository,
|
||||
// IWorkloadADRepository workloadADRepository,
|
||||
// IRepository<Trial> trialRepository,
|
||||
// IRepository<Subject> subjectRepository,
|
||||
// IRepository<SubjectVisit> subjectVisitRepository,
|
||||
// IUserInfo userInfo)
|
||||
// {
|
||||
// _workloadTPRepository = workloadTPRepository;
|
||||
// _workloadGlobalRepository = workloadGlobalRepository;
|
||||
// _workloadADRepository = workloadADRepository;
|
||||
// _trialRepository = trialRepository;
|
||||
|
||||
// _subjectRepository = subjectRepository;
|
||||
// _subjectVisitRepository = subjectVisitRepository;
|
||||
|
||||
// }
|
||||
// /// <summary>
|
||||
// /// 获取医生个人任务列表
|
||||
// /// WorkloadType 1-tp,2-global,3-ad
|
||||
// /// </summary>
|
||||
// /// <param name="param"></param>
|
||||
// /// <returns></returns>
|
||||
// [HttpPost]
|
||||
// public PageOutput<WorkloadReadingDTO> GetWorkloadList(WorkloadQueryParam param)
|
||||
// {
|
||||
// #pragma warning disable
|
||||
// IQueryable<WorkloadReadingDTO> query = null;
|
||||
// Expression<Func<Subject, bool>> subjectLambda = x => true;
|
||||
// if (param.SubjectCode != string.Empty)
|
||||
// {
|
||||
// subjectLambda = subjectLambda.And(o => o.Code.Contains(param.SubjectCode));
|
||||
// }
|
||||
// Expression<Func<Trial, bool>> trialLambda = x => true;
|
||||
// if (param.Expedited != null)
|
||||
// {
|
||||
// trialLambda = trialLambda.And(o => o.Expedited == param.Expedited);
|
||||
// }
|
||||
// if (param.TrialId != null && param.TrialId != Guid.Empty)
|
||||
// {
|
||||
// trialLambda = trialLambda.And(o => o.Id == param.TrialId);
|
||||
// }
|
||||
|
||||
|
||||
// if (param.WorkloadType == 1)// TP
|
||||
// {
|
||||
// Expression<Func<WorkloadTP, bool>> workloadLambda = x => true;
|
||||
// workloadLambda = workloadLambda.And(u => u.ReviewerId == _userInfo.Id);
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// if (param.Status == 30)//30 的时候,待读和正在读(未提交的)
|
||||
// {
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == 30 || o.Status == 40);
|
||||
// }
|
||||
// else
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == param.Status);
|
||||
// }
|
||||
// query = from tp in _workloadTPRepository.Where(workloadLambda)
|
||||
// join trial in _trialRepository.Where(trialLambda) on tp.TrialId equals trial.Id
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on tp.SubjectId equals subject.Id
|
||||
// join visit in _subjectVisitRepository.AsQueryable() on tp.SubjectVisitId equals visit.Id
|
||||
// select new WorkloadReadingDTO
|
||||
// {
|
||||
// Id = tp.Id,
|
||||
// StudyId = tp.StudyId,
|
||||
// WorkloadId = tp.Id,
|
||||
// WorkloadType = 1,
|
||||
// Status = tp.Status,
|
||||
// UpdateTime = tp.UpdateTime,
|
||||
// TrialId = tp.TrialId,
|
||||
// SubjectId = tp.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// VisitNum = visit.VisitNum,
|
||||
// VisitName = visit.VisitName,
|
||||
// Expedited = trial.Expedited,
|
||||
// TrialCode = trial.TrialCode,
|
||||
// TrialIndication = trial.Indication,
|
||||
// WorkloadCode = tp.TimepointCode
|
||||
// };
|
||||
// }
|
||||
// else if (param.WorkloadType == 2)//Global
|
||||
// {
|
||||
// Expression<Func<WorkloadGlobal, bool>> workloadLambda = x => true;
|
||||
// workloadLambda = workloadLambda.And(u => u.ReviewerId == _userInfo.Id);
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// if (param.Status == 30)
|
||||
// {
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == 30 || o.Status == 40);
|
||||
// }
|
||||
// else
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == param.Status);
|
||||
// }
|
||||
// query = from global in _workloadGlobalRepository.Where(workloadLambda)
|
||||
// join trial in _trialRepository.Where(trialLambda) on global.TrialId equals trial.Id
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on global.SubjectId equals subject.Id
|
||||
// //join visit in _subjectVisitRepository.GetAll() on global.VisitId equals visit.Id
|
||||
// select new WorkloadReadingDTO
|
||||
// {
|
||||
// Id = global.Id,
|
||||
// WorkloadId = global.Id,
|
||||
// WorkloadType = 1,
|
||||
// Status = global.Status,
|
||||
// UpdateTime = global.UpdateTime,
|
||||
// TrialId = global.TrialId,
|
||||
// SubjectId = global.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// //VisitNum = visit.VisitNum,
|
||||
// //VisitName = visit.VisitName,
|
||||
// VisitNum = global.VisitNum,
|
||||
// VisitName = global.VisitName,
|
||||
|
||||
// Expedited = trial.Expedited,
|
||||
// TrialCode = trial.TrialCode,
|
||||
// TrialIndication = trial.Indication,
|
||||
// WorkloadCode = global.GlobalCode
|
||||
// };
|
||||
// }
|
||||
// else if (param.WorkloadType == 3)//AD
|
||||
// {
|
||||
// Expression<Func<WorkloadAD, bool>> workloadLambda = x => true;
|
||||
// workloadLambda = workloadLambda.And(u => u.ReviewerId == _userInfo.Id);
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// if (param.Status == 30)//30 的时候,待读和正在读(未提交的)
|
||||
// {
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == 30 || o.Status == 40);
|
||||
// }
|
||||
// else
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == param.Status);
|
||||
// }
|
||||
// query = from ad in _workloadADRepository.Where(workloadLambda)
|
||||
// join trial in _trialRepository.Where(trialLambda) on ad.TrialId equals trial.Id
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on ad.SubjectId equals subject.Id
|
||||
// //join visit in _subjectVisitRepository.GetAll() on ad.visi equals visit.Id
|
||||
// select new WorkloadReadingDTO
|
||||
// {
|
||||
// Id = ad.Id,
|
||||
// WorkloadId = ad.Id,
|
||||
// WorkloadType = 1,
|
||||
// Status = ad.Status,
|
||||
// UpdateTime = ad.UpdateTime,
|
||||
// TrialId = ad.TrialId,
|
||||
// SubjectId = ad.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// //VisitNum = visit.VisitNum,
|
||||
// //VisitName = visit.VisitName,
|
||||
// Expedited = trial.Expedited,
|
||||
// TrialCode = trial.TrialCode,
|
||||
// TrialIndication = trial.Indication,
|
||||
// WorkloadCode = ad.ADCode
|
||||
// };
|
||||
// }
|
||||
// query.OrderByDescending(u => u.UpdateTime);
|
||||
// var count = query.Count();
|
||||
// query = query.Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
|
||||
// return new PageOutput<WorkloadReadingDTO>(param.PageIndex,
|
||||
// param.PageSize, count, query.ToList());
|
||||
// }
|
||||
// }
|
||||
//}
|
|
@ -1,635 +0,0 @@
|
|||
//using AutoMapper;
|
||||
//using IRaCIS.Core.Infrastructure.ExpressionExtend;
|
||||
//using IRaCIS.Core.Application.Contracts;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
//using IRaCIS.Core.Domain.Models;
|
||||
|
||||
//using IRaCIS.Core.Domain.Share;
|
||||
//using Microsoft.AspNetCore.Authorization;
|
||||
//using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//namespace IRaCIS.Core.Application.Services
|
||||
//{
|
||||
// [ ApiExplorerSettings(GroupName = "Reading")]
|
||||
// public class ReportService : BaseService, IReportService
|
||||
// {
|
||||
// private readonly ITURepository _tURepository;
|
||||
// private readonly ITRRepository _tRRepository;
|
||||
// private readonly IRSRepository _rSRepository;
|
||||
// private readonly IRepository<Report> _reportRepository;
|
||||
// private readonly IRepository<VisitStage> _visitStageRepository;
|
||||
// private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
// private readonly IWorkloadTPRepository _workloadTPRepository;
|
||||
// private readonly IWorkloadGlobalRepository _workloadGlobalRepository;
|
||||
|
||||
|
||||
// #pragma warning disable
|
||||
// private string linkGroupId;
|
||||
// public ReportService(ITURepository tURepository, ITRRepository tRRepository,
|
||||
// IRSRepository rSRepository, IRepository<Report> reportRepository,
|
||||
// IWorkloadTPRepository workloadTPRepository,
|
||||
// IRepository<VisitStage> visitStageRepository,
|
||||
// IRepository<SubjectVisit> subjectVisitRepository,
|
||||
// IWorkloadGlobalRepository workloadGlobalRepository,
|
||||
// IMapper mapper)
|
||||
// {
|
||||
// _tURepository = tURepository;
|
||||
// _tRRepository = tRRepository;
|
||||
// _rSRepository = rSRepository;
|
||||
// _reportRepository = reportRepository;
|
||||
// _workloadTPRepository = workloadTPRepository;
|
||||
// _visitStageRepository = visitStageRepository;
|
||||
// _subjectVisitRepository = subjectVisitRepository;
|
||||
// _workloadGlobalRepository = workloadGlobalRepository;
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// public bool AddLesion(List<LesionInformation> lesionList, ReportDTO report)
|
||||
// {
|
||||
// TU lastTu = _tURepository.AsQueryable().OrderByDescending("TUSEQ").FirstOrDefault();
|
||||
// int tuSeq = 101;
|
||||
// if (lastTu != null) { tuSeq = lastTu.TUSEQ + 1; }
|
||||
// TR lastTr = _tRRepository.AsQueryable().OrderByDescending("TRSEQ").FirstOrDefault();
|
||||
// int trSeq = 1;
|
||||
// if (lastTr != null) { trSeq = lastTr.TRSEQ + 1; }
|
||||
|
||||
// foreach (var lesion in lesionList)
|
||||
// {
|
||||
// var linkId = lesion.TULNKID;
|
||||
// if (string.IsNullOrWhiteSpace(lesion.TULNKID))
|
||||
// {
|
||||
// linkId = (lesion.TUORRES == "TARGET") ? "T" + tuSeq.ToString() : "NT" + tuSeq.ToString();
|
||||
// }
|
||||
// _tURepository.Add(new TU
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
// LesionType = lesion.LesionType,
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TUSEQ = tuSeq,
|
||||
// TULNKID = linkId,
|
||||
|
||||
// TUTESTCD = lesion.TUTESTCD,
|
||||
// TUTEST = lesion.TUTEST,
|
||||
// TUORRES = lesion.TUORRES,
|
||||
// TUSTRESC = lesion.TUSTRESC,
|
||||
|
||||
// TULOC = lesion.TULOC,
|
||||
// LocDescription = lesion.LocDescription,
|
||||
// TULAT = lesion.TULAT,
|
||||
// TUDIR = lesion.TUDIR,
|
||||
// TUPORTOT = lesion.TUPORTOT,
|
||||
// TUMETHOD = lesion.TUMETHOD,
|
||||
// TUEVAL = lesion.TUEVAL,
|
||||
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
|
||||
// TUREFID = lesion.TUREFID,
|
||||
// TUACPTFL = lesion.TUACPTFL,
|
||||
// TUEVALID = _userInfo.ReviewerCode,//lesion.TUEVALID,
|
||||
// TUGRPID = string.Empty,
|
||||
// TUDY = lesion.TUDY,// 检查日
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TUDTC = lesion.TUDTC,
|
||||
// TUNAM = lesion.TUNAM,
|
||||
// TUSPID = lesion.TUSPID,
|
||||
// TpCode = report.TpCode
|
||||
// });
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = linkId,
|
||||
// TRGRPID = lesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = lesion.TRTESTCD,
|
||||
// TRTEST = lesion.TRTEST,
|
||||
// TRORRES = lesion.TRORRES,
|
||||
// TRORRESU = lesion.TRORRESU,
|
||||
|
||||
// TRNAM = lesion.TUNAM,
|
||||
// TRMETHOD = lesion.TUMETHOD,
|
||||
// TREVAL = lesion.TUEVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,//lesion.TUEVALID,
|
||||
// TRACPTFL = lesion.TUACPTFL,
|
||||
// CoveredLesion = true,
|
||||
// Note = lesion.Note,
|
||||
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TRDTC = lesion.TRDTC,
|
||||
// TRDY = lesion.TRDY,
|
||||
// TpCode = report.TpCode
|
||||
// });
|
||||
// tuSeq++;
|
||||
// trSeq++;
|
||||
// }
|
||||
|
||||
// return _rSRepository.SaveChanges();
|
||||
// }
|
||||
|
||||
// private IList<LesionInformation> GetBLLesion(string trialCode, string SubjectCode, string tpcodeGroup)
|
||||
// {
|
||||
// int[] t = { 1, 2, 3 };
|
||||
// var query = from tu in _tURepository.Where(u => t.Contains(u.LesionType)
|
||||
// && u.STUDYID == trialCode && u.USUBJID == SubjectCode && u.TpCode.Contains(tpcodeGroup) /*u.TUEVALID==_userInfo.ReviewerCode*/)
|
||||
// join tr in _tRRepository.Where(u => u.VISITNUM == 1 && u.STUDYID == trialCode
|
||||
// && u.USUBJID == SubjectCode && u.TREVALID == _userInfo.ReviewerCode)
|
||||
// on tu.TULNKID equals tr.TRLNKID into temp
|
||||
// from tr in temp.DefaultIfEmpty()
|
||||
// select new LesionInformation
|
||||
// {
|
||||
// TUId = tu.Id,
|
||||
// LesionType = tu.LesionType,
|
||||
// TULNKID = tu.TULNKID,
|
||||
// TUSEQ = tu.TUSEQ,
|
||||
// TULOC = tu.TULOC,
|
||||
// LocDescription = tu.LocDescription,
|
||||
// TULAT = tu.TULAT,
|
||||
// TUDIR = tu.TUDIR,
|
||||
// TUPORTOT = tu.TUPORTOT,
|
||||
// TRORRES = tr.TRORRES,
|
||||
// VISITNUM = tu.VISITNUM,
|
||||
// Note = tr.Note
|
||||
// };
|
||||
// return query.ToList();
|
||||
// }
|
||||
|
||||
// /// 获取基线期病灶信息及其他信息
|
||||
// [HttpGet, Route("getBLLineLesion/{trialCode}/{subjectCode}/{tpCode}")]
|
||||
// public BaseLineReportDTO getBLLineLesion(string trialCode, string subjectCode, string tpCode)
|
||||
// {
|
||||
// var tpcodeGroup = tpCode.Substring(tpCode.Length - 3, 3);
|
||||
// var report = _reportRepository.FirstOrDefault(u => u.TrialCode == trialCode && u.SubjectCode == subjectCode && u.VisitNum == 1); ;
|
||||
|
||||
// BaseLineReportDTO result = new BaseLineReportDTO
|
||||
// {
|
||||
// LesionInformation = GetBLLesion(trialCode, subjectCode, tpcodeGroup).Where(u => u.VISITNUM == 1).ToList(),
|
||||
// ReportResult = _mapper.Map<ReportDTO>(report)
|
||||
// };
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// /// 获取其他访视病灶信息
|
||||
// [AllowAnonymous]
|
||||
// [HttpGet, Route("getVisitLineLesion/{trialCode}/{subjectCode}/{visitNum:decimal}/{tpCode}")]
|
||||
// public VisitLesionInfo GetVisitLineLesion(string trialCode, string subjectCode, decimal visitNum, string tpCode)
|
||||
// {
|
||||
// var tpcodeGroup = tpCode.Substring(tpCode.Length - 3, 3);
|
||||
// VisitLesionInfo visitLesionInfo = new VisitLesionInfo();
|
||||
// var blLesionList = GetBLLesion(trialCode, subjectCode, tpcodeGroup);
|
||||
// int[] t = { 1, 2, 3 };
|
||||
// var query = from tu in _tURepository.Where(u => u.STUDYID == trialCode && u.USUBJID == subjectCode && u.TpCode.Contains(tpcodeGroup) /*u.TUEVALID == _userInfo.ReviewerCode*/)
|
||||
// join tr in _tRRepository.Where(u => u.VISITNUM == visitNum && u.STUDYID == trialCode && u.USUBJID == subjectCode && u.TpCode.Contains(tpcodeGroup))
|
||||
// on tu.TULNKID equals tr.TRLNKID into temp
|
||||
// from tr in temp.DefaultIfEmpty()
|
||||
// select new LesionInformation
|
||||
// {
|
||||
// TUId = tu.Id,
|
||||
// TUSEQ = tu.TUSEQ,
|
||||
// TULOC = tu.TULOC,
|
||||
// LesionType = tu.LesionType,
|
||||
// TULNKID = tu.TULNKID,
|
||||
// LocDescription = tu.LocDescription,
|
||||
// TULAT = tu.TULAT,
|
||||
// TUDIR = tu.TUDIR,
|
||||
// TUPORTOT = tu.TUPORTOT,
|
||||
// TRORRESU = tr.TRORRESU,
|
||||
// TRORRES = tr.TRORRES,
|
||||
// Note = tr.Note,
|
||||
// CoveredLesion = tr.CoveredLesion,
|
||||
// VISITNUM = tr.VISITNUM
|
||||
// };
|
||||
// var list = query.ToList();
|
||||
// var currentVisitLesion = list.Where(u => t.Contains(u.LesionType) && u.VISITNUM == visitNum).ToList();
|
||||
// foreach (var item in blLesionList)
|
||||
// {
|
||||
// var temp = _mapper.Map<VisitLesion>(item);
|
||||
// temp.CurrentLesion = currentVisitLesion.Where(u => u.STUDYID == item.STUDYID
|
||||
// && u.USUBJID == item.USUBJID && u.TUEVAL == item.TUEVAL
|
||||
// && u.TULNKID == item.TULNKID).FirstOrDefault() ?? new LesionInformation();
|
||||
// visitLesionInfo.BLLesionList.Add(temp);
|
||||
// }
|
||||
|
||||
// List<Guid> blIdList = blLesionList.Select(u => u.TUId).ToList();
|
||||
// List<Guid> visitIdList = currentVisitLesion.Where(u => t.Contains(u.LesionType)).Select(u => u.TUId).ToList();
|
||||
// var visitLesion = visitIdList.Except(blIdList);
|
||||
|
||||
// foreach (var item in visitLesion)
|
||||
// {
|
||||
// VisitLesion tempLesion = new VisitLesion();
|
||||
// tempLesion.CurrentLesion = currentVisitLesion.Where(u => u.TUId == item).FirstOrDefault() ?? new LesionInformation();
|
||||
// tempLesion.LesionType = tempLesion.CurrentLesion.LesionType;
|
||||
// tempLesion.TUSEQ = tempLesion.CurrentLesion.TUSEQ;
|
||||
// visitLesionInfo.BLLesionList.Add(tempLesion);
|
||||
// }
|
||||
// // 以往新病灶,病灶类型为5,且访视编号小于当前访视,且不是基线
|
||||
// var previousLesion = list.Where(u => u.VISITNUM < visitNum && u.VISITNUM != 1 && u.LesionType == 5).ToList();
|
||||
// foreach (var item in previousLesion)
|
||||
// {
|
||||
// var temp = _mapper.Map<VisitLesion>(item);
|
||||
// temp.CurrentLesion = currentVisitLesion.Where(u => u.TULNKID==item.TULNKID && u.STUDYID == item.STUDYID && u.USUBJID == item.USUBJID && u.TUEVAL == item.TUEVAL).FirstOrDefault() ?? new LesionInformation();
|
||||
// visitLesionInfo.PreviousNewLesionList.Add(temp);
|
||||
// }
|
||||
|
||||
// visitLesionInfo.EquivocalNewLesionList = list.Where(u => u.VISITNUM <= visitNum && u.LesionType == 4).ToList();
|
||||
// visitLesionInfo.UnequivocalNewLesionList = list.Where(u => u.VISITNUM == visitNum && u.LesionType == 5).ToList();
|
||||
|
||||
// var report = _reportRepository.FirstOrDefault(u => u.TrialCode == trialCode && u.SubjectCode == subjectCode && u.VisitNum == visitNum); ;
|
||||
// visitLesionInfo.ReportResult = _mapper.Map<ReportDTO>(report);
|
||||
|
||||
// var rs = _rSRepository.Where(u => u.STUDYID == trialCode && u.USUBJID == subjectCode
|
||||
// && u.RSEVALID == _userInfo.ReviewerCode && u.VISITNUM == visitNum);
|
||||
|
||||
// var target = rs.FirstOrDefault(u => u.RSTESTCD == "TRGRESP");
|
||||
// var non_target = rs.FirstOrDefault(u => u.RSTESTCD == "NTRGRESP");
|
||||
// var overall = rs.FirstOrDefault(u => u.RSTESTCD == "OVRLRESP");
|
||||
|
||||
// visitLesionInfo.Efficacy = new EfficacyAssessment
|
||||
// {
|
||||
|
||||
// TargetLesion = target?.RSORRES,
|
||||
// TargetLesionNote = target?.Note,
|
||||
// Non_targetLesion = non_target?.RSORRES,
|
||||
// Non_targetLesionNote = non_target?.Note,
|
||||
// OverallAssessment = overall?.RSORRES,
|
||||
// OverallAssessmentNote = overall?.Note
|
||||
// };
|
||||
|
||||
// var preRS = _rSRepository.Where(u => u.STUDYID == trialCode && u.USUBJID == subjectCode
|
||||
// && u.VISITNUM < visitNum && u.RSTESTCD == "OVRLRESP"
|
||||
// && u.RSEVAL == _userInfo.ReviewerCode /*&& u.VISITNUM == visitNum*/)
|
||||
// .Select(u => new PreviousOverallAssessment
|
||||
// {
|
||||
// VisitName = u.VISIT,
|
||||
// OverallAssessment = u.RSORRES
|
||||
// }).ToList();
|
||||
// visitLesionInfo.PreviousOverallAssessment = preRS;
|
||||
|
||||
// var targetList = _tRRepository.Where(u => (!string.IsNullOrWhiteSpace(u.TRLNKID)) && (!u.TRLNKID.Contains("N")) && u.STUDYID == trialCode &&
|
||||
// u.USUBJID == subjectCode && u.TpCode.Contains(tpcodeGroup) && u.VISITNUM < visitNum).ToList();
|
||||
|
||||
// var q = from ttt in targetList
|
||||
// group ttt by ttt.VISIT into s
|
||||
// select new MinVisit
|
||||
// {
|
||||
// MinSum = s.Sum(p => p.TRORRES_Double),
|
||||
// MinVistName = s.Key
|
||||
// };
|
||||
// var tempList = q.ToList();
|
||||
// MinVisit min = new MinVisit();
|
||||
// if (tempList.Count>0)
|
||||
// {
|
||||
// min = tempList.FirstOrDefault();
|
||||
// }
|
||||
// foreach (var item in tempList)
|
||||
// {
|
||||
// if (min.MinSum > item.MinSum)
|
||||
// {
|
||||
// min = item;
|
||||
// }
|
||||
// }
|
||||
// visitLesionInfo.MinVisitInfo = min;
|
||||
|
||||
// return visitLesionInfo;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 提交报告
|
||||
// /// </summary>
|
||||
// [AllowAnonymous]
|
||||
// [HttpPost("{tpId:guid}")]
|
||||
// public bool SubmiteReport(Guid tpId)
|
||||
// {
|
||||
// // 提交报告 同时查询VisitStage(项目访视计划,看是否需要添加全局)
|
||||
|
||||
// var query = from workloadTp in _workloadTPRepository.Where(u => u.Id == tpId)
|
||||
// join subjectVisit in _subjectVisitRepository.AsQueryable()
|
||||
// on workloadTp.SubjectVisitId equals subjectVisit.Id
|
||||
// join visitStage in _visitStageRepository.AsQueryable()
|
||||
// on new { workloadTp.TrialId, subjectVisit.VisitNum } equals new { visitStage.TrialId, visitStage.VisitNum }
|
||||
// select new
|
||||
// {
|
||||
// WorkloadTp = workloadTp,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// NeedGlobal = visitStage.NeedGlobal
|
||||
// };
|
||||
// var workload = query.ToList().FirstOrDefault();
|
||||
// if (workload != null)
|
||||
// {
|
||||
// if (workload.NeedGlobal)// 需要产生全局
|
||||
// {
|
||||
// var group = workload.WorkloadTp.TimepointCode.Substring(workload.WorkloadTp.TimepointCode.Length - 2, 2);
|
||||
// _workloadGlobalRepository.Add(new WorkloadGlobal
|
||||
// {
|
||||
// GlobalCode = workload.WorkloadTp.TimepointCode + "G" + group,
|
||||
// ReviewerId = Guid.Empty,
|
||||
// SiteId = workload.WorkloadTp.SiteId,
|
||||
// Status = -1,
|
||||
// SubjectId = workload.WorkloadTp.SubjectId,
|
||||
// TrialId = workload.WorkloadTp.TrialId,
|
||||
// VisitId = workload.WorkloadTp.SubjectVisitId,
|
||||
// VisitNum = workload.VisitNum,
|
||||
// VisitName = workload.VisitName,
|
||||
// UpdateTime = DateTime.Now
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// return _workloadTPRepository.Update(u => u.Id == tpId, s => new WorkloadTP
|
||||
// {
|
||||
// Status = (int)WorkloadStatus.ReviewFinish
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// 保存 基线期病灶及测量信息及其他信息,不会改变状态
|
||||
// /// </summary>
|
||||
// [AllowAnonymous]
|
||||
// [HttpPost]
|
||||
// public bool AddBaseLineLesion(BaseLineReportCommand baseLineReportCommand)
|
||||
// {
|
||||
// if (baseLineReportCommand.LesionInformation.Count < 1) return false;
|
||||
|
||||
// var addedLesion = baseLineReportCommand.LesionInformation[0];
|
||||
|
||||
// //删除已经有的数据
|
||||
// _tURepository.Delete(u => u.VISITNUM == addedLesion.VISITNUM && u.USUBJID == addedLesion.USUBJID && u.TUEVALID == _userInfo.ReviewerCode);
|
||||
// _tRRepository.Delete(u => u.VISITNUM == addedLesion.VISITNUM && u.USUBJID == addedLesion.USUBJID && u.TREVALID == _userInfo.ReviewerCode);
|
||||
// _reportRepository.Delete(u => u.TPId == baseLineReportCommand.ReportResult.TPId);
|
||||
|
||||
// _workloadTPRepository.Update(u => u.Id == baseLineReportCommand.ReportResult.TPId, s => new WorkloadTP
|
||||
// {
|
||||
// Status = (int)WorkloadStatus.Reading
|
||||
// });
|
||||
|
||||
// //序号按照每个项目、每个受试者、每个评估者,一条记录
|
||||
// TU lastTu = _tURepository.Where(u => u.STUDYID == addedLesion.STUDYID && u.USUBJID == addedLesion.USUBJID
|
||||
// && u.TUEVAL == addedLesion.TUEVAL).OrderByDescending("TUSEQ").FirstOrDefault();
|
||||
// int tuSeq = 101;
|
||||
// if (lastTu != null) { tuSeq = lastTu.TUSEQ; }
|
||||
// TR lastTr = _tRRepository.AsQueryable().OrderByDescending("TRSEQ").FirstOrDefault();
|
||||
// int trSeq = 1;
|
||||
// if (lastTr != null) { trSeq = lastTr.TRSEQ; }
|
||||
|
||||
// linkGroupId = Guid.NewGuid().ToString();
|
||||
// foreach (var lesion in baseLineReportCommand.LesionInformation)
|
||||
// {
|
||||
// var linkId = lesion.TULNKID;
|
||||
// if (string.IsNullOrWhiteSpace(lesion.TULNKID))
|
||||
// {
|
||||
// linkId = (lesion.TUORRES == "TARGET") ? "T" + tuSeq.ToString() : "NT" + tuSeq.ToString();
|
||||
// }
|
||||
// _tURepository.Add(new TU
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
// LesionType = lesion.LesionType,
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TUSEQ = tuSeq,
|
||||
// TULNKID = linkId,
|
||||
|
||||
// TUTESTCD = lesion.TUTESTCD,
|
||||
// TUTEST = lesion.TUTEST,
|
||||
// TUORRES = lesion.TUORRES,
|
||||
// TUSTRESC = lesion.TUSTRESC,
|
||||
|
||||
// TULOC = lesion.TULOC,
|
||||
// LocDescription = lesion.LocDescription,
|
||||
// TULAT = lesion.TULAT,
|
||||
// TUDIR = lesion.TUDIR,
|
||||
// TUPORTOT = lesion.TUPORTOT,
|
||||
// TUMETHOD = lesion.TUMETHOD,
|
||||
// TUEVAL = lesion.TUEVAL,
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
|
||||
// TUREFID = lesion.TUREFID,
|
||||
// TUACPTFL = lesion.TUACPTFL,
|
||||
// TUEVALID = _userInfo.ReviewerCode,//lesion.TUEVALID,
|
||||
// TUGRPID = string.Empty,
|
||||
// TUDY = lesion.TUDY,// 检查日
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TUDTC = lesion.TUDTC,
|
||||
// TUNAM = lesion.TUNAM,
|
||||
// TUSPID = lesion.TUSPID,
|
||||
|
||||
// TpCode = baseLineReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = linkId,
|
||||
// TRGRPID = lesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = lesion.TRTESTCD,
|
||||
// TRTEST = lesion.TRTEST,
|
||||
// TRORRES = lesion.TRORRES,
|
||||
// TRORRESU = lesion.TRORRESU,
|
||||
|
||||
// TRNAM = lesion.TUNAM,
|
||||
// TRMETHOD = lesion.TUMETHOD,
|
||||
// TREVAL = lesion.TUEVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,//lesion.TUEVALID,
|
||||
// TRACPTFL = lesion.TUACPTFL,
|
||||
|
||||
// Note = lesion.Note,
|
||||
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TRDTC = lesion.TRDTC,
|
||||
// TRDY = lesion.TRDY,
|
||||
// TpCode = baseLineReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// tuSeq++;
|
||||
// trSeq++;
|
||||
// }
|
||||
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = addedLesion.STUDYID,
|
||||
|
||||
// USUBJID = addedLesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = string.Empty,
|
||||
// TRGRPID = addedLesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = addedLesion.TRTESTCD,
|
||||
// TRTEST = "Sum of Diameter",
|
||||
// TRORRES = baseLineReportCommand.SumOfDiameter,
|
||||
// TRORRESU = "mm",//addedLesion.TRORRESU,
|
||||
|
||||
// TRNAM = addedLesion.TUNAM,
|
||||
// TRMETHOD = addedLesion.TUMETHOD,
|
||||
// TREVAL = addedLesion.TUEVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,//addedLesion.TUEVALID,
|
||||
// TRACPTFL = addedLesion.TUACPTFL,
|
||||
|
||||
// Note = string.Empty,
|
||||
|
||||
// VISITNUM = addedLesion.VISITNUM,
|
||||
// VISIT = addedLesion.VISIT,
|
||||
// VISITDY = addedLesion.VISITDY,
|
||||
// EPOCH = addedLesion.EPOCH,
|
||||
// TRDTC = addedLesion.TRDTC,
|
||||
// TRDY = addedLesion.TRDY,
|
||||
// TpCode = baseLineReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// trSeq++;
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = addedLesion.STUDYID,
|
||||
|
||||
// USUBJID = addedLesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = string.Empty,
|
||||
// TRGRPID = addedLesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = addedLesion.TRTESTCD,
|
||||
// TRTEST = "Sum Diameters of Non Lymph Node Tumors",
|
||||
// TRORRES = baseLineReportCommand.SumDiameterOfNonLymphNode,
|
||||
// TRORRESU = "mm",//addedLesion.TRORRESU,
|
||||
|
||||
// TRNAM = addedLesion.TUNAM,
|
||||
// TRMETHOD = addedLesion.TUMETHOD,
|
||||
// TREVAL = addedLesion.TUEVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,//addedLesion.TUEVALID,
|
||||
// TRACPTFL = addedLesion.TUACPTFL,
|
||||
|
||||
// Note = string.Empty,
|
||||
|
||||
// VISITNUM = addedLesion.VISITNUM,
|
||||
// VISIT = addedLesion.VISIT,
|
||||
// VISITDY = addedLesion.VISITDY,
|
||||
// EPOCH = addedLesion.EPOCH,
|
||||
// TRDTC = addedLesion.TRDTC,
|
||||
// TRDY = addedLesion.TRDY,
|
||||
// TpCode = baseLineReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// trSeq++;
|
||||
// _reportRepository.Add(_mapper.Map<Report>(baseLineReportCommand.ReportResult));
|
||||
|
||||
// return _reportRepository.SaveChanges();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 添加访视报告信息
|
||||
// /// LesionInformation 为新病灶及测量信息(包括分裂及合并产生的)
|
||||
// /// TRList 已经存在的病灶的测量信息
|
||||
// /// RSList 疗效信息
|
||||
// /// </summary>
|
||||
// [AllowAnonymous]
|
||||
// [HttpPost, Route("saveVisitReport")]
|
||||
// public bool SaveVisitReport(VisitReportCommand visitReportCommand)
|
||||
// {
|
||||
// linkGroupId = Guid.NewGuid().ToString();
|
||||
// var visitNum = visitReportCommand.ReportResult.VisitNum;
|
||||
// var subjectId = visitReportCommand.ReportResult.SubjectCode;
|
||||
|
||||
// //删除已经有的数据
|
||||
// _tURepository.Delete(u => u.VISITNUM == visitNum && u.USUBJID == subjectId && u.TUEVALID == _userInfo.ReviewerCode);
|
||||
// _tRRepository.Delete(u => u.VISITNUM == visitNum && u.USUBJID == subjectId && u.TREVALID == _userInfo.ReviewerCode);
|
||||
// _reportRepository.Delete(u => u.TPId == visitReportCommand.ReportResult.TPId);
|
||||
// _rSRepository.Delete(u => u.VISITNUM == visitNum && u.RSEVALID == _userInfo.ReviewerCode);
|
||||
|
||||
// var report = visitReportCommand.ReportResult;
|
||||
|
||||
// _workloadTPRepository.Update(u => u.Id == report.TPId, s => new WorkloadTP
|
||||
// {
|
||||
// Status = (int)WorkloadStatus.Reading
|
||||
// });
|
||||
// if (visitReportCommand.LesionInformation.Count > 0)
|
||||
// {
|
||||
// AddLesion(visitReportCommand.LesionInformation, report);
|
||||
// }
|
||||
|
||||
// TR lastTr = _tRRepository.AsQueryable().OrderByDescending("TRSEQ").FirstOrDefault();
|
||||
// int trSeq = 1;
|
||||
// if (lastTr != null) { trSeq = lastTr.TRSEQ + 1; }
|
||||
|
||||
// foreach (var lesion in visitReportCommand.TRList)
|
||||
// {
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = lesion.TRLNKID,
|
||||
// TRGRPID = lesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = lesion.TRTESTCD,
|
||||
// TRTEST = lesion.TRTEST,
|
||||
// TRORRES = lesion.TRORRES,
|
||||
// TRORRESU = lesion.TRORRESU,
|
||||
|
||||
// TRNAM = lesion.TRNAM,
|
||||
// TRMETHOD = lesion.TRMETHOD,
|
||||
// TREVAL = lesion.TREVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,// lesion.TREVALID,
|
||||
// TRACPTFL = lesion.TRACPTFL,
|
||||
|
||||
// Note = lesion.Note,
|
||||
// CoveredLesion = lesion.CoveredLesion,
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TRDTC = lesion.TRDTC,
|
||||
// TRDY = lesion.TRDY,
|
||||
// TpCode = visitReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// trSeq++;
|
||||
// }
|
||||
// foreach (var rs in visitReportCommand.RSList)
|
||||
// {
|
||||
// _rSRepository.Add(new RS
|
||||
// {
|
||||
// STUDYID = rs.STUDYID,
|
||||
// USUBJID = rs.USUBJID,
|
||||
// RSSEQ = 0,//
|
||||
// RSLNKGRP = linkGroupId,
|
||||
// RSTESTCD = rs.RSTESTCD,
|
||||
// RSTEST = rs.RSTEST,
|
||||
// RSCAT = rs.RSCAT,
|
||||
// RSORRES = rs.RSORRES,
|
||||
// RSSTRESC = rs.RSSTRESC,
|
||||
// RSSTAT = rs.RSSTAT,
|
||||
// RSREASND = rs.RSCAT,
|
||||
// RSEVAL = rs.RSEVAL,
|
||||
// RSEVALID = _userInfo.ReviewerCode,//
|
||||
// VISITNUM = rs.VISITNUM,
|
||||
// VISIT = rs.VISIT,
|
||||
// RSDTC = rs.RSDTC,
|
||||
// RSDY = rs.RSDY,
|
||||
// TpCode = visitReportCommand.ReportResult.TpCode,
|
||||
// StudyGuid = rs.StudyGuid,
|
||||
// TrialGuid = rs.TrialGuid,
|
||||
// SubjectGuid = rs.SubjectGuid,
|
||||
// Note = rs.Note
|
||||
// });
|
||||
// }
|
||||
|
||||
// _reportRepository.Add(_mapper.Map<Report>(visitReportCommand.ReportResult));
|
||||
|
||||
// return _rSRepository.SaveChanges();
|
||||
// }
|
||||
// }
|
||||
//}
|
|
@ -1,20 +0,0 @@
|
|||
using AutoMapper;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
public class ReadingAndReportConfig : Profile
|
||||
{
|
||||
public ReadingAndReportConfig()
|
||||
{
|
||||
CreateMap<LesionInformation, VisitLesion>();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -36,10 +36,11 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public class TrialSiteForSelect
|
||||
{
|
||||
public Guid TrialSiteId => Id;
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
|
||||
public string TrialSiteCode { get; set; } = string.Empty;
|
||||
|
||||
|
@ -78,7 +79,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? UserTypeId { get; set; }
|
||||
|
||||
|
@ -101,7 +102,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? UserTypeId { get; set; }
|
||||
|
||||
|
@ -133,7 +134,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public bool IsDeleted { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
@ -187,7 +188,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
}
|
||||
|
@ -197,7 +198,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
/////<summary> UserName</summary>
|
||||
//public string UserName { get; set; }
|
||||
|
@ -251,7 +252,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
|
||||
public bool IsUpdate { get; set; }
|
||||
|
@ -271,7 +272,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public Guid? Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
@ -342,7 +343,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public string UserKeyInfo { get; set; } = string.Empty;
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string UserTypeStr { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public UserTypeEnum UserTypeEnum { get; set; } = UserTypeEnum.Undefined;
|
||||
|
|
|
@ -196,13 +196,13 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
TrialSiteSurvey? currentEntity = null;
|
||||
|
||||
|
||||
var userList = await _trialSiteUserRepository.Where(t => t.TrialId == userInfo.TrialId && t.SiteId == userInfo.SiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var userList = await _trialSiteUserRepository.Where(t => t.TrialId == userInfo.TrialId && t.TrialSiteId == userInfo.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
//普通登录
|
||||
if (userInfo.IsUpdate == false)
|
||||
{
|
||||
|
||||
var dbEntityList = await _trialSiteSurveyRepository.Where(t => t.TrialId == userInfo.TrialId && t.SiteId == userInfo.SiteId).ToListAsync();
|
||||
var dbEntityList = await _trialSiteSurveyRepository.Where(t => t.TrialId == userInfo.TrialId && t.TrialSiteId == userInfo.TrialSiteId).ToListAsync();
|
||||
|
||||
|
||||
//没有记录 new一份
|
||||
|
@ -236,7 +236,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
|
||||
|
||||
await UnlockSyncSiteUserAsync(userInfo.TrialId, userInfo.SiteId, currentEntity.Id, userList);
|
||||
await UnlockSyncSiteUserAsync(userInfo.TrialId, userInfo.TrialSiteId, currentEntity.Id, userList);
|
||||
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
//找到最新的调研表
|
||||
|
||||
var currentLatest = await _trialSiteSurveyRepository.Where(t => t.TrialId == userInfo.TrialId && t.SiteId == userInfo.SiteId, true)
|
||||
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();
|
||||
|
||||
if (currentLatest == null)
|
||||
|
@ -344,7 +344,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
private async Task UnlockSyncSiteUserAsync(Guid trialId, Guid siteId, Guid trialSiteSurveyId, List<TrialSiteUserSurvey> userList)
|
||||
{
|
||||
var existList = await _trialSiteUserSurveyRepository.Where(t => t.IsHistoryUser && t.TrialSiteSurvey.TrialId == trialId && t.TrialSiteSurvey.SiteId == siteId, true).ToListAsync();
|
||||
var existList = await _trialSiteUserSurveyRepository.Where(t => t.IsHistoryUser && t.TrialSiteSurvey.TrialId == trialId && t.TrialSiteSurvey.TrialSiteId == siteId, true).ToListAsync();
|
||||
|
||||
foreach (var item in userList)
|
||||
{
|
||||
|
@ -379,10 +379,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
if (find.State != TrialSiteSurveyEnum.PMCreatedAndLock && find.IsDeleted != true)
|
||||
{
|
||||
var userList = await _trialSiteUserRepository.Where(t => t.TrialId == find.TrialId && t.SiteId == find.SiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var userList = await _trialSiteUserRepository.Where(t => t.TrialId == find.TrialId && t.TrialSiteId == find.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
await UnlockSyncSiteUserAsync(find.TrialId, find.SiteId, find.Id, userList);
|
||||
await UnlockSyncSiteUserAsync(find.TrialId, find.TrialSiteId, find.Id, userList);
|
||||
}
|
||||
|
||||
|
||||
|
@ -460,7 +460,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public async Task<PageOutput<TrialSiteSurveyView>> GetTrialSiteSurveyList(TrialSiteSurveyQueryDTO surveyQueryDTO)
|
||||
{
|
||||
var trialSiteSurveyQueryable = _trialSiteSurveyRepository.Where(t => t.TrialId == surveyQueryDTO.TrialId).IgnoreQueryFilters()
|
||||
.WhereIf(surveyQueryDTO.SiteId != null, t => t.SiteId == surveyQueryDTO.SiteId)
|
||||
.WhereIf(surveyQueryDTO.TrialSiteId != null, t => t.TrialSiteId == surveyQueryDTO.TrialSiteId)
|
||||
.WhereIf(surveyQueryDTO.IsDeleted != null, t => t.IsDeleted == surveyQueryDTO.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.UserKeyInfo), t => t.UserName.Contains(surveyQueryDTO.UserKeyInfo) || t.Phone.Contains(surveyQueryDTO.UserKeyInfo) || t.Email.Contains(surveyQueryDTO.UserKeyInfo))
|
||||
.WhereIf(surveyQueryDTO.State != null, t => t.State == surveyQueryDTO.State)
|
||||
|
@ -480,7 +480,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
var trialSiteSurveyQueryable = _trialSiteSurveyRepository
|
||||
.Where(t => t.Id != inQuery.TrialSiteSurveyId)
|
||||
.Where(t => t.TrialId == inQuery.TrialId && t.SiteId == inQuery.SiteId).IgnoreQueryFilters()
|
||||
.Where(t => t.TrialId == inQuery.TrialId && t.TrialSiteId == inQuery.TrialSiteId).IgnoreQueryFilters()
|
||||
.ProjectTo<TrialSiteSurveySelectView>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await trialSiteSurveyQueryable.ToListAsync();
|
||||
|
@ -496,10 +496,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
var groupSelectIdQuery =
|
||||
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||
.WhereIf(queryParam.SiteId != null, t => t.SiteId == queryParam.SiteId)
|
||||
.WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId)
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||
.GroupBy(t => t.SiteId)
|
||||
.GroupBy(t => t.TrialSiteId)
|
||||
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||
|
||||
|
||||
|
@ -611,7 +611,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
var trialInfo = await _repository.FirstOrDefaultAsync<Trial>(t => t.Id == trialSiteSubmitBackCommand.TrialId);
|
||||
|
||||
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialSiteSubmitBackCommand.TrialId && t.SiteId == survey.SiteId, true);
|
||||
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialSiteSubmitBackCommand.TrialId && t.Id == survey.TrialSiteId, true);
|
||||
|
||||
|
||||
//主题
|
||||
|
@ -778,10 +778,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
var needQuitUserList = allUserList.Where(t => t.IsHistoryUser && t.IsHistoryUserOriginDeleted == false && t.IsHistoryUserDeleted == true).ToList();
|
||||
|
||||
await DealSiteUserQuitSiteAsync(trialId, trialSiteSurvey.SiteId, needQuitUserList);
|
||||
await DealSiteUserQuitSiteAsync(trialId, trialSiteSurvey.TrialSiteId, needQuitUserList);
|
||||
|
||||
//将历史锁定的调研表废弃
|
||||
await _trialSiteSurveyRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.SiteId == trialSiteSurvey.SiteId && t.State == TrialSiteSurveyEnum.PMCreatedAndLock && t.Id != trialSiteSurveyId, z => new TrialSiteSurvey() { IsDeleted = true });
|
||||
await _trialSiteSurveyRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteSurvey.TrialSiteId && t.State == TrialSiteSurveyEnum.PMCreatedAndLock && t.Id != trialSiteSurveyId, z => new TrialSiteSurvey() { IsDeleted = true });
|
||||
|
||||
}
|
||||
await _trialSiteSurveyRepository.SaveChangesAsync();
|
||||
|
@ -867,7 +867,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
var trialId = joinCommand.TrialId;
|
||||
var userId = (Guid)userInfo.SystemUserId;
|
||||
var siteId = trialSiteSurvey.SiteId;
|
||||
var trialSiteId = trialSiteSurvey.TrialSiteId;
|
||||
|
||||
|
||||
|
||||
|
@ -893,11 +893,11 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, joinCommand.BaseUrl, joinCommand.RouteUrl);
|
||||
}
|
||||
|
||||
var findTrialSiteUser = await _trialSiteUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, true);
|
||||
var findTrialSiteUser = await _trialSiteUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.TrialSiteId == trialSiteId, true);
|
||||
|
||||
if (findTrialSiteUser == null)
|
||||
{
|
||||
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });
|
||||
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, TrialSiteId = trialSiteId, UserId = userId });
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -928,7 +928,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
var userIdList = list.Select(t => t.SystemUserId).ToList();
|
||||
|
||||
|
||||
await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.SiteId == siteId && userIdList.Contains(t.UserId), c => new TrialSiteUser()
|
||||
await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == siteId && userIdList.Contains(t.UserId), c => new TrialSiteUser()
|
||||
{
|
||||
IsDeleted = true,
|
||||
DeletedTime = DateTime.Now,
|
||||
|
@ -988,7 +988,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
}
|
||||
|
||||
var userId = sysUserInfo.Id;
|
||||
var siteId = item.SiteId;
|
||||
var trialSiteId = item.TrialSiteId;
|
||||
|
||||
//判断是否加入到项目
|
||||
var findTrialUser = await _trialUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
|
@ -1012,11 +1012,11 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
}
|
||||
|
||||
|
||||
var findTrialSiteUser = await _trialSiteUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, true);
|
||||
var findTrialSiteUser = await _trialSiteUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.TrialSiteId == trialSiteId, true);
|
||||
|
||||
if (findTrialSiteUser == null)
|
||||
{
|
||||
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });
|
||||
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, TrialSiteId = trialSiteId, UserId = userId });
|
||||
|
||||
}
|
||||
else
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject.DTO
|
|||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
|
@ -51,7 +51,8 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject.DTO
|
|||
public Guid Id { get;set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid? SubjectVisitId { get; set; }
|
||||
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
{
|
||||
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect &&t.TaskAllocationState==TaskAllocationState.Allocated && t.SourceSubjectVisitId != null)
|
||||
|
||||
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
|
||||
.WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId)
|
||||
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
|
||||
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
|
||||
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
|
||||
|
@ -116,7 +116,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
select new StudyDTO_UltrasonicDicom()
|
||||
{
|
||||
TrialId = dicomStudy.TrialId,
|
||||
SiteId = dicomStudy.SiteId,
|
||||
TrialSiteId = dicomStudy.Subject.TrialSiteId,
|
||||
SubjectId = dicomStudy.SubjectId,
|
||||
SubjectVisitId = dicomStudy.SubjectVisitId,
|
||||
VisitName = dicomStudy.SubjectVisit.VisitName,
|
||||
|
@ -136,9 +136,9 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
|
||||
StudyTime = dicomStudy.StudyTime,
|
||||
|
||||
TrialSiteAliasName = dicomStudy.TrialSite.TrialSiteAliasName,
|
||||
TrialSiteAliasName = dicomStudy.Subject.TrialSite.TrialSiteAliasName,
|
||||
|
||||
TrialSiteCode = dicomStudy.TrialSite.TrialSiteCode,
|
||||
TrialSiteCode = dicomStudy.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = dicomStudy.Uploader.UserName,
|
||||
|
||||
|
@ -255,7 +255,6 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
|
||||
study.Id = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString());
|
||||
study.TrialId = incommand.TrialId;
|
||||
study.SiteId = incommand.SiteId;
|
||||
study.SubjectId = incommand.SubjectId;
|
||||
study.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -279,7 +278,6 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SiteId = incommand.SiteId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -296,7 +294,6 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
isntance.SeriesId = series.Id;
|
||||
|
||||
isntance.TrialId = incommand.TrialId;
|
||||
isntance.SiteId = incommand.SiteId;
|
||||
isntance.SubjectId = incommand.SubjectId;
|
||||
isntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -340,7 +337,6 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SiteId = incommand.SiteId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
series.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
@ -364,7 +360,6 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
insntance.SeriesId = dicomSeries.Id;
|
||||
|
||||
insntance.TrialId = incommand.TrialId;
|
||||
insntance.SiteId = incommand.SiteId;
|
||||
insntance.SubjectId = incommand.SubjectId;
|
||||
insntance.SubjectVisitId = incommand.SubjectVisitId;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<VisitTask, VisitTaskDTO_UltrasonicDicom>()
|
||||
.ForMember(o => o.SubjectVisitId, t => t.MapFrom(u => u.SourceSubjectVisitId))
|
||||
.ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
|
||||
.ForMember(o => o.TrialSiteId, t => t.MapFrom(u => u.Subject.TrialSiteId))
|
||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
|
||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
|
||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
||||
|
|
|
@ -135,8 +135,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
//[NotDefault]
|
||||
//public Guid TrialId { get; set; }
|
||||
|
||||
//[NotDefault]
|
||||
//public Guid SiteId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace IRaCIS.Application.Contracts
|
|||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string MainCenter { get; set; } = string.Empty;
|
||||
public DateTime OptTime { get; set; }
|
||||
public int State { get; set; }
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||
public class TrialSiteCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public string SiteName { get; set; }
|
||||
|
||||
|
@ -54,6 +54,9 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
|
||||
public string TrialSiteName { get; set; } = String.Empty;
|
||||
|
||||
public string TrialSiteAliasName { get; set; } = String.Empty;
|
||||
|
||||
public string TrialSiteCode { get; set; } = String.Empty;
|
||||
|
@ -65,7 +68,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
|||
public class AssginSiteCRCCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public DateTime? CreateTime { get; set; } = DateTime.Now;
|
||||
public string UserRealName { get; set; } = String.Empty;
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
[NotDefault]
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public bool IsExternal { get; set; }
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace IRaCIS.Application.Contracts
|
|||
[ExcelFormat("yyyy-MM-dd HH:mm:ss")]
|
||||
public DateTime? DeletedTime { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public string Phone { get; set; } = String.Empty;
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
|
@ -186,7 +186,7 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class SiteCRCCommand : UserTrialCommand
|
||||
{
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid UserTypeId { get; set; }
|
||||
public string UserType { get; set; } = String.Empty;
|
||||
|
@ -229,7 +229,7 @@ namespace IRaCIS.Application.Contracts
|
|||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public int? UserCount { get; set; }
|
||||
|
||||
|
@ -304,7 +304,7 @@ namespace IRaCIS.Application.Contracts
|
|||
public class SiteCRCQuery : TrialMaintenanceQuery
|
||||
{
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(param.UserTypeId != null, t => t.User.UserTypeId == param.UserTypeId)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserRealName), t => (t.User.FullName).Contains(param.UserRealName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName), t => t.User.OrganizationName.Contains(param.OrganizationName))
|
||||
.ProjectTo<AssginSiteCRCListDTO>(_mapper.ConfigurationProvider, new { siteId = param.SiteId });
|
||||
.ProjectTo<AssginSiteCRCListDTO>(_mapper.ConfigurationProvider, new { trialSiteId = param.TrialSiteId });
|
||||
|
||||
return await query.ToPagedListAsync(param.PageIndex,
|
||||
param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "UpdateTime" : param.SortField, param.Asc);
|
||||
|
|
|
@ -30,103 +30,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
|
||||
#region 移动废弃
|
||||
|
||||
///// <summary>
|
||||
///// Site用户列表导出
|
||||
///// </summary>
|
||||
///// <param name="param"></param>
|
||||
///// <param name="_commonDocumentRepository"></param>
|
||||
///// <returns></returns>
|
||||
///// <exception cref="Exception"></exception>
|
||||
//[HttpPost]
|
||||
//[AllowAnonymous]
|
||||
//public async Task<IActionResult> TrialSiteUserListExport(SiteCRCExportQueryDTO param, [FromServices] IRepository<CommonDocument> _commonDocumentRepository, [FromServices] IDictionaryService _dictionaryService)
|
||||
//{
|
||||
|
||||
// var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
// exportInfo.List = await _trialSiteUserRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
// .WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName),
|
||||
// t => t.TrialSite.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode),
|
||||
// t => t.TrialSite.TrialSiteCode.Contains(param.TrialSiteCode))
|
||||
// .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator,
|
||||
// t => t.UserId == _userInfo.Id)
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => (t.User.FullName).Contains(param.UserKeyInfo)
|
||||
// || t.User.UserName.Contains(param.UserKeyInfo) || t.User.EMail.Contains(param.UserKeyInfo))
|
||||
|
||||
// .ProjectTo<SiteUserExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
// exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
// return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment,_dictionaryService,typeof(SiteUserExportDTO));
|
||||
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Site用户汇总表导出
|
||||
///// </summary>
|
||||
///// <param name="queryParam"></param>
|
||||
///// <param name="_commonDocumentRepository"></param>
|
||||
///// <param name="_trialSiteSurveyRepository"></param>
|
||||
///// <param name="_trialSiteUserSurveyRepository"></param>
|
||||
///// <param name="_dictionaryService"></param>
|
||||
///// <returns></returns>
|
||||
///// <exception cref="Exception"></exception>
|
||||
//[HttpPost]
|
||||
//[AllowAnonymous]
|
||||
//public async Task<IActionResult> TrialSiteUserSummaryListExport(TrialSiteUserSurveyExportQueryDto queryParam,
|
||||
// [FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
// [FromServices] IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
// [FromServices] IRepository<TrialSiteUserSurvey> _trialSiteUserSurveyRepository
|
||||
// , [FromServices] IDictionaryService _dictionaryService
|
||||
//)
|
||||
//{
|
||||
|
||||
// var data = (await _trialRepository.Where(t => t.Id == queryParam.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
// var groupSelectIdQuery =
|
||||
// _trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||
// .WhereIf(queryParam.SiteId != null, t => t.SiteId == queryParam.SiteId)
|
||||
// .WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||
// .GroupBy(t => t.SiteId)
|
||||
// .Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||
|
||||
|
||||
// var query = _trialSiteUserSurveyRepository
|
||||
// .Where(t => groupSelectIdQuery.Contains(t.TrialSiteSurveyId))
|
||||
// .WhereIf(queryParam.UserTypeId != null, t => t.UserTypeId == queryParam.UserTypeId)
|
||||
// .WhereIf(queryParam.IsGenerateAccount != null, t => t.IsGenerateAccount == queryParam.IsGenerateAccount)
|
||||
// .WhereIf(queryParam.TrialRoleNameId != null, t => t.TrialRoleNameId == queryParam.TrialRoleNameId)
|
||||
// .WhereIf(queryParam.State != null && queryParam.State != TrialSiteUserStateEnum.OverTime, t => t.InviteState == queryParam.State)
|
||||
// .WhereIf(queryParam.State != null && queryParam.State == TrialSiteUserStateEnum.OverTime, t => t.InviteState == TrialSiteUserStateEnum.HasSend && t.ExpireTime < DateTime.Now)
|
||||
// .WhereIf(!string.IsNullOrEmpty(queryParam.UserName), t => (t.LastName + " / " + t.FirstName).Contains(queryParam.UserName))
|
||||
// .WhereIf(!string.IsNullOrEmpty(queryParam.OrganizationName), t => t.OrganizationName.Contains(queryParam.OrganizationName))
|
||||
// .ProjectTo<TrialSiteUserSummaryDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
// data.List = await query.ToListAsync();
|
||||
|
||||
|
||||
|
||||
// var exportInfo = data;
|
||||
|
||||
// exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
// return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment,_dictionaryService,typeof(TrialSiteUserSummaryDto));
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>Pannel 进去 SiteTab </summary>
|
||||
[HttpPost]
|
||||
|
@ -179,7 +82,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
[HttpGet, Route("{trialId:guid}/{siteId:guid}")]
|
||||
public async Task<List<UserTrialDTO>> GetTrialSiteCRCList(Guid trialId, Guid siteId)
|
||||
{
|
||||
var query = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.SiteId == siteId).IgnoreQueryFilters()
|
||||
var query = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == siteId).IgnoreQueryFilters()
|
||||
.ProjectTo<UserTrialDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await query.ToListAsync();
|
||||
|
@ -241,28 +144,24 @@ namespace IRaCIS.Core.Application.Services
|
|||
if (dbEntity == null) return Null404NotFound(dbEntity);
|
||||
|
||||
var trialId = dbEntity.TrialId;
|
||||
var siteId = dbEntity.SiteId;
|
||||
var trialSiteId = dbEntity.Id;
|
||||
|
||||
if (editTrialSiteCommand.IsDeleted)
|
||||
{
|
||||
|
||||
//if (await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId))
|
||||
//{
|
||||
//---The site has been associated with CRC, and couldn't be deleted.
|
||||
// return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedCRC"]);
|
||||
//}
|
||||
if (await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId))
|
||||
{
|
||||
//---The site has been associated with CRC, and couldn't be deleted.
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedCRC"]);
|
||||
}
|
||||
|
||||
if (await _repository.AnyAsync<Subject>(t => t.SiteId == siteId && t.TrialId == trialId))
|
||||
if (await _repository.AnyAsync<Subject>(t => t.TrialSiteId == trialSiteId && t.TrialId == trialId))
|
||||
{
|
||||
//---The subjects has been added to this site, and couldn't be disable.
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_ParticipantJoined"]);
|
||||
}
|
||||
|
||||
//if (await _repository.AnyAsync<DicomStudy>(t => t.SiteId == siteId && t.TrialId == trialId))
|
||||
//{
|
||||
//---The site has been uploaded study, and couldn't be deleted.
|
||||
// return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteUploadedData"]);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -387,24 +286,19 @@ namespace IRaCIS.Core.Application.Services
|
|||
if (relation == null) return Null404NotFound(relation);
|
||||
|
||||
var trialId = relation.TrialId;
|
||||
var siteId = relation.SiteId;
|
||||
var trialSiteId = relation.Id;
|
||||
|
||||
if (await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId))
|
||||
if (await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId))
|
||||
{
|
||||
//---The site has been associated with CRC, and couldn't be deleted.
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedCRC"]);
|
||||
}
|
||||
|
||||
if (await _repository.AnyAsync<Subject>(t => t.SiteId == siteId && t.TrialId == trialId))
|
||||
if (await _repository.AnyAsync<Subject>(t => t.TrialSiteId == trialSiteId && t.TrialId == trialId))
|
||||
{
|
||||
//---The subjects has been added to this site, and couldn't be deleted.
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedSubject"]);
|
||||
}
|
||||
if (await _repository.AnyAsync<DicomStudy>(t => t.SiteId == siteId && t.TrialId == trialId))
|
||||
{
|
||||
//---The site has been uploaded study, and couldn't be deleted.
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteUploadedData"]);
|
||||
}
|
||||
|
||||
await _repository.DeleteAsync(relation);
|
||||
|
||||
|
|
|
@ -91,12 +91,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(t => t.UserType, u => u.MapFrom(t => t.User.UserTypeRole.UserTypeShortName));
|
||||
CreateMap<User, TrialMaintenanceDTO>();
|
||||
|
||||
var siteId = Guid.Empty;
|
||||
var trialSiteId = Guid.Empty;
|
||||
CreateMap<TrialUser, AssginSiteCRCListDTO>().IncludeMembers(t => t.User)
|
||||
.ForMember(d => d.UserRealName, u => u.MapFrom(s => s.User.FullName))
|
||||
.ForMember(d => d.SiteId, u => u.MapFrom(t => siteId))
|
||||
.ForMember(d => d.TrialSiteId, u => u.MapFrom(t => trialSiteId))
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(t => t.User.UserTypeRole.UserTypeShortName))
|
||||
.ForMember(d => d.IsSelect, u => u.MapFrom(t => t.SiteList.Any(k => k.SiteId == siteId)));
|
||||
.ForMember(d => d.IsSelect, u => u.MapFrom(t => t.SiteList.Any(k => k.TrialSiteId == trialSiteId)));
|
||||
CreateMap<User, AssginSiteCRCListDTO>();
|
||||
|
||||
var trialId = Guid.Empty;
|
||||
|
@ -305,8 +305,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
.ForMember(t => t.ApprovalRequiredSiteCount, u =>
|
||||
u.MapFrom(c => userTypeEnumInt == (int)UserTypeEnum.ProjectManager || userTypeEnumInt == (int)UserTypeEnum.APM ?
|
||||
c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Select(t => t.SiteId).Distinct().Count()
|
||||
: c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Select(t => t.SiteId).Distinct().Count())
|
||||
c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Select(t => t.TrialSiteId).Distinct().Count()
|
||||
: c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Select(t => t.TrialSiteId).Distinct().Count())
|
||||
)
|
||||
;
|
||||
|
||||
|
|
|
@ -13,7 +13,9 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public int? Age { get; set; }
|
||||
public string Sex { get; set; } = string.Empty;
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public string MedicalNo { get; set; } = string.Empty;
|
||||
|
||||
|
@ -51,7 +53,7 @@ namespace IRaCIS.Application.Contracts
|
|||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public SubjectStatus Status { get; set; }
|
||||
public DateTime? OutEnrollmentTime { get; set; }
|
||||
|
@ -151,7 +153,7 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
|
||||
public bool? IsMissingImages { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public SubjectStatus? Status { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public class SubjectVisitCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public bool IsFinalVisit { get; set; }
|
||||
|
||||
public string BlindName { get; set; } = string.Empty;
|
||||
|
@ -16,7 +18,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public Guid? Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public bool InPlan { get; set; } = true;
|
||||
public VisitExecutedEnum VisitExecuted { get; set; }
|
||||
public decimal VisitNum { get; set; }
|
||||
|
@ -128,7 +130,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public Guid? SubjectId { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
}
|
||||
|
||||
public class SubjectVisitSelectItem
|
||||
|
@ -289,17 +291,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public string StudyInstanceUid { get; set; } = String.Empty;
|
||||
|
||||
|
||||
|
||||
//public Guid TrialId { get; set; }
|
||||
//public Guid SiteId { get; set; }
|
||||
//public Guid SubjectId { get; set; }
|
||||
//public DateTime? SVSTDTC { get; set; }
|
||||
//public DateTime? SVENDTC { get; set; }
|
||||
|
||||
//public string DTFPath { get; set; }
|
||||
//public string FileRealName { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -307,7 +299,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public class UploadDTFCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
@ -318,7 +310,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public Guid Id { get; set; } = Guid.Empty;
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
@ -490,7 +482,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
//public List<DistributeReviewer> DistributeReviewers { get; set; }=new List<DistributeReviewer>();
|
||||
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string SiteName { get; set; } = String.Empty;
|
||||
public string InstitutionName { get; set; } = String.Empty;
|
||||
public string StudyId { get; set; } = String.Empty;//这个Id是dicom文件中的Id
|
||||
|
@ -539,7 +531,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public string SubjectInfo { get; set; } = String.Empty;
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(param.Sex), t => t.Sex.Contains(param.Sex))
|
||||
.WhereIf(param.Status != null, t => t.Status == param.Status)
|
||||
|
||||
.WhereIf(param.SiteId != null, t => t.SiteId == param.SiteId)
|
||||
.WhereIf(param.TrialSiteId != null, t => t.TrialSiteId == param.TrialSiteId)
|
||||
// CRC 只负责他管理site的受试者
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.ProjectTo<SubjectQueryView>(_mapper.ConfigurationProvider)
|
||||
|
@ -141,7 +141,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpGet("{siteId:guid}/{trialId:guid}")]
|
||||
public List<SubjectSelect> GetSubjectListBySiteId(Guid siteId, Guid trialId)
|
||||
{
|
||||
var query = _subjectRepository.Where(t => t.SiteId == siteId && t.TrialId == trialId && t.Status == SubjectStatus.OnVisit).Select(u => new SubjectSelect()
|
||||
var query = _subjectRepository.Where(t => t.TrialSiteId == siteId && t.TrialId == trialId && t.Status == SubjectStatus.OnVisit).Select(u => new SubjectSelect()
|
||||
{
|
||||
Code = u.Code,
|
||||
FirstName = u.FirstName,
|
||||
|
|
|
@ -669,7 +669,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
Modality=item.Modalities,
|
||||
StudyId=item.StudyId,
|
||||
TrialId=nodicom.TrialId,
|
||||
SiteId=nodicom.SiteId,
|
||||
SubjectVisitId=nodicom.SubjectVisitId,
|
||||
SubjectId=nodicom.SubjectId,
|
||||
SeriesNumber=1,
|
||||
|
|
|
@ -268,15 +268,15 @@ namespace IRaCIS.Application.Services
|
|||
foreach (var visitPlan in addvisitStages)
|
||||
{
|
||||
|
||||
var subjectSVS = await _subjectVisitRepository.Where(t => t.TrialId == visitPlan.TrialId).Select(t => new { t.SubjectId, t.SiteId, t.IsFinalVisit }).Distinct().ToListAsync();
|
||||
var subjectSVS = await _subjectVisitRepository.Where(t => t.TrialId == visitPlan.TrialId).Select(t => new { t.SubjectId, t.TrialSiteId, t.IsFinalVisit }).Distinct().ToListAsync();
|
||||
|
||||
var subjectList = subjectSVS.Select(t => new { t.SubjectId, t.SiteId }).Distinct().ToList();
|
||||
var subjectList = subjectSVS.Select(t => new { t.SubjectId, t.TrialSiteId }).Distinct().ToList();
|
||||
|
||||
foreach (var subject in subjectList)
|
||||
{
|
||||
|
||||
var svItem = _mapper.Map<SubjectVisit>(visitPlan);
|
||||
svItem.SiteId = subject.SiteId;
|
||||
svItem.TrialSiteId = subject.TrialSiteId;
|
||||
svItem.SubjectId = subject.SubjectId;
|
||||
|
||||
//设置了末次访视,那么加访视计划的时候,设置为不可用
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace IRaCIS.Application.Contracts
|
|||
public class WorkloadTPDTO
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string SiteName { get; set; } = String.Empty;
|
||||
public Guid SubjectId { get; set; }
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
@ -30,7 +30,7 @@ namespace IRaCIS.Application.Contracts
|
|||
public class WorkloadGlobalDTO
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string SiteName { get; set; } = String.Empty;
|
||||
public Guid VisitId { get; set; }
|
||||
public string VisitName { get; set; } = String.Empty;
|
||||
|
@ -56,7 +56,7 @@ namespace IRaCIS.Application.Contracts
|
|||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string SiteName { get; set; }=String.Empty;
|
||||
public Guid SubjectId { get; set; }
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
@ -76,7 +76,7 @@ namespace IRaCIS.Application.Contracts
|
|||
public class WorkloadDistributionQueryParam : PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; } = Guid.Empty;
|
||||
public Guid? SiteId { get; set; } = Guid.Empty;
|
||||
public Guid? TrialSiteId { get; set; } = Guid.Empty;
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
public string WorkloadCode { get; set; } = string.Empty;
|
||||
public string Reviewer { get; set; } = string.Empty;
|
||||
|
|
|
@ -1,573 +0,0 @@
|
|||
//using IRaCIS.Application.Contracts;
|
||||
//using IRaCIS.Core.Application.Contracts;
|
||||
//using System.Linq.Expressions;
|
||||
//using IRaCIS.Core.Infrastructure.ExpressionExtend;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
//using IRaCIS.Core.Domain.Models;
|
||||
//using IRaCIS.Core.Domain.Share;
|
||||
//using IRaCIS.Core.Infrastructure.Extention;
|
||||
//using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//namespace IRaCIS.Core.Application.Services
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// TP、Global、AD 工作量分配查看
|
||||
// /// </summary>
|
||||
// [ ApiExplorerSettings(GroupName = "Trial")]
|
||||
//#pragma warning disable
|
||||
// public class WorkloadDistributionService : BaseService, IWorkloadDistributionService
|
||||
// {
|
||||
// private readonly IWorkloadTPRepository _workloadTpRepository;
|
||||
// private readonly IWorkloadGlobalRepository _workloadGlobalRepository;
|
||||
// private readonly IWorkloadADRepository _workloadAdRepository;
|
||||
// private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
// private readonly IRepository<DicomStudy> _studyRepository;
|
||||
// private readonly IRepository<Doctor> _doctorRepository;
|
||||
// private readonly IRepository<Subject> _subjectRepository;
|
||||
// private readonly IRepository<Site> _siteRepository;
|
||||
// private readonly IWorkloadDetailRepository _workloadDetailRepository;
|
||||
|
||||
|
||||
// public WorkloadDistributionService(IWorkloadTPRepository workloadTpRepository,
|
||||
// IWorkloadGlobalRepository workloadGlobalRepository,
|
||||
// IWorkloadADRepository workloadAdRepository,
|
||||
// IRepository<SubjectVisit> subjectVisitRepository, IRepository<DicomStudy> studyRepository,
|
||||
// IRepository<Doctor> doctorRepository, IRepository<Subject> subjectRepository,
|
||||
// IRepository<Site> siteRepository,
|
||||
// IWorkloadDetailRepository workloadDetailRepository,
|
||||
// IUserInfo userInfo)
|
||||
// {
|
||||
// _workloadTpRepository = workloadTpRepository;
|
||||
// _workloadGlobalRepository = workloadGlobalRepository;
|
||||
// _workloadAdRepository = workloadAdRepository;
|
||||
// _subjectVisitRepository = subjectVisitRepository;
|
||||
// _studyRepository = studyRepository;
|
||||
// _doctorRepository = doctorRepository;
|
||||
// _subjectRepository = subjectRepository;
|
||||
// _siteRepository = siteRepository;
|
||||
// _workloadDetailRepository = workloadDetailRepository;
|
||||
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 批量分配Tp
|
||||
// /// </summary>
|
||||
// /// <param name="workloadTPCommand"></param>
|
||||
// /// <returns></returns>
|
||||
// [HttpPost]
|
||||
// public IResponseOutput DistributeTP(WorkloadTPCommand workloadTPCommand)
|
||||
// {
|
||||
// //当前采用的是没有提示到具体的TP,如有需要在修改下
|
||||
// var studyIdList = workloadTPCommand.TpList.Select(u => u.StudyId);
|
||||
// var temp = _workloadTpRepository.Where(u => studyIdList.Contains(u.StudyId) && u.ReviewerId == workloadTPCommand.ReviewerId);
|
||||
// if (temp.Any() )
|
||||
// {
|
||||
// return ResponseOutput.NotOk("The TPs of different Arms of the same subject couldn't be assigned to the same reviewer.");
|
||||
// }
|
||||
// var success = false;
|
||||
// workloadTPCommand.TpList.ForEach(t =>
|
||||
// {
|
||||
// _workloadDetailRepository.Add(new WorkloadDetail
|
||||
// {
|
||||
// WorkloadId = t.Id,
|
||||
// OptUserName = _userInfo.RealName,
|
||||
// OptTime = DateTime.Now,
|
||||
// Status = (int)WorkloadStatus.Distributed,
|
||||
// ReviewerId = workloadTPCommand.ReviewerId
|
||||
// });
|
||||
// _workloadDetailRepository.SaveChanges();
|
||||
// success = _workloadTpRepository.Update(u => u.Id == t.Id, k => new WorkloadTP()
|
||||
// {
|
||||
// ReviewerId = workloadTPCommand.ReviewerId,
|
||||
// Status = (int)WorkloadStatus.Distributed
|
||||
// });
|
||||
// });
|
||||
// return ResponseOutput.Result(success);
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// 批量分配AD
|
||||
// /// </summary>
|
||||
// /// <param name="workloadTPCommand"></param>
|
||||
// /// <returns></returns>
|
||||
// [HttpPost]
|
||||
// public IResponseOutput DistributeAD(WorkloadAdCommand workloadTPCommand)
|
||||
// {
|
||||
// var success = false;
|
||||
// workloadTPCommand.IdList.ForEach(t =>
|
||||
// {
|
||||
// _workloadDetailRepository.Add(new WorkloadDetail
|
||||
// {
|
||||
// WorkloadId = t,
|
||||
// OptUserName = _userInfo.RealName,
|
||||
// OptTime = DateTime.Now,
|
||||
// Status = (int)WorkloadStatus.Distributed,
|
||||
// ReviewerId = workloadTPCommand.ReviewerId
|
||||
// });
|
||||
// _workloadDetailRepository.SaveChanges();
|
||||
// success = _workloadAdRepository.Update(u => u.Id == t, k => new WorkloadAD()
|
||||
// {
|
||||
// ReviewerId = workloadTPCommand.ReviewerId,
|
||||
// Status = (int)WorkloadStatus.Distributed
|
||||
// });
|
||||
// });
|
||||
// return ResponseOutput.Result(success);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 批量分配Global
|
||||
// /// </summary>
|
||||
// /// <param name="workloadGCommand"></param>
|
||||
// /// <returns></returns>
|
||||
// [HttpPost]
|
||||
// public IResponseOutput DistributeGlobal(WorkloadGlobalCommand workloadGCommand)
|
||||
// {
|
||||
// var temp = _workloadGlobalRepository.Where(u => workloadGCommand.GlobalList.Select(s => s.SubjectId).Contains(u.SubjectId)
|
||||
// && workloadGCommand.GlobalList.Select(s => s.VisitNum).Contains(u.VisitNum) &&
|
||||
// u.ReviewerId == workloadGCommand.ReviewerId);
|
||||
// if (temp.Any())
|
||||
// {
|
||||
// return ResponseOutput.NotOk("The Globals of different Arms of the same subject couldn't be assigned to the same reviewer.");
|
||||
// }
|
||||
|
||||
// var success = false;
|
||||
// workloadGCommand.GlobalList.ForEach(t =>
|
||||
// {
|
||||
// _workloadDetailRepository.Add(new WorkloadDetail
|
||||
// {
|
||||
// WorkloadId = t.Id,
|
||||
// OptUserName = _userInfo.RealName,
|
||||
// OptTime = DateTime.Now,
|
||||
// Status = (int)WorkloadStatus.Distributed,
|
||||
// ReviewerId = workloadGCommand.ReviewerId
|
||||
// });
|
||||
// _workloadDetailRepository.SaveChanges();
|
||||
// success = _workloadGlobalRepository.Update(u => u.Id == t.Id, k => new WorkloadGlobal()
|
||||
// {
|
||||
// ReviewerId = workloadGCommand.ReviewerId,
|
||||
// Status = (int)WorkloadStatus.Distributed
|
||||
// });
|
||||
// });
|
||||
// return ResponseOutput.Result(success);
|
||||
// }
|
||||
|
||||
// [HttpPost]
|
||||
// public PageOutput<WorkloadGlobalDTO> GetWorkloadGlobalList(WorkloadDistributionQueryParam param)
|
||||
// {
|
||||
// IQueryable<WorkloadGlobalDTO> query = null;
|
||||
// Expression<Func<WorkloadGlobal, bool>> workloadTPLambda = x => x.TrialId == param.TrialId;
|
||||
// if (param.SiteId != null)
|
||||
// {
|
||||
// workloadTPLambda = workloadTPLambda.And(t => t.SiteId == param.SiteId);
|
||||
// }
|
||||
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// workloadTPLambda = workloadTPLambda.And(t => t.Status == param.Status);
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(param.WorkloadCode))
|
||||
// {
|
||||
// var globalCode = param.WorkloadCode.Trim();
|
||||
// workloadTPLambda = workloadTPLambda.And(t => t.GlobalCode.Contains(globalCode));
|
||||
// }
|
||||
// if (param.GroupId != null && param.GroupId > 0)
|
||||
// {
|
||||
// var groupCode = "G0" + param.GroupId;
|
||||
// workloadTPLambda = workloadTPLambda.And(t => t.GlobalCode.Contains(groupCode));
|
||||
// }
|
||||
|
||||
// Expression<Func<Subject, bool>> subjectLambda = x => x.TrialId == param.TrialId;
|
||||
// if (!string.IsNullOrEmpty(param.SubjectCode))
|
||||
// {
|
||||
// var subjectCode = param.SubjectCode.Trim();
|
||||
// subjectLambda = subjectLambda.And(t => t.Code.Contains(subjectCode));
|
||||
// }
|
||||
// Expression<Func<Doctor, bool>> doctorLambda = x => true;
|
||||
// if (!string.IsNullOrEmpty(param.Reviewer))
|
||||
// {
|
||||
// var reviewer = param.Reviewer.Trim();
|
||||
|
||||
// doctorLambda = doctorLambda.And(t => t.ChineseName.Contains(reviewer)
|
||||
// || t.FirstName.Contains(reviewer) || t.LastName.Contains(reviewer));
|
||||
// query = from workloadG in _workloadGlobalRepository.Where(workloadTPLambda)
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on workloadG.SubjectId equals subject.Id
|
||||
// join site in _siteRepository.AsQueryable() on workloadG.SiteId equals site.Id
|
||||
// join doctor in _doctorRepository.Where(doctorLambda) on workloadG.ReviewerId equals doctor.Id
|
||||
// select new WorkloadGlobalDTO()
|
||||
// {
|
||||
// Id = workloadG.Id,
|
||||
// ReviewerCode = doctor.ReviewerCode,
|
||||
// ReviewerChineseName = doctor.ChineseName,
|
||||
// ReviewerFirstName = doctor.FirstName,
|
||||
// ReviewerId = doctor.Id,
|
||||
// ReviewerLastName = doctor.LastName,
|
||||
// SiteId = workloadG.SiteId,
|
||||
// SiteName = site.SiteName,
|
||||
// Status = workloadG.Status,
|
||||
// GlobalCode = workloadG.GlobalCode,
|
||||
// SubjectCode = subject.Code,
|
||||
// VisitId = workloadG.VisitId,
|
||||
// UpdateTime = workloadG.UpdateTime,
|
||||
// SubjectId = workloadG.SubjectId,
|
||||
// VisitNum = workloadG.VisitNum,
|
||||
// VisitName = workloadG.VisitName
|
||||
// };
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// query = from workloadG in _workloadGlobalRepository.Where(workloadTPLambda)
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on workloadG.SubjectId equals subject.Id
|
||||
// join site in _siteRepository.AsQueryable() on workloadG.SiteId equals site.Id
|
||||
// join doctor in _doctorRepository.Where(doctorLambda) on workloadG.ReviewerId equals doctor.Id into cc
|
||||
// from doctor in cc.DefaultIfEmpty()
|
||||
// select new WorkloadGlobalDTO()
|
||||
// {
|
||||
// Id = workloadG.Id,
|
||||
// ReviewerCode = doctor.ReviewerCode,
|
||||
// ReviewerChineseName = doctor.ChineseName,
|
||||
// ReviewerFirstName = doctor.FirstName,
|
||||
// ReviewerId = doctor.Id,
|
||||
// ReviewerLastName = doctor.LastName,
|
||||
// SiteId = workloadG.SiteId,
|
||||
// SiteName = site.SiteName,
|
||||
// Status = workloadG.Status,
|
||||
// GlobalCode = workloadG.GlobalCode,
|
||||
// SubjectCode = subject.Code,
|
||||
// VisitId = workloadG.VisitId,
|
||||
// UpdateTime = workloadG.UpdateTime,
|
||||
// SubjectId = workloadG.SubjectId,
|
||||
// VisitNum = workloadG.VisitNum,
|
||||
// VisitName = workloadG.VisitName
|
||||
// };
|
||||
// }
|
||||
|
||||
// var count = query.Count();
|
||||
|
||||
// var propName = param.SortField == string.Empty ? "GlobalCode" : param.SortField;
|
||||
|
||||
// query = param.Asc
|
||||
// ? query.OrderBy(propName).ThenBy(t => t.SiteName).ThenBy(t => t.SubjectCode)
|
||||
// : query.OrderByDescending(propName).ThenBy(t => t.SiteName).ThenBy(t => t.SubjectCode);
|
||||
|
||||
// query = query.Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
|
||||
// var list = query.ToList();
|
||||
|
||||
// return new PageOutput<WorkloadGlobalDTO>(param.PageIndex,
|
||||
// param.PageSize, count, list);
|
||||
// }
|
||||
|
||||
// [HttpPost]
|
||||
// public PageOutput<WorkloadADDTO> GetWorkloadADList(WorkloadDistributionQueryParam param)
|
||||
// {
|
||||
// IQueryable<WorkloadADDTO> query = null;
|
||||
// Expression<Func<WorkloadAD, bool>> workloadAdLambda = x => x.TrialId == param.TrialId;
|
||||
// if (param.SiteId != null)
|
||||
// {
|
||||
// workloadAdLambda = workloadAdLambda.And(t => t.SiteId == param.SiteId);
|
||||
// }
|
||||
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// workloadAdLambda = workloadAdLambda.And(t => t.Status == param.Status);
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(param.WorkloadCode))
|
||||
// {
|
||||
// var adCode = param.WorkloadCode.Trim();
|
||||
// workloadAdLambda = workloadAdLambda.And(t => t.ADCode.Contains(adCode));
|
||||
// }
|
||||
|
||||
// Expression<Func<Subject, bool>> subjectLambda = x => x.TrialId == param.TrialId;
|
||||
// if (!string.IsNullOrEmpty(param.SubjectCode))
|
||||
// {
|
||||
// var subjectCode = param.SubjectCode.Trim();
|
||||
// subjectLambda = subjectLambda.And(t => t.Code.Contains(subjectCode));
|
||||
|
||||
// }
|
||||
// Expression<Func<Doctor, bool>> doctorLambda = x => true;
|
||||
// if (!string.IsNullOrEmpty(param.Reviewer))
|
||||
// {
|
||||
// var reviewer = param.Reviewer.Trim();
|
||||
// doctorLambda = doctorLambda.And(t => t.ChineseName.Contains(reviewer)
|
||||
// || t.FirstName.Contains(reviewer) || t.LastName.Contains(reviewer));
|
||||
// query = from workloadAd in _workloadAdRepository.Where(workloadAdLambda)
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on workloadAd.SubjectId equals subject.Id
|
||||
// join site in _siteRepository.AsQueryable() on workloadAd.SiteId equals site.Id
|
||||
// join doctor in _doctorRepository.Where(doctorLambda) on workloadAd.ReviewerId equals doctor.Id
|
||||
// select new WorkloadADDTO()
|
||||
// {
|
||||
// Id = workloadAd.Id,
|
||||
// ReviewerCode = doctor.ReviewerCode,
|
||||
// ReviewerChineseName = doctor.ChineseName,
|
||||
// ReviewerFirstName = doctor.FirstName,
|
||||
// ReviewerId = doctor.Id,
|
||||
// ReviewerLastName = doctor.LastName,
|
||||
// SiteId = workloadAd.SiteId,
|
||||
// SiteName = site.SiteName,
|
||||
// Status = workloadAd.Status,
|
||||
// ADCode = workloadAd.ADCode,
|
||||
// SubjectCode = subject.Code,
|
||||
// SubjectId = workloadAd.SubjectId,
|
||||
// UpdateTime = workloadAd.UpdateTime
|
||||
// };
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// query = from workloadAd in _workloadAdRepository.Where(workloadAdLambda)
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on workloadAd.SubjectId equals subject.Id
|
||||
|
||||
// join site in _siteRepository.AsQueryable() on workloadAd.SiteId equals site.Id
|
||||
// join doctor in _doctorRepository.Where(doctorLambda) on workloadAd.ReviewerId equals doctor.Id into cc
|
||||
// from doctor in cc.DefaultIfEmpty()
|
||||
// select new WorkloadADDTO()
|
||||
// {
|
||||
// Id = workloadAd.Id,
|
||||
// ReviewerCode = doctor.ReviewerCode,
|
||||
// ReviewerChineseName = doctor.ChineseName,
|
||||
// ReviewerFirstName = doctor.FirstName,
|
||||
// ReviewerId = doctor.Id,
|
||||
// ReviewerLastName = doctor.LastName,
|
||||
// SiteId = workloadAd.SiteId,
|
||||
// SiteName = site.SiteName,
|
||||
// Status = workloadAd.Status,
|
||||
// ADCode = workloadAd.ADCode,
|
||||
// SubjectCode = subject.Code,
|
||||
// SubjectId = workloadAd.SubjectId,
|
||||
// UpdateTime = workloadAd.UpdateTime
|
||||
// };
|
||||
|
||||
// }
|
||||
// var count = query.Count();
|
||||
|
||||
// var propName = param.SortField == string.Empty ? "ADCode" : param.SortField;
|
||||
|
||||
// query = param.Asc
|
||||
// ? query.OrderBy(propName).ThenBy(t => t.SiteName).ThenBy(t => t.SubjectCode)
|
||||
// : query.OrderByDescending(propName).ThenBy(t => t.SiteName).ThenBy(t => t.SubjectCode);
|
||||
|
||||
// query = query.Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
|
||||
// var list = query.ToList();
|
||||
|
||||
// return new PageOutput<WorkloadADDTO>(param.PageIndex,
|
||||
// param.PageSize, count, list);
|
||||
// }
|
||||
|
||||
// [HttpPost]
|
||||
// public PageOutput<WorkloadTPDTO> GetWorkloadTPList(WorkloadDistributionQueryParam param)
|
||||
// {
|
||||
// IQueryable<WorkloadTPDTO> query = null;
|
||||
// Expression<Func<WorkloadTP, bool>> workloadTPLambda = x => x.TrialId == param.TrialId;
|
||||
// if (param.SiteId != null)
|
||||
// {
|
||||
// workloadTPLambda = workloadTPLambda.And(t => t.SiteId == param.SiteId);
|
||||
// }
|
||||
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// workloadTPLambda = workloadTPLambda.And(t => t.Status == param.Status);
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(param.WorkloadCode))
|
||||
// {
|
||||
// var timepoint = param.WorkloadCode.Trim();
|
||||
|
||||
// workloadTPLambda = workloadTPLambda.And(t => t.TimepointCode.Contains(timepoint));
|
||||
// }
|
||||
// if (param.GroupId != null && param.GroupId > 0)
|
||||
// {
|
||||
// var groupCode = "T0" + param.GroupId;
|
||||
// workloadTPLambda = workloadTPLambda.And(t => t.TimepointCode.Contains(groupCode));
|
||||
// }
|
||||
|
||||
// Expression<Func<Subject, bool>> subjectLambda = x => x.TrialId == param.TrialId;
|
||||
// if (!string.IsNullOrEmpty(param.SubjectCode))
|
||||
// {
|
||||
// var subjectCode = param.SubjectCode.Trim();
|
||||
// subjectLambda = subjectLambda.And(t => t.Code.Contains(subjectCode));
|
||||
// }
|
||||
// Expression<Func<Doctor, bool>> doctorLambda = x => true;
|
||||
// if (!string.IsNullOrEmpty(param.Reviewer))
|
||||
// {
|
||||
// var reviewer = param.Reviewer.Trim();
|
||||
// doctorLambda = doctorLambda.And(t => t.ChineseName.Contains(reviewer)
|
||||
// || t.FirstName.Contains(reviewer) || t.LastName.Contains(reviewer));
|
||||
// query = from workloadTp in _workloadTpRepository.Where(workloadTPLambda)
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on workloadTp.SubjectId equals subject.Id
|
||||
// join subjectVisit in _subjectVisitRepository.AsQueryable() on workloadTp.SubjectVisitId equals subjectVisit.Id
|
||||
// join study in _studyRepository.AsQueryable() on workloadTp.StudyId equals study.Id
|
||||
// join site in _siteRepository.AsQueryable() on workloadTp.SiteId equals site.Id
|
||||
// join doctor in _doctorRepository.Where(doctorLambda) on workloadTp.ReviewerId equals doctor.Id
|
||||
|
||||
// select new WorkloadTPDTO()
|
||||
// {
|
||||
// Id = workloadTp.Id,
|
||||
// ReviewerCode = doctor.ReviewerCode,
|
||||
// ReviewerChineseName = doctor.ChineseName,
|
||||
// ReviewerFirstName = doctor.FirstName,
|
||||
// ReviewerId = doctor.Id,
|
||||
// ReviewerLastName = doctor.LastName,
|
||||
// SiteId = workloadTp.SiteId,
|
||||
// SiteName = site.SiteName,
|
||||
// Status = workloadTp.Status,
|
||||
// StudyCode = study.StudyCode,
|
||||
// StudyId = workloadTp.StudyId,
|
||||
// TimepointCode = workloadTp.TimepointCode,
|
||||
// SubjectCode = subject.Code,
|
||||
// SubjectVisitId = workloadTp.SubjectVisitId,
|
||||
// SubjectId = workloadTp.SubjectId,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// UpdateTime = workloadTp.UpdateTime
|
||||
// };
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// query = from workloadTp in _workloadTpRepository.Where(workloadTPLambda)
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on workloadTp.SubjectId equals subject.Id
|
||||
// join subjectVisit in _subjectVisitRepository.AsQueryable() on workloadTp.SubjectVisitId equals subjectVisit.Id
|
||||
// join study in _studyRepository.AsQueryable() on workloadTp.StudyId equals study.Id
|
||||
// join site in _siteRepository.AsQueryable() on workloadTp.SiteId equals site.Id
|
||||
// join doctor in _doctorRepository.Where(doctorLambda) on workloadTp.ReviewerId equals doctor.Id into cc
|
||||
// from doctor in cc.DefaultIfEmpty()
|
||||
// select new WorkloadTPDTO()
|
||||
// {
|
||||
// Id = workloadTp.Id,
|
||||
// ReviewerCode = doctor.ReviewerCode,
|
||||
// ReviewerChineseName = doctor.ChineseName,
|
||||
// ReviewerFirstName = doctor.FirstName,
|
||||
// ReviewerId = doctor.Id,
|
||||
// ReviewerLastName = doctor.LastName,
|
||||
// SiteId = workloadTp.SiteId,
|
||||
// SiteName = site.SiteName,
|
||||
// Status = workloadTp.Status,
|
||||
// StudyCode = study.StudyCode,
|
||||
// StudyId = workloadTp.StudyId,
|
||||
// TimepointCode = workloadTp.TimepointCode,
|
||||
// SubjectCode = subject.Code,
|
||||
// SubjectVisitId = workloadTp.SubjectVisitId,
|
||||
// SubjectId = workloadTp.SubjectId,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// UpdateTime = workloadTp.UpdateTime
|
||||
// };
|
||||
|
||||
// }
|
||||
// var count = query.Count();
|
||||
|
||||
// var propName = param.SortField == string.Empty ? "TimepointCode" : param.SortField;
|
||||
// query = param.Asc
|
||||
// ? query.OrderBy(propName).ThenBy(t => t.SiteName).ThenBy(t => t.SubjectCode)
|
||||
// : query.OrderByDescending(propName).ThenBy(t => t.SiteName).ThenBy(t => t.SubjectCode);
|
||||
// query = query.Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
|
||||
// var list = query.ToList();
|
||||
|
||||
// return new PageOutput<WorkloadTPDTO>(param.PageIndex,
|
||||
// param.PageSize, count, list);
|
||||
// }
|
||||
|
||||
// //修改单个TP
|
||||
// [HttpPost("{tpId:guid}/{reviewerId:guid}")]
|
||||
// public IResponseOutput UpdateDistributeAD(Guid tpId, Guid reviewerId)
|
||||
// {
|
||||
// _workloadDetailRepository.Add(new WorkloadDetail
|
||||
// {
|
||||
// WorkloadId = tpId,
|
||||
// OptUserName = _userInfo.RealName,
|
||||
// OptTime = DateTime.Now,
|
||||
// Status = (int)WorkloadStatus.Distributed,
|
||||
// ReviewerId = reviewerId
|
||||
// });
|
||||
// _workloadDetailRepository.SaveChanges();
|
||||
// var success= _workloadAdRepository.Update(t => t.Id == tpId, u => new WorkloadAD()
|
||||
// {
|
||||
// ReviewerId = reviewerId,
|
||||
// Status = (int)WorkloadStatus.Distributed
|
||||
// });
|
||||
|
||||
// return ResponseOutput.Result(success);
|
||||
// }
|
||||
|
||||
// //修改单个Global
|
||||
// [HttpPost("{tpId:guid}/{reviewerId:guid}/{subjectId:guid}/{visitNum}")]
|
||||
// public IResponseOutput UpdateDistributeGlobal(Guid tpId, Guid reviewerId, Guid subjectId, decimal visitNum)
|
||||
// {
|
||||
// var temp = _workloadGlobalRepository.Where(u => u.SubjectId == subjectId &&
|
||||
// u.VisitNum == visitNum &&
|
||||
// u.ReviewerId == reviewerId && u.Id != tpId);
|
||||
// if (temp.Any())
|
||||
// {
|
||||
// return ResponseOutput.NotOk("The Global of the other arm of this subject has already been assigned to this reviewer, and the assignment couldn't be performed.");
|
||||
// }
|
||||
|
||||
// _workloadDetailRepository.Add(new WorkloadDetail
|
||||
// {
|
||||
// WorkloadId = tpId,
|
||||
// OptUserName = _userInfo.RealName,
|
||||
// OptTime = DateTime.Now,
|
||||
// Status = (int)WorkloadStatus.Distributed,
|
||||
// ReviewerId = reviewerId
|
||||
// });
|
||||
// _workloadDetailRepository.SaveChanges();
|
||||
// return ResponseOutput.Result(_workloadGlobalRepository.Update(t => t.Id == tpId, u => new WorkloadGlobal()
|
||||
// {
|
||||
// ReviewerId = reviewerId,
|
||||
// Status = (int)WorkloadStatus.Distributed
|
||||
// }));
|
||||
// }
|
||||
|
||||
// //修改单个TP
|
||||
// [HttpPost("{tpId:guid}/{reviewerId:guid}/{studyId:guid}")]
|
||||
// public IResponseOutput UpdateDistributeTP(Guid tpId, Guid reviewerId, Guid studyId)
|
||||
// {
|
||||
// var temp = _workloadTpRepository.Where(u => u.StudyId == studyId && u.ReviewerId == reviewerId && u.Id != tpId);
|
||||
// if (temp.Any())
|
||||
// {
|
||||
// return ResponseOutput.NotOk("The TP of the other arm of this subject has already been assigned to this reviewer, and the assignment couldn't be performed.");
|
||||
// }
|
||||
|
||||
// _workloadDetailRepository.Add(new WorkloadDetail
|
||||
// {
|
||||
// WorkloadId = tpId,
|
||||
// OptUserName = _userInfo.RealName,
|
||||
// OptTime = DateTime.Now,
|
||||
// Status = (int)WorkloadStatus.Distributed,
|
||||
// ReviewerId = reviewerId
|
||||
// });
|
||||
// _workloadDetailRepository.SaveChanges();
|
||||
// return ResponseOutput.Result(_workloadTpRepository.Update(t => t.Id == tpId, u => new WorkloadTP()
|
||||
// {
|
||||
// ReviewerId = reviewerId,
|
||||
// Status = (int)WorkloadStatus.Distributed
|
||||
// }));
|
||||
// }
|
||||
|
||||
// [HttpGet("{workloadId:guid}")]
|
||||
// public IResponseOutput<List<WorkloadDetailDTO>> GetWorkloadDetail(Guid workloadId)
|
||||
// {
|
||||
// IQueryable<WorkloadDetailDTO> query = null;
|
||||
// query = from detail in _workloadDetailRepository.Where(u => u.WorkloadId == workloadId)
|
||||
// join doctor in _doctorRepository.AsQueryable() on detail.ReviewerId equals doctor.Id into cc
|
||||
// from doctor in cc.DefaultIfEmpty()
|
||||
// select new WorkloadDetailDTO()
|
||||
// {
|
||||
// OptTime = detail.OptTime,
|
||||
// OptUserName = detail.OptUserName,
|
||||
// ReviewerChineseName = doctor.ChineseName,
|
||||
// ReviewerFirstName = doctor.FirstName,
|
||||
// ReviewerLastName = doctor.LastName,
|
||||
// Status = detail.Status
|
||||
// };
|
||||
// var list = query.OrderByDescending(u => u.OptTime).ToList();
|
||||
// return ResponseOutput.Ok(list);
|
||||
// }
|
||||
|
||||
// [HttpPost("UpdateGlobalStatus/{globalId:guid}")]
|
||||
// public IResponseOutput UpdateGlobalStatus(Guid globalId)
|
||||
// {
|
||||
// return ResponseOutput.Result(_workloadGlobalRepository.Update(u => u.Id == globalId, t => new WorkloadGlobal()
|
||||
// {
|
||||
// Status = 0
|
||||
// }));
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
|
@ -271,13 +271,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var c = MD5Helper.Md5("123456");
|
||||
|
||||
//update DicomInstance set Path = '/IRaCISData/TrialData/' + cast(DicomInstance.TrialId as varchar) + '/' + DicomInstance.SiteId + '/' + DicomInstance.SubjectId + '/' + DicomInstance.SubjectVisitId + '/Dicom/' + DicomInstance.StudyId + '/' + DicomInstance.Id + '.dcm'
|
||||
|
||||
|
||||
//await _repository.BatchUpdateAsync<DicomInstance>(u => u.Path.Contains(".dcm"), t => new DicomInstance() { Path = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{t.TrialId}/{t.SiteId}/{t.SubjectId}/{t.SubjectVisitId}/{StaticData.Folder.DicomFolder}/{t.StudyId}/{t.Id}.dcm" });
|
||||
|
||||
//await _repository.BatchUpdateAsync<DicomInstance>(u => !u.Path.Contains(".dcm"), t => new DicomInstance() { Path = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{t.TrialId}/{t.SiteId}/{t.SubjectId}/{t.SubjectVisitId}/{StaticData.Folder.DicomFolder}/{t.StudyId}/{t.Id}" });
|
||||
|
||||
|
||||
|
||||
return new { env.EnvironmentName, EMailConfig = _systemEmailConfig.CurrentValue, BasicConfig = _basicConfig.CurrentValue };
|
||||
|
||||
|
@ -414,12 +408,12 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
||||
var studyList = _repository.Where<DicomStudy>(t => t.SeriesList.Any(t => t.ImageResizePath.Length < 10)).Select(t => new { t.TrialId, t.SiteId, t.SubjectId, t.SubjectVisitId, t.Id }).ToList();
|
||||
var studyList = _repository.Where<DicomStudy>(t => t.SeriesList.Any(t => t.ImageResizePath.Length < 10)).Select(t => new { t.TrialId, t.Subject.TrialSiteId, t.SubjectId, t.SubjectVisitId, t.Id }).ToList();
|
||||
|
||||
foreach (var studyitem in studyList)
|
||||
{
|
||||
|
||||
var relativePath = $"{studyitem.TrialId}/{studyitem.SiteId}/{studyitem.SubjectId}/{studyitem.SubjectVisitId}/{StaticData.Folder.DicomFolder}/{studyitem.Id}/";
|
||||
var relativePath = $"{studyitem.TrialId}/{studyitem.TrialSiteId}/{studyitem.SubjectId}/{studyitem.SubjectVisitId}/{StaticData.Folder.DicomFolder}/{studyitem.Id}/";
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
t.Subject = subject;
|
||||
t.SubjectId = subject.Id;
|
||||
t.TrialId = subject.TrialId;
|
||||
t.SiteId = subject.SiteId;
|
||||
t.TrialSiteId = subject.TrialSiteId;
|
||||
t.IsEnrollmentConfirm = t.IsBaseLine ? IsEnrollementQualificationConfirm : false;
|
||||
t.Id = NewId.NextGuid();
|
||||
|
||||
|
@ -67,34 +67,6 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
||||
#region 在f访视计划确认的时候处理 给subject添加访视计划
|
||||
////已添加受试者 都不存在该新增的计划名称 那么该项目所有受试者都增加一个访视记录
|
||||
//if (!await _subjectVisitRepository.AnyAsync(t => t.VisitName == visitPlan.VisitName && t.TrialId == visitPlan.TrialId))
|
||||
//{
|
||||
// var subjectSVS = await _subjectVisitRepository.Where(t => t.TrialId == visitPlan.TrialId).Select(t => new { t.SubjectId, t.SiteId, t.IsFinalVisit }).Distinct().ToListAsync();
|
||||
|
||||
// var subjects = subjectSVS.Select(t => new { t.SubjectId, t.SiteId }).Distinct().ToList();
|
||||
|
||||
// foreach (var subject in subjects)
|
||||
// {
|
||||
|
||||
// var svItem = _mapper.Map<SubjectVisit>(visitPlan);
|
||||
// svItem.SiteId = subject.SiteId;
|
||||
// svItem.SubjectId = subject.SubjectId;
|
||||
// svItem.Id = NewId.NextGuid();
|
||||
|
||||
// //设置了末次访视,那么加访视计划的时候,设置为不可用
|
||||
// if (subjectSVS.Any(t => t.SubjectId == svItem.SubjectId && t.IsFinalVisit))
|
||||
// {
|
||||
// svItem.VisitExecuted = VisitExecutedEnum.Unavailable;
|
||||
// }
|
||||
|
||||
// await _subjectVisitRepository.AddAsync(svItem);
|
||||
// }
|
||||
|
||||
// await _subjectVisitRepository.SaveChangesAsync();
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -33,15 +33,14 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
{
|
||||
//Site变更
|
||||
|
||||
if ( context.Entity.SiteId != context.UnmodifiedEntity?.SiteId)
|
||||
if ( context.Entity.TrialSiteId != context.UnmodifiedEntity?.TrialSiteId)
|
||||
{
|
||||
var subjectId = context.Entity.Id;
|
||||
var siteId = context.Entity.SiteId;
|
||||
var trialSiteId = context.Entity.TrialSiteId;
|
||||
|
||||
|
||||
await _repository.BatchUpdateAsync<SubjectVisit>(t => t.SubjectId == subjectId, u => new SubjectVisit() { SiteId = siteId });
|
||||
await _repository.BatchUpdateAsync<SubjectVisit>(t => t.SubjectId == subjectId, u => new SubjectVisit() { TrialSiteId = trialSiteId });
|
||||
|
||||
await _repository.BatchUpdateAsync<DicomStudy>(t => t.SubjectId == subjectId, u => new DicomStudy() { SiteId = siteId });
|
||||
|
||||
|
||||
#region 废弃
|
||||
|
|
|
@ -55,13 +55,12 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
|||
(x.CheckState == CheckStateEnum.ToCheck && x.AuditState == AuditStateEnum.QCPassed || (x.CheckState == CheckStateEnum.CVIng && x.AuditState == AuditStateEnum.QCPassed));
|
||||
|
||||
var dicomQuery = from sv in _subjectVisitRepository.Where(subjectVisitLambda)
|
||||
join trialSite in _trialSiteRepository.Where(t => t.TrialId == trialId) on sv.SiteId equals trialSite.SiteId
|
||||
join subject in _subjectRepository.AsQueryable() on sv.SubjectId equals subject.Id
|
||||
join study in _studyRepository.AsQueryable() on sv.Id equals study.SubjectVisitId
|
||||
select new CheckDBModel()
|
||||
{
|
||||
SubjectVisitId = sv.Id,
|
||||
SiteCode = trialSite.TrialSiteCode,
|
||||
SiteCode = sv.TrialSite.TrialSiteCode,
|
||||
StudyDate = study.StudyTime == null ? string.Empty : ((DateTime)study.StudyTime).ToString("yyyy-MM-dd"),
|
||||
StudyId = study.Id,
|
||||
Modality = study.ModalityForEdit,
|
||||
|
@ -70,13 +69,12 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
|||
};
|
||||
|
||||
var noneDicomQuey = from sv in _subjectVisitRepository.Where(subjectVisitLambda)
|
||||
join trialSite in _trialSiteRepository.Where(t => t.TrialId == trialId) on sv.SiteId equals trialSite.SiteId
|
||||
join subject in _subjectRepository.AsQueryable() on sv.SubjectId equals subject.Id
|
||||
join noneDicomStudy in _noneDicomStudyRepository.AsQueryable() on sv.Id equals noneDicomStudy.SubjectVisitId
|
||||
select new CheckDBModel()
|
||||
{
|
||||
SubjectVisitId = sv.Id,
|
||||
SiteCode = trialSite.TrialSiteCode,
|
||||
SiteCode = sv.TrialSite.TrialSiteCode,
|
||||
StudyDate = noneDicomStudy.ImageDate.ToString("yyyy-MM-dd"),
|
||||
StudyId = noneDicomStudy.Id,
|
||||
Modality = noneDicomStudy.Modality,
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
public bool Anonymize { get; set; }
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public string TriggerTime { get; set; } = string.Empty;
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
|
|
@ -15,10 +15,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public List<DicomSeries> SeriesList { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public TrialSite TrialSite { get; set; }
|
||||
[JsonIgnore]
|
||||
public Site Site { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public List<SubjectCriteriaEvaluationVisitStudyFilter> SubjectCriteriaEvaluationVisitStudyFilterList { get; set; }
|
||||
|
@ -28,7 +25,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
|
|
@ -14,6 +14,10 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[Table("StudyMonitor")]
|
||||
public class StudyMonitor : Entity, IAuditAdd
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("StudyId")]
|
||||
public DicomStudy DicomStudy { get; set; }
|
||||
|
@ -61,8 +65,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }=Guid.Empty;
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
@ -77,9 +79,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
[JsonIgnore]
|
||||
public TrialSite TrialSite { get; set; }
|
||||
[JsonIgnore]
|
||||
[ForeignKey("SiteId")]
|
||||
public Site Site { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("TrialId")]
|
||||
public Trial Trial { get; set; }
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public class ImageShare: Entity
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid StudyId { get; set; }
|
||||
|
||||
|
|
|
@ -19,8 +19,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public List<NoneDicomStudyFile> NoneDicomFileList { get; set; }
|
||||
[JsonIgnore]
|
||||
public SubjectVisit SubjectVisit { get; set; }
|
||||
[JsonIgnore]
|
||||
public TrialSite TrialSite { get; set; }
|
||||
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public Subject Subject { get; set; }
|
||||
|
||||
|
@ -36,11 +37,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[Required]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SiteId
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SubjectId
|
||||
|
|
|
@ -25,10 +25,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中心ID
|
||||
/// </summary>
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
|
@ -41,12 +37,8 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid CreateUserId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 中心
|
||||
/// </summary>
|
||||
public Site Site { get; set; }
|
||||
|
||||
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public TrialSite TrialSite { get; set; }
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// <summary>
|
||||
/// 中心ID
|
||||
/// </summary>
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为访视
|
||||
|
|
|
@ -15,8 +15,14 @@ namespace IRaCIS.Core.Domain.Models
|
|||
///</summary>
|
||||
[Table("TrialSiteSurvey")]
|
||||
public class TrialSiteSurvey : Entity, IAuditUpdate, IAuditAdd,ISoftDelete
|
||||
{
|
||||
public TrialSiteSurveyEnum State { get; set; } = TrialSiteSurveyEnum.ToSubmit;
|
||||
{
|
||||
|
||||
|
||||
|
||||
[Required]
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public TrialSiteSurveyEnum State { get; set; } = TrialSiteSurveyEnum.ToSubmit;
|
||||
|
||||
|
||||
// 必须 { get; set; } 否则 翻译出错
|
||||
|
@ -44,12 +50,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
[Required]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SiteId
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CreateTime
|
||||
|
|
|
@ -33,10 +33,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中心
|
||||
/// </summary>
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 受试者
|
||||
|
|
|
@ -9,10 +9,12 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid? SiteId { get; set; }
|
||||
|
||||
public string TrialSiteCode { get; set; } = String.Empty;
|
||||
|
||||
public string TrialSiteName { get; set; } = String.Empty;
|
||||
|
||||
public string TrialSiteAliasName { get; set; }=String.Empty;
|
||||
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
@ -30,6 +32,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
//导航属性
|
||||
[ForeignKey("SiteId")]
|
||||
public Site Site { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("TrialId")]
|
||||
public Trial Trial { get; set; }
|
||||
|
|
|
@ -17,7 +17,11 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public class TrialSiteUser : Entity, IAuditUpdate, IAuditAdd,ISoftDelete
|
||||
{
|
||||
|
||||
[Required]
|
||||
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
|
||||
[Required]
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
|
||||
|
@ -25,8 +29,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid TrialId { get; set; }
|
||||
|
||||
|
||||
[Required]
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
|
@ -50,11 +52,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
[ForeignKey("TrialId")]
|
||||
public Trial Trial { get; set; }
|
||||
[JsonIgnore]
|
||||
[ForeignKey("SiteId")]
|
||||
public Site Site { get; set; }
|
||||
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public TrialSite TrialSite { get; set; }
|
||||
|
|
|
@ -50,17 +50,19 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid? FinalSubjectVisitId { get; set; }
|
||||
|
||||
|
||||
//需要配置是两个键连接
|
||||
[JsonIgnore]
|
||||
public TrialSite TrialSite { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("TrialId")]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("SiteId")]
|
||||
public Site Site { get; set; }
|
||||
public TrialSite TrialSite { get; set; }
|
||||
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public List<DicomStudy> StudyList { get; set; } = new List<DicomStudy>();
|
||||
|
||||
|
@ -69,7 +71,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public string LastName { get; set; } = string.Empty;
|
||||
public int? Age { get; set; }
|
||||
public string Sex { get; set; } = string.Empty;
|
||||
public Guid SiteId { get; set; } = Guid.Empty;
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("LatestSubjectVisitId")]
|
||||
|
@ -126,7 +128,5 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public List<ClinicalForm> ClinicalFormList { get; set; }
|
||||
|
||||
|
||||
//是否分配了读片医生
|
||||
//public bool IsAssignDoctorUser{get;set;}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,12 +9,26 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[Table("SubjectVisit")]
|
||||
public class SubjectVisit : Entity, IAuditUpdate, IAuditAdd, ISoftDelete
|
||||
{
|
||||
//一个访视 对应有对应Site的 TrialSiteCode 所以 fluentApi中配置 TrialSite 连表用TrialId SiteId 双字段
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public TrialSite TrialSite { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//一个访视 对应有对应Site的 TrialSiteCode
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public VisitStage VisitStage { get; set; }
|
||||
|
@ -197,9 +211,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[ForeignKey("TrialId")]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("SiteId")]
|
||||
public Site Site { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("SubjectId")]
|
||||
|
|
|
@ -1316,73 +1316,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
|
||||
|
||||
#region OLd
|
||||
//var entitylist = entitys.Where(x => x.Entity.GetType() == typeof(TrialQCQuestionAnswer)).Select(x => x.Entity as TrialQCQuestionAnswer).ToList();
|
||||
//var firstEntity = entitylist.FirstOrDefault();
|
||||
//var subjectVisit = await _dbContext.SubjectVisit.Where(x => x.Id == firstEntity.SubjectVisitId).FirstOrDefaultAsync();
|
||||
//subjectVisit = subjectVisit ?? new SubjectVisit();
|
||||
//if (type == "Add")
|
||||
//{
|
||||
|
||||
|
||||
// await InsertInspection(firstEntity, type, answer => new InspectionConvertDTO()
|
||||
// {
|
||||
// SiteId = subjectVisit.SiteId,
|
||||
// SubjectId = subjectVisit.SubjectId,
|
||||
// SubjectVisitName = subjectVisit.VisitName,
|
||||
// TrialId = subjectVisit.TrialId,
|
||||
// SubjectVisitId = subjectVisit.Id,
|
||||
|
||||
// //GeneralId = subjectVisit.Id,
|
||||
// //byzhouhang
|
||||
// ObjectRelationParentId = subjectVisit.Id,
|
||||
// }, new
|
||||
// {
|
||||
// QcQuestionAnswerCommands = await Getdata(entitylist),
|
||||
// });
|
||||
//}
|
||||
//else if (type == "Update")
|
||||
//{
|
||||
|
||||
// var questionIds = entitylist.Where(x => x.SubjectVisitId == subjectVisit.Id).Select(x => x.Id).ToList();
|
||||
// var createUserId = entitylist.Select(x => x.CreateUserId).FirstOrDefault();
|
||||
// var noUpdateData = _dbContext.TrialQCQuestionAnswer.Where(x => x.CreateUserId == createUserId && x.SubjectVisitId == subjectVisit.Id && !questionIds.Contains(x.Id)).ToList();
|
||||
// entitylist.AddRange(noUpdateData);
|
||||
|
||||
// await InsertInspection(firstEntity, type, answer => new InspectionConvertDTO()
|
||||
// {
|
||||
// SiteId = subjectVisit.SiteId,
|
||||
// SubjectId = subjectVisit.SubjectId,
|
||||
// SubjectVisitName = subjectVisit.VisitName,
|
||||
// TrialId = subjectVisit.TrialId,
|
||||
// SubjectVisitId = subjectVisit.Id,
|
||||
|
||||
// //GeneralId = subjectVisit.Id,
|
||||
// //byzhouhang
|
||||
// ObjectRelationParentId = subjectVisit.Id,
|
||||
// }, new
|
||||
// {
|
||||
// QcQuestionAnswerCommands = await Getdata(entitylist),
|
||||
// });
|
||||
|
||||
|
||||
//}
|
||||
|
||||
//async Task<List<AnswerDto>> Getdata(List<TrialQCQuestionAnswer> questionAnswers)
|
||||
//{
|
||||
// var ids = questionAnswers.Select(x => x.TrialQCQuestionConfigureId).ToList();
|
||||
// var trialQCQuestionConfigureDatas = await _dbContext.TrialQCQuestionConfigure.Where(x => ids.Contains(x.Id)).ToListAsync();
|
||||
// var collect = questionAnswers.GroupJoin(trialQCQuestionConfigureDatas, one => one.TrialQCQuestionConfigureId, two => two.Id, (x, y) => new { one = x, two = y })
|
||||
// .SelectMany(a => a.two.DefaultIfEmpty(), (c, d) => new { c = c.one, d })
|
||||
// .OrderBy(x => x.d.ShowOrder)
|
||||
// .Select(o => new AnswerDto()
|
||||
// {
|
||||
// QuestionName = o.d.QuestionName,
|
||||
// Answer = o.c.Answer,
|
||||
// }).ToList();
|
||||
// return collect;
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
@ -1504,7 +1437,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var entity = item.Entity as TrialSiteSurvey;
|
||||
if (entity.TrialSite == null)
|
||||
{
|
||||
entity.TrialSite = await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.SiteId == entity.SiteId && x.TrialId == entity.TrialId).FirstOrDefaultAsync();
|
||||
entity.TrialSite = await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.Id == entity.TrialSiteId && x.TrialId == entity.TrialId).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
if (entity.PreliminaryUser == null)
|
||||
|
@ -1714,7 +1647,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
if (entity.TrialSite == null)
|
||||
{
|
||||
entity.TrialSite = await _dbContext.TrialSite.Where(x => x.TrialId == entity.TrialId && x.SiteId == entity.SiteId).IgnoreQueryFilters().FirstOrDefaultAsync();
|
||||
entity.TrialSite = await _dbContext.TrialSite.Where(x => x.Id == entity.TrialSiteId).IgnoreQueryFilters().FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
await InsertInspection<TrialSiteUser>(item.Entity as TrialSiteUser, type, x => new InspectionConvertDTO
|
||||
|
@ -1736,17 +1669,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var entity = item.Entity as Subject;
|
||||
var finalSubjectVisitName = await _dbContext.SubjectVisit.AsNoTracking().Where(x => x.Id == entity.FinalSubjectVisitId && entity.FinalSubjectVisitId != null).Select(x => x.VisitName).FirstOrDefaultAsync();
|
||||
|
||||
//var trialSiteCode = await _dbContext.TrialSite.Where(t => t.TrialId == entity.TrialId && t.SiteId == entity.SiteId).Select(t => t.TrialSiteCode).FirstOrDefaultAsync();
|
||||
|
||||
var trialSiteId = await _dbContext.TrialSite.Where(t => t.TrialId == entity.TrialId && t.SiteId == entity.SiteId).Select(t => t.Id).FirstOrDefaultAsync();
|
||||
|
||||
await InsertInspection<Subject>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
SubjectId = x.Id,
|
||||
SiteId = x.SiteId,
|
||||
|
||||
TrialSiteId = x.TrialSiteId,
|
||||
|
||||
//项目的信息 找离的最近的项目稽查信息
|
||||
ObjectRelationParentId = trialSiteId,
|
||||
ObjectRelationParentId = entity.TrialSiteId,
|
||||
}, new
|
||||
{
|
||||
FinalSubjectVisitName = finalSubjectVisitName,
|
||||
|
@ -1861,7 +1792,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
SubjectId = x.SubjectId,
|
||||
SubjectVisitId = x.Id,
|
||||
SiteId = x.SiteId,
|
||||
|
||||
TrialSiteId = x.TrialSiteId,
|
||||
|
||||
ExtraIndentification = extraIdentification,
|
||||
|
||||
|
@ -2090,7 +2022,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var clinicalDataTrialSet = await _dbContext.ClinicalDataTrialSet.Where(t => t.Id == clinicalData.ClinicalDataTrialSetId).FirstOrDefaultAsync();
|
||||
|
||||
SubjectVisit? visit = await _dbContext.SubjectVisit.Where(x => x.Id == clinicalData.ReadingId).FirstOrDefaultAsync();
|
||||
Site? siteInfo = null;
|
||||
TrialSite? siteInfo = null;
|
||||
Subject? subject = null;
|
||||
|
||||
//阅片标准
|
||||
|
@ -2105,7 +2037,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
if (visit != null)
|
||||
{
|
||||
siteInfo = await _dbContext.Site.Where(x => x.Id == visit.SiteId).FirstOrDefaultAsync();
|
||||
siteInfo = await _dbContext.TrialSite.Where(x => x.Id == visit.TrialSiteId).FirstOrDefaultAsync();
|
||||
subject = await _dbContext.Subject.Where(x => x.Id == clinicalData.SubjectId).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
|
@ -2117,7 +2049,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
SubjectVisitId = subjectVisitId,
|
||||
}, new
|
||||
{
|
||||
SiteCode = siteInfo == null ? "" : siteInfo.SiteCode,
|
||||
SiteCode = siteInfo == null ? "" : siteInfo.TrialSiteCode,
|
||||
SubjectCode = subject == null ? "" : subject.Code,
|
||||
VisitName = visit == null ? "" : visit.VisitName,
|
||||
clinicalDataTrialSet.ClinicalDataSetName,
|
||||
|
@ -2140,7 +2072,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var clinicalDataTrialSet = await _dbContext.ClinicalDataTrialSet.Where(t => t.Id == entity.ClinicalDataTrialSetId).FirstOrDefaultAsync();
|
||||
|
||||
SubjectVisit? visit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.ReadingId).FirstOrDefaultAsync();
|
||||
Site? siteInfo = null;
|
||||
TrialSite? siteInfo = null;
|
||||
Subject? subject = null;
|
||||
|
||||
//阅片标准
|
||||
|
@ -2155,7 +2087,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
if (visit != null)
|
||||
{
|
||||
siteInfo = await _dbContext.Site.Where(x => x.Id == visit.SiteId).FirstOrDefaultAsync();
|
||||
siteInfo = await _dbContext.TrialSite.Where(x => x.Id == visit.TrialSiteId).FirstOrDefaultAsync();
|
||||
subject = await _dbContext.Subject.Where(x => x.Id == entity.SubjectId).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
|
@ -2167,7 +2099,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
SubjectVisitId = subjectVisitId,
|
||||
}, new
|
||||
{
|
||||
SiteCode = siteInfo == null ? "" : siteInfo.SiteCode,
|
||||
SiteCode = siteInfo == null ? "" : siteInfo.TrialSiteCode,
|
||||
SubjectCode = subject == null ? "" : subject.Code,
|
||||
VisitName = visit == null ? "" : visit.VisitName,
|
||||
clinicalDataTrialSet.ClinicalDataSetName,
|
||||
|
@ -2328,8 +2260,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var siteCodes = string.Empty;
|
||||
if (entity.ReadingScope == ReadingScopeEnum.Site)
|
||||
{
|
||||
var siteIds = entity.ReadingPeriodSites.Select(t => t.SiteId).ToList();
|
||||
var nameList = _dbContext.TrialSite.Where(c => c.TrialId == entity.TrialId && siteIds.Contains(c.SiteId)).Select(t => t.TrialSiteCode).ToList();
|
||||
var siteIds = entity.ReadingPeriodSites.Select(t => t.TrialSiteId).ToList();
|
||||
var nameList = _dbContext.TrialSite.Where(c => c.TrialId == entity.TrialId && siteIds.Contains(c.Id)).Select(t => t.TrialSiteCode).ToList();
|
||||
|
||||
siteCodes = String.Join(',', nameList);
|
||||
}
|
||||
|
@ -2421,12 +2353,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
|
||||
Subject subject = await _dbContext.Subject.Where(x => x.Id == readModule.SubjectId).FirstOrDefaultAsync();
|
||||
Site siteInfo = await _dbContext.Site.Where(x => x.Id == subject.SiteId).FirstOrDefaultAsync();
|
||||
TrialSite siteInfo = await _dbContext.TrialSite.Where(x => x.Id == subject.TrialSiteId).FirstOrDefaultAsync();
|
||||
|
||||
var clinicalDataSetNameList = clinicalDataTrialSetList.Select(x => x.ClinicalDataSetName).ToList();
|
||||
objData= new
|
||||
{
|
||||
SiteCode = siteInfo == null ? "" : siteInfo.SiteCode,
|
||||
SiteCode = siteInfo == null ? "" : siteInfo.TrialSiteCode,
|
||||
SubjectCode = subject == null ? "" : subject.Code,
|
||||
LatestScanDate = latestScanDate,
|
||||
ClinicalDataSetName = string.Join(",", clinicalDataSetNameList),
|
||||
|
@ -2464,7 +2396,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var readModuleCriterionFrom = await _dbContext.ReadModuleCriterionFrom.Where(t => t.ReadModuleId == entity.Id).FirstOrDefaultAsync();
|
||||
var latestScanDate = await _dbContext.ReadModule.Where(t => t.Id == entity.Id).Select(x => x.SubjectVisit.LatestScanDate).FirstOrDefaultAsync();
|
||||
Site? siteInfo = null;
|
||||
TrialSite? siteInfo = null;
|
||||
Subject? subject = null;
|
||||
//阅片标准
|
||||
|
||||
|
@ -2486,7 +2418,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
|
||||
subject = await _dbContext.Subject.Where(x => x.Id == entity.SubjectId).FirstOrDefaultAsync();
|
||||
siteInfo = await _dbContext.Site.Where(x => x.Id == subject.SiteId).FirstOrDefaultAsync();
|
||||
siteInfo = await _dbContext.TrialSite.Where(x => x.Id == subject.TrialSiteId).FirstOrDefaultAsync();
|
||||
|
||||
var clinicalDataSetNameList = clinicalDataTrialSetList.Select(x => x.ClinicalDataSetName).ToList().Distinct();
|
||||
|
||||
|
@ -2496,7 +2428,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
objData=new
|
||||
{
|
||||
SiteCode = siteInfo == null ? "" : siteInfo.SiteCode,
|
||||
SiteCode = siteInfo == null ? "" : siteInfo.TrialSiteCode,
|
||||
SubjectCode = subject == null ? "" : subject.Code,
|
||||
LatestScanDate = latestScanDate,
|
||||
ClinicalDataSetName = string.Join(",", clinicalDataSetNameList),
|
||||
|
@ -3473,7 +3405,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
InspectionGeneralData generalData = new InspectionGeneralData()
|
||||
{
|
||||
SiteId = inspection.SiteId,
|
||||
TrialSiteId=inspection.TrialSiteId,
|
||||
SubjectId = inspection.SubjectId,
|
||||
SubjectVisitId = inspection.SubjectVisitId,
|
||||
TrialId = inspection.TrialId,
|
||||
|
@ -3486,14 +3418,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
if (inspection.VisitTaskId != null)
|
||||
{
|
||||
|
||||
if (generalData.TrialId == null || generalData.SiteId == null || generalData.SubjectId == null || generalData.TrialReadingCriterionId == null)
|
||||
if (generalData.TrialId == null || generalData.TrialSiteId == null || generalData.SubjectId == null || generalData.TrialReadingCriterionId == null)
|
||||
{
|
||||
var info = await _dbContext.VisitTask.Where(x => x.Id == inspection.VisitTaskId).Select(x => new { SubjectCode = x.Subject.Code, TrialSiteCode = x.Subject.TrialSite.TrialSiteCode, SubjectId = x.SubjectId, x.Subject.SiteId, x.TrialId, x.SourceSubjectVisitId, ReadModuleSubjectVisitId = (Guid?)x.ReadModule.SubjectVisitId, x.TrialReadingCriterionId }).FirstOrDefaultAsync();
|
||||
var info = await _dbContext.VisitTask.Where(x => x.Id == inspection.VisitTaskId).Select(x => new { SubjectCode = x.Subject.Code, TrialSiteCode = x.Subject.TrialSite.TrialSiteCode, SubjectId = x.SubjectId, x.Subject.TrialSiteId, x.TrialId, x.SourceSubjectVisitId, ReadModuleSubjectVisitId = (Guid?)x.ReadModule.SubjectVisitId, x.TrialReadingCriterionId }).FirstOrDefaultAsync();
|
||||
|
||||
generalData.TrialReadingCriterionId = info?.TrialReadingCriterionId ?? generalData.TrialReadingCriterionId;
|
||||
generalData.TrialId = info?.TrialId ?? generalData.TrialId;
|
||||
generalData.SubjectId = info?.SubjectId ?? generalData.SubjectId;
|
||||
generalData.SiteId = info?.SiteId ?? generalData.SiteId;
|
||||
generalData.TrialSiteId = info?.TrialSiteId ?? generalData.TrialSiteId;
|
||||
generalData.SubjectVisitId = info?.SourceSubjectVisitId != null ? info?.SourceSubjectVisitId : (info?.ReadModuleSubjectVisitId != null ? info?.ReadModuleSubjectVisitId : null);
|
||||
|
||||
//以后移除
|
||||
|
@ -3517,14 +3449,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
if (inspection.SubjectVisitId != null)
|
||||
{
|
||||
if (generalData.TrialId == null || generalData.SiteId == null || generalData.SubjectId == null)
|
||||
if (generalData.TrialId == null || generalData.TrialSiteId == null || generalData.SubjectId == null)
|
||||
{
|
||||
var info = await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x =>
|
||||
new { x.SubjectId, x.SiteId, x.TrialId, SubjectCode = x.Subject.Code, TrialSiteCode = x.Subject.TrialSite.TrialSiteCode }).FirstOrDefaultAsync();
|
||||
new { x.SubjectId, x.TrialSiteId, x.TrialId, SubjectCode = x.Subject.Code, TrialSiteCode = x.Subject.TrialSite.TrialSiteCode }).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
generalData.TrialId = info?.TrialId ?? generalData.TrialId;
|
||||
generalData.SiteId = info?.SiteId ?? generalData.SiteId;
|
||||
generalData.TrialSiteId = info?.TrialSiteId ?? generalData.TrialSiteId;
|
||||
generalData.SubjectId = info?.SubjectId ?? generalData.SubjectId;
|
||||
|
||||
//以后移除
|
||||
|
@ -3538,21 +3470,22 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
if (generalData.SubjectId != null)
|
||||
{
|
||||
if (generalData.TrialId == null || generalData.SiteId == null)
|
||||
if (generalData.TrialId == null || generalData.TrialSiteId == null)
|
||||
{
|
||||
var info = await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => new { SubjectId = x.Id, x.SiteId, x.TrialId, SubjectCode = x.Code, TrialSiteCode = x.TrialSite.TrialSiteCode }).FirstOrDefaultAsync();
|
||||
var info = await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => new { SubjectId = x.Id, x.TrialSiteId, x.TrialId, SubjectCode = x.Code, TrialSiteCode = x.TrialSite.TrialSiteCode }).FirstOrDefaultAsync();
|
||||
|
||||
if (info == null)
|
||||
{
|
||||
var subject = _dbContext.Subject.Find(generalData.SubjectId);
|
||||
|
||||
generalData.TrialId = subject?.TrialId;
|
||||
generalData.SiteId = subject?.SiteId;
|
||||
generalData.TrialSiteId = subject?.TrialSiteId ;
|
||||
}
|
||||
else
|
||||
{
|
||||
generalData.TrialId = info?.TrialId ?? generalData.TrialId;
|
||||
generalData.SiteId = info?.SiteId ?? generalData.SiteId;
|
||||
|
||||
generalData.TrialSiteId = info?.TrialSiteId ?? generalData.TrialSiteId;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -180,10 +180,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
|
|||
/// </summary>
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中心
|
||||
/// </summary>
|
||||
public Guid? SiteId { get; set; }
|
||||
public Guid? TrialSiteId { get;set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 受试者
|
||||
|
|
|
@ -11,19 +11,8 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
|
||||
public void Configure(EntityTypeBuilder<NoneDicomStudy> builder)
|
||||
{
|
||||
// builder
|
||||
// .HasMany(s => s.TrialSiteUserList)
|
||||
//.WithOne(c => c.DicomStudy)
|
||||
//.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
//.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
|
||||
builder
|
||||
.HasOne(s => s.TrialSite)
|
||||
.WithMany(c => c.NoneDicomStudyList)
|
||||
.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,11 +12,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
public void Configure(EntityTypeBuilder<ReadingPeriodSite> builder)
|
||||
{
|
||||
|
||||
builder
|
||||
.HasOne(s => s.TrialSite)
|
||||
.WithMany(c => c.ReadingPeriodSites)
|
||||
.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,19 +11,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
|
||||
public void Configure(EntityTypeBuilder<DicomStudy> builder)
|
||||
{
|
||||
// builder
|
||||
// .HasMany(s => s.TrialSiteUserList)
|
||||
// .WithOne(c => c.DicomStudy)
|
||||
//.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
//.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
|
||||
builder
|
||||
.HasOne(s => s.TrialSite)
|
||||
.WithMany(c => c.StudyList)
|
||||
.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
|
||||
|
||||
builder
|
||||
.HasMany(s => s.ReadingClinicalDataList)
|
||||
|
|
|
@ -12,20 +12,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
|
||||
public void Configure(EntityTypeBuilder<StudyMonitor> builder)
|
||||
{
|
||||
// builder
|
||||
// .HasMany(s => s.TrialSiteUserList)
|
||||
//.WithOne(c => c.DicomStudy)
|
||||
//.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
//.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
//builder.Property(e => e.TotalMillisecondsInterval).HasValueGenerator<UploadTotalMillisecondsInterval>().ValueGeneratedOnAdd();
|
||||
|
||||
|
||||
builder
|
||||
.HasOne(s => s.TrialSite)
|
||||
.WithMany(c => c.StudyMonitorList)
|
||||
.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,19 +11,6 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
|
||||
public void Configure(EntityTypeBuilder<Subject> builder)
|
||||
{
|
||||
// 从 Subject 到 TrialSiteUserList 会用两个建
|
||||
//builder
|
||||
//.HasMany(s => s.TrialSiteUserList)
|
||||
//.WithOne(c => c.Subject)
|
||||
//.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
//.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
// 受试者 在项目中只有一个site 获取 TrialSiteCode 用两个键
|
||||
builder
|
||||
.HasOne(s => s.TrialSite)
|
||||
.WithMany(c => c.SubjectList)
|
||||
.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
//不能同时配置一对多 和一对一 但是有时表要存储多的最新的 比如受试者 最新的访视 在这里要显示配置
|
||||
builder.HasOne(s => s.LatestSubjectVisit);
|
||||
|
|
|
@ -11,20 +11,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
|
||||
public void Configure(EntityTypeBuilder<SubjectVisit> builder)
|
||||
{
|
||||
// SubjectVisit 从TrialSite 导航获取 TrialSiteCode 用两个键连接
|
||||
builder
|
||||
.HasOne(s => s.TrialSite)
|
||||
.WithMany(c => c.SubjectVisitList)
|
||||
.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
|
||||
// 从 SubjectVisit 到 TrialSiteUserList 会用两个建 这里不行,添加受试者的时候,批量添加访视的时候,siteId trialId 会重复 所以不能这样搞
|
||||
// modelBuilder.Entity<SubjectVisit>()
|
||||
//.HasMany(s => s.TrialSiteUserList)
|
||||
//.WithOne(c => c.SubjectVisit)
|
||||
//.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
//.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
|
||||
|
||||
builder.HasOne(s => s.Subject).WithMany(sv => sv.SubjectVisitList);
|
||||
|
|
|
@ -11,12 +11,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
|
||||
public void Configure(EntityTypeBuilder<TrialSite> builder)
|
||||
{
|
||||
//从 TrialSite 导航到TrialUserSite (Site下负责的CRC用户 )会用两个建 trial Site列表会用到
|
||||
builder
|
||||
.HasMany(s => s.CRCUserList)
|
||||
.WithOne(c => c.TrialSite)
|
||||
.HasForeignKey(s => new { s.TrialId, s.SiteId })
|
||||
.HasPrincipalKey(c => new { c.TrialId, c.SiteId });
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -36,18 +31,5 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
}
|
||||
}
|
||||
|
||||
//public class SubjectCriteriaEvaluationVisitFilterConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluationVisitFilter>
|
||||
//{
|
||||
|
||||
|
||||
// public void Configure(EntityTypeBuilder<SubjectCriteriaEvaluationVisitFilter> builder)
|
||||
// {
|
||||
// builder
|
||||
// .HasMany(s => s.SubjectCriterionTaskList)
|
||||
// .WithOne(c => c.SubjectCriteriaEvaluationVisitFilter)
|
||||
// .HasForeignKey(s => new { s.SubjectId, s.TrialReadingCriterionId })
|
||||
// .HasPrincipalKey(c => new { c.SubjectId, c.TrialReadingCriterionId });
|
||||
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue