Compare commits
No commits in common. "5f71d7f1b2342810b1eae32c23b305a7211c3b3b" and "21cafcab53a108d70291e3cf19685cc513dbea0f" have entirely different histories.
5f71d7f1b2
...
21cafcab53
|
|
@ -13696,32 +13696,6 @@
|
||||||
<param name="inQuery"></param>
|
<param name="inQuery"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.HospitalGroupService.AddOrUpdateHospitalGroupTag(IRaCIS.Core.Application.ViewModel.HospitalGroupTagAddOrEdit)">
|
|
||||||
<summary>
|
|
||||||
添加编辑 课题组标签
|
|
||||||
</summary>
|
|
||||||
<param name="addOrEditHospitalGroupTag"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.HospitalGroupService.DeleteHospitalGroupTag(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
删除课题组标签
|
|
||||||
</summary>
|
|
||||||
<param name="hospitalGroupTagId"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.HospitalGroupService.AddPatientHospitalGroupTag(IRaCIS.Core.Application.ViewModel.AddOrDeletePatientHospitalGroupTag)">
|
|
||||||
<summary>
|
|
||||||
给 患者添加 或者删除 课题组标签 1是添加 2 是删除
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.HospitalGroupService.GetHospitalGroupTagList">
|
|
||||||
<summary>
|
|
||||||
获取当前登录用户课题组标签下拉框
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SubjectService.AddOrUpdateSubject(IRaCIS.Application.Contracts.SubjectCommand)">
|
<member name="M:IRaCIS.Core.Application.Service.SubjectService.AddOrUpdateSubject(IRaCIS.Application.Contracts.SubjectCommand)">
|
||||||
<summary>
|
<summary>
|
||||||
添加或更新受试者信息[New]
|
添加或更新受试者信息[New]
|
||||||
|
|
|
||||||
|
|
@ -84,32 +84,4 @@ public class HospitalGroupAdminUserInfo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class HospitalGroupTagAddOrEdit
|
|
||||||
{
|
|
||||||
public Guid HospitalGroupId { get; set; }
|
|
||||||
|
|
||||||
public string Name { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class AddOrDeletePatientHospitalGroupTag
|
|
||||||
{
|
|
||||||
|
|
||||||
public int AddOrDelete { get; set; }
|
|
||||||
|
|
||||||
public Guid PatientId { get; set; }
|
|
||||||
|
|
||||||
public Guid HospitalGroupTagId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class HospitalGroupAndTagSelectView
|
|
||||||
{
|
|
||||||
public Guid HospitalGroupTagId { get; set; }
|
|
||||||
|
|
||||||
public Guid HospitalGroupId { get; set; }
|
|
||||||
|
|
||||||
public string HospitalGroupName { get; set; }
|
|
||||||
|
|
||||||
public string HospitalGroupTagName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
@ -267,9 +267,6 @@ namespace IRaCIS.Application.Contracts
|
||||||
public DateTime? BeginPushTime { get; set; }
|
public DateTime? BeginPushTime { get; set; }
|
||||||
public DateTime? EndPushTime { get; set; }
|
public DateTime? EndPushTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public List<Guid> PatientHospitalGroupTagIdList { get; set; } = new List<Guid>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PatientTrialView : PatientQueryView
|
public class PatientTrialView : PatientQueryView
|
||||||
|
|
@ -285,17 +282,6 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public List<string> ViewHospitalGroupList => StudyHospitalGroupList.Intersect(CurrentUserHospitalGroupList).ToList();
|
public List<string> ViewHospitalGroupList => StudyHospitalGroupList.Intersect(CurrentUserHospitalGroupList).ToList();
|
||||||
|
|
||||||
public List<PatientTagView> PatientHospitalGroupTagList { get; set; } = new List<PatientTagView>();
|
|
||||||
|
|
||||||
public List<PatientTagView> ViewPatientHospitalGroupTagList => PatientHospitalGroupTagList.Where(t => CurrentUserHospitalGroupList.Contains(t.HospitalGroupName)).ToList();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PatientTagView
|
|
||||||
{
|
|
||||||
public string HospitalGroupName { get; set; }
|
|
||||||
|
|
||||||
public string HospitalGroupTagName { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PatientTrialStatInfo
|
public class PatientTrialStatInfo
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,7 @@ using IRaCIS.Application.Contracts;
|
||||||
namespace IRaCIS.Core.Application.Service;
|
namespace IRaCIS.Core.Application.Service;
|
||||||
|
|
||||||
[ApiExplorerSettings(GroupName = "HIR")]
|
[ApiExplorerSettings(GroupName = "HIR")]
|
||||||
public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepository, IRepository<HospitalGroupTag> _hospitalGroupTagRepository,
|
public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepository,
|
||||||
IRepository<PatientHospitalGroupTag> _patientHospitalGroupTagRepository,
|
|
||||||
IRepository<IdentityUser> _identityUserRepository, IRepository<HospitalGroupIdentityUser> _hospitalGroupIdentityUserRepository,
|
IRepository<IdentityUser> _identityUserRepository, IRepository<HospitalGroupIdentityUser> _hospitalGroupIdentityUserRepository,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IHospitalGroupService
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IHospitalGroupService
|
||||||
{
|
{
|
||||||
|
|
@ -152,105 +151,6 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 课题组标签
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 添加编辑 课题组标签
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="addOrEditHospitalGroupTag"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateHospitalGroupTag(HospitalGroupTagAddOrEdit addOrEditHospitalGroupTag)
|
|
||||||
{
|
|
||||||
var verifyExp1 = new EntityVerifyExp<HospitalGroupTag>()
|
|
||||||
{
|
|
||||||
VerifyExp = u => u.Name == addOrEditHospitalGroupTag.Name,
|
|
||||||
VerifyMsg = _localizer["HospitalGroup_DuplicateTagName"]
|
|
||||||
};
|
|
||||||
|
|
||||||
var entity = await _hospitalGroupTagRepository.InsertOrUpdateAsync(addOrEditHospitalGroupTag, true, verifyExp1);
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 删除课题组标签
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="hospitalGroupTagId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpDelete("{hospitalGroupTagId:guid}")]
|
|
||||||
public async Task<IResponseOutput> DeleteHospitalGroupTag(Guid hospitalGroupTagId)
|
|
||||||
{
|
|
||||||
if (_patientHospitalGroupTagRepository.Any(t => t.HospitalGroupTagId == hospitalGroupTagId))
|
|
||||||
{
|
|
||||||
return ResponseOutput.NotOk(_localizer["HospitalGroup_PatientHaveBindTag"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var success = await _hospitalGroupTagRepository.DeleteFromQueryAsync(t => t.Id == hospitalGroupTagId);
|
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 给 患者添加 或者删除 课题组标签 1是添加 2 是删除
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<IResponseOutput> AddPatientHospitalGroupTag(AddOrDeletePatientHospitalGroupTag inCommand)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (inCommand.AddOrDelete == 1)
|
|
||||||
{
|
|
||||||
if (!_patientHospitalGroupTagRepository.Any(t => t.HospitalGroupTagId == inCommand.HospitalGroupTagId))
|
|
||||||
{
|
|
||||||
await _patientHospitalGroupTagRepository.InsertFromDTOAsync(inCommand);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await _patientHospitalGroupTagRepository.DeleteFromQueryAsync(t => t.PatientId == inCommand.PatientId && t.HospitalGroupTagId == inCommand.HospitalGroupTagId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取当前登录用户课题组标签下拉框
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public List<HospitalGroupAndTagSelectView> GetHospitalGroupTagList()
|
|
||||||
{
|
|
||||||
var currentUserHospitalGroupIdList = new List<Guid>();
|
|
||||||
|
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
|
|
||||||
{
|
|
||||||
currentUserHospitalGroupIdList = _identityUserRepository.Where(t => t.Id == _userInfo.IdentityUserId).SelectMany(t => t.IdentityUserHospitalGroupList)
|
|
||||||
.Where(t => t.IsDisabled == false && t.HospitalGroup.IsEnable).Select(t => t.HospitalGroupId).ToList();
|
|
||||||
}
|
|
||||||
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA)
|
|
||||||
{
|
|
||||||
currentUserHospitalGroupIdList = _identityUserRepository.Where(t => t.Id == _userInfo.IdentityUserId).SelectMany(t => t.IdentityUserHospitalGroupList)
|
|
||||||
.Where(t => t.IsDisabled == false && t.HospitalGroup.IsEnable && t.IsManager).Select(t => t.HospitalGroupId).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var list = _hospitalGroupTagRepository.Where(t => currentUserHospitalGroupIdList.Contains(t.HospitalGroupId))
|
|
||||||
.Select(t => new HospitalGroupAndTagSelectView()
|
|
||||||
{
|
|
||||||
HospitalGroupId = t.HospitalGroupId,
|
|
||||||
HospitalGroupName = t.HospitalGroup.Name,
|
|
||||||
HospitalGroupTagId = t.HospitalGroupId,
|
|
||||||
HospitalGroupTagName = t.Name
|
|
||||||
}).OrderBy(t => t.HospitalGroupName).ThenBy(t => t.HospitalGroupTagName).ToList();
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -644,7 +644,6 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
#region new ok
|
#region new ok
|
||||||
var query = _patientRepository.Where(t => isAdminOrOA ? true : t.SCPStudyList.Any(c => c.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId))))
|
var query = _patientRepository.Where(t => isAdminOrOA ? true : t.SCPStudyList.Any(c => c.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId))))
|
||||||
.WhereIf(inQuery.PatientHospitalGroupTagIdList.Any(), t => t.PatientHospitalGroupTagList.Any(k => inQuery.PatientHospitalGroupTagIdList.Contains(k.HospitalGroupTagId)))
|
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientName), t => t.PatientName.Contains(inQuery.PatientName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientName), t => t.PatientName.Contains(inQuery.PatientName))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), t => t.SubjectPatientList.Any(t => t.Subject.Trial.ExperimentName.Contains(inQuery.ExperimentName)))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), t => t.SubjectPatientList.Any(t => t.Subject.Trial.ExperimentName.Contains(inQuery.ExperimentName)))
|
||||||
|
|
@ -687,10 +686,7 @@ namespace IRaCIS.Application.Services
|
||||||
VisitCount = c.Subject.SubjectVisitList.Count()
|
VisitCount = c.Subject.SubjectVisitList.Count()
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
|
||||||
StudyHospitalGroupList = patient.SCPStudyList.SelectMany(t => t.HospitalGroupList).Select(t => t.HospitalGroup.Name).Distinct().ToList(),
|
StudyHospitalGroupList = patient.SCPStudyList.SelectMany(t => t.HospitalGroupList).Select(t => t.HospitalGroup.Name).Distinct().ToList()
|
||||||
|
|
||||||
PatientHospitalGroupTagList = patient.PatientHospitalGroupTagList
|
|
||||||
.Select(t => new PatientTagView() { HospitalGroupName = t.HospitalGroupTag.HospitalGroup.Name, HospitalGroupTagName = t.HospitalGroupTag.Name }).ToList()
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,10 +222,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.IsGACurrentHospitalDisabled, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Any(t => t.IsDisabled && t.HospitalGroupId == hostpitalGroupId)));
|
.ForMember(d => d.IsGACurrentHospitalDisabled, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Any(t => t.IsDisabled && t.HospitalGroupId == hostpitalGroupId)));
|
||||||
|
|
||||||
|
|
||||||
CreateMap<HospitalGroupTag, HospitalGroupTagAddOrEdit>().ReverseMap();
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<AddOrDeletePatientHospitalGroupTag, PatientHospitalGroupTag>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,10 @@
|
||||||
public class SCPPatient : BaseFullAuditEntity
|
public class SCPPatient : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
|
||||||
public List<SubjectPatient> SubjectPatientList { get; set; }
|
public List<SubjectPatient> SubjectPatientList { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<SCPStudy> SCPStudyList { get; set; }
|
public List<SCPStudy> SCPStudyList { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public List<PatientHospitalGroupTag> PatientHospitalGroupTagList { get; set; }
|
|
||||||
//[JsonIgnore]
|
//[JsonIgnore]
|
||||||
//public Subject Subject { get; set; }
|
//public Subject Subject { get; set; }
|
||||||
//[JsonIgnore]
|
//[JsonIgnore]
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public Guid HospitalGroupId { get; set; }
|
public Guid HospitalGroupId { get; set; }
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
public int ShowOrder { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,29 +0,0 @@
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class addorderbak : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "ShowOrder",
|
|
||||||
table: "HospitalGroupTag",
|
|
||||||
type: "int",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "ShowOrder",
|
|
||||||
table: "HospitalGroupTag");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -2992,9 +2992,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasMaxLength(400)
|
.HasMaxLength(400)
|
||||||
.HasColumnType("nvarchar(400)");
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
b.Property<int>("ShowOrder")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<DateTime>("UpdateTime")
|
b.Property<DateTime>("UpdateTime")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
|
@ -15517,7 +15514,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.SCPPatient", "Patient")
|
b.HasOne("IRaCIS.Core.Domain.Models.SCPPatient", "Patient")
|
||||||
.WithMany("PatientHospitalGroupTagList")
|
.WithMany()
|
||||||
.HasForeignKey("PatientId")
|
.HasForeignKey("PatientId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
@ -18924,8 +18921,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPPatient", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPPatient", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("PatientHospitalGroupTagList");
|
|
||||||
|
|
||||||
b.Navigation("SCPStudyList");
|
b.Navigation("SCPStudyList");
|
||||||
|
|
||||||
b.Navigation("SubjectPatientList");
|
b.Navigation("SubjectPatientList");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue