Browse Source

危急值项目列表

master
wxd 1 year ago
parent
commit
2f2a900f31
  1. 118
      src/Shentun.Peis.Application.Contracts/PhoneFollowUps/GetAsbitemOrItemCriticalByPatientRegisterIdDto.cs
  2. 2
      src/Shentun.Peis.Application/OccupationalDiseaseReports/OccupationalDiseaseReportAppService.cs
  3. 76
      src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs

118
src/Shentun.Peis.Application.Contracts/PhoneFollowUps/GetAsbitemOrItemCriticalByPatientRegisterIdDto.cs

@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Shentun.Peis.PhoneFollowUps
{
public class GetAsbitemOrItemCriticalByPatientRegisterIdDto
{
/// <summary>
/// 组合项目名称
/// </summary>
public string AsbitemName { get; set; }
/// <summary>
/// 小结 多个拼合成内容
/// </summary>
public string SummaryDetail { get; set; }
/// <summary>
/// 危急值范围
/// </summary>
public string CriticalRangeValue { get; set; }
/// <summary>
/// 危急值标志
/// </summary>
public char? IsCriticalValue { get; set; }
/// <summary>
/// 危急值处理内容
/// </summary>
public string CriticalValueContent { get; set; }
/// <summary>
/// 危急值是否审核 Y-N
/// </summary>
public char? IsCriticalValueAudit { get; set; }
/// <summary>
/// 该项目要否要复查 Y-N
/// </summary>
public char? IsReview { get; set; }
/// <summary>
/// 随访标志 Y-N
/// </summary>
public char? IsFollowUp { get; set; }
/// <summary>
/// 项目明细数据
/// </summary>
public List<GetAsbitemOrItemCriticalByPatientRegisterIdItemDetail> ItemDetails { get; set; }
}
public class GetAsbitemOrItemCriticalByPatientRegisterIdItemDetail
{
/// <summary>
/// 项目名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 项目结果
/// </summary>
public string ItemResult { get; set; }
/// <summary>
/// 单位
/// </summary>
public string Unit { get; set; }
/// <summary>
/// 参考范围
/// </summary>
public string ReferenceRangeValue { get; set; }
/// <summary>
/// 危急值范围
/// </summary>
public string CriticalRangeValue { get; set; }
/// <summary>
/// 危急值标志
/// </summary>
public char? IsCriticalValue { get; set; }
/// <summary>
/// 危急值处理内容
/// </summary>
public string CriticalValueContent { get; set; }
/// <summary>
/// 危急值是否审核 Y-N
/// </summary>
public char? IsCriticalValueAudit { get; set; }
/// <summary>
/// 该项目要否要复查 Y-N
/// </summary>
public char? IsReview { get; set; }
/// <summary>
/// 随访标志 Y-N
/// </summary>
public char? IsFollowUp { get; set; }
}
}

2
src/Shentun.Peis.Application/OccupationalDiseaseReports/OccupationalDiseaseReportAppService.cs

@ -362,7 +362,7 @@ namespace Shentun.Peis.OccupationalDiseaseReports
#endregion
var ddd = query.ToQueryString();
//var ddd = query.ToQueryString();
//var noCheckPatientRegisterList = query.ToList();
//var sumCount = noCheckPatientRegisterList.GroupBy(g => g.patientRegister).Count(); //总人数

76
src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs

