Browse Source

危急值

master
wxd 1 year ago
parent
commit
ed75a10fdf
  1. 13
      src/Shentun.Peis.Application.Contracts/RegisterCheckItems/GetRegisterCheckItemInputDto.cs
  2. 70
      src/Shentun.Peis.Application.Contracts/RegisterCheckItems/RegisterCheckItemDto.cs
  3. 49
      src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs

13
src/Shentun.Peis.Application.Contracts/RegisterCheckItems/GetRegisterCheckItemInputDto.cs

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.RegisterCheckItems
{
public class GetRegisterCheckItemInputDto
{
public Guid RegisterCheckId { get; set; }
public Guid ItemId { get; set; }
}
}

70
src/Shentun.Peis.Application.Contracts/RegisterCheckItems/RegisterCheckItemDto.cs

@ -1,49 +1,85 @@
using Shentun.Peis.ItemResultTemplates;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Shentun.Peis.RegisterCheckItems
{
public class RegisterCheckItemDto: AuditedEntityDtoNameNoGuid
public class RegisterCheckItemDto
{
/// <summary>
/// 项目名称
/// </summary>
public string ItemName { get; set; }
public Guid RegisterCheckId { get; set; }
/// <summary>
/// 项目编号
/// </summary>
public Guid ItemId { get; set; }
/// <summary>
/// 结果
/// 危急值范围
/// </summary>
public string? Result { get; set; }
public string CriticalRangeValue { get; set; }
/// <summary>
/// 单位
/// 危急值标志
/// </summary>
public string? Unit { get; set; }
public char? IsCriticalValue { get; set; }
/// <summary>
/// 参考范围
/// 危急值处理内容
/// </summary>
public string? ReferenceRangeValue { get; set; }
public string CriticalValueContent { get; set; }
/// <summary>
/// 危急值范围
/// 危急值创建者
/// </summary>
public string CriticalValueCreatorName { get; set; }
/// <summary>
/// 危急值创建日期
/// </summary>
public string CriticalValueCreationTime { get; set; }
/// <summary>
/// 危急值是否审核 Y-N
/// </summary>
public string? CriticalRangeValue { get; set; }
public char? IsCriticalValueAudit { get; set; }
/// <summary>
/// 危急值
/// 该项目要否要复查 Y-N
/// </summary>
public string? CriticalValue { get; set; }
public char? IsReview { get; set; }
/// <summary>
/// 报告单提示
/// 随访标志 Y-N
/// </summary>
public string? ResultStatusId { get; set; }
public char? IsFollowUp { get; set; }
/// <summary>
/// 检查医生
/// 随访创建时间
/// </summary>
public string? CheckDoctorName { get; set; }
public string FollowUpCreationTime { get; set; }
/// <summary>
/// 检查日期
/// 随访创建者
/// </summary>
public string? CheckDate { get; set; }
public string FollowUpCreatorName { get; set; }
}
}

49
src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs

@ -43,6 +43,8 @@ namespace Shentun.Peis.RegisterCheckItems
private readonly CacheService _cacheService;
private readonly ICurrentUser _currentUser;
private readonly FollowUpAppService _followUpAppService;
private readonly IRepository<Item, Guid> _itemRepository;
private readonly IRepository<ItemType, Guid> _itemTypeRepository;
public RegisterCheckItemAppService(
IRepository<RegisterCheckItem> registerCheckItemRepository,
IRepository<IdentityUser, Guid> userRepository,
@ -56,7 +58,9 @@ namespace Shentun.Peis.RegisterCheckItems
IRepository<RegisterCheckAsbitem, Guid> registerCheckAsbitemRepository,
IRepository<AsbitemDetail> asbitemDetailRepository,
ICurrentUser currentUser,
FollowUpAppService followUpAppService)
FollowUpAppService followUpAppService,
IRepository<Item, Guid> itemRepository,
IRepository<ItemType, Guid> itemTypeRepository)
{
this._registerCheckItemRepository = registerCheckItemRepository;
this._userRepository = userRepository;
@ -71,6 +75,8 @@ namespace Shentun.Peis.RegisterCheckItems
_asbitemDetailRepository = asbitemDetailRepository;
_currentUser = currentUser;
_followUpAppService = followUpAppService;
_itemRepository = itemRepository;
_itemTypeRepository = itemTypeRepository;
}
/// <summary>
@ -372,6 +378,47 @@ namespace Shentun.Peis.RegisterCheckItems
}
/// <summary>
/// 获取单个明细结果 单危急值相关内容
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("api/app/RegisterCheckItem/GetRegisterCheckItem")]
public async Task<RegisterCheckItemDto> GetRegisterCheckItemAsync(GetRegisterCheckItemInputDto input)
{
var registerCheckItemEnt = (from registerCheckItem in await _registerCheckItemRepository.GetQueryableAsync()
join item in await _itemRepository.GetQueryableAsync() on registerCheckItem.ItemId equals item.Id
where registerCheckItem.RegisterCheckId == input.RegisterCheckId && registerCheckItem.ItemId == input.ItemId
select new
{
registerCheckItem,
item
}).FirstOrDefault();
if (registerCheckItemEnt == null)
{
throw new UserFriendlyException("数据不存在");
}
var entDto = new RegisterCheckItemDto
{
CriticalRangeValue = registerCheckItemEnt.registerCheckItem.CriticalRangeValue,
ItemId = registerCheckItemEnt.registerCheckItem.ItemId,
ItemName = registerCheckItemEnt.item.DisplayName,
RegisterCheckId = registerCheckItemEnt.registerCheckItem.RegisterCheckId,
CriticalValueContent = registerCheckItemEnt.registerCheckItem.CriticalValueContent,
CriticalValueCreationTime = DataHelper.ConversionDateToString(registerCheckItemEnt.registerCheckItem.CriticalValueCreationTime),
FollowUpCreationTime = DataHelper.ConversionDateToString(registerCheckItemEnt.registerCheckItem.FollowUpCreationTime),
IsFollowUp = registerCheckItemEnt.registerCheckItem.IsFollowUp == null ? 'N' : registerCheckItemEnt.registerCheckItem.IsFollowUp,
IsCriticalValue = registerCheckItemEnt.registerCheckItem.IsCriticalValue == null ? 'N' : registerCheckItemEnt.registerCheckItem.IsCriticalValue,
IsCriticalValueAudit = registerCheckItemEnt.registerCheckItem.IsCriticalValueAudit == null ? 'N' : registerCheckItemEnt.registerCheckItem.IsCriticalValueAudit,
IsReview = registerCheckItemEnt.registerCheckItem.IsReview == null ? 'N' : registerCheckItemEnt.registerCheckItem.IsReview,
CriticalValueCreatorName = _cacheService.GetSurnameAsync(registerCheckItemEnt.registerCheckItem.CriticalValueCreatorId).GetAwaiter().GetResult(),
FollowUpCreatorName = _cacheService.GetSurnameAsync(registerCheckItemEnt.registerCheckItem.FollowUpCreatorId).GetAwaiter().GetResult()
};
return entDto;
}
/// <summary>
/// 修改明细表危急值相关内容

Loading…
Cancel
Save