From 64f04a3953b49d65cded567c9f4a97f40647191a Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 12 Sep 2025 13:17:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E4=BB=A3=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9-=E4=BA=BA=E5=91=98=E6=B7=BB=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=AF=BE=E9=A2=98=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 7 ++-- .../Service/Visit/DTO/PatientViewModel.cs | 9 ++++ .../Service/Visit/PatientService.cs | 13 ++++++ IRaCIS.Core.Application/TestService.cs | 41 +++++++++++++------ 4 files changed, 54 insertions(+), 16 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 1467aafd4..b962c0ff6 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -1,5 +1,4 @@ -using DocumentFormat.OpenXml.Bibliography; -using IP2Region.Net.Abstractions; +using IP2Region.Net.Abstractions; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Auth; using IRaCIS.Core.Application.Contracts; @@ -924,6 +923,8 @@ namespace IRaCIS.Core.Application.Service } newIdentityUser.UserRoleList = addRoleList; + + await _identityUserRepository.AddAsync(newIdentityUser); } else { @@ -952,7 +953,7 @@ namespace IRaCIS.Core.Application.Service } - await _userRoleRepository.SaveChangesAsync(); + await _identityUserRepository.SaveChangesAsync(); } diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index 46b8ecc4b..efb082837 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -1072,6 +1072,8 @@ namespace IRaCIS.Application.Contracts public string AccessionNumber { get; set; } + public string StudyIdStr { get; set; } = string.Empty; + public DateTime? StudyTime { get; set; } public string Modalities { get; set; } = string.Empty; @@ -1097,6 +1099,13 @@ namespace IRaCIS.Application.Contracts public string Name { get; set; } } + + + public class PatientStudyDto + { + + } + public class PatientSeriesDTO { diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 08f0c5b99..5bdb12662 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -840,6 +840,7 @@ namespace IRaCIS.Application.Services SCPStudyId = scpStudy.Id, SeriesCount = scpStudy.SeriesCount, StudyTime = scpStudy.StudyTime, + StudyIdStr=scpStudy.StudyId HospitalGroupList = scpStudy.HospitalGroupList.Select(t => new SCPStudyHospitalGroupInfo() { @@ -875,6 +876,8 @@ namespace IRaCIS.Application.Services return pageList; } + + /// /// 修改检查课题组 1是添加 2是删除,3是更新 /// @@ -952,6 +955,13 @@ namespace IRaCIS.Application.Services return ResponseOutput.Ok(); } + /// + /// 患者 检查预览 + /// + /// + /// + /// + /// public async Task>> GetPatientSeriesList(Guid scpStudyId, [FromServices] IRepository _seriesRepository, [FromServices] IRepository _instanceRepository @@ -986,6 +996,9 @@ namespace IRaCIS.Application.Services return ResponseOutput.Ok(seriesList, study); } + + + [UnitOfWork] [HttpDelete] public async Task DeletePatientStudy(Guid patiendId, Guid scpStudyId, diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index e638eec97..47d6c0053 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -288,32 +288,47 @@ namespace IRaCIS.Core.Application.Service [FromServices] IRepository _SCPStudyRepository, Guid hospitalGroupId) { - var scpStudyIdList = _SCPStudyRepository.Where().Select(t => t.Id).ToList(); - - foreach (var item in scpStudyIdList) + if ((await _SCPStudyHospitalGroupRepository.FirstOrDefaultAsync()) == null) { - await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = hospitalGroupId }); - } + var scpStudyIdList = _SCPStudyRepository.Where().Select(t => t.Id).ToList(); - await _SCPStudyRepository.SaveChangesAsync(); + foreach (var item in scpStudyIdList) + { + await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = hospitalGroupId }); + } + + await _SCPStudyRepository.SaveChangesAsync(); + } return ResponseOutput.Ok(); } + /// + /// 给所有的账户加上默认课题组 + /// + /// + /// + /// + /// [AllowAnonymous] public async Task NewUserHospitalGroup( - [FromServices] IRepository _SCPStudyHospitalGroupRepository, - [FromServices] IRepository _SCPStudyRepository, Guid hospitalGroupId) + [FromServices] IRepository _hospitalGroupIdentityUserRepository, + [FromServices] IRepository _identityUserRepository, Guid hospitalGroupId) { - var scpStudyIdList = _SCPStudyRepository.Where().Select(t => t.Id).ToList(); - - foreach (var item in scpStudyIdList) + if ((await _hospitalGroupIdentityUserRepository.FirstOrDefaultAsync()) == null) { - await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = hospitalGroupId }); + var identityUserIdList = _identityUserRepository.Where().Select(t => t.Id).ToList(); + + foreach (var item in identityUserIdList) + { + await _hospitalGroupIdentityUserRepository.AddAsync(new HospitalGroupIdentityUser() { IdentityUserId = item, HospitalGroupId = hospitalGroupId }); + } + + await _hospitalGroupIdentityUserRepository.SaveChangesAsync(); } - await _SCPStudyRepository.SaveChangesAsync(); + return ResponseOutput.Ok(); }