Browse Source

危急值

master
wxd 1 year ago
parent
commit
8c573d0572
  1. 12
      src/Shentun.Peis.Application.Contracts/PhoneFollowUps/GetPatientRegisterCriticalListInputDto.cs
  2. 12
      src/Shentun.Peis.Application.Contracts/PhoneFollowUps/PhoneFollowUpWithCriticalItemDto.cs
  3. 30
      src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs
  4. 14
      src/Shentun.Peis.Application/SmsSends/SmsSendAppService.cs

12
src/Shentun.Peis.Application.Contracts/PhoneFollowUps/GetPatientRegisterCriticalListInputDto.cs

@ -74,7 +74,17 @@ namespace Shentun.Peis.PhoneFollowUps
/// </summary>
public string? Phone { get; set; }
/// <summary>
/// 是否短信随访创建完成
/// </summary>
public char? IsSmsComplete { get; set; }
/// <summary>
/// 是否电话随访创建完成
/// </summary>
public char? IsPhoneComplete { get; set; }
public int MaxResultCount { get; set; } = 50;

12
src/Shentun.Peis.Application.Contracts/PhoneFollowUps/PhoneFollowUpWithCriticalItemDto.cs

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Shentun.Peis.PhoneFollowUps
@ -133,6 +135,16 @@ namespace Shentun.Peis.PhoneFollowUps
/// 电话随访记录
/// </summary>
public List<PhoneFollowUpSimpleDto> PhoneFollowUpDetail { get; set; }
/// <summary>
/// 是否短信随访创建完成
/// </summary>
public char IsSmsComplete { get; set; }
/// <summary>
/// 是否电话随访创建完成
/// </summary>
public char IsPhoneComplete { get; set; }
}
public class PhoneFollowUpWithCriticalItemAbnormalItemDto

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

@ -246,6 +246,16 @@ namespace Shentun.Peis.PhoneFollowUps
query = query.Where(m => m.patientRegister.CustomerOrgGroupId != null && input.CustomerOrgGroupIds.Contains(m.patientRegister.CustomerOrgGroupId.Value));
}
if (input.IsSmsComplete != null)
{
query = query.Where(m => m.followUp.IsSmsComplete == input.IsSmsComplete);
}
if (input.IsPhoneComplete != null)
{
query = query.Where(m => m.followUp.IsPhoneComplete == input.IsPhoneComplete);
}
#endregion
@ -301,7 +311,9 @@ namespace Shentun.Peis.PhoneFollowUps
ItemName = ss.FirstOrDefault().item.DisplayName,
IsCriticalValue = ss.Key.IsCriticalValue == null ? 'N' : ss.Key.IsCriticalValue.Value,
IsReview = ss.Key.IsReview == null ? 'N' : ss.Key.IsReview.Value
}).ToList()
}).ToList(),
IsPhoneComplete = s.Key.IsPhoneComplete,
IsSmsComplete = s.Key.IsSmsComplete
}).ToList();
return entListDto;
@ -587,7 +599,21 @@ namespace Shentun.Peis.PhoneFollowUps
[HttpPost("api/app/PhoneFollowUp/Delete")]
public async Task DeleteAsync(PhoneFollowUpIdInputDto input)
{
await _phoneFollowUpRepository.DeleteAsync(input.PhoneFollowUpId);
var phoneFollowUpEnt = await _phoneFollowUpRepository.FirstOrDefaultAsync(f => f.Id == input.PhoneFollowUpId);
if (phoneFollowUpEnt == null)
{
throw new UserFriendlyException("数据不存在");
}
await _phoneFollowUpRepository.DeleteAsync(input.PhoneFollowUpId, true);
if ((await _phoneFollowUpRepository.CountAsync(c => c.FollowUpId == phoneFollowUpEnt.FollowUpId)) == 0)
{
var followUpEnt = await _followUpRepository.FirstOrDefaultAsync(f => f.Id == phoneFollowUpEnt.FollowUpId);
if (followUpEnt != null)
{
followUpEnt.IsPhoneComplete = 'N';
await _followUpRepository.UpdateAsync(followUpEnt);
}
}
}

14
src/Shentun.Peis.Application/SmsSends/SmsSendAppService.cs

@ -241,7 +241,19 @@ namespace Shentun.Peis.SmsSends
new List<string> { DataHelper.ConversionDateToString(smsSendEnt.smsSend.PlanSendDate) });
//删除短信记录
await _smsSendRepository.DeleteAsync(input.SmsSendId);
await _smsSendRepository.DeleteAsync(input.SmsSendId, true);
if ((await _smsSendRepository.CountAsync(c => c.FollowUpId == smsSendEnt.smsSend.FollowUpId)) == 0)
{
var followUpEnt = await _followUpRepository.FirstOrDefaultAsync(f => f.Id == smsSendEnt.smsSend.FollowUpId);
if (followUpEnt != null)
{
followUpEnt.IsSmsComplete = 'N';
await _followUpRepository.UpdateAsync(followUpEnt);
}
}
}
}

Loading…
Cancel
Save