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(); }