Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
1688392216
|
@ -1031,13 +1031,12 @@
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetIRReadingDownloadStudyInfo(IRaCIS.Core.Application.Contracts.IRDownloadQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject})">
|
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetIRReadingDownloadStudyInfo(IRaCIS.Core.Application.Contracts.IRDownloadQuery)">
|
||||||
<summary>
|
<summary>
|
||||||
IR 阅片页面获取下载检查的信息 会根据标准进行过滤检查,(后端要考虑到一致性分析 subjectCode的问题)
|
IR 阅片页面获取下载检查的信息 会根据标准进行过滤检查,(后端要考虑到一致性分析 subjectCode的问题)
|
||||||
检查在访视下面,所以需要传递下载的访视Id,另外下载访视下面那些检查,就把访视下的对应的检查Id 丢到数组里就好
|
检查在访视下面,所以需要传递下载的访视Id,另外下载访视下面那些检查,就把访视下的对应的检查Id 丢到数组里就好
|
||||||
</summary>
|
</summary>
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<param name="_subjectRepository"></param>
|
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetTaskUploadedDicomStudyList(IRaCIS.Core.Application.Contracts.IRTaskUploadedDicomStudyQuery)">
|
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetTaskUploadedDicomStudyList(IRaCIS.Core.Application.Contracts.IRTaskUploadedDicomStudyQuery)">
|
||||||
|
@ -1047,6 +1046,20 @@
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.DownloadImageSuccess(System.Guid)">
|
||||||
|
<summary>
|
||||||
|
影像下载成功回调
|
||||||
|
</summary>
|
||||||
|
<param name="trialImageDownloadId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetTrialDownloadList(IRaCIS.Core.Application.Contracts.TrialIamgeDownQuery)">
|
||||||
|
<summary>
|
||||||
|
项目影像下载监控列表
|
||||||
|
</summary>
|
||||||
|
<param name="inQuery"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.RequestPackageAndAnonymizImage(System.Guid,System.Guid,System.Boolean,System.Boolean)">
|
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.RequestPackageAndAnonymizImage(System.Guid,System.Guid,System.Boolean,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
打包和匿名化影像 默认是匿名化打包,也可以不匿名化打包
|
打包和匿名化影像 默认是匿名化打包,也可以不匿名化打包
|
||||||
|
@ -4732,11 +4745,6 @@
|
||||||
文件路径
|
文件路径
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataTrialSetView.CreateTime">
|
|
||||||
<summary>
|
|
||||||
创建时间
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataTrialSetView.CreateUserId">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataTrialSetView.CreateUserId">
|
||||||
<summary>
|
<summary>
|
||||||
创建人
|
创建人
|
||||||
|
@ -14778,13 +14786,6 @@
|
||||||
影像阅片临床数据签名
|
影像阅片临床数据签名
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingClinicalDataService.DealVisiTaskClinicalDataSignedAsync(System.Guid,System.Guid,System.Guid,System.Boolean,System.Guid)">
|
|
||||||
<summary>
|
|
||||||
一致性分析的临床数据
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingClinicalDataService.GetTrialClinicalDataSelect(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialClinicalDataSelectIndto)">
|
<member name="M:IRaCIS.Application.Services.ReadingClinicalDataService.GetTrialClinicalDataSelect(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialClinicalDataSelectIndto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取下拉菜单
|
获取下拉菜单
|
||||||
|
|
|
@ -221,7 +221,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public class AnalysisTaskView : ReadingTaskView
|
public class AnalysisTaskView : ReadingTaskView
|
||||||
{
|
{
|
||||||
public bool? IsSelfAnalysis { get; set; }
|
|
||||||
|
|
||||||
public int ConsistentClinicalDataCount { get; set; } = 0;
|
public int ConsistentClinicalDataCount { get; set; } = 0;
|
||||||
|
|
||||||
|
|
|
@ -965,7 +965,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
||||||
// .Where(x=>x.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == x.SouceReadModuleId || c.ReadingId == x.SourceSubjectVisitId)))
|
|
||||||
.Where(x => !x.Subject.IsDeleted).Where(x => (x.IsNeedClinicalDataSign && x.IsClinicalDataSign) || !x.IsNeedClinicalDataSign);
|
.Where(x => !x.Subject.IsDeleted).Where(x => (x.IsNeedClinicalDataSign && x.IsClinicalDataSign) || !x.IsNeedClinicalDataSign);
|
||||||
|
|
||||||
iRUnReadOut = new IRUnReadOutDto()
|
iRUnReadOut = new IRUnReadOutDto()
|
||||||
|
|
|
@ -821,7 +821,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.Uploader.UserName.Contains(inQuery.Uploader))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.CreateUser.UserName.Contains(inQuery.Uploader))
|
||||||
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||||
.Select(t => new UnionStudyMonitorExportDto()
|
.Select(t => new UnionStudyMonitorExportDto()
|
||||||
|
@ -838,7 +838,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
IsDicom = t.IsDicom,
|
IsDicom = t.IsDicom,
|
||||||
|
|
||||||
Uploader = t.Uploader.UserName,
|
Uploader = t.CreateUser.UserName,
|
||||||
|
|
||||||
IP = t.IP,
|
IP = t.IP,
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
|
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -551,6 +552,54 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class TrialImageDownloadView
|
||||||
|
{
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public string SubjectCode { get; set; }
|
||||||
|
|
||||||
|
public bool IsSuccess { get; set; }
|
||||||
|
|
||||||
|
public DateTime DownloadStartTime { get; set; }
|
||||||
|
public DateTime? DownloadEndTime { get; set; }
|
||||||
|
|
||||||
|
public string VisitName { get; set; }
|
||||||
|
|
||||||
|
public ImageType ImageType { get; set; }
|
||||||
|
|
||||||
|
public int NoneDicomStudyCount { get; set; }
|
||||||
|
|
||||||
|
public int DicomStudyCount { get; set; }
|
||||||
|
|
||||||
|
public int ImageCount { get; set; }
|
||||||
|
public long ImageSize { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
public string UserFullName { get; set; }
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialIamgeDownQuery:PageInput
|
||||||
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public string? SubjectCode { get; set; }
|
||||||
|
|
||||||
|
public ImageType? ImageType { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum? UserType { get; set; }
|
||||||
|
|
||||||
|
public bool? IsSuccess { get; set; }
|
||||||
|
|
||||||
|
public DateTime? DownloadStartTime { get; set; }
|
||||||
|
public DateTime? DownloadEndTime { get; set; }
|
||||||
|
|
||||||
|
public string? IP { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class SubjectVisitTaskInfo
|
public class SubjectVisitTaskInfo
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IRepository<NoneDicomStudy> _noneDicomStudyReposiotry,
|
IRepository<NoneDicomStudy> _noneDicomStudyReposiotry,
|
||||||
IRepository<NoneDicomStudyFile> _noneDicomStudyFileReposiotry,
|
IRepository<NoneDicomStudyFile> _noneDicomStudyFileReposiotry,
|
||||||
IDistributedLockProvider _distributedLockProvider) : BaseService, IDownloadAndUploadService
|
IDistributedLockProvider _distributedLockProvider,
|
||||||
|
IRepository<TrialImageDownload> _trialImageDownloadRepository,
|
||||||
|
IRepository<Subject> _subjectRepository) : BaseService, IDownloadAndUploadService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
@ -220,9 +222,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
|
|
||||||
public async Task<IResponseOutput> PreArchiveDicomStudy(PriArchiveTaskStudyCommand preArchiveStudyCommand)
|
public async Task<IResponseOutput> PreArchiveDicomStudy(PriArchiveTaskStudyCommand preArchiveStudyCommand)
|
||||||
|
@ -678,11 +677,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
var isQueryDicom = inQuery.DicomStudyIdList.Count > 0;
|
var isQueryDicom = inQuery.DicomStudyIdList.Count > 0;
|
||||||
var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0;
|
var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0;
|
||||||
|
|
||||||
|
var imageType = (isQueryDicom && isQueryNoneDicom) ? ImageType.DicomAndNoneDicom : (isQueryDicom ? ImageType.Dicom : ImageType.NoneDicom);
|
||||||
|
|
||||||
var query = from sv in _subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId)
|
var query = from sv in _subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId)
|
||||||
|
|
||||||
|
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
|
TrialId = sv.TrialId,
|
||||||
SubjectCode = sv.Subject.Code,
|
SubjectCode = sv.Subject.Code,
|
||||||
VisitName = sv.VisitName,
|
VisitName = sv.VisitName,
|
||||||
|
|
||||||
|
@ -719,14 +721,32 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
file.FileName,
|
file.FileName,
|
||||||
file.Path,
|
file.Path,
|
||||||
file.FileType
|
file.FileType,
|
||||||
|
file.FileSize,
|
||||||
})
|
})
|
||||||
}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = query.FirstOrDefault();
|
var result = query.FirstOrDefault();
|
||||||
|
|
||||||
return ResponseOutput.Ok(result);
|
var preDownloadInfo = new TrialImageDownload()
|
||||||
|
{
|
||||||
|
Id = NewId.NextSequentialGuid(),
|
||||||
|
TrialId = result.TrialId,
|
||||||
|
SubjectCode = result.SubjectCode,
|
||||||
|
IP = _userInfo.IP,
|
||||||
|
DownloadStartTime = DateTime.Now,
|
||||||
|
IsSuccess = false,
|
||||||
|
ImageType = imageType,
|
||||||
|
VisitName = string.Join(" | ", result.VisitName),
|
||||||
|
NoneDicomStudyCount = result.NoneDicomStudyList.Count(),
|
||||||
|
DicomStudyCount = result.StudyList.Count(),
|
||||||
|
ImageCount = result.StudyList.Sum(s => s.SeriesList.Sum(s => s.InstanceList.Count())) + result.NoneDicomStudyList.Sum(s => s.FileList.Count()),
|
||||||
|
ImageSize = result.StudyList.Sum(t => t.SeriesList.Sum(s => s.InstanceList.Sum(i => i.FileSize))) + result.NoneDicomStudyList.Sum(t => t.FileList.Sum(s => s.FileSize))
|
||||||
|
?? 0
|
||||||
|
};
|
||||||
|
await _trialImageDownloadRepository.AddAsync(preDownloadInfo, true);
|
||||||
|
return ResponseOutput.Ok(result, preDownloadInfo.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -752,10 +772,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == isAnalysisCreate)
|
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect)
|
||||||
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
//这里过滤是否是一致性分析的
|
||||||
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync();
|
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync();
|
||||||
|
|
||||||
foreach (var item in list)
|
foreach (var item in list)
|
||||||
|
@ -817,17 +837,18 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
/// 检查在访视下面,所以需要传递下载的访视Id,另外下载访视下面那些检查,就把访视下的对应的检查Id 丢到数组里就好
|
/// 检查在访视下面,所以需要传递下载的访视Id,另外下载访视下面那些检查,就把访视下的对应的检查Id 丢到数组里就好
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inQuery"></param>
|
/// <param name="inQuery"></param>
|
||||||
/// <param name="_subjectRepository"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> GetIRReadingDownloadStudyInfo(IRDownloadQuery inQuery, [FromServices] IRepository<Subject> _subjectRepository)
|
public async Task<IResponseOutput> GetIRReadingDownloadStudyInfo(IRDownloadQuery inQuery)
|
||||||
{
|
{
|
||||||
var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
|
var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
|
||||||
.Select(t => new { t.IsImageFilter, t.CriterionModalitys }).FirstNotNullAsync();
|
.Select(t => new { t.IsImageFilter, t.CriterionModalitys, t.TrialId }).FirstNotNullAsync();
|
||||||
|
|
||||||
var isQueryDicom = inQuery.DicomStudyIdList.Count > 0;
|
var isQueryDicom = inQuery.DicomStudyIdList.Count > 0;
|
||||||
var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0;
|
var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0;
|
||||||
|
|
||||||
|
var imageType = (isQueryDicom && isQueryNoneDicom) ? ImageType.DicomAndNoneDicom : (isQueryDicom ? ImageType.Dicom : ImageType.NoneDicom);
|
||||||
|
|
||||||
var taskIdList = inQuery.SubjectVisitTaskList.Select(t => t.TaskId).ToList();
|
var taskIdList = inQuery.SubjectVisitTaskList.Select(t => t.TaskId).ToList();
|
||||||
|
|
||||||
var subjectVisitIdList = inQuery.SubjectVisitTaskList.Select(t => t.SubjectVisitId).ToList();
|
var subjectVisitIdList = inQuery.SubjectVisitTaskList.Select(t => t.SubjectVisitId).ToList();
|
||||||
|
@ -856,7 +877,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
InstancePathList = z.DicomInstanceList.Select(k => new
|
InstancePathList = z.DicomInstanceList.Select(k => new
|
||||||
{
|
{
|
||||||
k.Path
|
k.Path,
|
||||||
|
k.FileSize
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -874,7 +896,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
file.FileName,
|
file.FileName,
|
||||||
file.Path,
|
file.Path,
|
||||||
file.FileType
|
file.FileType,
|
||||||
|
file.FileSize
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
@ -885,7 +908,25 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(result);
|
var preDownloadInfo = new TrialImageDownload()
|
||||||
|
{
|
||||||
|
Id = NewId.NextSequentialGuid(),
|
||||||
|
TrialId = info.TrialId,
|
||||||
|
SubjectCode = inQuery.SubjectCode,
|
||||||
|
IP=_userInfo.IP,
|
||||||
|
DownloadStartTime = DateTime.Now,
|
||||||
|
IsSuccess = false,
|
||||||
|
ImageType = imageType,
|
||||||
|
VisitName = string.Join(" | ", result.Select(t => t.VisitName).OrderBy(t => t).ToList()),
|
||||||
|
NoneDicomStudyCount = result.Sum(t => t.NoneDicomStudyList.Count()),
|
||||||
|
DicomStudyCount = result.Sum(t => t.StudyList.Count()),
|
||||||
|
ImageCount = result.Sum(t => t.StudyList.Sum(s => s.SeriesList.Sum(s => s.InstancePathList.Count())) + t.NoneDicomStudyList.Sum(s => s.FileList.Count())),
|
||||||
|
ImageSize = result.Sum(t => t.StudyList.Sum(t => t.SeriesList.Sum(s => s.InstancePathList.Sum(i => i.FileSize))) + t.NoneDicomStudyList.Sum(t => t.FileList.Sum(s => s.FileSize))
|
||||||
|
) ?? 0
|
||||||
|
};
|
||||||
|
|
||||||
|
await _trialImageDownloadRepository.AddAsync(preDownloadInfo,true);
|
||||||
|
return ResponseOutput.Ok(result, preDownloadInfo.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -937,6 +978,40 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 影像下载成功回调
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="trialImageDownloadId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IResponseOutput> DownloadImageSuccess(Guid trialImageDownloadId)
|
||||||
|
{
|
||||||
|
await _trialImageDownloadRepository.UpdatePartialFromQueryAsync(t => t.Id == trialImageDownloadId, u => new TrialImageDownload()
|
||||||
|
{ DownloadEndTime = DateTime.Now, IsSuccess = true }, true);
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目影像下载监控列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inQuery"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<PageOutput<TrialImageDownloadView>> GetTrialDownloadList(TrialIamgeDownQuery inQuery)
|
||||||
|
{
|
||||||
|
var query = _trialImageDownloadRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
|
.WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.SubjectCode.Contains(inQuery.SubjectCode))
|
||||||
|
.WhereIf(inQuery.IP.IsNotNullOrEmpty(), t => t.IP.Contains(inQuery.IP))
|
||||||
|
.WhereIf(inQuery.ImageType != null, t => t.ImageType == inQuery.ImageType)
|
||||||
|
.WhereIf(inQuery.UserType != null, t => t.CreateUser.UserTypeEnum == inQuery.UserType)
|
||||||
|
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||||
|
.WhereIf(inQuery.DownloadStartTime != null, t => t.DownloadStartTime >= inQuery.DownloadStartTime)
|
||||||
|
.WhereIf(inQuery.DownloadEndTime != null, t => t.DownloadEndTime <= inQuery.DownloadEndTime)
|
||||||
|
|
||||||
|
.ProjectTo<TrialImageDownloadView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
return await query.ToPagedListAsync(inQuery);
|
||||||
|
}
|
||||||
|
|
||||||
#region 之前后端下载废弃
|
#region 之前后端下载废弃
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1361,9 +1436,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 按照任务为维度 展示上传的列表 废弃
|
#region 按照任务为维度 展示上传的列表 废弃
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// IR 影像上传任务列表 --old 20240903 界面调整,现在先废弃
|
/// IR 影像上传任务列表 --old 20240903 界面调整,现在先废弃
|
||||||
|
|
|
@ -411,7 +411,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||||
|
|
||||||
Uploader = t.Uploader.UserName,
|
Uploader = t.CreateUser.UserName,
|
||||||
|
|
||||||
UploadTime = t.CreateTime
|
UploadTime = t.CreateTime
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.Uploader.UserName.Contains(inQuery.Uploader))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.CreateUser.UserName.Contains(inQuery.Uploader))
|
||||||
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||||
.Select(t => new UnionStudyMonitorModel()
|
.Select(t => new UnionStudyMonitorModel()
|
||||||
|
@ -514,7 +514,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||||
|
|
||||||
Uploader = t.Uploader.UserName,
|
Uploader = t.CreateUser.UserName,
|
||||||
|
|
||||||
UploadTime = t.CreateTime,
|
UploadTime = t.CreateTime,
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<DicomStudy, StudyDTO>().IncludeMembers(t => t.Subject, u => u.SubjectVisit)
|
CreateMap<DicomStudy, StudyDTO>().IncludeMembers(t => t.Subject, u => u.SubjectVisit)
|
||||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteName))
|
.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.UploaderFirstName, u => u.MapFrom(s => s.CreateUser.FirstName))
|
||||||
.ForMember(d => d.UploaderLastName, u => u.MapFrom(s => s.Uploader.LastName))
|
.ForMember(d => d.UploaderLastName, u => u.MapFrom(s => s.CreateUser.LastName))
|
||||||
.ForMember(d => d.UploadedTime, u => u.MapFrom(s => s.CreateTime));
|
.ForMember(d => d.UploadedTime, u => u.MapFrom(s => s.CreateTime));
|
||||||
|
|
||||||
CreateMap<Subject, StudyDTO>();
|
CreateMap<Subject, StudyDTO>();
|
||||||
|
@ -69,7 +69,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<DicomStudy, QAStudyInfoDTO>()
|
CreateMap<DicomStudy, QAStudyInfoDTO>()
|
||||||
.ForMember(o => o.IsCompleteClinicalData, t => t.MapFrom(u => !u.ReadingClinicalDataList.Any(x => x.ReadingClinicalDataPDFList.Count() == 0)))
|
.ForMember(o => o.IsCompleteClinicalData, t => t.MapFrom(u => !u.ReadingClinicalDataList.Any(x => x.ReadingClinicalDataPDFList.Count() == 0)))
|
||||||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.Uploader.LastName + " / " + u.Uploader.FirstName))
|
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUser.LastName + " / " + u.CreateUser.FirstName))
|
||||||
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id))
|
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id))
|
||||||
.ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t => t.FailedFileCount > 0)))
|
.ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t => t.FailedFileCount > 0)))
|
||||||
.ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct())));
|
.ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct())));
|
||||||
|
@ -143,7 +143,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.NoneDicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.NoneDicomStudyList))
|
.ForMember(d => d.NoneDicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.NoneDicomStudyList))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
CreateMap<TrialImageDownload, TrialImageDownloadView>()
|
||||||
|
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUser.FullName))
|
||||||
|
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1279,7 +1279,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public bool IsBaseLine { get; set; }
|
public bool IsBaseLine { get; set; }
|
||||||
public bool IsUrgent { get; set; }
|
public bool IsUrgent { get; set; }
|
||||||
public Guid? ClinicalDataSignUserId { get; set; }
|
|
||||||
|
|
||||||
public bool IsQCConfirmedReupload { get; set; }
|
public bool IsQCConfirmedReupload { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -536,7 +536,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
// 一致性核查文件
|
// 一致性核查文件
|
||||||
CreateMap<InspectionFile, GetUserUploadFileDto>()
|
CreateMap<InspectionFile, GetUserUploadFileDto>()
|
||||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName + "/" + t.User.LastName));
|
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUser.FullName));
|
||||||
|
|
||||||
|
|
||||||
//CRC 质疑列表
|
//CRC 质疑列表
|
||||||
|
|
|
@ -376,11 +376,11 @@ namespace IRaCIS.Application.Services
|
||||||
return ResponseOutput.Result(result);
|
return ResponseOutput.Result(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 一致性分析的临床数据
|
///// 一致性分析的临床数据
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="inDto"></param>
|
///// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
//public async Task<IResponseOutput> ReadClinicalDataSign(ReadingClinicalDataSignIndto inDto)
|
//public async Task<IResponseOutput> ReadClinicalDataSign(ReadingClinicalDataSignIndto inDto)
|
||||||
//{
|
//{
|
||||||
|
|
||||||
|
|
|
@ -161,11 +161,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public List<string> TrialCriterionNameList { get; set; }
|
public List<string> TrialCriterionNameList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreateTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建人
|
/// 创建人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -337,7 +337,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<DicomStudy, SelectStudyView>()
|
CreateMap<DicomStudy, SelectStudyView>()
|
||||||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.Uploader.LastName + " / " + u.Uploader.FirstName))
|
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUser.LastName + " / " + u.CreateUser.FirstName))
|
||||||
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id));
|
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id));
|
||||||
|
|
||||||
CreateMap<VisitTask, HaveGeneratedTaskDto>()
|
CreateMap<VisitTask, HaveGeneratedTaskDto>()
|
||||||
|
|
|
@ -132,7 +132,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
||||||
|
|
||||||
TrialSiteCode = dicomStudy.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = dicomStudy.Subject.TrialSite.TrialSiteCode,
|
||||||
|
|
||||||
Uploader = dicomStudy.Uploader.UserName,
|
Uploader = dicomStudy.CreateUser.UserName,
|
||||||
|
|
||||||
UploadTime = dicomStudy.CreateTime
|
UploadTime = dicomStudy.CreateTime
|
||||||
};
|
};
|
||||||
|
|
|
@ -191,8 +191,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<SignDTO, TrialSign>();
|
CreateMap<SignDTO, TrialSign>();
|
||||||
|
|
||||||
CreateMap<TrialStateChange, TrialStateChangeDTO>()
|
CreateMap<TrialStateChange, TrialStateChangeDTO>()
|
||||||
.ForMember(t => t.UserRealName, u => u.MapFrom(c => c.User.FullName))
|
.ForMember(t => t.UserRealName, u => u.MapFrom(c => c.CreateUser.FullName))
|
||||||
.ForMember(t => t.UserName, u => u.MapFrom(c => c.User.UserName));
|
.ForMember(t => t.UserName, u => u.MapFrom(c => c.CreateUser.UserName));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -159,10 +159,10 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = confirm.User.FullName,
|
RealName = confirm.ConfirmUser.FullName,
|
||||||
UserName = confirm.User.UserName,
|
UserName = confirm.ConfirmUser.UserName,
|
||||||
UserTypeId = confirm.User.UserTypeId,
|
UserTypeId = confirm.ConfirmUser.UserTypeId,
|
||||||
UserTypeShortName = confirm.User.UserTypeRole.UserTypeShortName,
|
UserTypeShortName = confirm.ConfirmUser.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
FullFilePath = sysDoc.Path
|
FullFilePath = sysDoc.Path
|
||||||
};
|
};
|
||||||
|
|
|
@ -65,40 +65,7 @@ namespace IRaCIS.Core.Application.Triggers
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 触发临床数据
|
|
||||||
//if (context.ChangeType == ChangeType.Added)
|
|
||||||
//{
|
|
||||||
// var cRCClinicalDatas = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == context.Entity.TrialId && x.UploadRole == UploadRole.CRC && x.IsConfirm)
|
|
||||||
|
|
||||||
// .Select(x => new
|
|
||||||
// {
|
|
||||||
// x.Id,
|
|
||||||
// x.ClinicalDataLevel,
|
|
||||||
// }).ToListAsync();
|
|
||||||
|
|
||||||
// List<ReadingClinicalData> readingClinicals = new List<ReadingClinicalData>();
|
|
||||||
// readingClinicals.AddRange(
|
|
||||||
|
|
||||||
// cRCClinicalDatas.WhereIf(!context.Entity.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Select(x => new ReadingClinicalData()
|
|
||||||
// {
|
|
||||||
// ClinicalDataTrialSetId = x.Id,
|
|
||||||
// IsVisit = true,
|
|
||||||
// SubjectId = context.Entity.SubjectId,
|
|
||||||
// ReadingId = context.Entity.Id,
|
|
||||||
// TrialId = context.Entity.TrialId
|
|
||||||
|
|
||||||
// }).ToList()
|
|
||||||
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
|
||||||
// await _readingClinicalDataRepository.AddRangeAsync(readingClinicals);
|
|
||||||
// await _readingClinicalDataRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,10 +31,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public User RequestReReadingConfirmUser { get; set; }
|
public User RequestReReadingConfirmUser { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Trial Trial { get; set; }
|
public Trial Trial { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
|
|
||||||
#region 领域事件 仅仅允许通过提供的方法进行操作
|
#region 领域事件 仅仅允许通过提供的方法进行操作
|
||||||
|
[JsonIgnore]
|
||||||
private readonly List<DomainEvent> _domainEvents = [];
|
private readonly List<DomainEvent> _domainEvents = [];
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -68,6 +68,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("CreateUserId")]
|
||||||
|
[JsonIgnore]
|
||||||
|
public User CreateUser { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class BaseAddDeleteAuditEntity : Entity, IAuditAdd, ISoftDelete
|
public abstract class BaseAddDeleteAuditEntity : Entity, IAuditAdd, ISoftDelete
|
||||||
|
@ -78,6 +82,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public Guid? DeleteUserId { get; set; }
|
public Guid? DeleteUserId { get; set; }
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
public DateTime? DeletedTime { get; set; }
|
public DateTime? DeletedTime { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("CreateUserId")]
|
||||||
|
[JsonIgnore]
|
||||||
|
public User CreateUser { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class BaseFullAuditEntity : Entity, IAuditUpdate, IAuditAdd
|
public abstract class BaseFullAuditEntity : Entity, IAuditUpdate, IAuditAdd
|
||||||
|
@ -86,6 +94,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
public Guid UpdateUserId { get; set; }
|
public Guid UpdateUserId { get; set; }
|
||||||
public DateTime UpdateTime { get; set; }
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("CreateUserId")]
|
||||||
|
[JsonIgnore]
|
||||||
|
public User CreateUser { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,6 +110,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
public Guid UpdateUserId { get; set; }
|
public Guid UpdateUserId { get; set; }
|
||||||
public DateTime UpdateTime { get; set; }
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("CreateUserId")]
|
||||||
|
[JsonIgnore]
|
||||||
|
public User CreateUser { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,6 +124,8 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class BaseAuditUpdateEntity : Entity, IAuditUpdate
|
public abstract class BaseAuditUpdateEntity : Entity, IAuditUpdate
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("ConfirmUserId")]
|
[ForeignKey("ConfirmUserId")]
|
||||||
public User User { get; set; }
|
public User ConfirmUser { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[ForeignKey("SubjectVisitId")]
|
[ForeignKey("SubjectVisitId")]
|
||||||
public SubjectVisit SubjectVisit { get; set; }
|
public SubjectVisit SubjectVisit { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User Uploader { get; set; }
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<ReadingClinicalData> ReadingClinicalDataList { get; set; }
|
public List<ReadingClinicalData> ReadingClinicalDataList { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("TrialId")]
|
[ForeignKey("TrialId")]
|
||||||
public Trial Trial { get; set; }
|
public Trial Trial { get; set; }
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User Uploader { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Subject Subject { get; set; }
|
public Subject Subject { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public Subject Subject { get; set; }
|
public Subject Subject { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User Uploader { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public Guid SeqId { get; set; }
|
public Guid SeqId { get; set; }
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Domain.Models
|
||||||
|
{
|
||||||
|
[Table("TrialImageDownload")]
|
||||||
|
public class TrialImageDownload : BaseFullAuditEntity
|
||||||
|
{
|
||||||
|
#region 导航属性
|
||||||
|
[JsonIgnore]
|
||||||
|
public Trial Trial { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public string SubjectCode { get; set; }
|
||||||
|
|
||||||
|
public bool IsSuccess { get; set; }
|
||||||
|
|
||||||
|
public DateTime DownloadStartTime { get; set; }
|
||||||
|
public DateTime? DownloadEndTime { get; set; }
|
||||||
|
|
||||||
|
public string VisitName { get; set; }
|
||||||
|
|
||||||
|
public ImageType ImageType { get; set; }
|
||||||
|
|
||||||
|
public int NoneDicomStudyCount { get; set; }
|
||||||
|
|
||||||
|
public int DicomStudyCount { get; set; }
|
||||||
|
|
||||||
|
public int ImageCount { get; set; }
|
||||||
|
public long ImageSize { get; set; }
|
||||||
|
|
||||||
|
public string IP { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ImageType
|
||||||
|
{
|
||||||
|
Dicom = 1,
|
||||||
|
NoneDicom = 2,
|
||||||
|
DicomAndNoneDicom = 3
|
||||||
|
};
|
||||||
|
}
|
|
@ -24,8 +24,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<SystemNoticeUserRead> NoticeUserReadList { get; set; } = new List<SystemNoticeUserRead>();
|
public List<SystemNoticeUserRead> NoticeUserReadList { get; set; } = new List<SystemNoticeUserRead>();
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,17 +16,13 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<SystemDocConfirmedUser> SystemDocConfirmedList { get; set; }
|
public List<SystemDocConfirmedUser> SystemDocConfirmedList { get; set; }
|
||||||
[JsonIgnore]
|
|
||||||
public List<UserDoctor> UserDoctors { get; set; } = new List<UserDoctor>();
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<TrialUser> UserTrials { get; set; } = new List<TrialUser>();
|
public List<TrialUser> UserTrials { get; set; } = new List<TrialUser>();
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<VisitTask> VisitTaskList { get; set; }
|
public List<VisitTask> VisitTaskList { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("DoctorId")]
|
|
||||||
public Doctor Doctor { get; set; }
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,9 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public SubjectVisit SubjectVisit { get; set; }
|
public SubjectVisit SubjectVisit { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public TrialSite TrialSite { get; set; }
|
public TrialSite TrialSite { get; set; }
|
||||||
[JsonIgnore]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
||||||
public VisitTask VisitTask { get; set; }
|
public VisitTask VisitTask { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
|
|
|
@ -18,8 +18,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public Guid SubjectVisitId { get; set; }
|
public Guid SubjectVisitId { get; set; }
|
||||||
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public UserTypeEnum UserTypeEnum { get; set; }
|
public UserTypeEnum UserTypeEnum { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public class InspectionFile : BaseAddAuditEntity
|
public class InspectionFile : BaseAddAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User User { get; set; }
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public string FileName { get; set; } = string.Empty;
|
public string FileName { get; set; } = string.Empty;
|
||||||
|
|
|
@ -9,9 +9,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("LatestReplyUserId")]
|
[ForeignKey("LatestReplyUserId")]
|
||||||
public User LatestReplyUser { get; set; }
|
public User LatestReplyUser { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -9,9 +9,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public QCChallenge QCChallenge { get; set; }
|
public QCChallenge QCChallenge { get; set; }
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public string TalkContent { get; set; } = string.Empty;
|
public string TalkContent { get; set; } = string.Empty;
|
||||||
|
|
|
@ -47,9 +47,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,102 +0,0 @@
|
||||||
--同步重阅申请表结构后,再维护该字段
|
|
||||||
|
|
||||||
UPDATE VisitTaskReReading
|
|
||||||
SET TrialId = VisitTask.TrialId
|
|
||||||
FROM VisitTaskReReading
|
|
||||||
INNER JOIN VisitTask ON VisitTaskReReading.OriginalReReadingTaskId = VisitTask.Id;
|
|
||||||
|
|
||||||
delete VisitTaskReReading where TrialId is NULL
|
|
||||||
|
|
||||||
|
|
||||||
--数据库列字符串列 长度
|
|
||||||
SELECT t.name AS table_name,
|
|
||||||
c.name AS column_name,
|
|
||||||
d.name AS constraint_name,
|
|
||||||
ty.Name as typeName,
|
|
||||||
c.max_length as length
|
|
||||||
FROM sys.tables t
|
|
||||||
INNER JOIN sys.columns c ON c.object_id = t.object_id
|
|
||||||
LEFT JOIN sys.default_constraints d ON d.parent_object_id = c.object_id AND d.parent_column_id = c.column_id
|
|
||||||
INNER JOIN sys.types ty on ty.system_type_id = c.system_type_id
|
|
||||||
AND ty.name in ('nvarchar', 'varchar', 'char', 'nchar')
|
|
||||||
WHERE c.max_length < 100 AND c.max_length > 0
|
|
||||||
|
|
||||||
--带维护sql 的查询
|
|
||||||
|
|
||||||
SELECT t.name AS table_name,
|
|
||||||
c.name AS column_name,
|
|
||||||
d.name AS constraint_name,
|
|
||||||
ty.Name as typeName,
|
|
||||||
c.max_length as length,
|
|
||||||
'ALTER TABLE ' + QUOTENAME(t.name) + ' DROP CONSTRAINT [' + d.name + ']' AS drop_constraint_sql,
|
|
||||||
CASE WHEN c.max_length = -1 THEN 'ALTER TABLE ' + QUOTENAME(t.name) + ' ALTER COLUMN ' + QUOTENAME(c.name) + ' NVARCHAR(MAX)' + CASE WHEN c.is_nullable = 1 THEN ' NULL' ELSE ' NOT NULL' END
|
|
||||||
WHEN c.max_length > 0 AND c.max_length < 100 THEN 'ALTER TABLE ' + QUOTENAME(t.name) + ' ALTER COLUMN ' + QUOTENAME(c.name) + ' NVARCHAR(' + CAST(100 AS VARCHAR(10)) + ')' + CASE WHEN c.is_nullable = 1 THEN ' NULL' ELSE ' NOT NULL' END
|
|
||||||
WHEN c.max_length = 8000 THEN 'ALTER TABLE ' + QUOTENAME(t.name) + ' ALTER COLUMN ' + QUOTENAME(c.name) + ' NVARCHAR(' + CAST(4000 AS VARCHAR(10)) + ')' + CASE WHEN c.is_nullable = 1 THEN ' NULL' ELSE ' NOT NULL' END
|
|
||||||
ELSE 'ALTER TABLE ' + QUOTENAME(t.name) + ' ALTER COLUMN ' + QUOTENAME(c.name) + ' ' + ty.name + '(' + CAST(c.max_length AS VARCHAR(10)) + ')' + CASE WHEN c.is_nullable = 1 THEN ' NULL' ELSE ' NOT NULL' END
|
|
||||||
END AS AlterColumnSQL,
|
|
||||||
'ALTER TABLE ' + QUOTENAME(t.name) + ' ADD CONSTRAINT ' +'DF_'+t.name+ '_'+ c.name + ' DEFAULT ' + d.definition + ' FOR ' + QUOTENAME(c.name) AS add_constraint_sql
|
|
||||||
FROM sys.tables t
|
|
||||||
INNER JOIN sys.columns c ON c.object_id = t.object_id
|
|
||||||
LEFT JOIN sys.default_constraints d ON d.parent_object_id = c.object_id AND d.parent_column_id = c.column_id
|
|
||||||
INNER JOIN sys.types ty on ty.system_type_id = c.system_type_id
|
|
||||||
AND ty.name in ('nvarchar', 'varchar', 'char', 'nchar')
|
|
||||||
and (ty.name != 'nvarchar' or (ty.name = 'nvarchar' and (c.max_length = -1 or (c.max_length < 100 and c.max_length > 0))))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--修改默认约束名
|
|
||||||
SELECT
|
|
||||||
OBJECT_SCHEMA_NAME(dc.parent_object_id) AS schema_name,
|
|
||||||
OBJECT_NAME(dc.parent_object_id) AS table_name,
|
|
||||||
dc.name AS constraint_name,
|
|
||||||
COL_NAME(dc.parent_object_id, dc.parent_column_id) AS column_name,
|
|
||||||
CONCAT('EXEC sp_rename N''', dc.name, ''', N''DF_', OBJECT_NAME(dc.parent_object_id), '_', COL_NAME(dc.parent_object_id, dc.parent_column_id), '''') AS executable_sql
|
|
||||||
FROM
|
|
||||||
sys.default_constraints dc
|
|
||||||
WHERE
|
|
||||||
dc.is_system_named = 1 -- 只查询自动生成的系统默认约束
|
|
||||||
AND dc.name NOT LIKE 'DF\[_%]\[_%]' ESCAPE '\'; -- 排除符合 "DF_表名_列名" 格式的约束名
|
|
||||||
|
|
||||||
SELECT
|
|
||||||
sys.tables.name AS table_name,
|
|
||||||
sys.columns.name AS column_name,
|
|
||||||
sys.default_constraints.name AS constraint_name,
|
|
||||||
'EXEC sp_rename N''' + sys.default_constraints.name + ''', N''DF_' + sys.tables.name + '_' + sys.columns.name + ''''
|
|
||||||
AS executable_sql
|
|
||||||
FROM sys.default_constraints
|
|
||||||
INNER JOIN sys.tables ON sys.default_constraints.parent_object_id = sys.tables.object_id
|
|
||||||
INNER JOIN sys.columns ON sys.default_constraints.parent_column_id = sys.columns.column_id AND sys.tables.object_id = sys.columns.object_id
|
|
||||||
|
|
||||||
|
|
||||||
--修改主键
|
|
||||||
SELECT
|
|
||||||
OBJECT_NAME(i.object_id) AS '表名',
|
|
||||||
COL_NAME(ic.object_id, ic.column_id) AS '列名',
|
|
||||||
i.name AS '索引名',
|
|
||||||
CONCAT('EXEC sp_rename ''', i.name, ''', ''PK_', OBJECT_NAME(i.object_id), '_',
|
|
||||||
COL_NAME(ic.object_id, ic.column_id), '''')
|
|
||||||
AS '修改索引名为 PK_表名_字段名',
|
|
||||||
i.is_primary_key AS '是否主键'
|
|
||||||
FROM
|
|
||||||
sys.indexes i
|
|
||||||
INNER JOIN
|
|
||||||
sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
|
|
||||||
WHERE
|
|
||||||
(i.is_primary_key = 1 OR i.is_unique_constraint = 1)
|
|
||||||
AND OBJECTPROPERTY(i.object_id, 'IsSystemTable') = 0
|
|
||||||
AND OBJECTPROPERTY(i.object_id, 'IsMSShipped') = 0
|
|
||||||
AND OBJECT_NAME(i.object_id) <> 'sysdiagrams';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------维护临床数据是否应用 之前默认都是应用 现在添加字段 把状态都改为应用
|
|
||||||
update ClinicalDataTrialSet set IsApply=1
|
|
||||||
|
|
||||||
|
|
||||||
--维护 删除临床数据配置,导致删除阅片期问题
|
|
||||||
delete ReadingClinicalData
|
|
||||||
from ReadingClinicalData
|
|
||||||
INNER JOIN ReadModule on ReadingClinicalData.ReadingId = ReadModule.Id
|
|
||||||
|
|
||||||
|
|
||||||
where not EXISTS (select Id from TrialClinicalDataSetCriterion where ReadModule.TrialReadingCriterionId =TrialClinicalDataSetCriterion.TrialReadingCriterionId)
|
|
|
@ -1,15 +0,0 @@
|
||||||
-- 查询指定 code 的记录及其父项
|
|
||||||
SELECT *
|
|
||||||
FROM Dictionary
|
|
||||||
WHERE code = 'BusinessModule'
|
|
||||||
|
|
||||||
UNION
|
|
||||||
|
|
||||||
-- 查询指定 code 的记录及其子项
|
|
||||||
SELECT t.*
|
|
||||||
FROM Dictionary t
|
|
||||||
INNER JOIN (
|
|
||||||
SELECT Id
|
|
||||||
FROM Dictionary
|
|
||||||
WHERE code = 'BusinessModule'
|
|
||||||
) AS selected ON t.ParentId = selected.Id;
|
|
|
@ -1,188 +0,0 @@
|
||||||
--- 1、变更的表名
|
|
||||||
|
|
||||||
--EXEC sp_rename 'old_table_name', 'new_table_name';
|
|
||||||
EXEC sp_rename 'CriterionNidus', 'CriterionNidusSystem';
|
|
||||||
EXEC sp_rename 'ReadingCriterionDictionary', 'ReadingSystemCriterionDictionary';
|
|
||||||
|
|
||||||
|
|
||||||
---- 2、处理发布环境的表数据拆分
|
|
||||||
|
|
||||||
--会直接创建表 CriterionNidusSystem_copy
|
|
||||||
--SELECT *
|
|
||||||
--INTO CriterionNidusSystem_copy
|
|
||||||
--FROM CriterionNidusSystem
|
|
||||||
--WHERE IsSystemCriterion = 0;
|
|
||||||
|
|
||||||
--创建CriterionNidusTrial 将数据迁移过来
|
|
||||||
SELECT *
|
|
||||||
INTO CriterionNidusTrial
|
|
||||||
FROM CriterionNidusSystem
|
|
||||||
WHERE IsSystemCriterion = 0;
|
|
||||||
|
|
||||||
|
|
||||||
SELECT *
|
|
||||||
INTO ReadingTrialCriterionDictionary
|
|
||||||
FROM ReadingSystemCriterionDictionary
|
|
||||||
WHERE IsSystemCriterion = 0;
|
|
||||||
|
|
||||||
|
|
||||||
----- 三、维护稽查数据
|
|
||||||
select Count(*) from DataInspection where EntityName='CriterionNidus'
|
|
||||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add'
|
|
||||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Update'
|
|
||||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted'
|
|
||||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial'
|
|
||||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial/Auto'
|
|
||||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Update/IsTrial'
|
|
||||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted/IsTrial'
|
|
||||||
|
|
||||||
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary'
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType'
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType'
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType'
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType'
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType/IsTrial'
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType/IsTrial'
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType/IsTrial'
|
|
||||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType/IsTrial'
|
|
||||||
|
|
||||||
|
|
||||||
--系统 CriterionNidusSystem
|
|
||||||
update DataInspection SET Identification='CriterionNidusSystem/Add', EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add'
|
|
||||||
update DataInspection SET Identification='CriterionNidusSystem/Update' , EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Update'
|
|
||||||
update DataInspection SET Identification='CriterionNidusSystem/Deleted', EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted'
|
|
||||||
|
|
||||||
--项目 CriterionNidusTrial
|
|
||||||
update DataInspection SET Identification='CriterionNidusTrial/Add' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial'
|
|
||||||
update DataInspection SET Identification='CriterionNidusTrial/Add/Auto' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial/Auto'
|
|
||||||
update DataInspection SET Identification='CriterionNidusTrial/Update' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Update/IsTrial'
|
|
||||||
update DataInspection SET Identification='CriterionNidusTrial/Deleted' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted/IsTrial'
|
|
||||||
|
|
||||||
--系统ReadingSystemCriterionDictionary
|
|
||||||
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/QuestionType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType'
|
|
||||||
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/LesionType' , EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType'
|
|
||||||
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/OncologyAssessType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType'
|
|
||||||
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/GlobalAssessType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType'
|
|
||||||
|
|
||||||
--项目ReadingTrialCriterionDictionary
|
|
||||||
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/QuestionType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType/IsTrial'
|
|
||||||
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/LesionType' , EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType/IsTrial'
|
|
||||||
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/OncologyAssessType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType/IsTrial'
|
|
||||||
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/GlobalAssessType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType/IsTrial'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--国际化indication 维护
|
|
||||||
UPDATE Trial SET IndicationEnum = CASE
|
|
||||||
WHEN Indication = '肺癌' THEN 0
|
|
||||||
WHEN Indication = '实体瘤' THEN 1
|
|
||||||
WHEN Indication = '淋巴瘤' THEN 2
|
|
||||||
WHEN Indication = '乳腺癌' THEN 3
|
|
||||||
WHEN Indication = '白血病' THEN 4
|
|
||||||
WHEN Indication = '胃癌' THEN 5
|
|
||||||
WHEN Indication = '肝癌' THEN 6
|
|
||||||
WHEN Indication = '骨髓癌' THEN 7
|
|
||||||
WHEN Indication = '肠癌' THEN 8
|
|
||||||
WHEN Indication = '前列腺癌' THEN 9
|
|
||||||
WHEN Indication = '肾癌' THEN 10
|
|
||||||
WHEN Indication = '宫颈癌' THEN 11
|
|
||||||
WHEN Indication = '头颈部癌' THEN 12
|
|
||||||
WHEN Indication = '卵巢癌' THEN 13
|
|
||||||
WHEN Indication = '胆癌' THEN 14
|
|
||||||
WHEN Indication = '食管癌' THEN 15
|
|
||||||
WHEN Indication = '腹膜癌' THEN 16
|
|
||||||
WHEN Indication = '上皮癌' THEN 17
|
|
||||||
WHEN Indication = '黑色素瘤' THEN 18
|
|
||||||
WHEN Indication = '甲状腺癌' THEN 19
|
|
||||||
WHEN Indication = '输卵管癌' THEN 20
|
|
||||||
WHEN Indication = '胰腺癌' THEN 21
|
|
||||||
WHEN Indication = '膀胱癌' THEN 22
|
|
||||||
WHEN Indication = '鼻咽癌' THEN 23
|
|
||||||
WHEN Indication = '胶质瘤' THEN 24
|
|
||||||
WHEN Indication = '子宫癌' THEN 25
|
|
||||||
WHEN Indication = '尿道癌' THEN 26
|
|
||||||
WHEN Indication = '软组织肉瘤' THEN 27
|
|
||||||
WHEN Indication = '神经内分泌瘤' THEN 28
|
|
||||||
WHEN Indication = '睾丸癌' THEN 29
|
|
||||||
WHEN Indication = '骨肉瘤' THEN 30
|
|
||||||
WHEN Indication = '间皮瘤' THEN 31
|
|
||||||
WHEN Indication = '绒毛膜病' THEN 32
|
|
||||||
WHEN Indication = '胃肠道间质瘤' THEN 33
|
|
||||||
WHEN Indication = '骨癌' THEN 34
|
|
||||||
WHEN Indication = '脑瘤' THEN 35
|
|
||||||
WHEN Indication = '胸腺瘤' THEN 36
|
|
||||||
WHEN IndicationTypeId = '437a81b3-c5ad-49fd-82a1-8f441c4ba8da' THEN 37
|
|
||||||
WHEN IndicationTypeId = '433d9801-5fa0-42bb-604b-08d9c1232c4f' THEN 38
|
|
||||||
WHEN IndicationTypeId = 'a5fdd212-a716-4df4-604c-08d9c1232c4f' THEN 39
|
|
||||||
ELSE IndicationEnum
|
|
||||||
END;
|
|
||||||
|
|
||||||
select DISTINCT IndicationEnum ,Indication from Trial
|
|
||||||
|
|
||||||
update Trial set Indication='' where IndicationEnum not in (37,38,39)
|
|
||||||
|
|
||||||
|
|
||||||
-- 附加评估发布设置之前的默认值
|
|
||||||
Update ReadingQuestionCriterionTrial set IsAdditionalAssessment=0,IsAutoCreate=1
|
|
||||||
|
|
||||||
--- 维护临床数据英文名称
|
|
||||||
update clinicalDataSystemSet set clinicalDataSystemSet.ClinicalDataSetEnName=DictionaryChild.Value from Dictionary DictionaryChild
|
|
||||||
inner join clinicalDataSystemSet on CONVERT(varchar(200),clinicalDataSystemSet.ClinicalDataSetEnum) =DictionaryChild.Code
|
|
||||||
inner join Dictionary DictionaryParent on DictionaryParent.Id=DictionaryChild.ParentId
|
|
||||||
where DictionaryParent.Code='ClinicalDataType'
|
|
||||||
go
|
|
||||||
|
|
||||||
|
|
||||||
update ClinicalDataTrialSet set ClinicalDataTrialSet.ClinicalDataSetEnName=clinicalDataSystemSet.ClinicalDataSetEnName from clinicalDataSystemSet
|
|
||||||
inner join ClinicalDataTrialSet on ClinicalDataTrialSet.SystemClinicalDataSetId=clinicalDataSystemSet.Id
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---------------维护项目器官表 将器官信息在项目表里面存冗余
|
|
||||||
update OrganTrialInfo set
|
|
||||||
OrganTrialInfo.PartEN=OrganInfo.PartEN ,
|
|
||||||
OrganTrialInfo.Part=OrganInfo.Part,
|
|
||||||
OrganTrialInfo.TULOC=OrganInfo.TULOC,
|
|
||||||
OrganTrialInfo.TULOCEN=OrganInfo.TULOCEN,
|
|
||||||
OrganTrialInfo.TULAT=OrganInfo.TULAT,
|
|
||||||
OrganTrialInfo.TULATEN=OrganInfo.TULATEN,
|
|
||||||
OrganTrialInfo.IsLymphNodes=OrganInfo.IsLymphNodes,
|
|
||||||
OrganTrialInfo.IsCanEditPosition=OrganInfo.IsCanEditPosition,
|
|
||||||
OrganTrialInfo.Classification=OrganInfo.Classification,
|
|
||||||
OrganTrialInfo.ClassificationEN=OrganInfo.ClassificationEN,
|
|
||||||
OrganTrialInfo.ShowOrder=OrganInfo.ShowOrder,
|
|
||||||
OrganTrialInfo.OrganType=OrganInfo.OrganType
|
|
||||||
from OrganInfo inner join OrganTrialInfo
|
|
||||||
on OrganInfo.Id=OrganTrialInfo.OrganInfoId where OrganTrialInfo.OrganType is null
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
update FrontAuditConfig set Identification='' where Identification is NULL
|
|
||||||
|
|
||||||
--新增字段
|
|
||||||
|
|
||||||
ALTER TABLE [dbo].[Trial] ADD [AttendedReviewerTypes] varchar(255) COLLATE Chinese_PRC_CI_AS DEFAULT '' NOT NULL
|
|
||||||
GO
|
|
||||||
|
|
||||||
ALTER TABLE [dbo].[Trial] ADD [DeclarationTypes] varchar(255) COLLATE Chinese_PRC_CI_AS DEFAULT '' NOT NULL
|
|
||||||
GO
|
|
||||||
|
|
||||||
|
|
||||||
--维护sql
|
|
||||||
UPDATE Trial SET AttendedReviewerTypes = '|' + CAST(AttendedReviewerType AS VARCHAR(10)) + '|'
|
|
||||||
|
|
||||||
update Trial set DeclarationTypes ='|' + (select Code from Dictionary where Id= Trial.DeclarationTypeId) + '|'
|
|
||||||
|
|
||||||
|
|
||||||
--验证sql
|
|
||||||
select DISTINCT AttendedReviewerType ,AttendedReviewerTypes, DeclarationTypeId, Dictionary.Code,DeclarationTypes,Dictionary.[Value] from Trial inner join Dictionary on Trial.DeclarationTypeId=Dictionary.Id
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
-- 20221223同步表数据
|
|
||||||
-- Dictionary FrontAuditConfig Menu UserType UserTypeMenu ReadingQuestionSystem ReadingTableQuestionSystem OrganInfo ReadingQuestionCriterionSystem TumorAssessment
|
|
||||||
-- 需要特别注意的表 CriterionNidus ReadingCriterionDictionary
|
|
||||||
|
|
||||||
select * from CriterionNidus where IsSystemCriterion=1
|
|
||||||
select * from ReadingCriterionDictionary where IsSystemCriterion=1
|
|
||||||
delete CriterionNidus where IsSystemCriterion=1
|
|
||||||
delete ReadingCriterionDictionary where IsSystemCriterion=1
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,107 +0,0 @@
|
||||||
|
|
||||||
--无序维护sql
|
|
||||||
update VisitTask set TaskBlindName='Follow Up '
|
|
||||||
from VisitTask
|
|
||||||
INNER join ReadingQuestionCriterionTrial on VisitTask.TrialReadingCriterionId=ReadingQuestionCriterionTrial.Id
|
|
||||||
INNER join SubjectVisit on VisitTask.SourceSubjectVisitId=SubjectVisit.Id
|
|
||||||
where SubjectVisit.IsBaseLine=0 and ReadingQuestionCriterionTrial.IsReadingTaskViewInOrder=0
|
|
||||||
|
|
||||||
|
|
||||||
-- 有序维护sql
|
|
||||||
update VisitTask set TaskBlindName='Follow-up '+ cast(sv.rn as varchar)
|
|
||||||
from VisitTask
|
|
||||||
join ReadingQuestionCriterionTrial on VisitTask.TrialReadingCriterionId=ReadingQuestionCriterionTrial.Id
|
|
||||||
--join SubjectVisit on VisitTask.SourceSubjectVisitId=SubjectVisit.Id
|
|
||||||
join ( select Id SubjectVisitId, IsBaseLine, ROW_NUMBER() over( partition by SubjectId order by VisitNum asc )-1 rn,VisitNum from SubjectVisit where IsLostVisit=0) sv on VisitTask.SourceSubjectVisitId=sv.SubjectVisitId
|
|
||||||
where sv.IsBaseLine=0 and ReadingQuestionCriterionTrial.IsReadingTaskViewInOrder=1
|
|
||||||
|
|
||||||
update VisitTask set TaskBlindName='Baseline' from VisitTask
|
|
||||||
join SubjectVisit on VisitTask.SourceSubjectVisitId=SubjectVisit.Id where SubjectVisit.IsBaseLine=1
|
|
||||||
|
|
||||||
update Dictionary set code =0 where Id='15bb5529-a6fe-439f-5196-08da179a7080'
|
|
||||||
update Dictionary set code =1 where Id='0628d7be-afba-4471-5197-08da179a7080'
|
|
||||||
update Dictionary set code =2 where Id='41bfec4b-dbfb-401d-5198-08da179a7080'
|
|
||||||
update Dictionary set code =-1 where Id='1fac678d-69b6-41c3-5199-08da179a7080'
|
|
||||||
go
|
|
||||||
|
|
||||||
|
|
||||||
update ReadingQuestionCriterionTrial set DigitPlaces=DigitPlaces-1 where DigitPlaces is not null
|
|
||||||
update ReadingQuestionCriterionTrial set DigitPlaces=-1 where DigitPlaces=3
|
|
||||||
|
|
||||||
|
|
||||||
--2022 12 -9 同步
|
|
||||||
-- Dictionary UserTypeMenu Menu FrontAuditConfig ReadingQuestionCriterionSystem ReadingTableQuestionSystem
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--阅片标准维护
|
|
||||||
update DataInspection set ObjectRelationParentId3 = (select top 1 TrialReadingCriterionId from SubjectUser where Id =DataInspection.GeneralId) where EntityName='SubjectUser'
|
|
||||||
update DataInspection set ObjectRelationParentId2 = (select top 1 TrialReadingCriterionId from ReadingPeriodSet where Id =DataInspection.GeneralId) where EntityName='ReadingPeriodSet'
|
|
||||||
update DataInspection set ObjectRelationParentId2 = (select top 1 TrialReadingCriterionId from ReadModule where Id =DataInspection.GeneralId) where EntityName='ReadModule'
|
|
||||||
update DataInspection set ObjectRelationParentId2 = (select top 1 TrialReadingCriterionId from TaskConsistentRule where Id =DataInspection.GeneralId) where EntityName='TaskConsistentRule'
|
|
||||||
update DataInspection set ObjectRelationParentId3 = (select top 1 TrialReadingCriterionId from VisitTask where Id =DataInspection.GeneralId) where EntityName='VisitTask'
|
|
||||||
|
|
||||||
update ReadingTableQuestionTrial set DictionaryCode='' where DictionaryCode is null
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--维护RowInfo的OrderMark
|
|
||||||
|
|
||||||
select * from ReadingTableAnswerRowInfo
|
|
||||||
update ReadingTableAnswerRowInfo set ReadingTableAnswerRowInfo.OrderMark=ReadingQuestionTrial.OrderMark from ReadingQuestionTrial
|
|
||||||
inner join ReadingTableAnswerRowInfo on ReadingTableAnswerRowInfo.QuestionId=ReadingQuestionTrial.Id
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
delete ReadingTableQuestionAnswer where TableQuestionId in (select id from ReadingTableQuestionTrial where QuestionMark=3)
|
|
||||||
go
|
|
||||||
delete ReadingTableQuestionTrial where QuestionMark=3
|
|
||||||
go
|
|
||||||
delete ReadingTableQuestionSystem where QuestionMark=3
|
|
||||||
go
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------2022-12-13----------------------------
|
|
||||||
update ReadingQuestionSystem set DefaultValue=''
|
|
||||||
update ReadingQuestionTrial set DefaultValue=''
|
|
||||||
|
|
||||||
----------删除之后要重新同步器官数据
|
|
||||||
delete OrganInfo where SystemCriterionId='B0450000-9B8E-98FA-6658-08DA4DAB1FAC'
|
|
||||||
delete OrganTrialInfo
|
|
||||||
where (select count(1) as num from OrganInfo where OrganInfo.Id = OrganTrialInfo.OrganInfoId) = 0
|
|
||||||
|
|
||||||
|
|
||||||
----2022-12-15
|
|
||||||
Update Trial set BlindBaseLineName='Baseline',BlindFollowUpPrefix='Follow-up'
|
|
||||||
update DataInspection set VisitTaskId = GeneralId where EntityName='VisitTask'
|
|
||||||
|
|
||||||
--发布之前备份 前后端代码和完整的数据库
|
|
||||||
|
|
||||||
--2022-12-17 维护稽查数据
|
|
||||||
update DataInspection set VisitTaskId= substring(JsonDetail,CHARINDEX('OriginalReReadingTaskId":"',JsonDetail)+26,36) where EntityName='VisitTaskReReading'
|
|
||||||
update DataInspection set VisitTaskId= substring(JsonDetail,CHARINDEX('VisitTaskId":"',JsonDetail)+14,36) where EntityName='TaskMedicalReview'
|
|
||||||
update DataInspection set VisitTaskId= substring(JsonDetail,CHARINDEX('VisitTaskId":"',JsonDetail)+14,36) where EntityName='ReadingOncologyTaskInfo'
|
|
||||||
update DataInspection set VisitTaskId= substring(JsonDetail,CHARINDEX('VisitTaskId":"',JsonDetail)+14,36) where EntityName='ReadingMedicalReviewDialog'
|
|
||||||
update DataInspection set VisitTaskId= substring(JsonDetail,CHARINDEX('VisitTaskId":"',JsonDetail)+14,36) where EntityName='ReadingTaskQuestionAnswer'
|
|
||||||
update DataInspection set VisitTaskId= substring(JsonDetail,CHARINDEX('VisitTaskId":"',JsonDetail)+14,36) where EntityName='ReadingTableAnswerRowInfo'
|
|
||||||
update DataInspection set VisitTaskId= substring(JsonDetail,CHARINDEX('VisitTaskId":"',JsonDetail)+14,36) where EntityName='ReadingMedicineQuestionAnswer'
|
|
||||||
|
|
||||||
update DataInspection set SubjectVisitId=null where EntityName='ReadModule'
|
|
||||||
update DataInspection set TrialReadingCriterionId=(select TrialReadingCriterionId from VisitTask where Id =VisitTaskId) where VisitTaskId is not null and TrialReadingCriterionId is null
|
|
||||||
|
|
||||||
|
|
||||||
--稽查bug 数据维护
|
|
||||||
|
|
||||||
update DataInspection set TrialReadingCriterionId= substring(JsonDetail,CHARINDEX('TrialCriterionId":"',JsonDetail)+19 +
|
|
||||||
( DATALENGTH( left( cast([JsonDetail] as VARCHAR(2500)) ,charindex('TrialCriterionId":"',JsonDetail)) )
|
|
||||||
-LEN ( left( cast([JsonDetail] as VARCHAR(2500)) ,charindex('TrialCriterionId":"',JsonDetail)) )
|
|
||||||
),36) where EntityName='ReadingTableQuestionTrial'
|
|
||||||
update DataInspection set TrialReadingCriterionId= substring(JsonDetail,CHARINDEX('ReadingQuestionCriterionTrialId":"',JsonDetail)+34,36) where EntityName='ReadingQuestionTrial'
|
|
||||||
update DataInspection set TrialReadingCriterionId= GeneralId where EntityName='ReadingQuestionCriterionTrial'
|
|
||||||
|
|
||||||
--维护临床数据状态
|
|
||||||
update ReadingClinicalData set IsSign=1 where EXISTS(select * from SubjectVisit where Id=ReadingId and IsBaseLine=1 and IsConfirmedClinicalData=1) and IsSign=0
|
|
||||||
update ReadingClinicalData set ReadingClinicalDataState=3 where IsSign=1 and ReadingClinicalDataState!=3
|
|
||||||
|
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
-- 插入字典code
|
|
||||||
|
|
||||||
|
|
||||||
declare @TrialCriterionId uniqueidentifier='54650000-3E2C-0016-75E6-08DB320098F3'
|
|
||||||
|
|
||||||
insert TrialCriterionDictionaryCode (Id,TrialCriterionId,Code,CreateTime,CreateUserId)
|
|
||||||
select NEWID(),
|
|
||||||
@TrialCriterionId,Code,'2020-01-01','00000000-0000-0000-0000-000000000000' from SystemCriterionDictionaryCode
|
|
||||||
|
|
||||||
inner join ReadingQuestionCriterionTrial on SystemCriterionDictionaryCode.SystemCriterionId=ReadingQuestionCriterionTrial.ReadingQuestionCriterionSystemId and ReadingQuestionCriterionTrial.Id=
|
|
||||||
@TrialCriterionId
|
|
||||||
|
|
||||||
where Code not in (select Code from TrialCriterionDictionaryCode where TrialCriterionId=
|
|
||||||
@TrialCriterionId)
|
|
||||||
|
|
||||||
-- 插入字典
|
|
||||||
insert into ReadingCriterionDictionary (Id,CriterionId,DictionaryId,CreateTime,CreateUserId,IsSystemCriterion,ParentCode,IsBaseLineUse,IsFollowVisitUse)
|
|
||||||
|
|
||||||
select NEWID(), @TrialCriterionId,DictionaryId,'2020-01-01','00000000-0000-0000-0000-000000000000',0,ParentCode,IsBaseLineUse,IsFollowVisitUse from ReadingCriterionDictionary
|
|
||||||
|
|
||||||
inner join ReadingQuestionCriterionTrial on ReadingCriterionDictionary.CriterionId=ReadingQuestionCriterionTrial.ReadingQuestionCriterionSystemId and ReadingQuestionCriterionTrial.Id=
|
|
||||||
@TrialCriterionId
|
|
||||||
|
|
||||||
where DictionaryId not in (select DictionaryId from ReadingCriterionDictionary where CriterionId=
|
|
||||||
@TrialCriterionId)
|
|
|
@ -11,9 +11,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual TrialStatusDetail TrialDetail { get; set; }
|
public virtual TrialStatusDetail TrialDetail { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
[JsonIgnore]
|
|
||||||
public Doctor Doctor { get; set; }
|
public Doctor Doctor { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[ForeignKey("TrialId")]
|
[ForeignKey("TrialId")]
|
||||||
public Trial Trial { get; set; }
|
public Trial Trial { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User User { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
|
@ -14,10 +14,12 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Trial Trial { get; set; }
|
public Trial Trial { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("UserId")]
|
[ForeignKey("UserId")]
|
||||||
public User User { get; set; }
|
public User User { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<VisitPlanInfluenceStudy> InfluenceStudyList { get; set; } = new List<VisitPlanInfluenceStudy>();
|
public List<VisitPlanInfluenceStudy> InfluenceStudyList { get; set; } = new List<VisitPlanInfluenceStudy>();
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("CreateUserId")]
|
|
||||||
public User CreateUser { get; set; }
|
|
||||||
[JsonIgnore]
|
|
||||||
[ForeignKey("VisitPlanInfluenceStatId")]
|
[ForeignKey("VisitPlanInfluenceStatId")]
|
||||||
public VisitPlanInfluenceStat VisitPlanInfluenceStat { get; set; }
|
public VisitPlanInfluenceStat VisitPlanInfluenceStat { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -527,6 +527,10 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
public virtual DbSet<EnrollReadingCriterion> EnrollReadingCriterion { get; set; }
|
public virtual DbSet<EnrollReadingCriterion> EnrollReadingCriterion { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public virtual DbSet<TrialImageDownload> TrialImageDownload { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|
||||||
{
|
|
||||||
//public class StudyConfigration : IEntityTypeConfiguration<DicomStudy>
|
|
||||||
//{
|
|
||||||
|
|
||||||
// /// <summary>
|
|
||||||
// /// 一个外键,关联多个表 ReadingId
|
|
||||||
// /// </summary>
|
|
||||||
// /// <param name="builder"></param>
|
|
||||||
// public void Configure(EntityTypeBuilder<DicomStudy> builder)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// builder
|
|
||||||
// .HasMany(s => s.ReadingClinicalDataList)
|
|
||||||
// .WithOne(c => c.DicomStudy)
|
|
||||||
// .HasForeignKey(s => new { s.StudyId })
|
|
||||||
// .HasPrincipalKey(c => new { c.Id });
|
|
||||||
|
|
||||||
|
|
||||||
// builder
|
|
||||||
// .HasMany(s => s.ReadingConsistentClinicalDataList)
|
|
||||||
// .WithOne(c => c.DicomStudy)
|
|
||||||
// .HasForeignKey(s => new { s.StudyId })
|
|
||||||
// .HasPrincipalKey(c => new { c.Id });
|
|
||||||
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//public class UserConfigration : IEntityTypeConfiguration<User>
|
|
||||||
//{
|
|
||||||
// public void Configure(EntityTypeBuilder<User> builder)
|
|
||||||
// {
|
|
||||||
// //对于阅片人来讲,会有很多任务
|
|
||||||
// builder.HasMany(t => t.VisitTaskList).WithOne(t => t.DoctorUser).HasForeignKey(t => t.DoctorUserId).IsRequired(false);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
|
|
@ -1,17 +1,17 @@
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
using System.Reflection.Emit;
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||||
{
|
{
|
||||||
public class SubjectConfigration : IEntityTypeConfiguration<Subject>
|
public class SubjectConfigration : IEntityTypeConfiguration<Subject>
|
||||||
{
|
{
|
||||||
public void Configure(EntityTypeBuilder<Subject> builder)
|
public void Configure(EntityTypeBuilder<Subject> builder)
|
||||||
{
|
{
|
||||||
|
|
||||||
//不能同时配置一对多 和一对一 但是有时表要存储多的最新的 比如受试者 最新的访视 在这里要显示配置
|
//不能同时配置一对多 和一对一 但是有时表要存储多的最新的 比如受试者 最新的访视 在这里要显示配置
|
||||||
builder.HasOne(s => s.LatestSubjectVisit).WithMany().HasForeignKey(t => t.LatestSubjectVisitId);
|
builder.HasOne(s => s.LatestSubjectVisit).WithMany().HasForeignKey(t => t.LatestSubjectVisitId);
|
||||||
builder.HasOne(s => s.FinalSubjectVisit).WithMany().HasForeignKey(t => t.FinalSubjectVisitId);
|
builder.HasOne(s => s.FinalSubjectVisit).WithMany().HasForeignKey(t => t.FinalSubjectVisitId);
|
||||||
builder.HasMany(s => s.SubjectVisitList).WithOne(sv => sv.Subject).HasForeignKey(t => t.SubjectId);
|
builder.HasMany(s => s.SubjectVisitList).WithOne(sv => sv.Subject).HasForeignKey(t => t.SubjectId);
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,8 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||||
{
|
{
|
||||||
public void Configure(EntityTypeBuilder<Dictionary> builder)
|
public void Configure(EntityTypeBuilder<Dictionary> builder)
|
||||||
{
|
{
|
||||||
|
|
||||||
//自身同时存在一对多 和一对一的关系,配置一对多的就可以,一对一 不用配置,有点奇怪
|
//自身同时存在一对多 和一对一的关系,配置一对多的就可以,一对一 不用配置,有点奇怪
|
||||||
builder.HasMany(t => t.ChildList).WithOne(t => t.Parent).HasForeignKey(d => d.ParentId);
|
builder.HasMany(t => t.ChildList).WithOne(t => t.Parent).HasForeignKey(d => d.ParentId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,4 +44,50 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||||
builder.HasMany(t => t.EarlierSubjectUserList).WithOne(t => t.ReplacedSubjectUser).HasForeignKey(t => t.ReplacedSubjectUserId);
|
builder.HasMany(t => t.EarlierSubjectUserList).WithOne(t => t.ReplacedSubjectUser).HasForeignKey(t => t.ReplacedSubjectUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class UserConfigration : IEntityTypeConfiguration<User>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<User> builder)
|
||||||
|
{
|
||||||
|
//User 和VisitTask 存在一对多的关系 这里不显式配置就报错,why?
|
||||||
|
builder.HasMany(t => t.VisitTaskList).WithOne(t => t.DoctorUser).HasForeignKey(t => t.DoctorUserId);
|
||||||
|
|
||||||
|
//builder.HasOne(t => t.Doctor).WithOne(t => t.User);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SystemDocConfirmedUserConfigration : IEntityTypeConfiguration<SystemDocConfirmedUser>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<SystemDocConfirmedUser> builder)
|
||||||
|
{
|
||||||
|
#region 不用显示配置
|
||||||
|
//// 配置 CreateUser 关系
|
||||||
|
//builder.HasOne(s => s.CreateUser)
|
||||||
|
// .WithMany() // 假设 User 表没有对应的反向导航属性,如果有,填入属性名
|
||||||
|
// .HasForeignKey(s => s.CreateUserId);
|
||||||
|
////.OnDelete(DeleteBehavior.Restrict); // 可根据业务需求调整删除行为
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// 配置 ConfirmUser 关系 (一个用户可以签名多个文档)
|
||||||
|
builder.HasOne(s => s.ConfirmUser) // ConfirmUser
|
||||||
|
.WithMany(t => t.SystemDocConfirmedList)
|
||||||
|
.HasForeignKey(s => s.ConfirmUserId);
|
||||||
|
//.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialUserConfigration : IEntityTypeConfiguration<TrialUser>
|
||||||
|
{
|
||||||
|
//当一个实体,针对同一个类,有两个一对一导航属性,但是是不同的外键,一个外键是一对一,一个是一对多,那么需要显示配置一对多的关系
|
||||||
|
public void Configure(EntityTypeBuilder<TrialUser> builder)
|
||||||
|
{
|
||||||
|
//TrialUser 和User 之间 一对多 (一个用户可以参与多个项目)
|
||||||
|
builder.HasOne(s => s.User)
|
||||||
|
.WithMany(t => t.UserTrials)
|
||||||
|
.HasForeignKey(s => s.UserId);
|
||||||
|
|
||||||
|
//TrialUser User 一对一 创建人
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,6 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class SubjectCriteriaEvaluationConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluation>
|
public class SubjectCriteriaEvaluationConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluation>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||||
//subject 删除了,但是任务没删除,导致的查询问题
|
//subject 删除了,但是任务没删除,导致的查询问题
|
||||||
builder.HasQueryFilter(b => b.Subject.IsDeleted == false);
|
builder.HasQueryFilter(b => b.Subject.IsDeleted == false);
|
||||||
|
|
||||||
//builder.HasOne(t => t.Subject).WithMany(s => s.SubjectVisitTaskList).HasForeignKey(t => t.SubjectId);
|
|
||||||
//builder.HasMany(t => t.TaskMedicalReviewList).WithOne(t => t.VisitTask).HasForeignKey(t => t.VisitTaskId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class ReadingQuestionTrialConfigration : IEntityTypeConfiguration<ReadingQuestionTrial>
|
public class ReadingQuestionTrialConfigration : IEntityTypeConfiguration<ReadingQuestionTrial>
|
||||||
|
|
|
@ -96,8 +96,11 @@ public class AuditEntityInterceptor(IUserInfo _userInfo, ILogger<AuditEntityInte
|
||||||
{
|
{
|
||||||
addEntity.CreateTime = DateTime.Now;
|
addEntity.CreateTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
if (addEntity.CreateUserId == default(Guid))
|
||||||
|
{
|
||||||
|
addEntity.CreateUserId = _userInfo.Id;
|
||||||
|
}
|
||||||
|
|
||||||
addEntity.CreateUserId = _userInfo.Id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.Entity is IAuditUpdate updateEntity)
|
if (entry.Entity is IAuditUpdate updateEntity)
|
||||||
|
@ -113,9 +116,13 @@ public class AuditEntityInterceptor(IUserInfo _userInfo, ILogger<AuditEntityInte
|
||||||
addEntity3.CreateTime = DateTime.Now;
|
addEntity3.CreateTime = DateTime.Now;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (addEntity3.CreateUserId == default(Guid))
|
||||||
|
{
|
||||||
|
addEntity3.CreateUserId = _userInfo.Id;
|
||||||
|
addEntity3.CreateUser = _userInfo.RealName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
addEntity3.CreateUserId = _userInfo.Id;
|
|
||||||
addEntity3.CreateUser = _userInfo.RealName;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,10 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
||||||
{
|
{
|
||||||
return string.IsNullOrEmpty(value);
|
return string.IsNullOrEmpty(value);
|
||||||
}
|
}
|
||||||
|
public static bool IsNotNullOrEmpty(this string value)
|
||||||
|
{
|
||||||
|
return !string.IsNullOrEmpty(value);
|
||||||
|
}
|
||||||
|
|
||||||
// 扩展 IEnumerable<T> 类型
|
// 扩展 IEnumerable<T> 类型
|
||||||
public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable)
|
public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable)
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
https://www.cnblogs.com/cqpanda/p/16815263.html
|
https://www.cnblogs.com/cqpanda/p/16815263.html
|
||||||
|
|
||||||
|
|
||||||
# dotnet ef migrations add 签名名字 -p 项目名 -c 上下文名 -o 迁移文件生成目录
|
# dotnet ef migrations add 本地迁移名字 -p 项目名 -c 数据库上下文名 -o 迁移文件生成目录
|
||||||
|
|
||||||
1、生成迁移文件
|
1、生成迁移文件
|
||||||
dotnet ef migrations add Initial -p IRaCIS.Core.Test -c IRCContext -o CodeFirstTest/MSSQL/Migrations
|
dotnet ef migrations add Initial -p IRaCIS.Core.Test -c IRCContext -o CodeFirstTest/MSSQL/Migrations
|
||||||
|
|
||||||
2、撤销刚才生成的迁移文件
|
2、撤销刚才生成的迁移文件(未更新到数据库的)
|
||||||
dotnet ef migrations remove -p IRaCIS.Core.Test -c IRCContext
|
dotnet ef migrations remove -p IRaCIS.Core.Test -c IRCContext
|
||||||
|
|
||||||
3、将迁移文件更新到数据库
|
3、将迁移文件更新到数据库
|
||||||
|
@ -17,7 +17,7 @@ https://www.cnblogs.com/cqpanda/p/16815263.html
|
||||||
4、查看已有迁移
|
4、查看已有迁移
|
||||||
dotnet ef migrations list -p IRaCIS.Core.Test -c IRCContext
|
dotnet ef migrations list -p IRaCIS.Core.Test -c IRCContext
|
||||||
|
|
||||||
5、撤销某次更新到数据库的迁移
|
5、撤销某次更新到数据库的迁移(自动执行down 方法)
|
||||||
dotnet ef database update 某次迁移的前一次迁移名称 -p IRaCIS.Core.Test -c IRCContext
|
dotnet ef database update 某次迁移的前一次迁移名称 -p IRaCIS.Core.Test -c IRCContext
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue