diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index 25d18e18f..aea8f9e32 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -23,6 +23,7 @@ using SixLabors.ImageSharp.Formats.Jpeg; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; using Newtonsoft.Json; +using FellowOakDicom.Imaging.Codec; namespace IRaCIS.Core.SCP.Service { @@ -325,6 +326,9 @@ namespace IRaCIS.Core.SCP.Service { await request.File.SaveAsync(ms); + + + //irc 从路径最后一截取Guid storeRelativePath = await ossService.UploadToOSSAsync(ms, ossFolderPath, instanceId.ToString(), false); diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 13eb261ef..dce747e3c 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -153,6 +153,11 @@ namespace IRaCIS.Application.Services var entity = await _hIRHospitalRepository.InsertOrUpdateAsync(addOrEditHIRHospital, true, exp, exp2); + var hospitalInfo = await _hIRHospitalRepository.Where(t => t.IsDefault == true).FirstNotNullAsync(); + + //更新了联网信息,也要变更缓存是否可以联网,防止修改 + await _fusionCache.SetAsync(CacheKeys.Hospital, hospitalInfo, TimeSpan.FromDays(7)); + return ResponseOutput.Ok(entity.Id.ToString()); } @@ -161,6 +166,11 @@ namespace IRaCIS.Application.Services [HttpDelete("{hIRHospitalId:guid}")] public async Task DeleteHIRHospital(Guid hIRHospitalId) { + if (_hIRHospitalRepository.Any(t => t.Id == hIRHospitalId && t.IsDefault == true)) + { + return ResponseOutput.NotOk(_localizer["Patient_CannotDeleteDefaultHospital"]); + } + var success = await _hIRHospitalRepository.DeleteFromQueryAsync(t => t.Id == hIRHospitalId, true); return ResponseOutput.Ok();