@ -6,6 +6,7 @@ using Shentun.Peis.CriticalFollowValues;
using Shentun.Peis.CustomerOrgs;
using Shentun.Peis.Enums;
using Shentun.Peis.Models;
using Shentun.Peis.PatientRegisters;
using SqlSugar;
using System;
using System.Collections.Generic;
@ -37,6 +38,7 @@ namespace Shentun.Peis.PhoneFollowUps
private readonly IRepository<Item, Guid> _itemRepository;
private readonly IRepository<Patient, Guid> _patientRepository;
private readonly CustomerOrgManager _customerOrgManager;
private readonly IRepository<RegisterCheckSummary, Guid> _registerCheckSummaryRepository;
public PhoneFollowUpAppService(
IRepository<PhoneFollowUp, Guid> phoneFollowUpRepository,
@ -49,7 +51,8 @@ namespace Shentun.Peis.PhoneFollowUps
IRepository<Asbitem, Guid> asbitemRepository,
IRepository<Item, Guid> itemRepository,
IRepository<Patient, Guid> patientRepository,
CustomerOrgManager customerOrgManager)
CustomerOrgManager customerOrgManager,
IRepository<RegisterCheckSummary, Guid> registerCheckSummaryRepository)
{
_phoneFollowUpRepository = phoneFollowUpRepository;
_cacheService = cacheService;
@ -62,6 +65,7 @@ namespace Shentun.Peis.PhoneFollowUps
_itemRepository = itemRepository;
_patientRepository = patientRepository;
_customerOrgManager = customerOrgManager;
_registerCheckSummaryRepository = registerCheckSummaryRepository;
}
@ -354,6 +358,76 @@ namespace Shentun.Peis.PhoneFollowUps
//return entListDto;
}
/// <summary>
/// 获取项目危急值内容
/// </summary>
/// <returns></returns>
[HttpPost("api/app/PhoneFollowUp/GetAsbitemOrItemCriticalByPatientRegisterId")]
public async Task<List<GetAsbitemOrItemCriticalByPatientRegisterIdDto>> GetAsbitemOrItemCriticalByPatientRegisterIdAsync(PatientRegisterIdInputDto input)
{
var query = from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
join registerCheckItem in await _registerCheckItemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckItem.RegisterCheckId
join item in await _itemRepository.GetQueryableAsync() on registerCheckItem.ItemId equals item.Id
join registerCheckSummary in await _registerCheckSummaryRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckSummary.RegisterCheckId into registerCheckSummaryTemp
from registerCheckSummaryHaveEmpty in registerCheckSummaryTemp.DefaultIfEmpty()
select new
{
patientRegister,
registerCheck,
asbitem,
registerCheckItem,
item,
registerCheckSummaryHaveEmpty
};
if (input.PatientRegisterId == Guid.Empty)
{
throw new UserFriendlyException("人员ID格式不正确");
}
query = query.Where(m => m.patientRegister.Id == input.PatientRegisterId);
var registerCheckGroup = query.ToList().GroupBy(g => g.registerCheck);
var entListDto = registerCheckGroup.Select(s => new GetAsbitemOrItemCriticalByPatientRegisterIdDto
{
AsbitemName = string.Join(",", s.Select(ss => ss.asbitem.DisplayName).Distinct()),
CriticalRangeValue = s.Key.CriticalRangeValue,
CriticalValueContent = s.Key.CriticalValueContent,
IsCriticalValue = s.Key.IsCriticalValue,
IsCriticalValueAudit = s.Key.IsCriticalValueAudit,
IsFollowUp = s.Key.IsFollowUp,
IsReview = s.Key.IsReview,
SummaryDetail = string.Join("<br>", s.Where(m => m.registerCheckSummaryHaveEmpty != null).Select(ss => ss.registerCheckSummaryHaveEmpty.Summary).Distinct()),
ItemDetails = s.GroupBy(g => g.registerCheckItem).ToList()
.Select(ss => new GetAsbitemOrItemCriticalByPatientRegisterIdItemDetail
{
CriticalRangeValue = ss.Key.CriticalRangeValue,
CriticalValueContent = ss.Key.CriticalValueContent,
IsCriticalValue = ss.Key.IsCriticalValue,
IsCriticalValueAudit = ss.Key.IsCriticalValueAudit,
IsFollowUp = ss.Key.IsFollowUp,
IsReview = ss.Key.IsReview,
ItemName = ss.FirstOrDefault().item.DisplayName,
ItemResult = ss.Key.Result,
ReferenceRangeValue = ss.Key.ReferenceRangeValue,
Unit = ss.Key.Unit
}).ToList()
}).ToList();
return entListDto;
}
/// <summary>
/// 自动生成电话随访记录
/// </summary>

Loading…
Cancel
Save