Browse Source

体检报告页面过滤项目

bjmzak
wxd 1 year ago
parent
commit
b399fa31fc
  1. 22
      src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs

22
src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs

@ -158,16 +158,16 @@ namespace Shentun.Peis.RegisterChecks
// itemType
// }).ToList();
var entlist = (await _registerCheckRepository.GetDbSetAsync())
var entlist = (await _registerCheckRepository.GetQueryableAsync())
.Include(x => x.RegisterCheckAsbitems)
.ThenInclude(x => x.Asbitem).ThenInclude(x => x.ItemType)
.Where(m => m.RegisterCheckAsbitems.Select(s => s.PatientRegisterId).Contains(input.PatientRegisterId)).ToList();
.Where(m => m.PatientRegisterId == input.PatientRegisterId).ToList();
//排序
entlist = entlist.OrderBy(o => o.RegisterCheckAsbitems.Max(o => o.Asbitem.ItemType.DisplayOrder)).ToList()
.OrderBy(o => o.RegisterCheckAsbitems.Max(o => o.Asbitem.DisplayOrder)).ToList();
var userList = await _userRepository.GetListAsync();
var entdto = entlist.Select(s => new RegisterCheckOrAsbitemNameOrIsChargeDto
var entdto = entlist.Where(m => m.RegisterCheckAsbitems.Where(mm => mm.Asbitem.IsCheck == 'Y').Count() > 0).Select(s => new RegisterCheckOrAsbitemNameOrIsChargeDto
{
CheckTypeFlag = s.RegisterCheckAsbitems.First().Asbitem.ItemType.CheckTypeFlag,
AsbitemName = string.Join(",", s.RegisterCheckAsbitems.Select(rs => rs.Asbitem.DisplayName).ToList()),
@ -195,7 +195,7 @@ namespace Shentun.Peis.RegisterChecks
LastModifierId = s.LastModifierId,
//RegisterAsbitemId = s.RegisterAsbitemId,
ThirdInfo = s.ThirdInfo,
CreatorName = _cacheService.GetSurnameAsync( s.CreatorId).Result,
CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).Result,
LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).Result,
ItemTypeDisplayOrder = s.RegisterCheckAsbitems.First().Asbitem.ItemType.DisplayOrder,
AsbitemDisplayOrder = s.RegisterCheckAsbitems.First().Asbitem.DisplayOrder
@ -218,8 +218,8 @@ namespace Shentun.Peis.RegisterChecks
.Include(x => x.RegisterCheckAsbitems)
.ThenInclude(x => x.Asbitem).ThenInclude(x => x.ItemType)
.Where(m => m.RegisterCheckAsbitems.Select(s => s.PatientRegisterId)
.Contains(input.PatientRegisterId)
&& m.RegisterCheckAsbitems.Select(s=>s.Asbitem.IsCheck).Contains('Y'));
.Contains(input.PatientRegisterId)
&& m.RegisterCheckAsbitems.Select(s => s.Asbitem.IsCheck).Contains('Y'));
#region 增加项目类别权限
@ -282,19 +282,19 @@ namespace Shentun.Peis.RegisterChecks
{
throw new UserFriendlyException("RegisterCheckItems参数不能为空");
}
if(!input.RegisterCheckItems.Where(o=>!string.IsNullOrWhiteSpace(o.Result)).ToList().Any())
if (!input.RegisterCheckItems.Where(o => !string.IsNullOrWhiteSpace(o.Result)).ToList().Any())
{
throw new UserFriendlyException("明细结果不能全部为空");
}
var registerCheck = await _registerCheckRepository.GetAsync(input.RegisterCheckId);
var registerCheck = await _registerCheckRepository.GetAsync(input.RegisterCheckId);
var patientRegister = await _patientRegisterRepository.GetAsync(registerCheck.PatientRegisterId);
//修改医生和检查日期
if(string.IsNullOrWhiteSpace(input.CheckDoctorId))
if (string.IsNullOrWhiteSpace(input.CheckDoctorId))
{
input.CheckDoctorId = CurrentUser.Id.ToString();
}
_registerCheckManager.UpdateCheckDoctorAndDateAsync(patientRegister, registerCheck, input.CheckDoctorId, input.CheckDate,input.ExecOrganizationUnitId);
_registerCheckManager.UpdateCheckDoctorAndDateAsync(patientRegister, registerCheck, input.CheckDoctorId, input.CheckDate, input.ExecOrganizationUnitId);
//更新人员登记信息完成标志
patientRegister.CompleteFlag = PatientRegisterCompleteFlag.PartCheck;
await _patientRegisterRepository.UpdateAsync(patientRegister);

Loading…
Cancel
Save