修改bug
parent
a86c43d8d9
commit
46c4416434
|
@ -9,6 +9,8 @@ using IRaCIS.Core.Application.MediatR.Handlers;
|
|||
using System.Threading.Tasks;
|
||||
using MassTransit;
|
||||
using MassTransit.NewIdProviders;
|
||||
using System.IO;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
|
@ -56,14 +58,20 @@ namespace IRaCIS.Core.API
|
|||
|
||||
|
||||
|
||||
|
||||
//// Serilog
|
||||
SerilogExtension.AddSerilogSetup(enviromentName, host.Services);
|
||||
|
||||
//缓存项目的状态 匿名化数据
|
||||
await InitCache(host);
|
||||
|
||||
WatchJsonFile(Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "en-US.json") );
|
||||
|
||||
WatchJsonFile(Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "zh-CN.json"));
|
||||
|
||||
|
||||
|
||||
|
||||
host.Run();
|
||||
|
||||
Log.Logger.Warning($"当前环境:{enviromentName}");
|
||||
|
@ -154,5 +162,45 @@ namespace IRaCIS.Core.API
|
|||
await _mediator.Send(new TrialStateCacheRequest());
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static void LoadJsonFile(string filePath)
|
||||
{
|
||||
|
||||
IConfigurationBuilder builder = new ConfigurationBuilder()
|
||||
.AddJsonFile(filePath);
|
||||
|
||||
IConfigurationRoot enConfiguration = builder.Build();
|
||||
|
||||
|
||||
|
||||
foreach (IConfigurationSection section in enConfiguration.GetChildren())
|
||||
{
|
||||
if (filePath.Contains("en-US.json") )
|
||||
{
|
||||
StaticData.En_US_Dic[section.Key] = section.Value;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
StaticData.Zh_CN_Dic[section.Key] = section.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public static void WatchJsonFile(string filePath)
|
||||
{
|
||||
FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath));
|
||||
watcher.Changed += (sender, e) => LoadJsonFile(filePath);
|
||||
watcher.EnableRaisingEvents = true;
|
||||
|
||||
LoadJsonFile(filePath);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5192,6 +5192,11 @@
|
|||
全局阅片显示类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionTrialView.ConvertShowType">
|
||||
<summary>
|
||||
转化显示类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionTrialView.DefaultValue">
|
||||
<summary>
|
||||
默认值
|
||||
|
@ -5447,6 +5452,11 @@
|
|||
全局阅片显示类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionSystemView.ConvertShowType">
|
||||
<summary>
|
||||
转化显示类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingQuestionSystemView.DefaultValue">
|
||||
<summary>
|
||||
默认值
|
||||
|
@ -5767,6 +5777,11 @@
|
|||
全局阅片显示类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionSystemInDto.ConvertShowType">
|
||||
<summary>
|
||||
转化显示类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionSystemInDto.DefaultValue">
|
||||
<summary>
|
||||
默认值
|
||||
|
@ -5912,6 +5927,11 @@
|
|||
全局阅片显示类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionTrialInDto.ConvertShowType">
|
||||
<summary>
|
||||
转化显示类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionTrialInDto.DefaultValue">
|
||||
<summary>
|
||||
默认值
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
catch (Exception e)
|
||||
{
|
||||
|
||||
throw new BusinessValidationFailedException("解析Json文件配置出现问题");
|
||||
throw new BusinessValidationFailedException("解析Json文件配置出现问题:"+e.Message);
|
||||
}
|
||||
|
||||
//默认存储的路径
|
||||
|
@ -88,7 +88,6 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
if (bestDrive == null || ((double)(defaultDrive.TotalSize - defaultDrive.TotalFreeSpace) / defaultDrive.TotalSize) * 100 < switchingRatio)
|
||||
{
|
||||
bestStoreRootFolder = defaultStoreRootFolder;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -176,6 +176,24 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
}
|
||||
|
||||
|
||||
public class PreArchiveDicomStudyCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SiteId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public int FailedFileCount { get; set; }
|
||||
public decimal FileSize { get; set; }
|
||||
|
||||
|
||||
public int FileCount { get; set; }
|
||||
}
|
||||
|
||||
public class NewArchiveStudyCommand
|
||||
{
|
||||
[NotDefault]
|
||||
|
@ -186,6 +204,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public Guid SubjectId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid StudyMonitorId { get; set; }
|
||||
|
||||
public bool IsAdd { get; set; }
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ using IRaCIS.Core.Application.Helper;
|
|||
using IRaCIS.Core.Infrastructure;
|
||||
using DocumentFormat.OpenXml.Presentation;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.MediatR.Handlers;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||
{
|
||||
|
@ -26,10 +30,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
private readonly IRepository<DicomStudy> _dicomstudyRepository;
|
||||
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||
|
||||
private readonly IRepository<StudyMonitor> _studyMonitorRepository;
|
||||
|
||||
|
||||
public StudyService(IEasyCachingProvider provider
|
||||
, IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<DicomInstance> dicomInstanceRepository,
|
||||
IRepository<DicomSeries> dicomSeriesRepository, IRepository<DicomStudy> dicomstudyRepository, IRepository<Dictionary> dictionaryRepository)
|
||||
IRepository<DicomSeries> dicomSeriesRepository, IRepository<DicomStudy> dicomstudyRepository, IRepository<Dictionary> dictionaryRepository, IRepository<StudyMonitor> studyMonitorRepository)
|
||||
{
|
||||
_provider = provider;
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
|
@ -37,6 +44,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
_dicomSeriesRepository = dicomSeriesRepository;
|
||||
_dicomstudyRepository = dicomstudyRepository;
|
||||
_dictionaryRepository = dictionaryRepository;
|
||||
_studyMonitorRepository = studyMonitorRepository;
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,9 +83,52 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
#endregion
|
||||
}
|
||||
|
||||
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
public async Task<IResponseOutput> PreArchiveDicomStudy(PreArchiveDicomStudyCommand preArchiveStudyCommand)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
var studyMonitor = new StudyMonitor()
|
||||
{
|
||||
TrialId = preArchiveStudyCommand.TrialId,
|
||||
SiteId = preArchiveStudyCommand.SiteId,
|
||||
SubjectId = preArchiveStudyCommand.SubjectId,
|
||||
SubjectVisitId = preArchiveStudyCommand.SubjectVisitId,
|
||||
|
||||
IsSuccess = false,
|
||||
UploadStartTime = DateTime.Now,
|
||||
IsDicom = true,
|
||||
IP = _userInfo.IP,
|
||||
|
||||
FileSize = preArchiveStudyCommand.FileSize,
|
||||
FileCount = preArchiveStudyCommand.FileCount,
|
||||
FailedFileCount = preArchiveStudyCommand.FailedFileCount,
|
||||
|
||||
};
|
||||
|
||||
|
||||
var addEntity = await _studyMonitorRepository.AddAsync(studyMonitor, true);
|
||||
|
||||
return ResponseOutput.Ok(addEntity.Id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
[UnitOfWork]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
public async Task<IResponseOutput> AddOrUpdateArchiveStudy(NewArchiveStudyCommand incommand)
|
||||
{
|
||||
var trialId = incommand.TrialId;
|
||||
|
||||
var studyMonitor = await _studyMonitorRepository.FirstOrDefaultAsync(t => t.Id == incommand.StudyMonitorId);
|
||||
studyMonitor.UploadFinishedTime = DateTime.Now;
|
||||
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||
studyMonitor.IsDicomReUpload = !incommand.IsAdd;
|
||||
|
||||
if (incommand.IsAdd)
|
||||
{
|
||||
var study = _mapper.Map<DicomStudy>(incommand.Study);
|
||||
|
@ -148,6 +199,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
|
||||
|
||||
studyMonitor.StudyId = study.Id;
|
||||
studyMonitor.StudyCode = study.StudyCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -168,7 +221,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
{
|
||||
var series = _mapper.Map<DicomSeries>(seriesItem);
|
||||
|
||||
series.Id = IdentifierHelper.CreateGuid(series.StudyInstanceUid, series.SeriesInstanceUid, trialId.ToString());
|
||||
series.Id = IdentifierHelper.CreateGuid(series.StudyInstanceUid, series.SeriesInstanceUid, trialId.ToString());
|
||||
series.StudyId = study.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
|
@ -181,7 +234,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
foreach (var instanceItem in incommand.InstanceList)
|
||||
{
|
||||
var insntance = _mapper.Map<DicomInstance>(instanceItem);
|
||||
insntance.Id= IdentifierHelper.CreateGuid(insntance.StudyInstanceUid, insntance.SeriesInstanceUid, insntance.SopInstanceUid, trialId.ToString());
|
||||
insntance.Id = IdentifierHelper.CreateGuid(insntance.StudyInstanceUid, insntance.SeriesInstanceUid, insntance.SopInstanceUid, trialId.ToString());
|
||||
insntance.StudyId = study.Id;
|
||||
insntance.SeriesId = series.Id;
|
||||
|
||||
|
@ -199,6 +252,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
//某个序列下少了instance
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
await _dicomstudyRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
@ -207,8 +263,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<UnionStudyViewModel>> GetDicomAndNoneDicomStudyList(StudyQuery studyQuery)
|
||||
{
|
||||
|
|
|
@ -640,24 +640,21 @@ namespace IRaCIS.Core.Application
|
|||
AdditionalAssessment additional = new AdditionalAssessment();
|
||||
var addTypeList = additional.GetSystemDefeaultAdditionalAssessmentList(updateItem.CriterionType, updateItem.AdditionalAssessmentType);
|
||||
|
||||
foreach (var addType in addTypeList)
|
||||
if(! await _readingQuestionTrialRepository.AnyAsync(t => t.ReadingQuestionCriterionTrialId == updateItem.TrialReadingCriterionId && t.IsAdditional==true))
|
||||
{
|
||||
foreach (var question in addType.AdditionalQuestionList)
|
||||
foreach (var addType in addTypeList)
|
||||
{
|
||||
question.ReadingQuestionCriterionTrialId = updateItem.TrialReadingCriterionId;
|
||||
question.TrialId = trialId;
|
||||
foreach (var question in addType.AdditionalQuestionList)
|
||||
{
|
||||
question.ReadingQuestionCriterionTrialId = updateItem.TrialReadingCriterionId;
|
||||
question.TrialId = trialId;
|
||||
|
||||
await _readingQuestionTrialRepository.AddAsync(question);
|
||||
await _readingQuestionTrialRepository.AddAsync(question);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//删除附加问题
|
||||
|
||||
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(t => t.ReadingQuestionCriterionTrialId == updateItem.TrialReadingCriterionId && t.IsAdditional == true);
|
||||
}
|
||||
|
||||
|
||||
await _trialCriterionAdditionalAssessmentTypeRepository.UpdatePartialFromQueryAsync(updateItem.Id, t => new TrialCriterionAdditionalAssessmentType() { IsSelected = updateItem.IsSelected });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
namespace IRaCIS.Core.Domain.Share;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Share;
|
||||
|
||||
public static class StaticData
|
||||
{
|
||||
|
||||
public static Dictionary<string, string> En_US_Dic = new Dictionary<string, string>();
|
||||
|
||||
public static Dictionary<string, string> Zh_CN_Dic = new Dictionary<string, string>();
|
||||
|
||||
|
||||
|
||||
#region 字典表项固定值
|
||||
|
@ -19,6 +25,8 @@ public static class StaticData
|
|||
|
||||
public static class Folder
|
||||
{
|
||||
|
||||
public static readonly string Resources = "Resources";
|
||||
public static readonly string IRaCISDataFolder = "IRaCISData";
|
||||
|
||||
public static readonly string TrialDataFolder = "TrialData";
|
||||
|
|
Loading…
Reference in New Issue