From ed2a777fd44f71125318c4685f826a566fa5a263 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 27 Aug 2025 14:21:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=93=E5=AD=98=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 4 ++++ .../Service/Visit/PatientService.cs | 10 ++++++++++ 2 files changed, 14 insertions(+) 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();